    /* ========================================
       膜客时代操作台 样式表 — D·极简专业
       白底黑字 · 克制留白 · 高级感
       目录：
       1. CSS变量与根元素
       2. 基础重置与排版
       3. 布局组件（侧栏/主区域/面板）
       4. 按钮与表单
       5. 表格
       6. 卡片与统计
       7. 弹窗与抽屉
       8. 通知与反馈
       9. 页面专用
       10. 响应式
       ======================================== */

    /* —— 1. CSS变量与根元素 —— */
    :root {
      /* ═══ 主色阶 (Brand) — 与已验收原型统一的海军蓝 / 钴蓝 ═══ */
      --blue: #4167d9;
      --blue-dark: #172231;
      --blue-bg: #eef2ff;
      --primary: #4167d9;
      --primary-dark: #3159bd;
      --primary-darker: #29489d;

      /* ═══ 语义色 (Semantic) ═══ */
      --green: #00a86f;
      --green-bg: #e3f8ef;
      --green-dark: #008f5b;
      --red-bg: #fce8eb;
      --orange: #ff9f1c;
      --red: #df1b41;
      --danger: #df1b41;
      --red-dark: #df1b41;
      --purple: #4167d9;
      --cyan: #00d4d4;

      /* ═══ 中性色阶 (Neutral) ═══ */
      --ink: #172231;
      --text: #3f4d61;
      --text-secondary: #59677c;
      --muted: #6b7482;
      --muted-light: #aab7c4;
      --card: #ffffff;
      --bg-alt: #f7f9fc;
      --rule: #dcdfe5;
      --border: #dcdfe5;
      --border2: #cdd3dc;
      --divider: #eaebee;
      --brand-light: #eef2ff;
      --orange-bg: #fff5e6;

      /* ═══ 侧边栏深色 (Sidebar Dark) ═══ */
      --side-bg: #172231;
      --side-active-bg: #2b3b52;
      --side-active-bar: #7e96f2;
      --side-text: #9eabba;
      --side-text-active: #ffffff;

      /* ═══ 背景 (Background) ═══ */
      --bg: #f5f5f3;
      --panel: #ffffff;
      --glass: #ffffff;

      /* ═══ 间距阶梯 (Spacing — 4px base, 8x grid) ═══ */
      --space-1: 4px;
      --space-2: 8px;
      --space-3: 12px;
      --space-4: 16px;
      --space-5: 20px;
      --space-6: 24px;
      --space-8: 32px;
      --space-10: 40px;

      /* ═══ 字号阶梯 (Typography) ═══ */
      --text-xs: .75rem;
      --text-sm: .8125rem;
      --text-base: .875rem;
      --text-md: 1rem;
      --text-lg: 1.25rem;
      --text-xl: 1.5rem;
      --text-2xl: 2rem;

      /* ═══ 圆角阶梯 (Radius) ═══ */
      --radius-sm: 8px;
      --radius-md: 10px;
      --radius-lg: 14px;
      --radius-xl: 16px;
      --radius-2xl: 20px;
      --radius-full: 999px;

      /* ═══ 阴影阶梯 (Shadow — 单层，极其克制) ═══ */
      --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
      --shadow-md: 0 4px 12px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.04);
      --shadow-lg: 0 12px 32px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06);
      --shadow: 0 20px 60px rgba(10,37,64,0.15), 0 8px 16px rgba(10,37,64,0.08);

      /* ═══ 组件基准 (Component) ═══ */
      --font: "Segoe UI Variable Text", "Segoe UI Variable", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
      --input-height: 40px;
      --table-max-height: 420px;
    }

    /* —— 2. 基础重置与排版 —— */
    * { box-sizing: border-box; }
    .hidden { display: none !important; }
    button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
      outline: 3px solid rgba(49, 89, 217, .24);
      outline-offset: 2px;
    }
    body {
      margin: 0;
      font-family: var(--font);
      color: var(--ink);
      background: var(--bg);
      height: 100vh;
      overflow: hidden;
      -webkit-font-smoothing: antialiased;
    }
    button, input, select, textarea { font: inherit; }

    /* —— 3. 布局组件（侧栏/主区域/面板） —— */
    .app { height: 100vh; display: grid; grid-template-columns: 112px 1fr; grid-template-rows: 1fr; }
    .side {
      background: var(--side-bg);
      color: var(--side-text);
      padding: 24px 10px 18px;
      position: sticky;
      top: 0;
      height: 100vh;
      z-index: 5;
      border-right: none;
      box-shadow: 1px 0 0 rgba(0,0,0,0.2);
      overflow-y: auto;
    }
    .brand { display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center; font-size: 19px; font-weight: 800; margin: 2px 0 24px; color: var(--side-text-active); letter-spacing: -0.3px; }
    .brand .hamburger { display: none; background: none; border: 0; font-size: 1.5rem; cursor: pointer; color: var(--side-text-active); padding: 4px; line-height: 1; }
    .side-overlay { display: none; }
    .nav { display: grid; gap: 5px; padding-bottom: 14px; }
    .nav button {
      border: 0;
      width: 100%;
      color: var(--side-text);
      background: transparent;
      border-radius: var(--radius-md);
      min-height: 58px;
      padding: 9px 4px;
      cursor: pointer;
      font-family: var(--font);
      font-size: .82rem;
      transition: background-color 0.2s ease, color 0.2s ease;
    }
    .nav button:hover { background: var(--side-active-bg); color: var(--side-text-active); }
    .nav button span { display: block; line-height: 1; margin-bottom: 6px; }
    .nav button span.nav-icon { display: flex; justify-content: center; align-items: center; width: 28px; height: 28px; margin: 0 auto 6px; }
    .nav button span.nav-icon svg { width: 18px; height: 18px; }
    .nav button.active {
      background: var(--side-active-bg);
      color: var(--side-text-active);
      border-radius: var(--radius-md);
      font-weight: 600;
      box-shadow: inset 3px 0 0 var(--side-active-bar);
    }
    .nav button.active:hover { background: var(--side-active-bg); color: var(--side-text-active); }

    .main { min-width: 0; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; background: var(--bg); }
    .topbar {
      background: var(--card);
      min-height: 64px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 30px;
      border-bottom: 1px solid var(--rule);
      position: sticky;
      top: 0;
      z-index: 120;
    }
    .title { display: flex; align-items: baseline; gap: 14px; position: relative; }
    .title h1 { margin: 0; font-size: 23px; font-weight: 700; color: var(--blue-dark); letter-spacing: -0.3px; }
    .user { min-width:0; display:flex; align-items:center; justify-content:flex-end; gap:10px; color:var(--muted); font-size:.85rem; }
    .account-control { position:relative; flex:0 0 auto; }
    .operation-center { position:relative; }
    .operation-center-trigger { min-height:32px; display:inline-flex; align-items:center; gap:7px; padding:5px 10px; border:1px solid var(--rule); border-radius:999px; color:var(--muted); background:var(--card); font-size:12px; font-weight:700; cursor:pointer; }
    .operation-center-trigger:hover, .operation-center-trigger.active { color:var(--blue-dark); border-color:var(--blue); background:var(--blue-bg); }
    .operation-center-trigger.busy { color:#92400e; border-color:#f5c56b; background:#fff7e6; }
    .operation-center-count { min-width:18px; height:18px; display:inline-flex; align-items:center; justify-content:center; padding:0 5px; border-radius:999px; color:#fff; background:var(--blue); font-size:10px; font-variant-numeric:tabular-nums; }
    .operation-center-panel { position:absolute; top:40px; right:0; z-index:10020; width:min(390px, calc(100vw - 32px)); max-height:430px; overflow:auto; padding:10px; border:1px solid var(--rule); border-radius:12px; background:var(--card); box-shadow:0 18px 50px rgba(15,23,42,.18); }
    .operation-center-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:4px 4px 10px; border-bottom:1px solid var(--rule); }
    .operation-center-head strong { color:var(--ink); font-size:14px; }
    .operation-center-head span { color:var(--muted); font-size:11px; }
    .operation-empty { padding:22px 12px; color:var(--muted); text-align:center; font-size:12px; }
    .operation-item { display:grid; grid-template-columns:10px minmax(0,1fr) auto; gap:9px; align-items:start; padding:11px 5px; border-bottom:1px solid var(--rule); }
    .operation-item:last-child { border-bottom:0; }
    .operation-status-dot { width:8px; height:8px; margin-top:5px; border-radius:50%; background:#94a3b8; }
    .operation-item.running .operation-status-dot, .operation-item.pending .operation-status-dot { background:#d97706; box-shadow:0 0 0 4px rgba(217,119,6,.12); }
    .operation-item.succeeded .operation-status-dot { background:#059669; }
    .operation-item.uncertain .operation-status-dot, .operation-item.failed .operation-status-dot { background:#dc2626; }
    .operation-copy { min-width:0; display:grid; gap:3px; }
    .operation-copy strong { overflow:hidden; color:var(--ink); font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
    .operation-copy span { color:var(--muted); font-size:11px; line-height:1.45; }
    .operation-copy small { color:#8a94a3; font-size:10px; font-variant-numeric:tabular-nums; }
    .operation-item button { padding:4px 7px; border:1px solid var(--rule); border-radius:6px; color:var(--blue-dark); background:#fff; font-size:10px; cursor:pointer; }
    .operation-center .operation-actions { display:flex; flex-direction:column; gap:6px; align-items:stretch; max-width:126px; }
    .operation-center .operation-actions button { white-space:normal; line-height:1.45; }
    .operation-center .operation-actions button:disabled { cursor:wait; opacity:.65; }
    .operation-center .operation-check-feedback { padding-top:4px; overflow-wrap:anywhere; color:var(--blue-dark); }
    .operation-live-region { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

    .page { display: none; }
    .page.active {
      display: flex;
      flex-direction: column;
      flex: 1;
      padding: 18px 26px 28px;
      overflow: hidden;
      animation: pageIn 0.15s ease;
    }
    @keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }
    .page > .panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }

    /* 需要页面级滚动的页面 */
    #home, #settings, #scope, #acceptance, #sales { overflow-y: auto; }
    #home > .panel { flex: 0 1 auto; display: flex; flex-direction: column; overflow: visible; }
    #sales > .panel { flex: 0 1 auto; overflow: visible; }
    #finance.active { overflow-y: auto; overflow-x: hidden; }
    #scope > .scope { flex: 1; }
    #acceptance > .scope { flex: 1; min-height: 200px; }
    #home { gap: 14px; }

    .dashboard {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 12px;
      margin-bottom: 16px;
    }
    .stat {
      color: var(--ink);
      background: var(--card);
      border: 1px solid transparent;
      border-radius: var(--radius-lg);
      padding: 20px 22px;
      min-height: 92px;
      box-shadow: var(--shadow-sm);
      position: relative;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    .stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
    .stat::before { content:""; position:absolute; width:4px; height:100%; left:0; top:0; border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
    .stat b { display: block; font-size: 1.8rem; line-height: 1.2; font-weight: 700; letter-spacing: -0.5px; color: var(--ink); }
    .stat small { display: block; font-size: .72rem; color: var(--muted); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px; }
    .stat .stat-label { display: block; font-size: .72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

    .stat.green::before { background: var(--green); }
    .stat.blue::before { background: var(--blue); }
    .stat.purple::before { background: var(--blue); }
    .stat.pink::before { background: var(--red); }
    .stat.orange::before { background: var(--orange); }
    .green b, .green small, .green .stat-label { color: var(--ink); }
    .blue b, .blue small, .blue .stat-label { color: var(--ink); }
    .purple b, .purple small, .purple .stat-label { color: var(--ink); }
    .pink b, .pink small, .pink .stat-label { color: var(--ink); }
    .orange b, .orange small, .orange .stat-label { color: var(--ink); }

    .panel {
      background: var(--card);
      border: 1px solid var(--rule);
      border-radius: var(--radius-lg);
      box-shadow: 0 1px 2px rgba(23, 34, 49, .035);
    }
    .workbench-panel { display: flex; flex-direction: column; }
    .fixed-action-area {
      flex: 0 0 auto;
      background: var(--card);
      border-bottom: 1px solid var(--rule);
      position: relative;
      z-index: 3;
    }
    .scroll-table-area {
      overflow: auto;
      border-top: 1px solid var(--rule);
    }
    .scroll-table-area table { table-layout: auto; }
    .collapsible-form {
      border-top: 1px solid var(--rule);
      overflow: hidden;
      transition: max-height 0.3s ease;
    }
    .collapsible-form.collapsed { max-height: 40px !important; }
    .collapsible-form.collapsed .collapsible-body { display: none; }
    .collapsible-form.expanded .collapsible-body { display: block; }
    .collapsible-form.expanded { max-height: 800px; }
    .collapsible-toggle {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 18px;
      cursor: pointer;
      user-select: none;
      background: var(--bg-alt);
      border-bottom: 1px solid var(--rule);
    }
    .collapsible-toggle:hover { background: var(--divider); }
    .collapsible-toggle h3 { margin: 0; font-size: .88rem; color: var(--ink); font-weight: 600; }
    .collapsible-toggle .toggle-arrow {
      font-size: .75rem;
      color: var(--muted);
      transition: transform 0.2s ease;
    }
    .collapsible-toggle .toggle-arrow.open { transform: rotate(90deg); }
    .collapse-hint { color: var(--muted); font-size: .78rem; margin-left: auto; }
    .collapsible-body { padding: 10px 18px 14px; }

    .panel-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 14px 18px;
      border-bottom: 1px solid var(--rule);
      position: relative;
      z-index: 20;
    }
    .panel-head h2 { margin: 0; font-size: .95rem; font-weight: 600; color: var(--ink); }
    .toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

    /* —— 4. 按钮与表单 —— */
    .btn {
      border: 1px solid var(--border2);
      background: var(--card);
      border-radius: var(--radius-md);
      padding: 6px 14px;
      cursor: pointer;
      font-family: var(--font);
      font-size: var(--text-base);
      white-space: nowrap;
      transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
      font-weight: 500;
      color: var(--text-secondary);
      height: 38px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    .btn:hover { background: var(--bg-alt); border-color: var(--blue); color: var(--blue); }
    .btn:active { transform: scale(0.98); }

    .btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
    .btn.primary:hover { background: #4f5bd5; border-color: #4f5bd5; color: #fff; }
    .btn.primary:active { transform: scale(0.98); }

    .btn.green-btn { background: var(--green); border-color: var(--green); color: #fff; }
    .btn.green-btn:hover { background: var(--green-dark); border-color: var(--green-dark); }

    .btn.red-btn { background: var(--red); border-color: var(--red); color: #fff; }
    .btn.red-btn:hover { background: #b91c1c; border-color: #b91c1c; }

    .btn.orange-btn { background: var(--orange); border-color: var(--orange); color: #fff; }
    .btn.orange-btn:hover { background: #d97706; border-color: #d97706; }

    .btn.orange-outline {
      background: var(--orange-bg);
      border-color: #fdba74;
      color: #9a3412;
      font-weight: 600;
    }
    .btn.orange-outline:hover { border-color: var(--orange); color: #9a3412; }

    .action-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
    .assist-actions {
      background: var(--orange-bg);
      border: 1px dashed #fbbf24;
      border-radius: var(--radius-md);
      padding: 6px 10px;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .assist-actions span { color: #92400e; font-size: .78rem; font-weight: 600; }

    .dual-form-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
      border-top: 1px solid var(--rule);
      padding: 10px 14px;
      background: var(--card);
    }
    .dual-form {
      border: 1px solid var(--rule);
      border-radius: var(--radius-md);
      padding: 10px 12px;
      background: var(--card);
    }
    .dual-form-title {
      font-size: .88rem;
      font-weight: 600;
      color: var(--ink);
      margin-bottom: 8px;
      padding-bottom: 6px;
      border-bottom: 1px solid var(--divider);
    }
    .dual-form-actions {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      margin-top: 8px;
      padding-top: 8px;
      border-top: 1px solid var(--divider);
    }
    .compact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 14px; }
    .compact-grid > div { display: flex; flex-direction: column; gap: 2px; }
    .compact-grid > div label { font-size: var(--text-sm); color: var(--muted); font-weight: 500; }
    .compact-grid > div input,
    .compact-grid > div select {
      height: var(--input-height);
      font-size: var(--text-base);
      line-height: 1.4;
      padding: 0 10px;
      border: 1px solid var(--border2);
      border-radius: var(--radius-md);
      transition: border-color 0.15s ease;
    }

    .form { padding: 14px 18px; }
    .form-grid {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
      gap: 12px 16px;
      align-items: end;
    }
    .form-grid > div { display: flex; flex-direction: column; gap: 2px; }
    .form-grid > div label { font-size: .75rem; color: var(--muted); white-space: nowrap; font-weight: 500; margin-bottom: 4px; }
    .form-grid > div input,
    .form-grid > div select {
      height: var(--input-height);
      min-width: 0;
      width: 100%;
      box-sizing: border-box;
      padding: 0 10px;
      font-size: var(--text-base);
      border: 1px solid var(--border2);
      border-radius: var(--radius-md);
      transition: border-color 0.15s ease;
      background: var(--card);
    }
    .form-grid > div input:focus,
    .form-grid > div select:focus,
    .compact-grid > div input:focus,
    .compact-grid > div select:focus {
      outline: none;
      border-color: var(--blue);
      box-shadow: 0 0 0 3px rgba(94,106,210,0.12);
    }
    .form-grid > div input[placeholder*="备注"],
    .form-grid > div input[placeholder*="可选"] {
      min-width: 240px;
      max-width: 400px;
    }
    .form-grid > div[style*="grid-column:span 2"] input,
    .form-grid > div[style*="grid-column:span 3"] input {
      max-width: 100%;
      min-width: 200px;
    }
    .keyword-search-box {
      grid-column: 1 / -1;
      background: var(--bg-alt);
      border: 1px solid var(--rule);
      border-radius: var(--radius-md);
      padding: 12px;
      display: grid;
      grid-template-columns: 130px 1fr;
      gap: 12px;
      align-items: center;
    }
    .keyword-search-box label { margin: 0; color: var(--ink); font-weight: 700; }
    .keyword-search-box input {
      height: 38px;
      border-color: var(--border2);
      background: var(--card);
      font-size: .92rem;
    }
    .inline-help {
      display: none;
      margin: 0 14px 12px;
      padding: 10px 12px;
      background: var(--orange-bg);
      border: 1px solid #fde68a;
      border-radius: var(--radius-md);
      color: #78350f;
      font-size: .85rem;
      line-height: 1.65;
    }
    .inline-help b { color: #92400e; }
    .inline-help p { margin: 0 0 6px; }
    .inline-help ol { margin: 0; padding-left: 20px; }
    .new-product-box {
      background: var(--orange-bg);
      border: 1px solid #fed7aa;
      border-radius: var(--radius-md);
      padding: 12px;
      margin-top: 10px;
    }
    .new-product-box h4 {
      grid-column: 1 / -1;
      margin: 0;
      color: #9a3412;
      font-size: .95rem;
      font-weight: 600;
    }
    .similar-products {
      grid-column: 1 / -1;
      display: none;
      background: var(--card);
      border: 1px solid #fed7aa;
      border-radius: var(--radius-md);
      padding: 10px;
    }
    .similar-products .hint { color: #9a3412; font-size: .82rem; margin-bottom: 8px; font-weight: 600; }
    .similar-item {
      display: grid;
      grid-template-columns: 90px 1fr 90px 90px;
      gap: 8px;
      align-items: center;
      padding: 8px;
      border-radius: var(--radius-md);
      cursor: pointer;
      border: 1px solid transparent;
      font-size: .85rem;
      transition: background-color 0.15s ease, border-color 0.15s ease;
    }
    .similar-item:hover { background: var(--orange-bg); border-color: #fdba74; }

    /* 商品重名/相似提示 — 浮动显示，不影响行高 */
    .batch-tbl td { position: relative; }
    .prod-hint { position: absolute; left: 4px; right: 4px; top: 100%; z-index: 10; padding: 5px 10px; border-radius: 0 0 var(--radius-sm) var(--radius-sm); font-size: 12px; line-height: 1.5; box-shadow: 0 2px 6px rgba(0,0,0,.1); }
    .prod-hint-exact { background: #fef2f2; border: 1px solid #fecaca; border-top: none; }
    .prod-hint-similar { background: #fffbeb; border: 1px solid #fde68a; border-top: none; }
    .prod-hint-link { color: var(--blue); cursor: pointer; font-weight: 600; border-bottom: 1px dashed var(--blue); padding: 0 1px; transition: all .15s; }
    .prod-hint-link:hover { color: #4f46e5; background: rgba(94,106,210,.08); border-radius: 2px; border-bottom-style: solid; }
    .prod-hint-info { color: var(--muted); font-weight: 400; font-size: 11px; }
    .prod-hint-tip { color: #94a3b8; margin-top: 2px; font-size: 11px; }
    /* 资料页新增商品查重：独立的全宽风险区，不挤在商品名称字段内 */
    #baseEditModal #baseProdHint {
      position: static !important;
      grid-column: 1 / -1;
      margin: 2px 0 0;
      padding: 0;
      overflow: hidden;
      box-shadow: none;
      border: 1px solid #efcd88;
      border-radius: 10px;
      background: #fff9ec;
      color: #563713;
      font-size: 12px;
      line-height: 1.5;
    }
    #baseEditModal .base-product-duplicate-head,
    #baseEditModal .base-product-duplicate-candidate,
    #baseEditModal .base-product-duplicate-foot { padding: 10px 12px; }
    #baseEditModal .base-product-duplicate-head,
    #baseEditModal .base-product-duplicate-candidate {
      display: flex;
      align-items: center;
      gap: 12px;
      border-bottom: 1px solid #f1d8a7;
    }
    #baseEditModal .base-product-duplicate-head { justify-content: space-between; }
    #baseEditModal .base-product-duplicate-head strong { display: block; font-size: 13px; color: #6c430d; }
    #baseEditModal .base-product-duplicate-head small { display: block; margin-top: 1px; color: #8a6a3d; }
    #baseEditModal .base-product-duplicate-head > span,
    #baseEditModal .base-product-duplicate-level {
      flex: none;
      padding: 2px 7px;
      border-radius: 999px;
      background: #ffedbd;
      color: #895400;
      font-weight: 700;
    }
    #baseEditModal .base-product-duplicate-candidate > div { flex: 1; min-width: 0; }
    #baseEditModal .base-product-duplicate-candidate > div > strong { color: #18263c; }
    #baseEditModal .base-product-duplicate-foot { color: #8a6a3d; background: #fffdf7; }
    .new-product-batch-modal { width: 1040px; max-width: 94vw; }
    .batch-product-hint { margin-bottom: 8px; color: var(--muted); font-size: var(--text-sm); }
    .batch-product-table-wrap { margin-bottom: 8px; overflow: visible; border: 1px solid var(--rule); border-radius: 6px; }
    .batch-tbl { width: 100%; table-layout: fixed; font-size: var(--text-sm); }
    .batch-tbl th, .batch-tbl td { padding: 6px 4px; vertical-align: top; }
    .batch-tbl select { height: 34px; padding: 0 4px; font-size: var(--text-sm); }
    .batch-tbl input { height: 34px; }
    .batch-col-index, .batch-col-action { width: 30px; }
    .batch-col-name { width: 380px; }
    .batch-col-category { width: 100px; }
    .batch-col-unit { width: 80px; }
    .batch-col-money { width: 90px; }
    .batch-product-actions { display: flex; align-items: center; justify-content: space-between; }
    .batch-product-action-buttons { display: flex; gap: 8px; }
    .batch-product-result { margin-top: 8px; font-size: var(--text-sm); }
    .batch-row-remove { width: 24px; height: 24px; padding: 0; border: 0; border-radius: 4px; color: #fff; background: var(--danger); font-size: 15px; font-weight: 700; line-height: 1; cursor: pointer; }
    .new-supplier-modal { max-width: 560px; }

    /* ui62：资料页查重风险区与原型同层级；正式字段仍保留在业务表单中。 */
    #baseEditModal #baseProdHint.base-product-duplicate-panel {
      position: static !important;
      grid-column: 1 / -1;
      margin: 2px 0 0;
      padding: 0;
      overflow: visible;
      border: 0;
      border-radius: 0;
      background: transparent;
      color: #563713;
      font-family: inherit;
      font-size: 12px;
      line-height: 1.5;
    }
    #baseEditModal .base-product-duplicate-head,
    #baseEditModal .base-product-duplicate-candidate,
    #baseEditModal .base-product-duplicate-foot { box-sizing: border-box; }
    #baseEditModal .base-product-duplicate-shell {
      overflow: hidden;
      border: 1px solid #efcd88;
      border-radius: 10px;
      background: #fffaf1;
    }
    #baseEditModal .base-product-duplicate-head {
      min-height: 58px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 11px 13px;
      background: #fff6e5;
      border-bottom: 1px solid #efdcb8;
    }
    #baseEditModal .base-product-duplicate-head > div { display: grid; gap: 3px; min-width: 0; }
    #baseEditModal .base-product-duplicate-head strong { color: #6c430d; font-size: 12.5px; }
    #baseEditModal .base-product-duplicate-head small { color: #8a6a3d; font-size: 10px; line-height: 1.4; }
    #baseEditModal .base-product-duplicate-review-chip {
      flex: 0 0 auto;
      padding: 4px 8px;
      border-radius: 999px;
      color: #966019;
      background: #ffedc9;
      font-size: 9.5px;
      font-weight: 750;
    }
    #baseEditModal .base-product-duplicate-candidate {
      min-height: 58px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto auto;
      align-items: center;
      gap: 12px;
      padding: 10px 13px;
      border-bottom: 1px solid #efe4d0;
      background: rgba(255,255,255,.82);
    }
    #baseEditModal .base-product-duplicate-copy { min-width: 0; display: grid; gap: 3px; }
    #baseEditModal .base-product-duplicate-copy strong { overflow: hidden; color: #29374b; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
    #baseEditModal .base-product-duplicate-copy .prod-hint-info { color: #7b8799; font-size: 9.5px; }
    #baseEditModal .base-product-duplicate-level { color: #a06412; font-size: 10px; font-weight: 750; white-space: nowrap; }
    #baseEditModal .base-product-choose-existing {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 89px;
      height: 35px;
      padding: 0 11px;
      color: #354258;
      border: 1px solid #ced7e4;
      border-radius: 8px;
      background: #fff;
      box-shadow: none;
      font-family:var(--ui-font);
      font-size: 13px;
      font-weight: 720;
      line-height: 18px;
      white-space: nowrap;
    }
    #baseEditModal .base-product-choose-existing:hover { color: #315bc3; border-color: #9db2e8; background: #f7f9ff; }
    #baseEditModal .base-product-duplicate-override { display: grid; gap: 10px; padding: 12px 13px; }
    #baseEditModal .base-product-override-check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
    #baseEditModal .base-product-override-check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: #4568d9; }
    #baseEditModal .base-product-override-check span { display: grid; gap: 3px; }
    #baseEditModal .base-product-override-check strong { color: #764e17; font-size: 11.5px; }
    #baseEditModal .base-product-override-check small { color: #7e715d; font-size: 10px; font-weight: 400; line-height: 1.45; }
    #baseEditModal .base-product-duplicate-foot { margin-top: 12px; padding: 11px 13px; color: #8a6a3d; border: 1px solid #efcd88; border-radius: 8px; background: #fff6e5; font-size: 10px; }

    /* 资料页横排控件统一使用正式版按钮节奏，避免原生按钮漏网。 */
    #base .base-master-head-actions .btn,
    #base .base-master-tools > .btn,
    #base .base-detail-actions .btn,
    #base .base-master-pagination button {
      box-sizing: border-box;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 36px;
      padding: 0 13px;
      border-radius: 9px;
      font-family:var(--ui-font);
      font-size: 12px;
      font-weight: 700;
      line-height: 18px;
      white-space: nowrap;
    }
    #base .base-master-pagination button { min-height: 30px; font-size: 11px; }
    .supplier-similar-hint { display: none; margin-top: 8px; }
    .supplier-similar-panel { padding: 8px 10px; border: 1px solid #ffeaa7; border-radius: 6px; background: #fff3cd; font-size: var(--text-sm); }
    .supplier-similar-title { margin-bottom: 4px; font-weight: 600; }
    .supplier-similar-item { display: inline-block; margin: 2px; padding: 2px 8px; border-radius: 3px; background: #f5f5f5; }
    .purchase-product-select, .purchase-warehouse-select, .purchase-unit-input, .purchase-item-quantity, .purchase-item-cost { width: 100%; }
    .purchase-product-select.is-readonly, .purchase-warehouse-select.is-readonly { color: #6b7688; background: #f5f7fa; }
    .purchase-unit-input.is-readonly { color: #6b7688; background: #f5f7fa; }
    .purchase-unit-input.is-required { border-color: #fb923c; background: #fff7ed; }
    .purchase-unit-input.is-pending { color: #bbb; }
    .purchase-item-quantity { min-width: 50px; }
    .purchase-item-cost { min-width: 60px; }
    .purchase-item-amount { font-weight: 600; }
    .purchase-item-action { padding: 4px 0; }
    .purchase-item-remove { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; color: #fff; background: var(--danger); font-size: 15px; font-weight: 700; line-height: 1; cursor: pointer; }
    .purchase-edit-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; padding: 10px 16px; border: 2px solid #f59e0b; border-radius: 8px; color: #78350f; background: linear-gradient(135deg,#fef3c7,#fde68a); font-size: var(--text-sm); }
    .purchase-edit-banner > span { font-weight: 600; }
    .purchase-edit-banner em { margin-right: 4px; padding: 2px 6px; border-radius: 4px; font-style: normal; background: rgba(255,255,255,.55); }
    .purchase-edit-banner b { font-family: "Consolas", monospace; }
    .purchase-edit-actions { display: flex; gap: 8px; }
    .purchase-edit-save { padding: 5px 16px; font-size: var(--text-sm); font-weight: 600; }
    .purchase-edit-cancel { padding: 5px 14px; font-size: var(--text-sm); }
    .sales-photo-add-mark { display: block; margin-bottom: 4px; font-size: 28px; }
    .sales-order-help { padding: 0 14px 14px; color: var(--muted); font-size: var(--text-base); }
    .settings-auth-help { margin-bottom: 8px; color: #6b7280; font-size: var(--text-xs); line-height: 1.5; }
    .home-chart-empty { color: var(--muted); font-size: var(--text-sm); }
    .submit-overlay { position: fixed; inset: 0; z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: rgba(0,0,0,.45); }
    .submit-overlay-spinner { width: 48px; height: 48px; border: 4px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: submit-overlay-spin .8s linear infinite; }
    .submit-overlay-label { color: #fff; font-size: 16px; font-weight: 600; }
    @keyframes submit-overlay-spin { to { transform: rotate(360deg); } }
    .log-viewer-overlay { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.5); }
    .log-viewer-dialog { display: flex; flex-direction: column; width: 90%; max-width: 680px; max-height: 80vh; padding: 20px; border-radius: 12px; background: #fff; box-shadow: 0 8px 32px rgba(0,0,0,.3); }
    .log-viewer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; color: #1a1a2e; font-size: 16px; font-weight: 600; }
    .log-viewer-title.is-error, .log-viewer-type.is-error { color: var(--danger); }
    .log-viewer-subtitle { margin-left: auto; color: #9ca3af; font-size: var(--text-xs); font-weight: 400; }
    .log-viewer-close { padding: 0 4px; border: 0; color: #9ca3af; background: none; font-size: 18px; cursor: pointer; }
    .log-viewer-body { flex: 1; overflow-y: auto; font-size: var(--text-sm); }
    .log-viewer-table { width: 100%; border-collapse: collapse; font-size: var(--text-xs); }
    .log-viewer-table thead { color: #fff; background: #2563eb; }
    .log-viewer-table.is-error thead { background: var(--danger); }
    .log-viewer-table th { padding: 6px 8px; text-align: left; }
    .log-viewer-row:nth-child(odd) { background: #f8f9fb; }
    .log-viewer-row td { padding: 5px 8px; }
    .log-viewer-time { white-space: nowrap; }
    .log-viewer-detail { max-width: 280px; word-break: break-all; }
    .electron-update-button { position: fixed; bottom: 12px; left: 12px; z-index: 99999; display: none; align-items: center; gap: 0; opacity: 0; font-family: system-ui, sans-serif; font-size: var(--text-sm); cursor: pointer; user-select: none; transition: opacity .3s ease; }
    .electron-update-icon-wrap { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; background: #1a1a2e; }
    .electron-update-icon { transition: transform .3s ease; }
    .electron-update-label { height: 28px; padding: 0 14px 0 10px; border: 1px solid rgba(255,255,255,.15); border-left: 0; border-radius: 0 14px 14px 0; color: #00bcd4; background: #1a1a2e; font-weight: 500; line-height: 28px; white-space: nowrap; }
    .electron-update-badge { position: absolute; top: -2px; left: 22px; display: none; width: 8px; height: 8px; border-radius: 50%; background: #ff4444; }
    .electron-update-modal { position: fixed; inset: 0; z-index: 100000; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,.6); }
    .electron-update-dialog { width: 90%; max-width: 420px; padding: 32px; border: 1px solid rgba(255,255,255,.12); border-radius: 16px; background: #1a1a2e; box-shadow: 0 8px 32px rgba(0,0,0,.4); }
    .electron-update-head { margin-bottom: 20px; text-align: center; }
    .electron-update-hero-icon { margin-bottom: 12px; }
    .electron-update-head h3 { margin: 0 0 8px; color: #fff; font-size: 18px; }
    .electron-update-head p { margin: 0; color: rgba(255,255,255,.6); font-size: var(--text-sm); }
    .electron-update-progress-wrap { display: none; margin-bottom: 20px; }
    .electron-update-progress-track { height: 6px; overflow: hidden; border-radius: 8px; background: rgba(255,255,255,.1); }
    .electron-update-progress { width: 0; height: 100%; border-radius: 8px; background: linear-gradient(90deg,#00bcd4,#0288d1); transition: width .3s ease; }
    .electron-update-progress-wrap p { margin: 8px 0 0; color: rgba(255,255,255,.5); font-size: var(--text-xs); text-align: center; }
    .electron-update-actions { display: flex; justify-content: center; gap: 12px; }
    .electron-update-actions button { flex: 1; padding: 10px 20px; border-radius: 8px; font-size: var(--text-base); cursor: pointer; }
    .electron-update-cancel { border: 1px solid rgba(255,255,255,.15); color: rgba(255,255,255,.6); background: transparent; }
    .electron-update-confirm { border: 0; color: #fff; background: linear-gradient(135deg,#00bcd4,#0288d1); font-weight: 500; }

    label { display: block; color: var(--muted); font-size: .78rem; margin-bottom: 5px; font-weight: 500; }
    input, select, textarea {
      width: 100%;
      border: 1px solid var(--border2);
      border-radius: var(--radius-md);
      padding: 0 10px;
      font-family: var(--font);
      font-size: var(--text-base);
      background: var(--card);
      height: var(--input-height);
      color: var(--text);
      transition: border-color 0.15s ease;
    }
    input:focus, select:focus, textarea:focus {
      outline: none;
      border-color: var(--blue);
      box-shadow: 0 0 0 3px rgba(94,106,210,0.12);
    }
    textarea { min-height: 58px; resize: vertical; height: auto; }
    .required::before { content: "*"; color: var(--red); margin-right: 2px; }
    @keyframes requiredPulse {
      0%, 100% { border-color: var(--red); }
      50% { border-color: var(--red-dark); }
    }
    .field-required-error {
      border-color: var(--red) !important;
      background: var(--red-bg) !important;
      animation: requiredPulse .7s ease-in-out 3;
    }
    .field-error-tip {
      margin-top: 6px;
      color: var(--red-dark);
      background: var(--red-bg);
      border: 1px solid #fecaca;
      border-radius: var(--radius-md);
      padding: 6px 8px;
      font-size: .82rem;
      font-weight: 600;
    }

    #purchaseItemsBody .field-error-tip,
    #purchaseReturnModal .field-error-tip,
    #purchaseWarehouseModal .field-error-tip,
    #quickQtyModal .field-error-tip {
      white-space: normal;
      overflow-wrap: anywhere;
      line-height: 1.45;
    }

    /* —— 5. 表格 —— */
    .table-wrap {
      overflow: auto;
      border-top: 1px solid var(--rule);
      flex: 1;
      min-height: 200px;
      position: relative;
    }
    table { width: 100%; border-collapse: collapse; background: var(--card); }
    .sales-form-table:not(.sales-modern-lines) { table-layout: fixed; width: 100%; min-width: 0; }
    .sales-form-table:not(.sales-modern-lines) td { vertical-align: middle !important; padding: 6px 6px !important; height: 42px !important; }
    .sales-form-table:not(.sales-modern-lines) td input[type="number"],
    .sales-form-table:not(.sales-modern-lines) td input[type="text"],
    .sales-form-table:not(.sales-modern-lines) td input:not([type]),
    .sales-form-table:not(.sales-modern-lines) td select {
      width: 100% !important; box-sizing: border-box !important;
      height: 32px !important; min-height: 32px !important; max-height: 32px !important;
      padding: 4px 8px !important; margin: 0 !important; vertical-align: middle !important;
      line-height: normal !important; border: 1px solid var(--border2) !important; border-radius: var(--radius-sm) !important; font-size: 14px !important;
    }
    .sales-form-table:not(.sales-modern-lines) td button {
      margin: 0 !important; vertical-align: middle !important;
      display: inline-flex !important; align-items: center !important; justify-content: center !important;
      height: 32px !important; min-height: 32px !important; max-height: 32px !important;
      padding: 2px 10px !important; line-height: 1 !important;
    }
    .sales-form-table:not(.sales-modern-lines) td .productSearch { height: 32px !important; min-height: 32px !important; max-height: 32px !important; }
    .sales-form-table:not(.sales-modern-lines) td .stock-badge { vertical-align: middle !important; }
    .sales-form-table:not(.sales-modern-lines) th:nth-child(1), .sales-form-table:not(.sales-modern-lines) td:nth-child(1) { width: 4%; }
    .sales-form-table:not(.sales-modern-lines) th:nth-child(2), .sales-form-table:not(.sales-modern-lines) td:nth-child(2) { width: 7%; }
    .sales-form-table:not(.sales-modern-lines) th:nth-child(3), .sales-form-table:not(.sales-modern-lines) td:nth-child(3) { width: 7%; }
    .sales-form-table:not(.sales-modern-lines) th:nth-child(4), .sales-form-table:not(.sales-modern-lines) td:nth-child(4) { width: 14%; }
    .sales-form-table:not(.sales-modern-lines) th:nth-child(5), .sales-form-table:not(.sales-modern-lines) td:nth-child(5) { width: 7%; }
    .sales-form-table:not(.sales-modern-lines) th:nth-child(6), .sales-form-table:not(.sales-modern-lines) td:nth-child(6) { width: 7%; }
    .sales-form-table:not(.sales-modern-lines) th:nth-child(7), .sales-form-table:not(.sales-modern-lines) td:nth-child(7) { width: 4%; }
    .sales-form-table:not(.sales-modern-lines) th:nth-child(8), .sales-form-table:not(.sales-modern-lines) td:nth-child(8) { width: 5%; }
    .sales-form-table:not(.sales-modern-lines) th:nth-child(9), .sales-form-table:not(.sales-modern-lines) td:nth-child(9) { width: 10%; }
    .sales-form-table:not(.sales-modern-lines) th:nth-child(10), .sales-form-table:not(.sales-modern-lines) td:nth-child(10) { width: 8%; }
    .sales-form-table:not(.sales-modern-lines) th:nth-child(11), .sales-form-table:not(.sales-modern-lines) td:nth-child(11) { width: 8%; }
    .sales-form-table:not(.sales-modern-lines) th:nth-child(12), .sales-form-table:not(.sales-modern-lines) td:nth-child(12) { width: 8%; }
    .sales-form-table:not(.sales-modern-lines) th:nth-child(13), .sales-form-table:not(.sales-modern-lines) td:nth-child(13) { width: 11%; }
    .sales-form-table:not(.sales-modern-lines) input[type="text"],
    .sales-form-table:not(.sales-modern-lines) input[type="number"] { width: 100%; min-width: 60px; box-sizing: border-box; }
    @media (max-width: 1024px) {
      .sales-form-table:not(.sales-modern-lines) { font-size: var(--text-xs); }
      .sales-form-table:not(.sales-modern-lines) input { font-size: var(--text-xs); }
    }

    th, td { border-right: none; border-bottom: 1px solid var(--divider); padding: 10px 12px; text-align: left; vertical-align: middle; font-size: var(--text-base); color: var(--text); white-space: nowrap; }
    th {
      background: var(--bg-alt);
      color: var(--muted);
      font-weight: 600;
      font-size: var(--text-sm);
      position: sticky;
      top: 0;
      white-space: nowrap;
      z-index: 10;
      border-bottom: 2px solid var(--rule);
      border-right: none;
    }
    /* 数值列：表头和数据都居中（数量、库存、销量等纯数字） */
    th.num-c, td.num-c { text-align: center; font-variant-numeric: tabular-nums; }
    /* 金额列：表头和数据都右对齐（成本、金额、提成等货币） */
    th.num-r, td.num-r { text-align: right; font-variant-numeric: tabular-nums; }
    /* 状态/标签列：表头和数据都居中 */
    th.tag-c, td.tag-c { text-align: center; }
    th.sortable { cursor: pointer; user-select: none; }
    th.sortable:hover { background: var(--divider); color: var(--ink); }
    th.sortable::after { content: "⇅"; margin-left: 4px; font-size: 10px; opacity: 0.4; }
    th.sortable.sort-asc::after { content: "↑"; opacity: 1; color: var(--blue); font-size: 13px; font-weight: bold; }
    th.sortable.sort-desc::after { content: "↓"; opacity: 1; color: var(--blue); font-size: 13px; font-weight: bold; }

    tbody tr { transition: background-color 0.1s ease; }
    tbody tr:nth-child(even) { background: rgba(94, 106, 210, 0.035); }
    tbody tr:hover { background: var(--brand-light); }
    tbody tr:hover td { background: transparent; }

    #stock.active {
      overflow: hidden;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .stock-module-intro {
      flex: 0 0 auto;
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 24px;
      padding: 18px 22px;
      border: 1px solid var(--rule);
      border-radius: var(--radius-lg);
      background: linear-gradient(135deg, #fff 0%, #f7f9ff 100%);
      box-shadow: var(--shadow-sm);
    }
    .stock-module-intro h2 {
      margin: 4px 0 5px;
      color: var(--ink);
      font-size: 22px;
      line-height: 1.25;
      letter-spacing: -.02em;
    }
    .stock-module-intro p {
      margin: 0;
      color: var(--text-secondary);
      font-size: var(--text-sm);
      line-height: 1.55;
    }
    .stock-eyebrow {
      color: var(--blue);
      font-size: var(--text-xs);
      font-weight: 700;
      letter-spacing: .08em;
    }
    .stock-module-status {
      min-width: 230px;
      padding: 10px 14px;
      border: 1px solid #dbe4f4;
      border-radius: var(--radius-md);
      background: rgba(255,255,255,.78);
      display: grid;
      gap: 2px;
    }
    .stock-module-status span,
    .stock-module-status small { color: var(--muted); font-size: var(--text-xs); }
    .stock-module-status strong { color: var(--ink); font-size: var(--text-sm); }
    .stock-workspace-nav {
      flex: 0 0 auto;
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 8px;
      padding: 7px;
      border: 1px solid var(--rule);
      border-radius: var(--radius-lg);
      background: var(--card);
      box-shadow: var(--shadow-sm);
    }
    .stock-tab {
      min-width: 0;
      padding: 9px 12px;
      border: 1px solid transparent;
      border-radius: var(--radius-md);
      background: transparent;
      color: var(--text-secondary);
      cursor: pointer;
      text-align: left;
      font: inherit;
      font-size: var(--text-sm);
      font-weight: 650;
      transition: background-color .15s ease, border-color .15s ease, color .15s ease;
    }
    .stock-tab small {
      display: block;
      margin-top: 2px;
      overflow: hidden;
      color: var(--muted);
      font-size: var(--text-xs);
      font-weight: 500;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .stock-tab.active {
      background: var(--brand-light) !important;
      border-color: rgba(66, 99, 235, .2);
      color: var(--blue) !important;
      box-shadow: inset 3px 0 0 var(--blue);
    }
    .stock-tab.active small { color: var(--text-secondary); }
    .stock-tab:not(.active):hover { background: var(--bg-alt) !important; color: var(--ink); }
    .stock-tab-content { display: none !important; }
    .stock-tab-content.active { display: flex !important; flex-direction: column; overflow-y: auto; min-height: 0; flex: 1; }
    .stock-workspace-panel {
      padding: 18px;
      border: 1px solid var(--rule);
      border-radius: var(--radius-lg);
      background: var(--card);
      box-shadow: var(--shadow-sm);
    }
    .stock-tab-content.active .table-wrap { flex: 0 0 auto; }
    .stock-tab-content.active .scroll-table-area { max-height: 520px; }
    .stock-tab:focus { outline: none; }
    .stock-tab:focus-visible { outline: 2px solid rgba(66,99,235,.52); outline-offset: 2px; }
    .stock-adjust-entry {
      flex: 0 0 auto;
      margin-bottom: 16px;
      border: 1px solid var(--rule);
      border-radius: var(--radius-lg);
      background: #fff;
      overflow: hidden;
    }
    .stock-adjust-heading {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 20px;
      padding: 14px 16px;
      border-bottom: 1px solid var(--rule);
      background: linear-gradient(100deg, #f8faff 0%, #fff 72%);
    }
    .stock-adjust-heading span:first-child { color: var(--ink); font-size: var(--text-md); font-weight: 720; }
    .stock-adjust-heading p { margin: 3px 0 0; color: var(--muted); font-size: var(--text-xs); }
    .stock-adjust-safety {
      flex: 0 0 auto;
      padding: 5px 9px;
      border: 1px solid #cce7db;
      border-radius: 999px;
      background: #f0faf6;
      color: #08775b !important;
      font-size: var(--text-xs) !important;
      font-weight: 650 !important;
    }
    .stock-adjust-grid {
      display: grid;
      grid-template-columns: 150px minmax(260px, 1.35fr) repeat(3, minmax(145px, .7fr));
      gap: 12px;
      padding: 16px;
      align-items: end;
    }
    .stock-adjust-grid > div { min-width: 0; }
    .stock-adjust-grid label {
      display: block;
      margin-bottom: 6px;
      color: var(--text-secondary);
      font-size: var(--text-xs);
      font-weight: 650;
    }
    .stock-adjust-grid input,
    .stock-adjust-grid select { width: 100%; }
    #stockTabAdjustment #adjustProductSearch { width: 100%; }
    #stockTabAdjustment #adjustProduct[hidden] { display: none !important; }
    .stock-adjust-grid input[readonly] { background: var(--bg-alt); color: var(--text-secondary); }
    .stock-adjust-remark { grid-column: span 3; }
    .stock-adjust-preview {
      display: grid;
      grid-template-columns: repeat(5, minmax(110px, 1fr)) auto;
      gap: 0;
      padding: 0 16px 16px;
    }
    .stock-adjust-preview > div:not(.stock-adjust-preview-action) {
      padding: 10px 14px;
      border: 1px solid var(--rule);
      border-right: 0;
      background: var(--bg-alt);
    }
    .stock-adjust-preview > div:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
    .stock-adjust-preview span { display: block; color: var(--muted); font-size: var(--text-xs); }
    .stock-adjust-preview strong { display: block; margin-top: 3px; color: var(--ink); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
    .stock-adjust-preview strong.is-danger { color: var(--danger); }
    .stock-adjust-preview strong.is-warning { color: #b76a00; }
    .stock-adjust-preview strong.is-success { color: var(--green); }
    .stock-adjust-preview-action { display: flex; align-items: stretch; }
    .stock-adjust-preview-action .btn { min-width: 150px; border-radius: 0 var(--radius-md) var(--radius-md) 0; }
    .stock-adjust-cost-field[hidden],
    .stock-adjust-preview[hidden],
    .stock-adjust-flow[hidden] { display: none !important; }
    .stock-adjust-flow { margin-bottom: 14px; }
    .stock-adjust-flow-card { overflow: hidden; border: 1px solid var(--rule); border-radius: var(--radius-md); background: var(--card); }
    .stock-adjust-flow-title { padding: 7px 12px; border-bottom: 1px solid var(--rule); color: var(--text-secondary); background: var(--bg-alt); font-size: var(--text-xs); font-weight: 700; }
    .stock-adjust-flow-table-wrap { max-height: 180px; }
    .stock-adjust-history { padding-top: 12px; border-top: 2px solid var(--rule); }
    .stock-adjust-history-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
    .stock-adjust-history-title { color: var(--text-secondary); font-size: var(--text-sm); font-weight: 700; }
    .stock-adjust-history-head .btn { min-height: 30px; padding: 4px 11px; font-size: var(--text-xs); }
    .stock-adjust-history-table-wrap { max-height: 220px; border: 1px solid var(--rule); border-radius: var(--radius-md); }
    .stock-adjust-table { width: 100%; border-collapse: collapse; }
    .stock-adjust-table th { font-size: var(--text-xs); }
    .stock-adjust-ledger-row,
    .stock-adjust-history-row { border-bottom: 1px solid var(--rule); }
    .stock-adjust-ledger-row td { padding: 5px 8px; font-size: var(--text-xs); }
    .stock-adjust-history-row td { padding: 7px 8px; font-size: var(--text-xs); }
    .stock-adjust-date { white-space: nowrap; }
    .stock-adjust-code { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px !important; }
    .stock-adjust-in,
    .stock-adjust-impact.is-positive { color: var(--green); }
    .stock-adjust-out,
    .stock-adjust-impact.is-negative { color: var(--danger); }
    .stock-adjust-impact { font-weight: 700; }
    .stock-adjust-note { color: var(--muted); }
    .inventory-overview-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 24px;
      margin: -18px -18px 0;
      padding: 17px 18px 15px;
      border-bottom: 1px solid var(--rule);
      background: linear-gradient(105deg, #f8faff 0%, #fff 72%);
    }
    .inventory-overview-head h3 { margin: 3px 0 4px; color: var(--ink); font-size: 18px; line-height: 1.25; letter-spacing: -.015em; }
    .inventory-overview-head p { margin: 0; color: var(--text-secondary); font-size: var(--text-xs); line-height: 1.55; }
    .inventory-overview-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
    .inventory-overview-actions .btn { height: 36px; padding: 0 13px; }
    .inventory-kpis {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      margin: 0 -18px;
      border-bottom: 1px solid var(--rule);
    }
    .inventory-kpis > div { min-width: 0; padding: 12px 16px; border-right: 1px solid var(--rule); }
    .inventory-kpis > div:last-child { border-right: 0; }
    .inventory-kpis span,
    .inventory-kpis small { display: block; color: var(--muted); font-size: 11px; }
    .inventory-kpis strong { display: block; margin: 3px 0 1px; color: var(--ink); font-size: 19px; line-height: 1.2; font-variant-numeric: tabular-nums; }
    .ledger-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .inventory-filter-grid {
      display: grid;
      grid-template-columns: minmax(280px, 1.6fr) repeat(3, minmax(140px, .7fr));
      gap: 10px;
      margin: 0 -18px;
      padding: 12px 14px;
      border-bottom: 1px solid var(--rule);
      background: #fbfcfe;
    }
    .ledger-filter-grid { grid-template-columns: minmax(280px, 1.5fr) repeat(4, minmax(130px, .65fr)); }
    .inventory-filter-grid label { min-width: 0; display: grid; gap: 5px; }
    .inventory-filter-grid label > span { color: var(--text-secondary); font-size: 11px; font-weight: 650; }
    .inventory-filter-grid input,
    .inventory-filter-grid select { width: 100%; height: 35px; min-width: 0; padding: 0 10px; border: 1px solid var(--border2); border-radius: 8px; color: var(--ink); background: #fff; font: inherit; font-size: 12px; }
    .inventory-status-filter { display: flex; align-items: center; gap: 7px; margin: 0 -18px; padding: 9px 14px; border-bottom: 1px solid var(--rule); }
    .inventory-status-filter .btn { height: 29px; padding: 0 9px; font-size: 10px; }
    .inventory-status-filter > span { margin-left: auto; color: var(--muted); font-size: 11px; }
    .inventory-overview-table,
    .inventory-ledger-table { flex: 1 1 auto !important; min-height: 270px; max-height: 520px; margin: 12px 0 0; overflow: auto; border: 1px solid var(--rule); border-radius: var(--radius-md); }
    .inventory-overview-table table { width: 100%; min-width: 1030px; table-layout: fixed; }
    .inventory-overview-table th,
    .inventory-ledger-table th { position: sticky; top: 0; z-index: 2; padding: 9px 10px; color: #64748b; background: #f5f7fa; font-size: 11px; font-weight: 700; text-align: left; }
    .inventory-overview-table td,
    .inventory-ledger-table td { padding: 10px; color: #35455a; border-bottom: 1px solid var(--rule); font-size: 12px; vertical-align: middle; }
    .inventory-overview-table th:nth-child(1) { width: 72px; }
    .inventory-overview-table th:nth-child(2) { width: 210px; }
    .inventory-overview-table th:nth-child(3) { width: 95px; }
    .inventory-overview-table th:nth-child(4) { width: 105px; }
    .inventory-overview-table th:nth-child(5) { width: 125px; }
    .inventory-overview-table th:nth-child(6) { width: 135px; }
    .inventory-overview-table th:nth-child(7) { width: 140px; }
    .inventory-overview-table th:nth-child(8) { width: 135px; }
    .inventory-overview-table th:nth-child(9) { width: 150px; }
    .inventory-product-row td > strong,
    .inventory-ledger-table td > strong { display: block; overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 680; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
    .inventory-product-row td > span,
    .inventory-ledger-table td > span { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
    .inventory-row-actions { display: flex; flex-wrap: wrap; gap: 5px; }
    .inventory-row-actions .btn { height: 28px; padding: 0 8px; font-size: 10px; }
    .inventory-batch-row > td { padding: 0 !important; background: #f7f9fd; }
    .inventory-batch-detail { padding: 12px 14px 14px; border-left: 3px solid #8aa5f2; }
    .inventory-batch-meta { display: flex; align-items: baseline; gap: 10px; margin-bottom: 9px; }
    .inventory-batch-meta strong { color: var(--ink); font-size: 12px; }
    .inventory-batch-meta span { color: var(--muted); font-size: 10px; }
    .inventory-batch-list { display: grid; gap: 7px; }
    .inventory-batch-card { display: grid; grid-template-columns: 1.15fr .8fr .75fr .75fr .85fr; gap: 8px; padding: 9px 10px; border: 1px solid #dce4f1; border-radius: 8px; background: #fff; }
    .inventory-batch-card > div { min-width: 0; }
    .inventory-batch-card span { display: block; color: var(--muted); font-size: 9px; }
    .inventory-batch-card strong { display: block; margin-top: 2px; overflow: hidden; color: var(--ink); font-size: 11px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
    .inventory-ledger-table table { width: 100%; min-width: 960px; table-layout: fixed; }
    .inventory-ledger-table th:nth-child(1) { width: 125px; }
    .inventory-ledger-table th:nth-child(2) { width: 190px; }
    .inventory-ledger-table th:nth-child(3) { width: 200px; }
    .inventory-ledger-table th:nth-child(4) { width: 95px; }
    .inventory-ledger-table th:nth-child(5) { width: 140px; }
    .inventory-ledger-table th:nth-child(6) { width: 120px; }
    .inventory-ledger-table th:nth-child(7) { width: 210px; }
    .inventory-ledger-type { width: max-content; padding: 2px 6px; color: #42609e !important; border-radius: 999px; background: #edf2ff; font-size: 9px !important; }
    .inventory-ledger-no { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
    .inventory-impact.is-in { color: #087258 !important; }
    .inventory-impact.is-out { color: #bd3148 !important; }
    .inventory-impact.is-zero { color: var(--muted) !important; }
    .inventory-pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 42px; padding: 8px 2px 0; color: var(--muted); font-size: 11px; }
    .inventory-pagination > div { display: flex; align-items: center; gap: 8px; }
    .inventory-pagination strong { min-width: 48px; color: var(--ink); text-align: center; font-size: 11px; }
    .inventory-pagination .btn { height: 28px; padding: 0 9px; font-size: 10px; }
    .inventory-pagination .btn:disabled { opacity: .42; cursor: not-allowed; }
    body.role-sales .inventory-cost-sensitive { display: none !important; }
    .purchase-ledger-workspace,
    .purchase-create-workspace {
      min-height: 0;
      border: 1px solid var(--rule);
      border-radius: var(--radius-lg);
      background: #fff;
      overflow: hidden;
    }
    .purchase-ledger-workspace { display: flex; flex: 1; flex-direction: column; }
    .purchase-workspace-head,
    .purchase-create-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 24px;
      padding: 17px 18px 15px;
      border-bottom: 1px solid var(--rule);
      background: linear-gradient(105deg, #f8faff 0%, #fff 70%);
    }
    .purchase-workspace-head h3,
    .purchase-create-head h3 { margin: 3px 0 4px; color: var(--ink); font-size: 18px; line-height: 1.25; letter-spacing: -.015em; }
    .purchase-workspace-head p,
    .purchase-create-head p { margin: 0; color: var(--text-secondary); font-size: var(--text-xs); line-height: 1.55; }
    .purchase-workspace-eyebrow { color: var(--blue); font-size: 11px; font-weight: 750; letter-spacing: .08em; }
    .purchase-workspace-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
    .purchase-workspace-actions .btn,
    .purchase-create-head .btn { height: 36px; padding: 0 13px; }
    .purchase-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--rule); }
    .purchase-metric { position: relative; min-width: 0; padding: 12px 16px; border-right: 1px solid var(--rule); }
    .purchase-metric:last-child { border-right: 0; }
    .purchase-metric span,
    .purchase-metric small { display: block; color: var(--muted); font-size: 11px; }
    .purchase-metric strong { display: block; margin: 3px 0 1px; color: var(--ink); font-size: 19px; line-height: 1.2; font-variant-numeric: tabular-nums; }
    .purchase-list-filters { display: grid; grid-template-columns: minmax(280px, 1.8fr) repeat(3, minmax(140px, .7fr)); gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--rule); background: #fbfcfe; }
    .purchase-list-filters label,
    .purchase-master-fields label,
    .purchase-create-summary label { min-width: 0; display: grid; gap: 5px; }
    .purchase-list-filters label > span,
    .purchase-master-fields label > span,
    .purchase-create-summary label > span { color: var(--text-secondary); font-size: 11px; font-weight: 650; }
    .purchase-list-filters input,
    .purchase-list-filters select,
    .purchase-master-fields input,
    .purchase-master-fields select,
    .purchase-create-summary input { width: 100%; height: 35px; padding: 0 10px; border: 1px solid var(--border2); border-radius: 8px; color: var(--ink); background: #fff; font: inherit; font-size: 12px; }
    .purchase-list-summary { padding: 9px 14px; color: var(--text-secondary); border-bottom: 1px solid var(--rule); font-size: 11px; }
    .purchase-list-summary strong { color: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; }
    .purchase-workspace-table { min-height: 270px; max-height: 490px; flex: 1; overflow: auto; border: 0; border-radius: 0; }
    .purchase-workspace-table table { width: 100%; min-width: 1330px; table-layout: fixed; }
    .purchase-workspace-table th { position: sticky; top: 0; z-index: 2; padding: 9px 10px; color: #64748b; background: #f5f7fa; font-size: 11px; font-weight: 700; text-align: left; }
    .purchase-workspace-table td { padding: 10px; color: #35455a; border-bottom: 1px solid var(--rule); font-size: 12px; vertical-align: middle; }
    .purchase-workspace-table th:nth-child(1) { width: 115px; }
    .purchase-workspace-table th:nth-child(2) { width: 170px; }
    .purchase-workspace-table th:nth-child(3) { width: 130px; }
    .purchase-workspace-table th:nth-child(4) { width: 125px; }
    .purchase-workspace-table th:nth-child(5) { width: 275px; }
    .purchase-workspace-table th:nth-child(6) { width: 80px; }
    .purchase-workspace-table th:nth-child(7) { width: 110px; }
    .purchase-workspace-table th:nth-child(8) { width: 95px; }
    .purchase-workspace-table th:nth-child(9) { width: 230px; }
    .purchase-order-row.is-voided { opacity: .56; }
    .purchase-order-row td > small,
    .purchase-receipt-no + small { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
    .purchase-status { display: inline-flex; align-items: center; min-width: 56px; justify-content: center; padding: 3px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; }
    .purchase-status.posted { color: #087258; background: #e6f6ef; }
    .purchase-status.returned { color: #a56408; background: #fff2dc; }
    .purchase-status.voided { color: #b42d47; background: #fde9ed; }
    .purchase-receipt-no { display: block; overflow: hidden; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
    .purchase-warehouse-list { display: flex; flex-wrap: wrap; gap: 4px; }
    .purchase-warehouse-tag { display: inline-flex; padding: 3px 6px; color: #42609e; border-radius: 6px; background: #edf2ff; font-size: 10px; font-weight: 650; }
    .purchase-product-summary { display: grid; gap: 2px; max-height: 48px; overflow: hidden; }
    .purchase-product-summary span { overflow: hidden; font-size: 11px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
    .muted-text { color: var(--muted); }
    .purchase-row-actions { display: flex; flex-wrap: wrap; gap: 4px; }
    .purchase-row-actions .btn { height: 28px; padding: 0 8px; font-size: 10px; }
    .purchase-row-actions .danger-text { color: #bd3148; border-color: #f2c6cf; background: #fff; }
    .purchase-create-workspace { flex: 0 0 auto; }
    .purchase-create-workspace[hidden],
    .purchase-ledger-workspace[hidden] { display: none !important; }
    .purchase-master-fields { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)) minmax(260px, .9fr); gap: 12px; align-items: end; padding: 14px 16px; border-bottom: 1px solid var(--rule); }
    .purchase-master-shortcuts { min-height: 35px; display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
    .purchase-master-shortcuts > span { color: var(--muted); font-size: 11px; }
    .purchase-master-shortcuts .btn { height: 34px; padding: 0 10px; font-size: 11px; }
    .purchase-items-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 16px 9px; }
    .purchase-items-head > div:first-child { display: grid; gap: 2px; }
    .purchase-items-head strong { color: var(--ink); font-size: 13px; }
    .purchase-items-head span { color: var(--muted); font-size: 10px; }
    .purchase-items-head > div:last-child { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
    .purchase-items-head .btn { height: 32px; padding: 0 10px; font-size: 11px; }
    .purchase-items-table { max-height: 330px; margin: 0 16px; overflow: auto; border: 1px solid var(--rule); border-radius: var(--radius-md); }
    .purchase-items-table table { width: 100%; min-width: 1000px; table-layout: fixed; }
    .purchase-items-table th { padding: 8px; color: var(--muted); background: #f5f7fa; font-size: 10px; text-align: left; }
    .purchase-items-table td { padding: 7px 8px; border-bottom: 1px solid var(--rule); font-size: 11px; }
    .purchase-items-table th:nth-child(1) { width: 42px; }
    .purchase-items-table th:nth-child(2) { width: 310px; }
    .purchase-items-table th:nth-child(3) { width: 140px; }
    .purchase-items-table th:nth-child(4) { width: 95px; }
    .purchase-items-table th:nth-child(5),
    .purchase-items-table th:nth-child(6),
    .purchase-items-table th:nth-child(7) { width: 115px; }
    .purchase-items-table th:nth-child(8) { width: 65px; }
    .purchase-items-table input,
    .purchase-items-table select { width: 100%; height: 34px; padding: 0 8px; border: 1px solid var(--border2); border-radius: 7px; color: var(--ink); background: #fff; font: inherit; font-size: 11px; }
    .purchase-create-footer { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding: 12px 16px 16px; }
    .purchase-create-summary { min-width: 0; display: grid; flex: 1; grid-template-columns: 130px 150px minmax(280px, 1fr); gap: 10px; }
    .purchase-create-summary input[readonly] { color: var(--ink); background: #f5f7fa; font-weight: 700; font-variant-numeric: tabular-nums; }
    .purchase-submit-actions { display: flex; flex: 0 0 auto; gap: 8px; }
    .purchase-submit-actions .btn { min-width: 110px; height: 36px; }
    @media (max-width: 1180px) {
      .stock-workspace-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
      .stock-module-status { min-width: 200px; }
      .stock-adjust-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
      .stock-adjust-product { grid-column: span 2; }
      .stock-adjust-remark { grid-column: span 2; }
      .stock-adjust-preview { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 8px; }
      .stock-adjust-preview > div:not(.stock-adjust-preview-action) { border-right: 1px solid var(--rule); border-radius: var(--radius-md); }
      .stock-adjust-preview-action .btn { min-height: 54px; border-radius: var(--radius-md); }
      .inventory-overview-head { align-items: stretch; flex-direction: column; }
      .inventory-overview-actions { justify-content: flex-start; }
      .inventory-filter-grid,
      .ledger-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .inventory-filter-search { grid-column: 1 / -1; }
      .inventory-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .inventory-kpis > div:nth-child(2) { border-right: 0; }
      .inventory-kpis > div:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
      .purchase-workspace-head,
      .purchase-create-head { align-items: stretch; flex-direction: column; }
      .purchase-workspace-actions { justify-content: flex-start; }
      .purchase-list-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .purchase-search-field { grid-column: 1 / -1; }
      .purchase-master-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .purchase-master-shortcuts { justify-content: flex-start; }
      .purchase-create-footer { align-items: stretch; flex-direction: column; }
      .purchase-submit-actions { justify-content: flex-end; }
    }

    .empty-row { text-align: center; color: var(--muted); }
    .ui-state {
      --ui-state-accent: #64748b;
      --ui-state-border: #d8dee7;
      --ui-state-bg: #f8fafc;
      min-height: 74px;
      display: grid;
      place-items: center;
      align-content: center;
      gap: 5px;
      padding: 16px 20px;
      color: #536176;
      border: 1px dashed var(--ui-state-border);
      border-radius: 10px;
      background: var(--ui-state-bg);
      text-align: center;
    }
    .ui-state__label {
      display: inline-flex;
      min-height: 22px;
      align-items: center;
      padding: 0 8px;
      color: var(--ui-state-accent);
      border: 1px solid var(--ui-state-border);
      border-radius: 999px;
      background: #fff;
      font-size: 10px;
      font-weight: 750;
      letter-spacing: .03em;
    }
    .ui-state__title { color: #34445a; font-size: 12px; line-height: 1.5; }
    .ui-state__detail { max-width: 680px; color: #748296; font-size: 11px; line-height: 1.55; }
    .ui-state__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 3px; }
    .ui-state--loading,
    .ui-state--processing { --ui-state-accent:#355ac7; --ui-state-border:#cbd8f5; --ui-state-bg:#f5f8ff; }
    .ui-state--empty,
    .ui-state--readonly { --ui-state-accent:#64748b; --ui-state-border:#d8dee7; --ui-state-bg:#f8fafc; }
    .ui-state--error { --ui-state-accent:#b4233c; --ui-state-border:#efc6ce; --ui-state-bg:#fff7f8; }
    .ui-state--permission,
    .ui-state--locked { --ui-state-accent:#8a5a12; --ui-state-border:#ead3a8; --ui-state-bg:#fff9ee; }
    .ui-state--unknown { --ui-state-accent:#7950a3; --ui-state-border:#ddcbed; --ui-state-bg:#fbf8ff; }
    .ui-state--success { --ui-state-accent:#167361; --ui-state-border:#bae1d7; --ui-state-bg:#f1fbf7; }
    .empty-row > .ui-state { margin: 4px; }
    tbody tr.row-gift { background: var(--orange-bg) !important; }
    tbody tr.row-gift:hover { background: #fef3c7 !important; }
    tbody tr.row-loss { background: var(--red-bg) !important; }
    tbody tr.row-loss:hover { background: #fee2e2 !important; }
    tbody tr.row-zero { color: var(--muted); font-style: italic; }
    tbody tr.row-zero:hover { background: var(--bg-alt) !important; }
    .text-loss { color: var(--red); font-weight: 600; }
    .text-profit { color: var(--green); }
    .text-comm { color: #8b5cf6; font-weight: 700; }
    tbody tr.row-voided { opacity: .5; text-decoration: line-through; }
    /* 订单分组边框：首行顶边框 + 末行底边框，框住每组订单 */
    #salesReportTable tbody tr.order-start td { border-top:0; }
    #salesReportTable tbody tr.order-end td { border-bottom:1px solid #e7ebf0; }

    .filter-bar {
      display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
      padding: 8px 14px; background: var(--bg-alt);
      border-bottom: 1px solid var(--rule);
      position: relative; z-index: 15;
    }
    .filter-bar label { font-size: var(--text-xs); color: var(--muted); white-space: nowrap; text-transform: uppercase; letter-spacing: 0.5px; }
    .filter-bar input[type="date"] { padding: 0 10px; border: 1px solid var(--border2); border-radius: var(--radius-md); font-size: var(--text-sm); height: 36px; }
    .filter-bar select { padding: 0 10px; border: 1px solid var(--border2); border-radius: var(--radius-md); font-size: var(--text-sm); height: 36px; }
    .filter-bar .btn-sm { font-size: var(--text-xs); padding: 3px 10px; }
    .filter-bar input, .filter-bar select { width: auto; }
    .filter-bar input:not([type="date"]) { padding: 0 10px; border: 1px solid var(--border2); border-radius: var(--radius-md); font-size: var(--text-sm); min-width: 140px; flex: 1 1 180px; height: 36px; }
    td input, td select { width: 100%; box-sizing: border-box; padding: 0 10px; height: var(--input-height); font-size: var(--text-base); border: 1px solid var(--border2); border-radius: var(--radius-md); }

    /* —— 6. 卡片与统计 —— */
    .discount-box {
      display: grid;
      grid-template-columns: 24px 1fr 24px;
      align-items: center;
      gap: 3px;
      width: 100%;
    }
    .discount-box button {
      width: 26px;
      height: 26px;
      border: 1px solid var(--rule);
      border-radius: var(--radius-sm);
      background: var(--card);
      cursor: pointer;
      font-weight: 900;
      color: var(--ink);
    }
    .discount-box input { text-align: center; min-width: 0; }
    .discount-box span { color: var(--muted); font-weight: 700; }

    .product-cell { position: relative; }
    .productSearch {
      width: 100%; box-sizing: border-box; padding: 4px 8px; height: 34px;
      border: 1px solid var(--border2); border-radius: var(--radius-sm); font-size: 13px;
      outline: none; background: var(--card);
      transition: border-color 0.15s ease;
    }
    .productSearch:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(94,106,210,0.12); }
    .product-dropdown {
      position: fixed; z-index: 500;
      min-width: 380px; max-height: 360px; overflow-y: auto; overflow-x: hidden;
      background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-md);
      box-shadow: var(--shadow-md);
    }
    .dd-item {
      padding: 8px 12px; cursor: pointer; font-size: 13px; color: var(--text);
      border-bottom: 1px solid var(--divider); white-space: nowrap;
      display: flex; align-items: center; gap: 4px;
      transition: background-color 0.1s ease;
    }
    .dd-item:hover { background: var(--bg-alt); }
    .dd-item:last-child { border-bottom: none; }
    .dd-item.active { background: var(--bg-alt); }
    .dd-item .low-stock-badge {
      display: inline-block; background: var(--red); color: #fff;
      font-size: 10px; padding: 1px 4px; border-radius: var(--radius-sm); margin-left: 4px;
    }
    #globalProductDropdown .product-option {
      display: grid;
      gap: 6px;
      padding: 10px 12px;
      white-space: normal;
    }
    #globalProductDropdown .product-option-title {
      display: flex;
      align-items: center;
      gap: 7px;
      min-width: 0;
    }
    #globalProductDropdown .product-option-title strong {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    #globalProductDropdown .product-option-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 4px 10px;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.45;
    }
    #globalProductDropdown .product-option-meta > span + span::before {
      content: "·";
      margin-right: 10px;
      color: var(--border2);
    }
    #globalProductDropdown .product-option-badge {
      flex: 0 0 auto;
      border-radius: 999px;
      padding: 1px 6px;
      background: var(--brand-light);
      color: var(--blue);
      font-size: 11px;
      font-weight: 650;
    }
    #globalProductDropdown .product-option-stock.stock-neg,
    #globalProductDropdown .product-option-stock.stock-zero { color: var(--red); }
    #globalProductDropdown .product-option-stock.stock-low { color: var(--orange); }
    .stock-highlight { background: transparent !important; outline: 0; }
    .stock-highlight td { background: #fbfcff !important; }
    .stock-highlight td:first-child { box-shadow: inset 3px 0 #4167d9; }
    #stockRows tr { cursor: pointer; }
    #stockRows tr:hover td { background: var(--bg-alt); }

    .footer-form { padding: 10px 14px; border-top: 1px solid var(--rule); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px; background: var(--bg-alt); }
    .footer-form label { font-size: .72rem; }
    .footer-form input, .footer-form select { height: var(--input-height); font-size: var(--text-base); padding: 0 10px; border: 1px solid var(--border2); border-radius: var(--radius-md); box-sizing: border-box; width: 100%; }

    .upload-section { padding: 6px 14px 10px; border-top: 1px solid var(--rule); background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%); display: flex; flex-direction: column; align-items: center; }
    .upload-section label { font-weight: 600; font-size: .78rem; color: var(--text-secondary); margin-bottom: 4px; display: block; }
    .upload-area {
      border: 2px dashed var(--border2); border-radius: var(--radius-sm); padding: 8px 16px; text-align: center;
      cursor: pointer; transition: border-color 0.2s ease, background-color 0.2s ease; min-height: auto; height: auto; display: inline-flex; align-items: center; justify-content: center;
      position: relative; width: auto; max-width: 240px; flex: 0 0 auto; align-self: center;
    }
    .upload-area:hover { border-color: var(--ink); background: var(--bg-alt); }
    .upload-area.has-image { border-style: solid; border-color: var(--green); background: var(--green-bg); }
    .upload-placeholder { color: var(--muted-light); font-size: 14px; }
    .upload-status-mark {
      width: 26px;
      height: 26px;
      display: block;
      position: relative;
      margin: 0 auto 6px;
      border: 2px solid #16806a;
      border-radius: 50%;
    }
    .upload-status-mark::after {
      content: "";
      width: 9px;
      height: 5px;
      position: absolute;
      left: 7px;
      top: 7px;
      border-left: 2px solid #16806a;
      border-bottom: 2px solid #16806a;
      transform: rotate(-45deg);
    }
    .upload-preview { position: relative; display: inline-block; }
    .upload-preview img { max-height: 120px; max-width: 360px; border-radius: var(--radius-sm); border: 1px solid var(--rule); }
    .upload-remove-btn { position: absolute; top: -8px; right: -8px; font-size: 11px; padding: 2px 6px; border-radius: 50%; min-width: auto; }

    .summary-line { display: flex; justify-content: flex-end; gap: 28px; padding: 10px 14px; color: var(--muted); font-size: .82rem; position: relative; z-index: 15; }
    .summary-line strong { color: var(--ink); font-size: .95rem; font-weight: 700; }

    .quick {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
      gap: 10px;
      padding: 16px 18px;
      border-bottom: 1px solid var(--rule);
    }
    .quick button {
      border: 1px solid transparent;
      background: var(--card);
      cursor: pointer;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      padding: 14px 10px;
      border-radius: var(--radius-lg);
      color: var(--text);
      font-family: var(--font);
      font-size: .85rem;
      transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    }
    .quick button:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--blue); }
    .quick button:active { transform: translateY(0); }
    .icon {
      width: 42px;
      height: 42px;
      border-radius: var(--radius-md);
      display: grid;
      place-items: center;
      color: #fff;
      font-weight: 900;
      font-size: 1rem;
    }
    .icon svg { width: 22px; height: 22px; }

    .icon-grad-purple { background: #8b5cf6; }
    .icon-grad-teal { background: #14b8a6; }
    .icon-grad-amber { background: #f59e0b; }
    .icon-grad-green { background: #16a34a; }
    .icon-grad-blue { background: #3b82f6; }
    .icon-grad-lime { background: #84cc16; }
    .icon-grad-orange { background: #f97316; }
    .icon-grad-pink { background: #ec4899; }
    .icon-grad-cyan { background: #06b6d4; }
    .icon-grad-indigo { background: #2563eb; }
    .icon-grad-slate { background: #64748b; }

    .metric-card {
      flex: 1;
      min-width: 100px;
      background: var(--bg-alt);
      border-radius: var(--radius-md);
      padding: 10px 14px;
      border-left: 3px solid var(--blue);
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    .metric-card .m-label { font-size: var(--text-xs); color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
    .metric-card .m-value { font-size: 1.2rem; font-weight: 700; color: var(--ink); }
    .metric-card .m-value-sm { font-size: 15px; }
    .metric-card.accent-blue { border-left-color: var(--blue); }
    .metric-card.accent-blue .m-value { color: var(--blue); }
    .metric-card.accent-green { border-left-color: var(--green); }
    .metric-card.accent-green .m-value { color: var(--green); }
    .metric-card.accent-orange { border-left-color: var(--orange); }
    .metric-card.accent-orange .m-value { color: var(--orange); }
    .metric-card.accent-purple { border-left-color: #8b5cf6; }
    .metric-card.accent-purple .m-value { color: #8b5cf6; }
    .metric-card.accent-slate { border-left-color: var(--text-secondary); }
    .metric-card.accent-slate .m-value { color: var(--text-secondary); }

    .home-compact { display: grid; grid-template-columns: 1.2fr .8fr; gap: 12px; padding: 14px; flex: 1; }
    .mini-card {
      background: var(--card);
      border: 1px solid transparent;
      border-radius: var(--radius-lg);
      padding: 22px 24px;
      box-shadow: var(--shadow-sm);
      display: flex;
      flex-direction: column;
      transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    .mini-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
    .mini-card.full-height { flex: 1; }
    .mini-title { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px; }
    .mini-title h2 { margin:0; font-size:.88rem; font-weight: 600; color: var(--ink); }
    .store-chart-wrap { position: relative; flex: 0 0 auto; display: flex; flex-direction: column; margin-top: 10px; }
    .store-chart-wrap canvas { width: 100%; height: auto; display: block; }
    .store-legend { display: flex; gap: 16px; justify-content: center; margin-top: 8px; flex-wrap: wrap; }
    .store-legend .legend-item { display: flex; align-items: center; gap: 5px; font-size: .8rem; color: var(--muted); cursor: pointer; user-select: none; }
    .store-legend .legend-item .dot { width: 10px; height: 10px; border-radius: 50%; }
    .chart-tooltip { position: absolute; background: var(--blue-dark); color: #fff; padding: 6px 10px; border-radius: var(--radius-sm); font-size: .78rem; pointer-events: none; white-space: nowrap; z-index: 100; }

    /* 7天趋势明细表 */
    .home-trend-table { margin:0; }
    .trend-mini-table { width:100%; border-collapse:separate; border-spacing:0; overflow:hidden; border:1px solid #e4e8ee; border-radius:10px; font-size:.78rem; }
    .trend-mini-table thead th { height:34px; padding:0 10px; color:#69778b; background:#f8fafc; border-bottom:1px solid #dfe4eb; font-size:.7rem; font-weight:650; text-align:right; white-space:nowrap; }
    .trend-mini-table thead th:first-child,
    .trend-mini-table tbody td:first-child { text-align:left; }
    .trend-mini-table tbody td { height:35px; padding:0 10px; color:#3f4d61; border-bottom:1px solid #edf0f4; background:#fff; font-size:.76rem; text-align:right; }
    .trend-mini-table tbody tr:last-child td { border-bottom:0; }
    .trend-mini-table tbody tr:hover td { background:#f8faff; }
    .trend-mini-table .td-date { color: var(--muted); font-weight: 500; white-space: nowrap; }
    .trend-mini-table .td-day-total { font-weight: 600; color: var(--ink); }
    .trend-mini-table .muted-zero { color: #d1d5db; }
    .trend-mini-table .tr-grand-total td { height:38px; color:#24344c; border-top:1px solid #ced8ed; background:#f2f5fc; font-size:.78rem; font-weight:750; }

    /* 正式迁移版首页：以角色待办为主，不再堆叠旧式快捷入口 */
    #home.home-workspace { gap: 14px; padding-top: 22px; }
    #home.home-workspace > * { flex: 0 0 auto; }
    .home-intro { display:flex; align-items:center; justify-content:space-between; gap:28px; }
    .home-intro h2 { margin:4px 0 5px; color:var(--ink); font-size:1.55rem; line-height:1.2; letter-spacing:-.45px; }
    .home-intro p { margin:0; color:var(--muted); font-size:var(--text-sm); }
    .home-eyebrow { color:var(--muted); font-size:var(--text-xs); font-weight:700; letter-spacing:.03em; }
    .home-intro-actions { display:flex; align-items:center; gap:10px; }
    .home-scope-chip { display:inline-flex; align-items:center; min-height:36px; padding:0 13px; border:1px solid var(--rule); border-radius:var(--radius-full); color:var(--text-secondary); background:var(--card); font-size:var(--text-xs); font-weight:700; }
    .home-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border:1px solid var(--rule); border-radius:var(--radius-lg); background:var(--card); box-shadow:var(--shadow-sm); overflow:hidden; }
    .home-kpis article { min-height:106px; display:grid; align-content:center; gap:7px; padding:16px 20px; border-right:1px solid var(--divider); }
    .home-kpis article:last-child { border-right:0; }
    .home-kpis span { color:var(--muted); font-size:var(--text-xs); font-weight:700; }
    .home-kpis strong { color:var(--ink); font-size:1.45rem; line-height:1.15; font-variant-numeric:tabular-nums; letter-spacing:-.35px; }
    .home-kpis small { color:var(--muted); font-size:.72rem; }
    .home-kpis small b { color:inherit; font-weight:inherit; }
    .home-focus-grid { display:grid; grid-template-columns:minmax(600px,1.45fr) minmax(320px,.75fr); gap:14px; }
    .home-focus-grid > .panel, .home-bottom-grid > .panel, .home-trend-panel { min-height:0; box-shadow:0 1px 2px rgba(23,34,49,.04); }
    .home-task-panel .panel-head, .home-status-panel .panel-head, .home-trend-panel .panel-head, .home-detail-card .panel-head { min-height:62px; padding:14px 18px; }
    .home-task-panel .panel-head h2, .home-status-panel .panel-head h2, .home-trend-panel .panel-head h2, .home-detail-card .panel-head h2 { font-size:.96rem; font-weight:720; letter-spacing:-.01em; }
    .home-task-panel .panel-head > div, .home-status-panel .panel-head > div, .home-trend-panel .panel-head > div, .home-detail-card .panel-head > div { display:grid; gap:3px; }
    .home-task-panel .panel-head p, .home-status-panel .panel-head p, .home-trend-panel .panel-head p, .home-detail-card .panel-head p { margin:0; color:var(--muted); font-size:.72rem; line-height:1.45; }
    .home-task-list { display:grid; padding:0 12px 10px; }
    .home-loading-state { padding:28px 12px; color:var(--muted); text-align:center; font-size:var(--text-sm); }
    .home-task-item { width:100%; min-height:58px; display:grid; grid-template-columns:34px minmax(220px,1fr) auto 16px; align-items:center; gap:11px; padding:7px 9px; border:0; border-bottom:1px solid var(--divider); color:var(--text); background:transparent; text-align:left; cursor:pointer; }
    .home-task-item:last-child { border-bottom:0; }
    .home-task-item:hover { border-radius:var(--radius-sm); background:var(--bg-alt); }
    .home-task-icon { width:32px; height:32px; display:grid; place-items:center; border-radius:var(--radius-sm); color:var(--blue); background:var(--brand-light); font-size:1rem; font-weight:800; }
    .home-task-icon.warning { color:#a65e0d; background:#fff5df; }
    .home-task-icon.danger { color:#b53245; background:#fff0f2; }
    .home-task-icon.positive { color:#15745a; background:#eaf6f1; }
    .home-task-copy { min-width:0; display:grid; gap:3px; }
    .home-task-copy strong { color:var(--ink); font-size:var(--text-base); }
    .home-task-copy small { overflow:hidden; color:var(--muted); font-size:.72rem; text-overflow:ellipsis; white-space:nowrap; }
    .home-task-value { color:var(--text-secondary); font-size:var(--text-sm); font-weight:750; font-variant-numeric:tabular-nums; white-space:nowrap; }
    .home-task-arrow { color:var(--muted-light); font-size:1rem; }
    .home-status-list { display:grid; padding:4px 18px 14px; }
    .home-status-list > div { min-height:43px; display:flex; align-items:center; justify-content:space-between; gap:16px; border-bottom:1px solid var(--divider); color:var(--muted); font-size:var(--text-sm); }
    .home-status-list > div:last-child { border-bottom:0; }
    .home-status-list strong { color:var(--ink); font-variant-numeric:tabular-nums; }
    .home-status-list.compact { padding-top:0; }
    .home-trend-layout { display:grid; grid-template-columns:minmax(620px,1.25fr) minmax(360px,.75fr); gap:20px; padding:16px 18px 18px; }
    .home-trend-layout .home-trend-table { min-width:0; margin:0; overflow-x:auto; }
    .home-trend-layout .store-chart-wrap { min-width:0; margin:0; padding:10px 12px 8px 20px; border:0; border-radius:10px; background:#f8fafc; }
    .home-bottom-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
    .home-detail-card { min-height:226px; padding-bottom:14px; overflow:hidden; }
    .home-detail-card::before { content:""; display:block; height:3px; background:#4167d9; }
    #homeDailyProfitCard::before { background:#138060; }
    .home-technical-card::before { background:#7b8798; }
    .home-detail-total { display:block; padding:12px 18px 2px; color:var(--ink); font-size:1.45rem; font-weight:750; font-variant-numeric:tabular-nums; letter-spacing:-.02em; }
    #homeDailyProfitTotal { color:#138060; }
    .home-detail-card .mini-list { padding:0 18px; }
    .home-detail-note { margin:8px 18px 2px; color:var(--muted); font-size:.7rem; line-height:1.5; }
    .home-text-action { min-height:30px; display:inline-flex; align-items:center; padding:0 8px; border:1px solid #d7e0ef; border-radius:7px; color:#3159bd; background:#f8faff; font:inherit; font-size:.72rem; font-weight:700; cursor:pointer; }
    .home-text-action.danger { color:var(--red); }
    body.role-sales .home-sensitive-card, body.role-sales .home-sensitive-row { display:none; }
    body.role-sales .home-kpis { grid-template-columns:repeat(3,minmax(0,1fr)); }

    .money-hero { font-size: 1.8rem; font-weight: 800; letter-spacing:-0.5px; margin:8px 0; color: var(--ink); }
    .small-note { color: var(--muted); font-size:.78rem; }
    .mini-list { display:grid; gap:8px; margin-top:10px; flex:1; }
    .mini-row { display:flex; justify-content:space-between; align-items:center; gap:10px; font-size:.85rem; color:var(--muted); padding: 8px 12px; background: var(--bg-alt); border-radius: var(--radius-md); }
    .mini-row strong { color:var(--ink); font-weight: 600; }
    .mini-row.divider { border-top: 1px dashed var(--border); padding-top: 8px; margin-top: 2px; }
    .alert-danger { color: var(--red); }
    .alert-success { color: var(--green); }
    .mini-row strong.alert-danger { color: var(--red); }
    .mini-row strong.alert-success { color: var(--green); }

    .scope { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; flex: 1; }
    .scope-card {
      padding: 18px 20px; border-radius: var(--radius-lg);
      border: 1px solid transparent; background: var(--card);
      box-shadow: var(--shadow-sm);
      display: flex; flex-direction: column;
      transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    .scope-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
    .scope-card h3 { margin: 0 0 12px; font-size: .95rem; font-weight: 600; }
    .scope-card ul { margin: 0; padding-left: 1.2rem; color: var(--text); line-height: 2; flex: 1; font-size: .85rem; }

    .pill { display: inline-block; padding: 3px 10px; border-radius: var(--radius-full); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
    .must { background: #dcfce7; color: var(--green-dark); }
    .later { background: #fef3c7; color: #b45309; }
    .ignore { background: #fee2e2; color: #b42318; }

    .toast {
      position: fixed;
      right: 18px;
      bottom: 18px;
      max-width: 360px;
      background: var(--blue-dark);
      color: #fff;
      padding: 12px 14px;
      border-radius: var(--radius-md);
      opacity: 0;
      transform: translateY(12px);
      transition: opacity 0.22s ease, transform 0.22s ease;
      box-shadow: var(--shadow);
      line-height: 1.6;
      z-index: 10000;
      font-size: .85rem;
      pointer-events: none;
    }
    .toast.show { opacity: 1; transform: translateY(0); }
    /* 加载反馈限定作用域，不改变业务卡片布局。 */
    .toast {background:#fff;color:#20344f;border:1px solid #dce5f1;border-left:3px solid #3562c4;border-radius:13px;box-shadow:0 10px 32px #20344f18;max-width:min(360px,calc(100vw - 36px));overflow-wrap:anywhere}
    body.has-connection-feedback .toast {bottom:118px}
    #home {position:relative}
    #home[data-load-state] {min-height:480px}
    #home[data-load-state] > :not(#homeLoadPanel):not(.home-intro) {visibility:hidden}
    #homeLoadPanel {position:absolute;top:145px;left:50%;transform:translateX(-50%);width:min(490px,calc(100% - 32px));box-sizing:border-box;padding:26px 28px;background:#fff;border:1px solid #e1e8f2;border-radius:16px;box-shadow:0 12px 38px #20344f0c;color:#162a45;z-index:2}
    .home-load-icon {width:44px;height:44px;display:grid;place-items:center;background:#edf3ff;border-radius:13px;margin-bottom:18px}
    .home-load-icon i {width:21px;height:21px;border:2px solid #ccdafa;border-top-color:#3562c4;border-radius:50%;animation:home-load-spin 1s linear infinite}
    .home-load-copy strong {font-size:18px;font-weight:650}
    .home-load-copy p {font-size:12px;line-height:1.8;color:#62738a;margin:8px 0 20px}
    .home-load-track {height:5px;overflow:hidden;background:#edf2f9;border-radius:8px}
    .home-load-track i {display:block;width:38%;height:100%;background:linear-gradient(90deg,#89a8ed,#3562c4);border-radius:8px;animation:home-load-slide 1.6s ease-in-out infinite}
    .home-load-meta {display:flex;justify-content:space-between;gap:8px;font-size:11px;color:#62738a;margin-top:10px}
    .home-load-steps {display:flex;justify-content:space-between;gap:10px;list-style:none;padding:18px 0 0;margin:18px 0 0;border-top:1px solid #edf1f7;font-size:12px;color:#8c99ab}
    .home-load-steps li:before {content:'○';margin-right:6px}
    .home-load-steps .active {color:#3562c4}
    .home-load-steps .done {color:#248269}
    .home-load-steps .done:before {content:'✓'}
    .home-load-retry {margin-top:20px}
    #homeLoadPanel [hidden] {display:none!important}
    /* Refresh is one semantic control across workspaces; legacy page fonts/radii must not override it. */
    .ui-c-standard button.data-refresh-control {display:inline-flex;align-items:center;justify-content:center;gap:8px;height:var(--ui-control,36px);min-height:var(--ui-control,36px);padding:0 12px!important;background:#fff;color:#2c4362;border:1px solid var(--ui-border,#dce3ed)!important;border-radius:var(--ui-radius,8px)!important;font:650 14px/22px var(--ui-font)!important;box-shadow:none;cursor:pointer}
    .ui-c-standard button.data-refresh-control:before {content:'';display:block;flex:0 0 16px;width:16px;height:16px;background:currentColor;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 11a8 8 0 1 0 1.5 4.7M20 4v7h-7'/%3E%3C/svg%3E") center/contain no-repeat}
    .ui-c-standard button.data-refresh-control > span[aria-hidden] {display:none}
    .ui-c-standard button.data-refresh-control:hover {border-color:#9fb2e8!important;background:#f8faff;text-decoration:none}
    .ui-c-standard button.data-refresh-control:focus-visible {outline:3px solid #4167d929;outline-offset:2px}
    .ui-c-standard button.data-refresh-control:disabled {cursor:wait;opacity:.7}
    .ui-c-standard button.data-refresh-control {background:#fff!important}
    .ui-c-standard button.data-refresh-control:hover {background:#f8faff!important}
    .ui-c-standard button.data-refresh-control[aria-busy=true]:before {animation:home-load-spin 1s linear infinite}
    #home[data-load-state=error] .home-load-icon {background:#fff3e8}
    #home[data-load-state=error] .home-load-icon i {animation:none;border-color:#c98530}
    #connectionFeedback {position:fixed;right:18px;bottom:18px;display:flex;align-items:flex-start;gap:12px;max-width:calc(100vw - 36px);box-sizing:border-box;padding:16px 18px;background:#fff;border:1px solid #dce5f1;border-radius:13px;box-shadow:0 10px 32px #20344f18;z-index:9999;color:#20344f;pointer-events:none}
    #connectionFeedback strong {font-size:13px;font-weight:600}
    #connectionFeedback p {font-size:12px;line-height:1.6;color:#62738a;margin:5px 0 0}
    .connection-dot {width:9px;height:9px;flex-shrink:0;background:#3562c4;border-radius:50%;margin-top:5px;box-shadow:0 0 0 4px #edf3ff}
    #connectionFeedback[data-state=success] .connection-dot {background:#248269;box-shadow:0 0 0 4px #eaf6ef}
    #connectionFeedback[data-state=error] .connection-dot {background:#c98530;box-shadow:0 0 0 4px #fff3e8}
    @keyframes home-load-spin {to {transform:rotate(360deg)}}
    @keyframes home-load-slide {from {transform:translateX(-110%)}to {transform:translateX(370%)}}
    @media(prefers-reduced-motion:reduce) {.home-load-icon i,.home-load-track i {animation:none}.home-load-track i {width:100%;opacity:.5}}
    @media(max-width:600px) {#homeLoadPanel {top:160px;padding:22px 20px}.home-load-steps {gap:5px;font-size:11px}#connectionFeedback {right:12px;bottom:12px;max-width:calc(100vw - 24px)}}

    /* —— 8. 通知与慢写入反馈 —— */
    #notifStack {
      position: fixed; top: 72px; right: 20px; z-index: 10000;
      width: min(410px, calc(100vw - 40px));
      display: grid; gap: 10px; pointer-events: none;
    }
    .notif-card {
      --notif-accent: var(--blue);
      position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr) 24px;
      align-items: start; gap: 11px; width: 100%; min-width: 0;
      padding: 13px 12px 14px 14px; overflow: hidden;
      border: 1px solid var(--rule); border-left: 3px solid var(--notif-accent);
      border-radius: 12px; background: color-mix(in srgb, var(--card) 96%, var(--notif-accent) 4%);
      box-shadow: 0 14px 34px rgba(15, 23, 42, .13);
      opacity: 0; transform: translateY(-8px) scale(.985);
      transition: opacity .2s ease, transform .2s ease;
      pointer-events: auto;
    }
    .notif-card.show { opacity: 1; transform: translateY(0) scale(1); }
    .notif-card.hide { opacity: 0; transform: translateY(-6px) scale(.985); }
    .notif-card.success { --notif-accent: var(--green); }
    .notif-card.warning { --notif-accent: var(--orange); }
    .notif-card.error { --notif-accent: var(--red); }
    .notif-card .notif-icon {
      width: 30px; height: 30px; display: grid; place-items: center;
      border-radius: 9px; color: var(--notif-accent);
      background: color-mix(in srgb, var(--notif-accent) 11%, var(--card));
    }
    .notif-card .notif-icon svg { width: 17px; height: 17px; }
    .notif-card .notif-icon svg path {
      stroke: currentColor; stroke-width: 2.2; fill: none;
      stroke-linecap: round; stroke-linejoin: round;
    }
    .notif-card .notif-body { min-width: 0; }
    .notif-card .notif-kicker {
      margin: 0 0 2px; color: var(--notif-accent);
      font-size: 10px; font-weight: 800; line-height: 1.2; letter-spacing: .08em;
    }
    .notif-card .notif-title { margin: 0 0 3px; color: var(--ink); font-size: 14px; font-weight: 750; line-height: 1.35; }
    .notif-card .notif-desc { color: var(--muted); font-size: 12.5px; line-height: 1.55; overflow-wrap: anywhere; }
    .notif-card .notif-desc strong { color: var(--ink); font-weight: 700; }
    .notif-card .notif-bar { position: absolute; bottom: 0; left: 0; height: 2px; background: var(--notif-accent); }
    .notif-card .notif-close {
      width: 24px; height: 24px; display: grid; place-items: center; padding: 0;
      border: 0; border-radius: 7px; background: transparent;
      color: var(--muted); font: inherit; font-size: 18px; line-height: 1; cursor: pointer;
    }
    .notif-card .notif-close:hover { color: var(--ink); background: var(--bg-alt); }

    .write-feedback-mask {
      position: fixed; inset: 0; z-index: 99998; display: grid; place-items: center;
      padding: 24px; background: rgba(245, 247, 250, .82);
      opacity: 0; pointer-events: none; transition: opacity .18s ease;
    }
    .write-feedback-mask.show { opacity: 1; pointer-events: auto; }
    .write-feedback-panel {
      width: min(440px, calc(100vw - 40px)); display: grid;
      grid-template-columns: 38px minmax(0, 1fr); gap: 15px; align-items: start;
      padding: 20px 22px; border: 1px solid var(--rule); border-radius: 14px;
      background: var(--card); box-shadow: 0 20px 58px rgba(15, 23, 42, .16);
    }
    .write-feedback-spinner {
      width: 34px; height: 34px; border-radius: 50%;
      border: 3px solid var(--blue-bg); border-top-color: var(--blue);
      animation: writeFeedbackSpin .85s linear infinite;
    }
    .write-feedback-copy { min-width: 0; display: grid; gap: 3px; }
    .write-feedback-eyebrow { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .1em; }
    .write-feedback-title { color: var(--ink); font-size: 15px; font-weight: 750; line-height: 1.4; }
    .write-feedback-rule { color: var(--muted); font-size: 12px; line-height: 1.5; }
    .write-feedback-timer { margin-top: 5px; color: var(--blue-dark); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
    .write-feedback-slow {
      display: none; margin-top: 7px; padding: 8px 10px;
      border: 1px solid #f2d49b; border-radius: 8px; background: #fff8e8;
      color: #8a5a09; font-size: 11.5px; line-height: 1.5;
    }
    .write-feedback-slow.show { display: block; }
    @keyframes writeFeedbackSpin { to { transform: rotate(360deg); } }
    @media (prefers-reduced-motion: reduce) {
      .notif-card, .write-feedback-mask { transition: none; }
      .write-feedback-spinner { animation-duration: 1.8s; }
    }
    @media (max-width: 720px) {
      #notifStack { top: auto; right: 12px; bottom: 12px; width: calc(100vw - 24px); }
    }
    #confettiCanvas { position: fixed; inset: 0; pointer-events: none; z-index: 10001; }

    /* —— 7. 弹窗与抽屉 —— */
    /* 统一弹窗遮罩 — 无 backdrop-filter，纯色半透明 */
    .modal-overlay {
      display: none;
      position: fixed; top: 0; left: 0; width: 100%; height: 100%;
      background: rgba(10, 37, 64, 0.4);
      z-index: 999;
      justify-content: center;
      align-items: center;
    }
    .modal-overlay.show { display: flex; }
    /* 决策确认可能从其他业务弹层中发起，必须始终位于发起弹层之上。 */
    .modal-decision-overlay { z-index: 12050; }
    .modal-box {
      background: var(--card);
      border-radius: var(--radius-2xl);
      box-shadow: var(--shadow);
      width: 560px;
      max-width: 94vw;
      max-height: 85vh;
      overflow-y: auto;
      padding: 24px;
      animation: modalIn 0.2s ease;
      border: none;
    }
    .purchase-history-modal,
    .finance-month-modal,
    .finance-detail-modal { z-index: 1000; }
    .purchase-history-dialog {
      width: 96%;
      max-width: 1400px;
      max-height: 94vh;
      display: flex;
      flex-direction: column;
      padding: 0;
      overflow: hidden;
    }
    .purchase-detail-dialog { width: min(1040px, 94vw); max-width: 1040px; max-height: 88vh; }
    .purchase-history-head {
      flex: 0 0 auto;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 16px;
      padding: 14px 20px;
      border-bottom: 1px solid var(--rule);
      background: var(--bg-alt);
    }
    .purchase-history-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
    .purchase-history-summary { margin-top: 4px; color: var(--muted); font-size: 12px; }
    .purchase-detail-title-block { min-width: 0; }
    .purchase-detail-eyebrow { display: block; margin-bottom: 4px; color: var(--blue); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
    .purchase-detail-title-block h3 { overflow-wrap: anywhere; font-family: "Consolas", monospace; font-size: 18px; }
    .purchase-detail-meta { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
    .purchase-detail-close { width: 34px; height: 34px; border: 1px solid var(--rule); border-radius: 10px; background: var(--card); color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
    .purchase-detail-summary-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
      margin: 14px 20px 4px;
    }
    .purchase-detail-summary-grid > div { min-width: 0; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 10px; background: var(--bg-alt); }
    .purchase-detail-summary-grid span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 11px; }
    .purchase-detail-summary-grid strong { display: block; color: var(--ink); font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
    .purchase-history-actions { display: flex; align-items: center; gap: 8px; }
    .purchase-history-actions .btn { min-height: 34px; padding: 5px 14px; font-size: 12px; }
    .purchase-history-list { flex: 1; min-height: 0; overflow: auto; }
    .purchase-history-table { width: 100%; min-width: 1100px; }
    .purchase-history-subpanel {
      display: none;
      flex: 0 0 auto;
      border-top: 1px solid var(--rule);
      background: var(--bg-alt);
    }
    .purchase-detail-panel { display: block; flex: 0 1 auto; min-height: 0; border-top: 0; background: var(--card); }
    .purchase-history-subhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 20px; }
    .purchase-history-subhead h4 { margin: 0; color: var(--ink); font-size: 14px; font-weight: 650; }
    .purchase-history-subbody { overflow: auto; padding: 0 20px 12px; }
    .purchase-history-subbody table { width: 100%; }
    .purchase-history-detail-body { max-height: 240px; }
    .purchase-detail-dialog .purchase-history-detail-body { max-height: min(340px, 40vh); min-height: 0; flex: 0 1 auto; }
    .purchase-detail-hint { color: var(--muted); font-size: var(--text-xs); }
    .purchase-detail-table { min-width: 760px; table-layout: fixed; }
    .purchase-detail-table th:nth-child(1) { width: 190px; }
    .purchase-detail-table th:nth-child(2) { width: 95px; }
    .purchase-detail-table th:nth-child(3) { width: 105px; }
    .purchase-detail-table th:nth-child(4) { width: 58px; }
    .purchase-detail-table th:nth-child(5),
    .purchase-detail-table th:nth-child(6),
    .purchase-detail-table th:nth-child(7) { width: 86px; }
    .purchase-detail-table td { overflow-wrap: anywhere; vertical-align: top; }
    .purchase-history-supplier-body { max-height: 200px; }
    .purchase-supplier-row, .purchase-detail-row { border-bottom: 1px solid var(--rule); }
    .purchase-supplier-row td, .purchase-detail-row td { padding: 6px 8px; }
    .purchase-supplier-row td:first-child, .purchase-detail-name, .purchase-detail-strong { font-weight: 600; }
    .purchase-supplier-amount { font-weight: 600; }
    .purchase-supplier-percent, .purchase-detail-muted { color: var(--muted); }
    .purchase-detail-code { font-family: "Consolas", monospace; font-size: var(--text-xs); }
    .purchase-detail-row small { display: block; margin-top: 3px; color: var(--muted); }
    .purchase-detail-muted { font-size: var(--text-xs); }
    .purchase-detail-warning { display: flex; align-items: flex-start; gap: 9px; margin: 0 20px 14px; padding: 10px 12px; border: 1px solid #eadfb8; border-radius: 10px; background: #fff9e8; color: #735c16; font-size: 12px; line-height: 1.5; }
    .purchase-detail-warning > span { flex: 0 0 auto; width: 18px; height: 18px; border: 1px solid currentColor; border-radius: 50%; text-align: center; line-height: 16px; font-size: 11px; }
    .purchase-detail-warning p { margin: 0; }
    .purchase-detail-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px 16px; border-top: 1px solid var(--rule); }
    .purchase-detail-footer .btn { min-width: 116px; }
    @media (max-width: 820px) {
      .purchase-detail-dialog { width: calc(100vw - 20px); max-height: calc(100vh - 20px); }
      .purchase-history-head { align-items: flex-start; padding: 12px 14px; }
      .purchase-detail-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 12px 14px 4px; }
      .purchase-history-subhead { align-items: flex-start; flex-direction: column; padding: 10px 14px; }
      .purchase-history-subbody { padding: 0 14px 12px; }
      .purchase-detail-warning { margin: 0 14px 12px; }
      .purchase-detail-footer { padding: 10px 14px 14px; }
    }
    .purchase-recent-row, .purchase-history-row { border-bottom: 1px solid var(--rule); }
    .purchase-recent-row td { padding: 5px 8px; font-size: var(--text-xs); }
    .purchase-recent-date, .purchase-history-date { white-space: nowrap; }
    .purchase-recent-number, .purchase-history-number { font-family: "Consolas", monospace; font-size: var(--text-xs); }
    .purchase-recent-amount, .purchase-history-amount { font-weight: 600; }
    .purchase-recent-status, .purchase-history-unit, .purchase-history-remark { color: var(--muted); font-size: var(--text-xs); }
    .purchase-history-row td { padding: 7px 10px; }
    .purchase-history-row.is-voided { opacity: .5; }
    .purchase-history-status { font-weight: 600; }
    .purchase-status-voided, .purchase-status-return { color: var(--danger); }
    .purchase-status-received { color: var(--blue); }
    .purchase-history-products { max-width: 280px; color: var(--ink); font-size: var(--text-xs); line-height: 1.8; }
    .purchase-history-products > div { padding: 1px 0; }
    #stock .purchase-items-head .purchase-create-product { background: #e6f5f1; color: #116653; border: 1px solid #84bfae; font-weight: 600; }
    #stock .purchase-items-head .purchase-create-product:hover { background: #d1eee5; border-color: #398772; }
    #stock .purchase-items-head .purchase-create-product:focus-visible { outline: 3px solid #398772; outline-offset: 2px; }
    #stock .purchase-master-fields { grid-template-columns: minmax(300px, 1.4fr) minmax(170px, 1fr) minmax(170px, 1fr); }
    #stock .purchase-supplier-field { display:flex; align-items:flex-end; gap:8px; min-width:0; }
    #stock .purchase-supplier-field label { flex:1; min-width:0; }
    #stock .purchase-supplier-field .btn { flex-shrink:0; height:36px; }
    #stock .purchase-product-create-entry { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:8px; }
    #stock .purchase-items-head { align-items:flex-start; flex-wrap:wrap; }
    #stock .purchase-items-head .btn { height:36px; font-size:13px; padding:0 12px; }
    #stock .purchase-items-head span { font-size:12px; }
    #stock .purchase-add-row { padding:10px 16px 0; }
    #stock .purchase-add-row .btn { min-height:36px; padding:0 16px; }
    @media (max-width: 800px) { #stock .purchase-master-fields { grid-template-columns:1fr; } }
    .purchase-history-actions { white-space: nowrap; }
    .purchase-history-action { min-height: 28px; padding: 3px 10px; font-size: var(--text-xs); }
    .purchase-action-quantity { color: #fff; background: #0ea5e9; }
    .purchase-action-return { color: #fff; background: #b45309; }
    .purchase-return-overlay, .quick-quantity-overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(15,23,42,.55); }
    .purchase-return-overlay { z-index: 10020; }
    .quick-quantity-overlay { z-index: 10000; }
    .purchase-return-dialog { width: 100%; max-width: 900px; max-height: 86vh; padding: 0; overflow: auto; border-radius: 14px; box-shadow: 0 24px 70px rgba(15,23,42,.28); }
    .purchase-return-head { padding: 18px 20px; border-bottom: 1px solid var(--rule); }
    .purchase-return-head h3 { margin: 0 0 6px; }
    .purchase-return-head > div { color: var(--muted); font-size: var(--text-sm); }
    .purchase-return-body { padding: 16px 20px; }
    #purchaseReturnModal .return-row-filter, #salesReturnModal .return-row-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
    #purchaseReturnModal .return-row-filter input, #salesReturnModal .return-row-filter input { flex: 1; min-width: 180px; }
    #purchaseReturnModal .return-row-filter p, #salesReturnModal .return-row-filter p { flex-basis: 100%; margin: 0; color: var(--muted); font-size: var(--text-sm); }
    #purchaseReturnModal [data-return-search][hidden], #salesReturnModal [data-return-search][hidden] { display: none !important; }
    .purchase-return-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
    .purchase-return-table thead { background: var(--soft); }
    .purchase-return-table th, .purchase-return-table td { padding: 8px; text-align: left; }
    .purchase-return-table th.num-r, .purchase-return-table td.num-r { text-align: right; }
    .purchase-return-row { border-bottom: 1px solid var(--rule); }
    .purchase-return-row.is-disabled { opacity: .55; }
    .purchase-return-product, .purchase-return-remaining { font-weight: 700; }
    .purchase-return-batch { font-family: "Consolas", monospace; }
    .purchase-return-quantity { width: 100px; padding: 6px; border: 1px solid var(--rule); border-radius: 6px; }
    .purchase-return-state { margin-top: 3px; color: var(--muted); font-size: 11px; }
    .purchase-return-reason-label { margin-top: 14px; font-size: var(--text-sm); font-weight: 600; }
    .purchase-return-reason { width: 100%; margin-top: 6px; }
    .purchase-return-actions { padding: 14px 20px; }
    .quick-quantity-dialog { width: 100%; max-width: 560px; max-height: 80vh; padding: 24px; overflow-y: auto; }
    .quick-quantity-dialog h3 { margin: 0 0 8px; font-size: 16px; }
    .quick-quantity-dialog > p { margin: 0 0 16px; color: #6b7688; font-size: var(--text-xs); }
    .quick-quantity-table { width: 100%; margin-bottom: 16px; border-collapse: collapse; font-size: var(--text-sm); }
    .quick-quantity-table thead { background: #f5f7fa; }
    .quick-quantity-table th, .quick-quantity-table td { padding: 6px 8px; text-align: left; }
    .quick-quantity-old { color: #6b7688; }
    .quick-quantity-input { width: 80px; padding: 4px 6px; border: 1px solid var(--border2); border-radius: 4px; }
    .quick-quantity-actions { justify-content: flex-end; }
    .finance-month-dialog { width: 360px; max-height: 80vh; padding: 20px; }
    .finance-month-dialog > h3 { margin: 0 0 16px; font-size: 16px; }
    .finance-month-section { margin-bottom: 12px; }
    .finance-month-section-last { margin-bottom: 16px; }
    .finance-month-label { margin-bottom: 8px; color: var(--muted); font-size: .72rem; font-weight: 650; letter-spacing: .04em; }
    .finance-month-options { display: flex; flex-wrap: wrap; gap: 6px; }
    .finance-month-actions { margin-top: 4px; }
    .finance-detail-dialog {
      width: 90%;
      max-width: 560px;
      max-height: 85vh;
      display: flex;
      flex-direction: column;
      padding: 0;
      overflow: hidden;
    }
    .finance-detail-head {
      flex: 0 0 auto;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 14px;
      padding: 14px 20px;
      border-bottom: 1px solid var(--rule);
      background: var(--bg-alt);
    }
    .finance-detail-head h3 { margin: 0; font-size: 16px; }
    .finance-detail-stats { margin-top: 4px; color: var(--muted); font-size: 12px; }
    .finance-detail-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px; }
    @keyframes modalIn {
      from { opacity: 0; transform: scale(0.95); }
      to { opacity: 1; transform: scale(1); }
    }
    .modal-finance { width: 1100px; }
    .modal-box h3 { margin: 0 0 18px; font-size: 1.05rem; font-weight: 700; color: var(--ink); }
    .modal-box .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-bottom: 22px; }
    .modal-box .form-row.col-1 { grid-template-columns: 1fr; }
    .modal-box .form-row > div { display: flex; flex-direction: column; gap: 4px; }
    .modal-box .form-row > div label { font-size: .78rem; }
    .modal-box .form-row > div input, .modal-box .form-row > div select { height: var(--input-height); }
    .modal-box .form-row > .span-2 { grid-column: 1 / -1; }
    .modal-box .form-row textarea {
      width: 100%; min-height: 64px; resize: vertical; padding: 9px 11px;
      border: 1px solid var(--border2); border-radius: var(--radius-md);
      background: var(--card); color: var(--ink); font: inherit; line-height: 1.45;
    }
    .modal-box .form-row textarea:focus { outline: none; border-color: var(--ink); }
    .modal-box .form-row .inline-check {
      display: inline-flex; flex-direction: row; align-items: center; gap: 7px;
      margin-top: 6px; color: var(--text-secondary); line-height: 1.35;
    }
    .modal-box .form-row .inline-check input { width: 15px; height: 15px; margin: 0; }
    .modal-box .form-row > .staff-scope-group {
      grid-column: 1 / -1; gap: 7px; padding: 11px 12px;
      border: 1px solid var(--border2); border-radius: var(--radius-md); background: var(--bg-alt);
    }
    .staff-scope-options { display: flex; flex-wrap: wrap; gap: 8px; }
    .staff-scope-options label {
      min-width: 92px; display: inline-flex; align-items: center; gap: 7px;
      padding: 7px 10px; border: 1px solid var(--border2); border-radius: 8px;
      background: var(--card); color: var(--ink); cursor: pointer;
    }
    .staff-scope-options input { width: 15px; height: 15px !important; margin: 0; }
    .staff-scope-options input:disabled + span { color: var(--muted); }
    .staff-scope-group small { color: var(--muted); line-height: 1.5; }
    .modal-box .modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

    /* 高级弹窗（customConfirm / customPrompt）— 复用 .modal-overlay */
    .modal-overlay .modal-box[style*="min-width"],
    .modal-overlay .modal-box[style*="max-width:500px"] {
      min-width: 400px; max-width: 500px;
    }
    .modal-header {
      display: flex; align-items: center; gap: 14px;
      padding: 22px 24px 0;
    }
    .modal-icon {
      flex: 0 0 48px; width: 48px; height: 48px; border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      animation: modalIconPop .4s ease;
    }
    @keyframes modalIconPop { 0%{transform:scale(0);opacity:0} 100%{transform:scale(1);opacity:1} }
    .modal-icon.warning { background: #fef3c7; }
    .modal-icon.warning svg { width: 26px; height: 26px; }
    .modal-icon.warning svg path { stroke: var(--orange); stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
    .modal-icon.danger { background: var(--red-bg); }
    .modal-icon.danger svg { width: 26px; height: 26px; }
    .modal-icon.danger svg path { stroke: var(--red); stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
    .modal-icon.info { background: var(--brand-light); }
    .modal-icon.info svg { width: 26px; height: 26px; }
    .modal-icon.info svg path { stroke: var(--blue); stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
    .modal-title { font-size: 18px; font-weight: 700; color: var(--ink); }
    .modal-body { padding: 12px 24px 20px; }
    .modal-body .modal-msg {
      white-space: pre-wrap; font-size: 14px; color: var(--text-secondary);
      line-height: 1.7; max-height: 300px; overflow-y: auto;
    }
    .modal-body .modal-msg strong { color: var(--red); }
    .modal-input {
      width: 100%; padding: 10px 14px;
      border: 1px solid var(--border2); border-radius: var(--radius-md);
      font-size: 15px; box-sizing: border-box;
      transition: border-color 0.15s ease; margin-top: 12px;
    }
    .modal-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(94,106,210,0.12); }
    .modal-footer {
      display: flex; gap: 10px; justify-content: flex-end;
      padding: 0 24px 22px;
    }
    .modal-btn {
      padding: 10px 24px; border-radius: var(--radius-md);
      font-size: 14px; font-weight: 600; cursor: pointer;
      transition: background-color 0.15s ease, transform 0.1s ease; border: none;
    }
    .modal-btn:hover { transform: translateY(-1px); }
    .modal-btn:active { transform: translateY(0) scale(0.98); }
    .modal-btn.cancel { background: var(--card); color: var(--muted); border: 1px solid var(--rule); }
    .modal-btn.cancel:hover { background: var(--bg-alt); border-color: var(--border2); }
    .modal-btn.danger { background: var(--red); color: #fff !important; }
    .modal-btn.danger:hover { background: #b91c1c; color: #fff !important; }
    .modal-btn.primary { background: var(--blue); color: #fff; }
    .modal-btn.primary:hover { background: #4f5bd5; }

    /* —— 收款与欠款工作台 —— */
    #payment.active { overflow-y: auto; overflow-x: hidden; }
    #payment > .payment-workspace { flex:0 0 auto; min-height:auto; overflow:visible; }
    .payment-workspace { padding: 0 0 16px; }
    .runtime-version-stack { display: inline-flex; align-items: center; position: relative; min-width: 0; }
    .runtime-release-label { position: absolute; top: calc(100% + 2px); left: 50%; transform: translateX(-50%); display: block; width: max-content; max-width: 160px; font-size: 10px; line-height: 12px; font-weight: 400; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .migration-env-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 9px; border: 1px solid #c7d2fe; border-radius: 999px; background: #eef2ff; color: #4338ca; font-size: 11px; font-weight: 700; white-space: nowrap; }
    .payment-head {
      display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
      padding: 22px 24px 18px; border-bottom: 1px solid var(--rule);
    }
    .payment-eyebrow { display: block; margin-bottom: 5px; color: var(--blue); font-size: var(--text-xs); font-weight: 800; letter-spacing: .08em; }
    .payment-head h2 { margin: 0; color: var(--ink); font-size: var(--text-xl); letter-spacing: -.03em; }
    .payment-head p { max-width: 720px; margin: 7px 0 0; color: var(--muted); font-size: var(--text-sm); line-height: 1.65; }
    .payment-head-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
    .payment-identity { height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 0 11px; border: 1px solid var(--rule); border-radius: var(--radius-md); background: var(--bg-alt); color: var(--muted); font-size: var(--text-xs); }
    .payment-identity strong { color: var(--ink); }
    .payment-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding: 16px 24px 0; }
    .payment-kpis article { min-width: 0; padding: 15px 16px; border: 1px solid var(--rule); border-radius: var(--radius-lg); background: linear-gradient(180deg, #fff, #fbfcfe); }
    .payment-kpis span, .payment-kpis small { display: block; color: var(--muted); font-size: var(--text-xs); }
    .payment-kpis strong { display: block; margin: 8px 0 5px; color: var(--ink); font-size: var(--text-lg); font-variant-numeric: tabular-nums; }
    .payment-kpis article:nth-child(2) strong, .payment-kpis article:nth-child(3) strong, .payment-kpis article:nth-child(4) strong { color: var(--red); }
    .payment-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 16px 24px 0; }
    .payment-tabs button { position: relative; display: grid; gap: 4px; padding: 13px 16px; border: 1px solid var(--rule); border-radius: var(--radius-lg); background: #fff; color: var(--muted); text-align: left; cursor: pointer; }
    .payment-tabs button:hover { border-color: var(--border2); background: var(--bg-alt); }
    .payment-tabs button.active { border-color: var(--blue); background: var(--brand-light); color: var(--blue-dark); box-shadow: inset 0 -2px 0 var(--blue); }
    .payment-tabs strong { font-size: var(--text-base); }
    .payment-tabs small { font-size: var(--text-xs); font-weight: 500; }
    .payment-tabs b { position: absolute; top: 10px; right: 12px; min-width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; border-radius: 999px; background: var(--red-bg); color: var(--red); font-size: 11px; }
    .payment-filter-bar { display: grid; grid-template-columns: minmax(260px, 1fr) repeat(3, 130px) auto; gap: 8px; padding: 14px 24px 12px; }
    #payment .payment-kpis,
    #payment .payment-tabs,
    #payment .payment-filter-bar,
    #payment .payment-view { flex-shrink:0; }
    .payment-filter-bar input, .payment-filter-bar select { min-width: 0; }
    .payment-view { display: none; padding: 0 24px; }
    .payment-view.active { display: block; }
    .payment-view-note { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 10px 12px; border-left: 3px solid var(--blue); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: #f6f7ff; color: var(--muted); font-size: var(--text-xs); }
    .payment-view-note strong { color: var(--ink); }
    .payment-view-note.warning { border-left-color: var(--orange); background: var(--orange-bg); }
    .payment-table-wrap { flex:0 0 auto; min-height:0; max-height:none; overflow:auto; border:1px solid var(--rule); border-radius:var(--radius-lg); background:#fff; }
    .payment-table-wrap table { min-width: 980px; }
    .payment-table-wrap th { top: 0; }
    .payment-table-wrap th { height:38px; padding:0 10px; color:#69778b; background:#f8fafc; font-size:10.5px; font-weight:650; }
    .payment-table-wrap td { height:54px; padding:9px 10px; color:#3f4d61; font-size:11px; vertical-align:middle; }
    .payment-table-wrap td strong { font-size:11.5px; }
    .payment-table-wrap td small { display:block; margin-top:3px; color:#7d8999; font-size:9.5px; line-height:1.35; }
    .payment-money-positive { color: var(--green-dark); font-weight: 700; }
    .payment-money-negative { color: var(--red); font-weight: 700; }
    .payment-money-neutral { color: var(--text); font-weight: 700; }
    .payment-status { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; background: var(--bg-alt); color: var(--text); font-size: 11px; font-weight: 700; white-space: nowrap; }
    .payment-status.overdue, .payment-status.pending { background: var(--red-bg); color: var(--red); }
    .payment-status.partial { background: var(--orange-bg); color: #a35a00; }
    .payment-status.settled { background: var(--green-bg); color: var(--green-dark); }
    .payment-status-heading,
    .payment-action-heading,
    .payment-status-cell,
    .payment-action-cell { text-align:center!important; }
    .payment-action-cell { white-space: nowrap; }
    .payment-row-action {
      min-height:30px; display:inline-flex; align-items:center; justify-content:center; gap:6px;
      padding:4px 6px; color:#3159c9; border:0; border-radius:7px; background:transparent;
      font:inherit; font-size:12px; font-weight:700; line-height:1; cursor:pointer;
    }
    .payment-row-action:hover { background:#edf2ff; }
    .payment-row-action:focus-visible { outline:2px solid #6d87e5; outline-offset:2px; }
    .payment-row-action-icon { width:15px; height:15px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
    .payment-ledger-type {
      min-height:24px; display:inline-flex; align-items:center; padding:3px 7px;
      border-radius:6px; font-size:10px; font-weight:700; white-space:nowrap;
    }
    .payment-ledger-type.is-sale { color:#3159c9; background:#eef3ff; }
    .payment-ledger-type.is-prepayment { color:#8a5b0c; background:#fff5df; }
    .payment-ledger-type.is-transfer { color:#116d52; background:#e9f7f1; }
    .payment-ledger-type.is-out { color:#aa3446; background:#fff0f2; }
    .payment-ledger-type.is-other { color:#5f6d80; background:#f0f3f7; }
    @media (min-width:1101px) {
      #paymentReceivablesView .payment-table-wrap table { min-width:1160px; table-layout:fixed; }
      #paymentReceivablesView th:nth-child(1) { width:11%; }
      #paymentReceivablesView th:nth-child(2) { width:13%; }
      #paymentReceivablesView th:nth-child(3) { width:9%; }
      #paymentReceivablesView th:nth-child(4) { width:10%; }
      #paymentReceivablesView th:nth-child(5) { width:9%; }
      #paymentReceivablesView th:nth-child(6) { width:10%; }
      #paymentReceivablesView th:nth-child(7) { width:8%; }
      #paymentReceivablesView th:nth-child(8) { width:8%; }
      #paymentReceivablesView th:nth-child(9) { width:10%; }
      #paymentReceivablesView th:nth-child(10) { width:10%; }
      #paymentReceivablesView th:nth-child(11) { width:12%; }
      #paymentVoidedView .payment-table-wrap table { min-width:900px; table-layout:fixed; }
      #paymentVoidedView th:nth-child(1) { width:14%; }
      #paymentVoidedView th:nth-child(2) { width:13%; }
      #paymentVoidedView th:nth-child(3) { width:17%; }
      #paymentVoidedView th:nth-child(4) { width:13%; }
      #paymentVoidedView th:nth-child(5) { width:14%; }
      #paymentVoidedView th:nth-child(6) { width:15%; }
      #paymentVoidedView th:nth-child(7) { width:14%; }
      #paymentRefundsView .payment-table-wrap table { min-width:1080px; table-layout:fixed; }
      #paymentRefundsView th:nth-child(1) { width:12%; }
      #paymentRefundsView th:nth-child(2) { width:15%; }
      #paymentRefundsView th:nth-child(3) { width:15%; }
      #paymentRefundsView th:nth-child(4) { width:12%; }
      #paymentRefundsView th:nth-child(5) { width:13%; }
      #paymentRefundsView th:nth-child(6) { width:13%; }
      #paymentRefundsView th:nth-child(7) { width:10%; }
      #paymentRefundsView th:nth-child(8) { width:10%; }
      #paymentLedgerView .payment-table-wrap table { min-width:1280px; }
    }
    .payment-empty-action { margin-left: 10px; }
    .payment-modal { width: min(720px, calc(100vw - 32px)); padding: 0; overflow: hidden; }
    .payment-resolution-modal { width: min(780px, calc(100vw - 32px)); }
    .payment-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 20px 22px 15px; border-bottom: 1px solid var(--rule); background: var(--bg-alt); }
    .payment-modal-head span { color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
    .payment-modal-head h3 { margin: 4px 0 3px; font-size: var(--text-lg); }
    .payment-modal-head small { color: var(--muted); font-size: var(--text-xs); }
    .payment-modal > .form-row { margin: 0; padding: 18px 22px 14px; }
    .payment-modal > .form-row .full { grid-column: 1 / -1; }
    .payment-modal textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border2); border-radius: var(--radius-md); color: var(--ink); font: inherit; resize: vertical; }
    .payment-modal textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(94,106,210,.12); }
    .payment-modal-rule { margin: 0 22px 16px; padding: 10px 12px; border-left: 3px solid var(--blue); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: #f6f7ff; color: var(--muted); font-size: var(--text-xs); line-height: 1.6; }
    .stock-adjust-confirm-modal { width: min(900px, calc(100vw - 40px)); max-height: min(820px, calc(100vh - 40px)); padding: 0; overflow: hidden; }
    .stock-adjust-confirm-body { padding: 18px 22px 0; overflow: auto; }
    .stock-adjust-confirm-summary { display: grid; grid-template-columns: 1.25fr 1fr .85fr .9fr; gap: 10px; margin-bottom: 16px; }
    .stock-adjust-confirm-summary > div { min-width: 0; padding: 12px 13px; border: 1px solid var(--rule); border-radius: var(--radius-md); background: var(--bg-alt); }
    .stock-adjust-confirm-summary span,
    .stock-adjust-confirm-summary small,
    .stock-adjust-confirm-reason span,
    .stock-adjust-confirm-reason small { display: block; color: var(--muted); font-size: var(--text-xs); line-height: 1.45; }
    .stock-adjust-confirm-summary strong { display: block; margin: 4px 0 2px; color: var(--ink); font-size: var(--text-sm); line-height: 1.4; overflow-wrap: anywhere; }
    .stock-adjust-confirm-summary strong.danger-text { color: var(--danger); }
    .stock-adjust-confirm-summary strong.success-text { color: var(--green-dark); }
    .stock-adjust-fifo-table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius-lg); }
    .stock-adjust-fifo-table { width: 100%; min-width: 730px; border-collapse: collapse; table-layout: fixed; }
    .stock-adjust-fifo-table th { padding: 9px 11px; color: var(--muted); background: var(--bg-alt); border-bottom: 1px solid var(--rule); font-size: var(--text-xs); font-weight: 700; text-align: left; }
    .stock-adjust-fifo-table td { padding: 10px 11px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
    .stock-adjust-fifo-table tbody tr:last-child td { border-bottom: 0; }
    .stock-adjust-fifo-table td strong,
    .stock-adjust-fifo-table td small { display: block; }
    .stock-adjust-fifo-table td strong { color: var(--ink); font-size: var(--text-sm); line-height: 1.4; }
    .stock-adjust-fifo-table td small { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.35; }
    .stock-adjust-batch-index { display: inline-grid; place-items: center; float: left; width: 20px; height: 20px; margin: 0 7px 8px 0; border-radius: 999px; color: var(--blue); background: var(--blue-bg); font-size: 10px; font-weight: 800; }
    .stock-adjust-confirm-reason { margin-top: 12px; padding: 10px 12px; border-left: 3px solid var(--blue); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--bg-alt); }
    .stock-adjust-confirm-reason strong { display: block; margin: 2px 0; font-size: var(--text-sm); }
    .stock-adjust-confirm-warning { display: flex; align-items: flex-start; gap: 10px; margin: 14px 22px 0; padding: 10px 12px; border: 1px solid var(--warning-border); border-radius: var(--radius-md); color: var(--warning-text); background: var(--warning-bg); font-size: var(--text-xs); line-height: 1.55; }
    .stock-adjust-confirm-warning strong { flex: 0 0 auto; }
    .stock-adjust-confirm-modal > .modal-actions { padding: 16px 22px 20px; }
    /* This review keeps its header/actions visible while long content scrolls. */
    #stockAdjustmentReviewModal > .stock-adjust-confirm-modal { display: flex; flex-direction: column; }
    #stockAdjustmentReviewModal > .stock-adjust-confirm-modal > .payment-modal-head,
    #stockAdjustmentReviewModal > .stock-adjust-confirm-modal > .modal-actions { flex: 0 0 auto; }
    #stockAdjustmentReviewModal > .stock-adjust-confirm-modal > .stock-adjust-confirm-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
    @media (max-width: 760px) {
      .stock-adjust-confirm-modal { width: calc(100vw - 20px); max-height: calc(100vh - 20px); }
      .stock-adjust-confirm-summary { grid-template-columns: 1fr 1fr; }
      .stock-adjust-confirm-warning { display: block; }
      .stock-adjust-confirm-warning span { display: block; margin-top: 3px; }
    }
    .payment-modal-rule.warning { border-left-color: var(--orange); background: var(--orange-bg); }
    .payment-modal .modal-actions { padding: 0 22px 20px; }
    .payment-resolution-source { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 16px 22px 0; padding: 12px; border: 1px solid var(--rule); border-radius: var(--radius-md); background: #fff; }
    .payment-resolution-source div { min-width: 0; }
    .payment-resolution-source span { display: block; color: var(--muted); font-size: 11px; }
    .payment-resolution-source strong { display: block; margin-top: 4px; overflow: hidden; color: var(--ink); font-size: var(--text-sm); text-overflow: ellipsis; white-space: nowrap; }
    .required-mark { color: var(--red); }

    /* 内联表单校验提示 */
    .field-error {
      color: var(--red); font-size: 12px; font-weight: 500;
      margin-top: 3px; display: flex; align-items: center; gap: 4px;
      animation: fieldErrorIn .2s ease;
    }
    @keyframes fieldErrorIn { from{opacity:0;transform:translateY(-4px)} to{opacity:1;transform:translateY(0)} }
    .field-error::before {
      content: '!';
      display: inline-grid;
      place-items: center;
      width: 14px;
      height: 14px;
      border-radius: 999px;
      color: #fff;
      background: var(--danger);
      font-size: 10px;
      font-weight: 800;
      line-height: 1;
    }
    input.field-invalid, select.field-invalid, textarea.field-invalid {
      border-color: var(--red) !important; background: var(--red-bg) !important;
      animation: fieldShake .3s ease;
    }
    @keyframes fieldShake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-3px)} 75%{transform:translateX(3px)} }

    /* 导出进度条 */
    .export-progress {
      position: fixed; right: 24px; bottom: 24px; z-index: 10000;
      background: var(--card); border-radius: var(--radius-lg);
      box-shadow: var(--shadow); border: 1px solid var(--rule);
      padding: 18px 20px; min-width: 300px; max-width: 360px;
      opacity: 0; transform: translateX(400px);
      transition: opacity 0.3s ease, transform 0.3s ease;
    }
    .export-progress.show { opacity: 1; transform: translateX(0); }
    .export-progress .ep-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
    .export-progress .ep-icon { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-light); display: flex; align-items: center; justify-content: center; }
    .export-progress .ep-icon svg { width: 20px; height: 20px; animation: epSpin 1s linear infinite; }
    @keyframes epSpin { to { transform: rotate(360deg); } }
    .export-progress .ep-icon svg path { fill: none; stroke: var(--blue); stroke-width: 3; stroke-linecap: round; }
    .export-progress .ep-text { font-size: 14px; font-weight: 600; color: var(--ink); }
    .export-progress .ep-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
    .export-progress .ep-bar-wrap { height: 6px; background: var(--bg-alt); border-radius: 3px; overflow: hidden; }
    .export-progress .ep-bar { height: 100%; background: var(--blue); border-radius: 3px; width: 0%; transition: width 0.3s ease; }

    .global-loading { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 9999; }
    .global-loading.show { display: block; }
    .spinner { width: 40px; height: 40px; border: 3px solid var(--rule); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* 登录遮罩 — 无 backdrop-filter */
    .login-overlay { position: fixed; inset: 0; background: radial-gradient(circle at 18% 18%, rgba(14,165,233,.12), transparent 34%), linear-gradient(145deg,#f7fafc 0%,#edf4f8 48%,#f7fafc 100%); z-index: 999; display: flex; align-items: center; justify-content: center; padding: 32px; }
    .login-overlay.hidden { display: none; }
    .login-card { position: relative; overflow: hidden; background: rgba(255,255,255,.98); border: 1px solid rgba(148,163,184,.28); border-radius: 22px; padding: 46px 44px 34px; width: 420px; box-shadow: 0 30px 80px rgba(15,23,42,.16),0 8px 24px rgba(14,116,144,.08); animation: loginIn .35s ease; }
    .login-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg,#1d4ed8,#2563eb,#0891b2); }
    @keyframes loginIn { from{opacity:0;transform:translateY(-20px) scale(.96)} to{opacity:1;transform:translateY(0) scale(1)} }
    .login-logo { font-size: 27px; line-height: 1.2; font-weight: 800; text-align: center; color: #172554; letter-spacing: 4px; margin-bottom: 7px; }
    .login-sub { text-align: center; color: #64748b; font-size: 13px; margin-bottom: 32px; }
    .login-field { margin-bottom: 16px; position: relative; }
    .login-field input { width: 100%; padding: 12px 15px; border: 1px solid #cbd5e1; border-radius: 10px; font-size: 15px; outline: none; transition: border-color .2s ease,box-shadow .2s ease; box-sizing: border-box; background: #fff; height: 46px; }
    .login-field input:focus { border-color: #0284c7; box-shadow: 0 0 0 4px rgba(14,165,233,.13); }
    .login-field input::placeholder { color: var(--muted-light); }
    .login-card .login-btn { width: 100%; min-height: 46px; padding: 12px; background: linear-gradient(135deg,#1d4ed8,#2563eb 58%,#087ea4); color: #fff; border: none; border-radius: 10px; font-size: 15px; font-weight: 700; cursor: pointer; margin-top: 8px; transition: filter .2s ease,transform .1s ease,opacity .2s ease; letter-spacing: 2px; }
    .login-card .login-btn:hover { filter: brightness(1.04); transform: translateY(-1px); }
    .login-card .login-btn:active { transform: translateY(0); }
    .login-card .login-btn:disabled { cursor: wait; opacity: .62; transform: none; }
    .login-card .login-error { color: #b91c1c; font-size: 13px; text-align: center; min-height: 20px; margin-top: 13px; }
    .login-card .login-error:empty { min-height: 6px; margin-top: 5px; }

    /* Premium desktop login composition. The page remains usable without imagery. */
    .login-overlay {
      justify-content: flex-end;
      padding-right: clamp(44px, 8vw, 154px);
      background:
        radial-gradient(circle at 18% 26%, rgba(37,99,235,.22), transparent 27%),
        radial-gradient(circle at 42% 78%, rgba(8,145,178,.14), transparent 31%),
        linear-gradient(116deg, #091423 0%, #10243a 55.8%, #eaf2f7 56%, #f7fafc 100%);
    }
    .login-overlay::before {
      content: "膜客时代\A门店经营协同系统";
      white-space: pre;
      position: absolute;
      left: clamp(54px, 9vw, 172px);
      top: 30%;
      color: #fff;
      font-size: clamp(38px, 3.2vw, 62px);
      line-height: 1.28;
      letter-spacing: .08em;
      font-weight: 760;
      text-shadow: 0 16px 46px rgba(0,0,0,.32);
    }
    .login-overlay::after {
      content: "SALES  ·  INVENTORY  ·  FINANCE\A统一业务口径  ·  可追踪操作状态  ·  分角色数据边界";
      white-space: pre;
      position: absolute;
      left: clamp(58px, 9.2vw, 176px);
      top: calc(30% + clamp(132px, 10vw, 190px));
      color: rgba(226,232,240,.78);
      font-size: clamp(12px, .9vw, 15px);
      line-height: 2.2;
      letter-spacing: .08em;
    }
    .login-card {
      width: min(420px, calc(44vw - 88px));
      min-width: 360px;
      padding: 50px 46px 48px;
      border-color: rgba(255,255,255,.86);
      box-shadow: 0 34px 90px rgba(15,23,42,.18), 0 10px 30px rgba(8,126,164,.11);
    }
    .login-card::after {
      content: "安全登录 · 会话超时自动退出";
      position: absolute;
      left: 0;
      right: 0;
      bottom: 17px;
      color: #7890a3;
      font-size: 11px;
      font-weight: 500;
      letter-spacing: .04em;
      text-align: center;
    }
    .login-logo { color: #111c35; letter-spacing: .16em; }
    .login-sub { color: #64748b; letter-spacing: .05em; }
    .login-card .login-btn { box-shadow: 0 12px 24px rgba(29,78,216,.18); }

    @media (max-width: 1040px) {
      .login-overlay {
        justify-content: center;
        padding: 28px;
        background:
          radial-gradient(circle at 18% 18%, rgba(14,165,233,.12), transparent 34%),
          linear-gradient(145deg,#f7fafc 0%,#edf4f8 48%,#f7fafc 100%);
      }
      .login-overlay::before,
      .login-overlay::after { display: none; }
      .login-card { width: min(420px, calc(100vw - 56px)); min-width: 0; }
    }

    @media (max-width: 520px) {
      .login-overlay { padding: 16px; }
      .login-card { width: 100%; padding: 44px 24px 28px; border-radius: 18px; }
    }

    /* 角色徽章与下拉菜单 */
    .role-badge { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 4px 10px 4px 4px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-full); cursor: pointer; margin-left: 8px; position: relative; user-select: none; transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease; font: inherit; text-align: left; }
    .role-badge:hover, .role-badge.open { border-color: #a9bdd3; background: #f6fafe; box-shadow: 0 4px 14px rgba(15,54,87,.08); }
    .role-badge:focus-visible { outline: 3px solid rgba(37,99,235,.16); outline-offset: 2px; }
    .role-badge:active { transform: scale(0.98); }
    .role-badge .role-avatar { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; }
    .role-badge .role-meta { display: flex; flex-direction: column; line-height: 1.15; }
    .role-badge .role-meta .role-meta-name { font-size: 13px; font-weight: 600; color: var(--ink); }
    .role-badge .role-meta .role-meta-role { font-size: 10.5px; color: var(--muted); }
    .role-badge .role-chevron { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--muted-light); transition: transform 0.2s ease; flex-shrink: 0; }
    .role-badge.open .role-chevron { transform: rotate(180deg); }

    .role-menu { position: absolute; top: calc(100% + 10px); right: 0; width: 286px; background: var(--card); border: 1px solid #dce3f0; border-radius: 14px; box-shadow: 0 18px 48px rgba(23,34,60,.16); z-index: 500; overflow: hidden; opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.97); transform-origin: top right; transition: opacity 0.18s ease, transform 0.18s ease; pointer-events: none; }
    .role-menu.show { opacity: 1; visibility: visible; transform: translateY(0) scale(1); pointer-events: auto; }
    .role-menu-header { padding: 16px; border-bottom: 1px solid var(--divider); background: linear-gradient(145deg,#f7fbff,#eef6fa); }
    .role-menu-header .rmh-name { font-size: 15px; font-weight: 750; color: var(--ink); line-height: 1.25; }
    .role-menu-header .rmh-role { display: inline-flex; margin-top: 5px; padding: 3px 7px; border-radius: 999px; background: #e4f2f6; color: #17677b; font-size: 11px; font-weight: 700; }
    .role-menu-header .rmh-scope { margin-top: 9px; color: var(--muted); font-size: 11px; line-height: 1.5; white-space: normal; }
    .role-menu-session { display: flex; align-items: center; gap: 6px; margin-top: 9px; color: #38725f; font-size: 10.5px; font-weight: 650; }
    .role-menu-session span { width: 7px; height: 7px; border-radius: 50%; background: #20a478; box-shadow: 0 0 0 4px rgba(32,164,120,.1); }
    .role-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 16px; border: 0; background: #fff; font: inherit; font-size: 13px; color: var(--text); cursor: pointer; white-space: nowrap; transition: background-color 0.12s ease, color 0.12s ease; font-weight: 600; text-align: left; }
    .role-menu-item:hover { background: var(--bg-alt); color: var(--blue-dark); }
    .role-menu-item:focus-visible { outline: 2px solid rgba(37,99,235,.18); outline-offset: -3px; }
    .role-menu-item.danger { color: var(--red); }
    .role-menu-item.danger:hover { background: var(--red-bg); }
    .role-menu-item .rmi-icon { width: 18px; text-align: center; flex-shrink: 0; font-size: 14px; }

    .pwd-modal-box { width: min(360px, calc(100vw - 28px)); max-width: 360px; padding: 0; overflow: hidden; border: 1px solid #dce3f0; border-radius: 12px; box-shadow: 0 20px 58px rgba(15,23,42,.22); }
    .pwd-modal-head { display: grid; grid-template-columns: 32px minmax(0,1fr) 27px; gap: 9px; align-items: center; padding: 13px 16px 11px; border-bottom: 1px solid var(--divider); background: linear-gradient(145deg,#f9fcff,#eef6fa); }
    .pwd-modal-head h3 { margin: 0; color: var(--ink); font-size: 15px; font-weight: 750; letter-spacing: -.01em; }
    .pwd-modal-head p { margin: 2px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.4; }
    .pwd-modal-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: #e2f2f5; color: #17677b; }
    .pwd-modal-icon svg { width: 16px; height: 16px; }
    .pwd-modal-close { width: 27px; height: 27px; border: 0; border-radius: 7px; background: transparent; color: #7b879a; font: inherit; font-size: 18px; line-height: 1; cursor: pointer; }
    .pwd-modal-close:hover { background: #e9eef8; color: var(--ink); }
    .pwd-modal-close:focus-visible { outline: 3px solid rgba(37,99,235,.16); }
    .pwd-modal-body { display: grid; gap: 9px; padding: 13px 16px 6px; }
    .pwd-field { display: grid; gap: 4px; }
    .pwd-field label { color: #37435c; font-size: 11px; font-weight: 700; }
    .pwd-field input { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--border2); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-size: 12.5px; }
    .pwd-field input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.11); }
    .pwd-rule { padding: 7px 9px; border-radius: 7px; background: #f6f8fc; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
    .pwd-error { min-height: 16px; color: var(--red); font-size: 11px; line-height: 1.4; }
    .pwd-modal-actions { margin: 0; padding: 8px 16px 14px; border-top: 0; }
    .pwd-modal-actions .btn { min-width: 80px; height: 33px; font-size: 12px; }
    .pwd-modal-actions .btn.primary { background: #1d4ed8; border-color: #1d4ed8; box-shadow: 0 7px 16px rgba(29,78,216,.16); }
    .pwd-modal-actions .btn.primary:hover { background: #1e40af; border-color: #1e40af; }

    .run-status {
      display:inline-flex; align-items:center; gap:7px;
      padding:0 2px; border:0; border-radius:0;
      background:transparent; color:#53657d;
      font-size:.72rem; font-weight:650; white-space:nowrap;
      transition:color .18s ease;
    }
    .run-status::before {
      content:""; width:6px; height:6px; flex:0 0 6px; border-radius:50%;
      background:#2ca57e; box-shadow:0 0 0 3px #e6f5f0;
    }
    @keyframes runStatusPulse {
      0%, 100% { box-shadow: 0 0 0 4px rgba(22,163,74,0.16); opacity: 1; }
      50% { box-shadow: 0 0 0 8px rgba(22,163,74,0.04); opacity: 0.6; }
    }
    .run-status.bad { background:transparent; color:#ad3e4e; }
    .run-status.bad::before { background:#cf5b6c; box-shadow:0 0 0 3px #fae9ec; animation:none; }

    /* 订单修改通知：正式版采用摘要列表 + 独立审计侧页。 */
    .notify-bell { position:relative; width:36px; height:36px; display:inline-flex; align-items:center; justify-content:center; padding:0; color:#31445e; border:1px solid transparent; border-radius:10px; background:transparent; font:inherit; line-height:1; cursor:pointer; transition:background .16s ease, border-color .16s ease, box-shadow .16s ease; }
    .notify-bell:hover,
    .notify-bell[aria-expanded="true"] { border-color:#dfe6f0; background:#f8faff; box-shadow:0 3px 10px rgba(40,61,91,.07); }
    .notify-bell.has-unread { color:#3558b6; background:#f4f7ff; }
    .notify-bell:focus-visible { outline:3px solid rgba(65,103,217,.16); outline-offset:2px; }
    .notify-bell-icon { width:19px; height:19px; display:block; flex:0 0 19px; fill:none; stroke:currentColor; stroke-width:1.65; stroke-linecap:round; stroke-linejoin:round; transform:translateY(-.5px); }
    .notify-badge { position:absolute; top:-4px; right:-4px; min-width:18px; height:18px; display:flex; align-items:center; justify-content:center; padding:0 4px; color:#fff; border:2px solid #fff; border-radius:999px; background:#df5969; box-shadow:0 2px 7px rgba(191,54,72,.24); font-size:.58rem; font-weight:780; line-height:1; font-variant-numeric:tabular-nums; }
    .notify-panel { position:absolute; z-index:9999; top:calc(100% + 12px); right:0; width:420px; max-height:min(620px,calc(100vh - 84px)); overflow:hidden; flex-direction:column; border:1px solid #dfe5ee; border-radius:16px; background:#fff; box-shadow:0 22px 56px rgba(27,42,65,.17),0 4px 14px rgba(27,42,65,.06); }
    .notify-panel::before { content:""; position:absolute; top:-6px; right:116px; width:12px; height:12px; border-top:1px solid #dfe5ee; border-left:1px solid #dfe5ee; background:#fff; transform:rotate(45deg); }
    .notify-panel-header { position:relative; z-index:1; min-height:72px; display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 16px 13px; border-bottom:1px solid #e6ebf2; background:#fff; }
    .notify-panel-header > div:first-child { display:grid; gap:3px; }
    .notify-panel-header strong { color:#263850; font-size:.88rem; font-weight:760; }
    .notify-panel-header small { color:#8390a2; font-size:.66rem; }
    .notify-panel-actions { display:flex; align-items:center; gap:4px; }
    .notify-panel-action { min-height:30px; padding:0 8px; color:#53657d; border:0; border-radius:8px; background:transparent; font:inherit; font-size:.68rem; font-weight:680; cursor:pointer; }
    .notify-panel-action:hover { color:#3459b6; background:#f1f5ff; }
    .notify-panel-action.danger:hover { color:#ad3e4e; background:#fff1f3; }
    .notify-panel-body { flex:1; overflow-y:auto; padding:7px; background:#f7f9fc; }
    .notify-item { position:relative; margin-bottom:6px; overflow:hidden; border:1px solid #e4e9f0; border-radius:12px; background:#fff; transition:border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
    .notify-item:last-child { margin-bottom:0; }
    .notify-item:hover { border-color:#cfd9e8; box-shadow:0 7px 18px rgba(37,56,83,.08); transform:translateY(-1px); }
    .notify-item.unread { border-color:#cedaf2; background:linear-gradient(135deg,#fbfcff 0%,#f4f7ff 100%); }
    .notify-item.unread::before { content:""; position:absolute; top:15px; left:12px; width:7px; height:7px; border-radius:50%; background:#4f6fd8; box-shadow:0 0 0 4px rgba(79,111,216,.1); }
    .notify-item-content { width:100%; display:grid; grid-template-columns:minmax(0,1fr) auto; column-gap:14px; row-gap:5px; padding:12px 13px 11px 16px; color:inherit; border:0; background:transparent; text-align:left; font:inherit; cursor:pointer; }
    .notify-item.unread .notify-item-content { padding-left:30px; }
    .notify-item-top { grid-column:1 / -1; display:flex; align-items:center; justify-content:space-between; gap:12px; }
    .notify-item-top strong { color:#263850; font-size:.78rem; font-weight:780; }
    .notify-item-top time { color:#8a96a6; font-size:.63rem; font-variant-numeric:tabular-nums; }
    .notify-item-title { grid-column:1; color:#52647a; font-size:.7rem; font-weight:650; }
    .notify-item-desc { grid-column:1; display:grid; gap:3px; }
    .notify-preview { display:flex; align-items:center; gap:7px; min-width:0; color:#4e6077; font-size:.69rem; line-height:1.45; }
    .notify-preview i { width:3px; height:15px; flex:0 0 auto; border-radius:3px; background:#94a3b8; }
    .notify-preview.add i { background:#2f9d7e; }
    .notify-preview.delete i { background:#cc5f70; }
    .notify-preview.modify i { background:#d6a03b; }
    .notify-item-desc em { color:#7d8999; font-size:.65rem; font-style:normal; }
    .notify-item-meta { grid-column:1; overflow:hidden; color:#8995a5; font-size:.64rem; text-overflow:ellipsis; white-space:nowrap; }
    .notify-item-open { grid-column:2; grid-row:2 / span 3; align-self:center; display:flex; align-items:center; justify-content:center; gap:4px; min-height:30px; padding:0 8px; color:#4566c4; border-radius:8px; background:#f2f5fc; white-space:nowrap; font-size:.67rem; font-weight:700; }
    .notify-item:hover .notify-item-open { background:#e9effc; }
    .notify-item-open b { color:#8a97aa; font-size:.9rem; font-weight:400; }
    .notify-empty { min-height:240px; display:grid; place-items:center; align-content:center; gap:7px; padding:30px; color:#8491a3; text-align:center; }
    .notify-empty > span { width:38px; height:38px; display:grid; place-items:center; color:#2f8b70; border-radius:50%; background:#e8f5f0; font-size:.9rem; }
    .notify-empty strong { color:#43566f; font-size:.78rem; }
    .notify-empty small { font-size:.67rem; }

    .notify-detail-overlay { position:fixed; z-index:12000; inset:0; display:flex; justify-content:flex-end; background:rgba(23,35,52,.28); opacity:0; transition:opacity .18s ease; }
    .notify-detail-overlay[hidden] { display:none; }
    .notify-detail-overlay.open { opacity:1; }
    .notify-detail-sheet { width:min(680px,92vw); height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; border-left:1px solid #dce3ed; background:#f7f9fc; box-shadow:-24px 0 64px rgba(24,38,59,.18); transform:translateX(30px); transition:transform .18s ease; }
    .notify-detail-overlay.open .notify-detail-sheet { transform:translateX(0); }
    .notify-detail-head { min-height:82px; display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 20px; border-bottom:1px solid #e1e7ef; background:#fff; }
    .notify-detail-head > div { display:grid; gap:4px; }
    .notify-detail-head span { color:#5571c7; font-size:.64rem; font-weight:750; letter-spacing:.08em; }
    .notify-detail-head h2 { margin:0; color:#22344d; font-size:1.02rem; font-weight:780; }
    .notify-detail-close { width:34px; height:34px; display:grid; place-items:center; color:#637188; border:1px solid #e0e6ee; border-radius:10px; background:#fff; font:inherit; font-size:1.05rem; cursor:pointer; }
    .notify-detail-close:hover { color:#33465f; background:#f5f7fa; }
    .notify-detail-body { overflow-y:auto; padding:18px 20px 24px; }
    .notify-detail-summary { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; padding:18px; border:1px solid #dfe6ef; border-radius:14px; background:#fff; box-shadow:0 2px 7px rgba(33,51,76,.04); }
    .notify-detail-summary > div { min-width:0; display:grid; gap:6px; }
    .notify-detail-state { width:max-content; min-height:22px; display:inline-flex; align-items:center; padding:0 8px; color:#26755f; border-radius:999px; background:#e6f5ef; font-size:.63rem; font-weight:750; }
    .notify-detail-state.unread { color:#4160bd; background:#edf2ff; }
    .notify-detail-summary h3 { margin:0; color:#22364f; font-size:1.2rem; font-weight:790; letter-spacing:.01em; }
    .notify-detail-summary p { margin:0; color:#788599; font-size:.7rem; line-height:1.55; }
    .notify-detail-count { color:#5f7088; font-size:.68rem; font-weight:680; white-space:nowrap; }
    .notify-detail-notice { display:grid; gap:4px; margin-top:12px; padding:12px 14px; color:#6d5a2e; border:1px solid #eadcad; border-radius:11px; background:#fffaf0; }
    .notify-detail-notice strong { font-size:.72rem; }
    .notify-detail-notice span { color:#83734e; font-size:.67rem; line-height:1.55; }
    .notify-audit-timeline { display:grid; gap:12px; margin-top:14px; }
    .notify-audit-event { padding:16px; border:1px solid #dfe6ef; border-radius:14px; background:#fff; }
    .notify-audit-event > header { display:flex; align-items:center; gap:10px; padding-bottom:12px; border-bottom:1px solid #e8edf3; }
    .notify-editor-avatar { width:34px; height:34px; display:grid; place-items:center; color:#fff; border-radius:10px; background:#38516f; font-size:.75rem; font-weight:740; }
    .notify-audit-event > header > div { display:grid; gap:3px; }
    .notify-audit-event > header strong { color:#2b3d55; font-size:.77rem; }
    .notify-audit-event > header small { color:#8995a5; font-size:.64rem; }
    .notify-change-list { display:grid; gap:10px; padding-top:12px; }
    .notify-change-row { display:grid; grid-template-columns:120px minmax(0,1fr); gap:14px; align-items:center; }
    .notify-change-field { min-width:0; display:flex; align-items:center; gap:7px; }
    .notify-change-field span { min-width:34px; min-height:22px; display:inline-flex; align-items:center; justify-content:center; padding:0 7px; color:#596b82; border-radius:7px; background:#f1f4f8; font-size:.62rem; font-weight:740; }
    .notify-change-field span.add { color:#23745b; background:#e8f5f0; }
    .notify-change-field span.delete { color:#aa3c4d; background:#fff0f2; }
    .notify-change-field span.modify { color:#89601f; background:#fff4df; }
    .notify-change-field strong { overflow:hidden; color:#3c4f67; font-size:.71rem; text-overflow:ellipsis; white-space:nowrap; }
    .notify-change-compare { display:grid; grid-template-columns:minmax(0,1fr) 20px minmax(0,1fr); gap:8px; align-items:center; }
    .notify-change-compare > span { min-width:0; display:grid; gap:4px; padding:9px 10px; border-radius:9px; background:#f7f9fc; }
    .notify-change-compare small { color:#8a96a6; font-size:.6rem; }
    .notify-change-compare b { color:#33465e; font-size:.7rem; font-weight:680; line-height:1.55; overflow-wrap:anywhere; white-space:normal; }
    .notify-change-compare b.unknown { color:#8a96a6; font-weight:600; }
    .notify-change-compare > i { color:#9aa6b6; font-size:.75rem; font-style:normal; text-align:center; }
    .notify-change-compare > i svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
    .notify-change-empty { padding:12px; color:#8793a4; border-radius:9px; background:#f7f9fc; font-size:.69rem; text-align:center; }
    .notify-detail-foot { min-height:70px; display:flex; align-items:center; justify-content:flex-end; gap:9px; padding:12px 20px; border-top:1px solid #e1e7ef; background:#fff; }
    .notify-detail-secondary,
    .notify-detail-primary { min-height:38px; padding:0 15px; border-radius:10px; font:inherit; font-size:.72rem; font-weight:720; cursor:pointer; }
    .notify-detail-secondary { color:#50627a; border:1px solid #dce3ed; background:#fff; }
    .notify-detail-primary { color:#fff; border:1px solid #4167d9; background:#4167d9; box-shadow:0 5px 12px rgba(65,103,217,.18); }
    .notify-detail-primary:hover { background:#365bc7; }
    .notify-detail-primary:disabled { color:#8995a5; border-color:#dce3ed; background:#eef1f5; box-shadow:none; cursor:not-allowed; }
    @media (max-width:700px) {
      .notify-panel { position:fixed; top:64px; right:12px; left:12px; width:auto; max-height:calc(100vh - 80px); }
      .notify-panel::before { display:none; }
      .notify-detail-sheet { width:100%; }
      .notify-detail-body { padding:14px; }
      .notify-detail-summary { align-items:flex-start; flex-direction:column; }
      .notify-change-row { grid-template-columns:1fr; gap:7px; }
      .notify-change-compare { grid-template-columns:1fr; }
      .notify-change-compare > i { transform:rotate(90deg); }
    }

    /* notify02：改单通知升级为同屏列表 + 审计详情，避免在窄弹层与侧抽屉之间来回跳转。 */
    .notify-panel-backdrop { position:fixed; z-index:11980; inset:0; background:rgba(21,34,52,.34); backdrop-filter:blur(1px); }
    .notify-panel { position:fixed; z-index:11990; top:50%; right:auto; left:50%; width:min(1120px,calc(100vw - 48px)); height:min(820px,calc(100vh - 56px)); max-height:none; overflow:hidden; flex-direction:column; border:1px solid #d7dee8; border-radius:18px; background:#fff; box-shadow:0 30px 90px rgba(20,33,51,.24),0 7px 24px rgba(20,33,51,.1); transform:translate(-50%,-50%); }
    .notify-panel::before { display:none; }
    .notify-panel-header { min-height:74px; flex:0 0 auto; padding:14px 18px 13px 24px; }
    .notify-panel-heading { min-width:0; display:flex !important; grid-template-columns:none !important; align-items:center; gap:10px !important; }
    .notify-panel-heading strong { color:#172439; font-size:1.14rem; font-weight:800; letter-spacing:-.01em; }
    .notify-panel-heading small { padding-left:2px; color:#8995a6; font-size:.67rem; }
    .notify-panel-unread { min-height:25px; display:inline-flex; align-items:center; padding:0 10px; color:#c63f51; border-radius:999px; background:#fff0f2; font-size:.68rem; font-weight:760; }
    .notify-panel-actions { gap:6px; }
    .notify-panel-action { min-height:34px; padding:0 10px; border:1px solid transparent; }
    .notify-panel-action:hover { border-color:#dce4f2; }
    .notify-panel-close { width:34px; height:34px; display:grid; place-items:center; margin-left:4px; color:#5d6c80; border:1px solid #dfe5ed; border-radius:10px; background:#fff; font:inherit; cursor:pointer; }
    .notify-panel-close svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; }
    .notify-panel-close:hover { color:#25374f; background:#f5f7fa; }
    .notify-center-main { min-height:0; flex:1; display:grid; grid-template-columns:370px minmax(0,1fr); border-top:1px solid #e2e7ee; }
    .notify-list-pane { min-width:0; min-height:0; display:grid; grid-template-rows:auto minmax(0,1fr) auto; border-right:1px solid #e1e7ef; background:#f8fafc; }
    .notify-list-tools { display:grid; gap:12px; padding:17px 16px 14px; border-bottom:1px solid #e6ebf1; background:#fff; }
    .notify-filter-tabs { display:flex; align-items:center; gap:7px; }
    .notify-filter-tab { min-height:34px; padding:0 13px; color:#627187; border:1px solid #dfe5ed; border-radius:999px; background:#fff; font:inherit; font-size:.69rem; font-weight:680; cursor:pointer; }
    .notify-filter-tab:hover { color:#315bc7; border-color:#bfcdf0; }
    .notify-filter-tab.active { color:#2458d5; border-color:#4f78e8; background:#f4f7ff; box-shadow:0 0 0 2px rgba(79,120,232,.07); }
    .notify-search { height:39px; display:flex; align-items:center; gap:8px; padding:0 11px; color:#7c899b; border:1px solid #dce3eb; border-radius:10px; background:#fff; }
    .notify-search:focus-within { border-color:#7796e8; box-shadow:0 0 0 3px rgba(67,105,213,.1); }
    .notify-search-icon { width:17px; height:17px; flex:0 0 auto; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; }
    .notify-search input { min-width:0; flex:1; color:#2b3d55; border:0; outline:0; background:transparent; font:inherit; font-size:.7rem; }
    .notify-search input::placeholder { color:#9ba6b5; }
    .notify-panel-body { min-height:0; overflow-y:auto; padding:10px; background:#f8fafc; }
    .notify-item { margin-bottom:8px; border-radius:12px; box-shadow:none; }
    .notify-item:hover { transform:none; }
    .notify-item.selected { border-color:#5c83ec; box-shadow:0 0 0 2px rgba(75,116,229,.09),0 8px 20px rgba(37,65,123,.08); }
    .notify-item.selected .notify-item-content { background:linear-gradient(135deg,#fbfdff 0%,#f2f6ff 100%); }
    .notify-item-content { position:relative; grid-template-columns:minmax(0,1fr) auto; padding:13px 14px 12px 16px; }
    .notify-item.unread .notify-item-content { padding-left:30px; }
    .notify-item-title { grid-column:1 / -1; }
    .notify-item-desc { grid-column:1 / -1; }
    .notify-item-meta { grid-column:1; padding-right:6px; }
    .notify-item-read-state { grid-column:2; align-self:end; min-height:22px; display:inline-flex; align-items:center; justify-content:center; padding:0 8px; color:#d14456; border-radius:999px; background:#fff0f2; font-size:.61rem; font-weight:760; }
    .notify-item-read-state.read { color:#728096; background:#eef2f6; }
    .notify-preview { display:block; overflow:hidden; padding-left:9px; border-left:3px solid #94a3b8; text-overflow:ellipsis; white-space:nowrap; }
    .notify-preview.add { border-left-color:#2f9d7e; }
    .notify-preview.delete { border-left-color:#cc5f70; }
    .notify-preview.modify { border-left-color:#d6a03b; }
    .notify-list-pagination { min-height:54px; display:flex; align-items:center; justify-content:center; gap:11px; padding:8px 12px; border-top:1px solid #e2e7ee; background:#fff; }
    .notify-list-pagination button { width:32px; height:32px; display:grid; place-items:center; color:#49617f; border:1px solid #dbe2eb; border-radius:8px; background:#fff; font:inherit; font-size:1rem; cursor:pointer; }
    .notify-list-pagination button svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
    .notify-list-pagination button:hover:not(:disabled) { color:#2458d5; border-color:#aebfe9; background:#f5f8ff; }
    .notify-list-pagination button:disabled { color:#bbc3cf; background:#f5f6f8; cursor:not-allowed; }
    .notify-list-pagination span { min-width:128px; color:#718096; font-size:.66rem; text-align:center; }
    .notify-detail-pane { min-width:0; min-height:0; display:grid; grid-template-rows:minmax(0,1fr) auto; background:#fff; }
    .notify-detail-body { min-height:0; overflow-y:auto; padding:24px 26px 30px; }
    .notify-detail-empty { min-height:100%; display:grid; place-items:center; align-content:center; gap:9px; padding:40px; color:#8b97a7; text-align:center; }
    .notify-detail-empty > span { width:48px; height:48px; display:grid; place-items:center; color:#496fd8; border-radius:15px; background:#eef3ff; }
    .notify-detail-empty > span svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
    .notify-detail-empty strong { color:#40536b; font-size:.82rem; }
    .notify-detail-empty small { font-size:.68rem; }
    .notify-detail-summary { padding:4px 2px 19px; border:0; border-bottom:1px solid #e4e9f0; border-radius:0; box-shadow:none; }
    .notify-detail-summary > div:first-child { gap:7px; }
    .notify-detail-kicker { color:#516dcc; font-size:.68rem; font-weight:760; letter-spacing:.08em; }
    .notify-detail-summary h3 { font-size:1.5rem; letter-spacing:.02em; }
    .notify-detail-summary p { color:#68778c; font-size:.72rem; }
    .notify-detail-summary-side { min-width:120px; display:flex; align-items:flex-end; flex-direction:column; gap:9px; }
    .notify-detail-count { color:#65758b; }
    .notify-detail-notice { margin-top:14px; }
    .notify-audit-timeline { margin-top:15px; }
    .notify-audit-event { padding:17px; border-color:#dce4ee; }
    .notify-change-row { grid-template-columns:170px minmax(0,1fr); gap:16px; padding:3px 0; }
    .notify-change-field { align-items:flex-start; }
    .notify-change-field strong { padding-top:3px; white-space:normal; }
    .notify-change-compare > span { min-height:62px; align-content:center; padding:10px 12px; border:1px solid #edf0f4; background:#f8fafc; }
    .notify-change-compare > span:last-child b { color:#109363; }
    .notify-detail-foot { min-height:70px; padding:13px 26px; }
    .notify-detail-secondary { display:none; }
    .notify-detail-primary { min-width:138px; min-height:40px; }

    @media (max-width:980px) {
      .notify-panel { width:calc(100vw - 28px); height:calc(100vh - 28px); }
      .notify-center-main { grid-template-columns:330px minmax(0,1fr); }
      .notify-change-row { grid-template-columns:1fr; gap:8px; }
    }
    @media (max-width:760px) {
      .notify-panel { top:14px; right:14px; bottom:14px; left:14px; width:auto; height:auto; transform:none; }
      .notify-panel-heading small,
      .notify-panel-action { display:none; }
      .notify-center-main { overflow-y:auto; grid-template-columns:1fr; }
      .notify-list-pane { min-height:520px; border-right:0; border-bottom:1px solid #e1e7ef; }
      .notify-detail-pane { min-height:560px; }
      .notify-detail-body { padding:18px; }
      .notify-detail-secondary { display:inline-flex; align-items:center; }
    }
    @keyframes runStatusPulseBad {
      0%, 100% { box-shadow: 0 0 0 4px rgba(220,38,38,0.15); opacity: 1; }
      50% { box-shadow: 0 0 0 8px rgba(220,38,38,0.04); opacity: 0.6; }
    }

    /* —— 9. 页面专用 —— */
    /* 状态徽章 */
    .status-badge { display: inline-block; padding: 2px 8px; border-radius: var(--radius-sm); font-size: .72rem; font-weight: 700; }
    .status-badge.active { background: #dcfce7; color: var(--green-dark); }
    .status-badge.disabled { background: var(--red-bg); color: #991b1b; }
    .status-badge.pending { background: var(--orange-bg); color: #9a5b00; }
    .support-order-badge { display: inline-flex; align-items: center; margin-left: 6px; padding: 2px 7px; border: 1px solid #bfdbfe; border-radius: 999px; background: #eff6ff; color: #1d4ed8; font-size: 11px; font-weight: 650; line-height: 1.35; white-space: nowrap; vertical-align: middle; }

    .btn-sm { height:32px; padding:5px 10px; border-radius:8px; font-size:.75rem; font-weight:600; }
    .btn-active-dark { background: var(--ink) !important; color: #fff !important; }
    .btn-edit { background: var(--brand-light); border: 1px solid #bfdbfe; color: var(--blue); }
    .btn-del { background: var(--red-bg); border: 1px solid #fecaca; color: var(--red-dark); }
    .btn-toggle { background: var(--orange-bg); border: 1px solid #fde68a; color: #92400e; }

    .inline-select {
      padding: 2px 6px; border: 1px solid var(--border2);
      border-radius: var(--radius-sm); font-size: var(--text-xs);
      background: var(--card); height: 28px;
    }
    .inline-select.cat-warn { border-color: var(--red); background: var(--orange-bg); color: var(--red); }
    .table-compact th { padding: 4px 8px; font-size: var(--text-xs); }
    .table-compact td { padding: 4px 8px; font-size: var(--text-xs); }
    .op-btns { display: flex; gap: 4px; flex-wrap: nowrap; }

    /* 施工单状态 */
    .wo-pending { background: #fef3c7; color: #92400e; }
    .wo-progress { background: var(--brand-light); color: var(--blue); }
    .wo-done { background: #dcfce7; color: var(--green-dark); }
    .wo-accepted { background: #e0e7ff; color: #3730a3; }
    .wo-kanban { display: none; grid-template-columns: repeat(3,1fr); gap: 14px; min-height: 400px; }
    .wo-kanban.active { display: grid; }
    .wo-column { background: var(--bg-alt); border-radius: var(--radius-lg); padding: 12px; display: flex; flex-direction: column; }
    .wo-column h4 { font-size: 13px; font-weight: 600; margin: 0 0 10px; padding: 6px 10px; border-radius: var(--radius-sm); text-align: center; }
    .wo-column h4.col-pending { background: #fef3c7; color: #92400e; }
    .wo-column h4.col-progress { background: var(--brand-light); color: var(--blue); }
    .wo-column h4.col-done { background: #dcfce7; color: var(--green-dark); }
    .wo-card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-md); padding: 10px 12px; margin-bottom: 8px; cursor: pointer; transition: box-shadow 0.15s ease, transform 0.15s ease; }
    .wo-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
    .wo-card .wc-no { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
    .wo-card .wc-customer { font-size: 14px; font-weight: 700; margin-bottom: 2px; color: var(--ink); }
    .wo-card .wc-detail { font-size: 12px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
    .wo-card .wc-actions { margin-top: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
    .wo-card .wc-actions .btn-sm { font-size: 11px; padding: 2px 8px; }
    .wo-table-wrap { display: block; }
    .wo-table-wrap.hidden { display: none; }

    .aging-ok { color: var(--green); }
    .aging-warn { color: var(--orange); }
    .aging-danger { color: var(--red); font-weight: 700; }
    .aging-severe { background: var(--red-bg); color: #991b1b; font-weight: 700; }

    .so-status { display: inline-block; padding: 2px 8px; border-radius: var(--radius-sm); font-size: .72rem; font-weight: 600; }
    .so-status.已保存 { background: #e0e7ff; color: #3730a3; }
    .so-status.已审核 { background: #dcfce7; color: var(--green-dark); }
    .so-status.已作废 { background: var(--bg-alt); color: var(--muted); text-decoration: line-through; }

    .wo-status { display: inline-block; padding: 2px 8px; border-radius: var(--radius-sm); font-size: .72rem; font-weight: 700; }

    .stock-badge { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: var(--radius-sm); font-size: .72rem; font-weight: 700; white-space: nowrap; }
    .stock-badge.stock-ok { background: #dcfce7; color: var(--green-dark); }
    .stock-badge.stock-low { background: #fef3c7; color: #92400e; }
    .stock-badge.stock-zero { background: var(--red-bg); color: #991b1b; }
    .stock-badge.stock-neg { background: #fecaca; color: #7f1d1d; }
    .stock-badge.stock-manual { background: #fff8e8; color: #8a5811; }
    .stock-badge.stock-service { background: #eef2f7; color: #526174; }
    .owner-material-toggle { display: inline-flex; align-items: center; gap: 5px; margin: 5px 0 0 6px; padding: 3px 7px; border: 1px solid #d8dee8; border-radius: 999px; color: #65748a; background: #fff; cursor: pointer; font-size: .72rem; font-weight: 700; white-space: nowrap; }
    .owner-material-toggle input { width: 13px; height: 13px; margin: 0; accent-color: var(--blue); }
    .owner-material-toggle:has(input:checked) { border-color: #efb45d; color: #845314; background: #fff8e9; }
    .cost-mode-hint { display: block; margin-top: 4px; color: #718096; font-size: .7rem; line-height: 1.35; }

    .sales-cost-queue-button { border-color: #e7bd74; color: #8a5811; background: #fff8e8; }
    .sales-cost-queue-overlay { display: none; z-index: 1150; }
    .sales-cost-queue-modal { width: min(1120px, calc(100vw - 48px)); max-width: 1120px; max-height: 86vh; overflow: hidden; }
    .sales-cost-queue-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
    .sales-cost-queue-head > div { display: grid; gap: 3px; }
    .sales-cost-queue-head span { color: #986016; font-size: .72rem; font-weight: 800; letter-spacing: .08em; }
    .sales-cost-queue-head h3 { margin: 0; }
    .sales-cost-queue-head small { color: var(--muted); }
    .sales-cost-queue-body { display: grid; gap: 10px; max-height: calc(86vh - 150px); padding: 14px 2px 4px; overflow-y: auto; }
    .sales-cost-queue-gate { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 12px; border: 1px solid #f0cf95; border-radius: 9px; color: #845314; background: #fff8e8; }
    .sales-cost-queue-gate span { color: #7b6850; font-size: .76rem; }
    .sales-cost-queue-row { display: grid; grid-template-columns: minmax(210px, 1.3fr) minmax(155px, .8fr) minmax(170px, .8fr) minmax(220px, 1.15fr) auto; align-items: end; gap: 12px; padding: 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
    .sales-cost-queue-order, .sales-cost-queue-fact { display: grid; gap: 3px; min-width: 0; }
    .sales-cost-queue-order > span { width: max-content; padding: 2px 7px; border-radius: 999px; color: #8a5811; background: #fff2d7; font-size: .68rem; font-weight: 800; }
    .sales-cost-queue-order strong, .sales-cost-queue-order small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .sales-cost-queue-order small, .sales-cost-queue-fact small, .sales-cost-queue-fact span { color: var(--muted); font-size: .72rem; }
    .sales-cost-queue-row label { display: grid; gap: 5px; margin: 0; font-size: .74rem; font-weight: 700; }
    .sales-cost-queue-row label > input, .sales-cost-money-input { min-height: 36px; }
    .sales-cost-money-input { display: flex; align-items: center; gap: 5px; padding: 0 9px; border: 1px solid var(--border); border-radius: 7px; background: #fff; }
    .sales-cost-money-input b { color: var(--muted); }
    .sales-cost-money-input input { min-width: 0; padding: 0; border: 0; outline: 0; }
    .sales-cost-queue-empty, .sales-cost-queue-loading { display: grid; place-items: center; gap: 7px; min-height: 180px; color: var(--muted); text-align: center; }
    .sales-cost-queue-empty.error { color: var(--danger); }
    .sales-cost-queue-pagination { position: sticky; bottom: -4px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; color: var(--muted); background: color-mix(in srgb, var(--card) 94%, transparent); box-shadow: 0 -4px 16px rgba(15, 23, 42, .06); }
    .sales-cost-queue-pagination > div { display: flex; gap: 8px; }
    .auto-calc-detail-card { width: min(700px, calc(100vw - 32px)); max-width: 700px; }
    .auto-calc-detail-body { max-height: 60vh; overflow: auto; }
    .auto-calc-detail-table { width: 100%; }
    .auto-calc-detail-total { font-weight: 700; background: var(--bg-alt); }
    .auto-calc-detail-breakdown { margin-top: 12px; }
    .auto-calc-detail-breakdown > summary { cursor: pointer; font-weight: 600; }
    .auto-calc-detail-subtable { margin-top: 8px; }
    .auto-calc-detail-context { margin-bottom: 8px; color: var(--muted); font-size: var(--text-sm); line-height: 1.5; }
    .expense-detail-overlay { display: none; z-index: 1100; }
    .expense-detail-dialog { max-width: 560px; max-height: 80vh; overflow-y: auto; }
    .expense-detail-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
    .expense-detail-dialog-head h3 { margin: 0; }
    .expense-detail-month { margin-bottom: 10px; color: var(--muted); font-size: var(--text-xs); }
    .expense-detail-dialog-actions { margin-top: 12px; }
    @media (max-width: 980px) {
      .sales-cost-queue-row { grid-template-columns: 1fr 1fr; }
      .sales-cost-queue-row .sales-cost-save { justify-self: start; }
    }

    /* 销售角色敏感数据屏蔽 */
    body.role-sales #homeStockValue { display: none !important; }
    body.role-sales .stat.pink { display: none !important; }
    body.role-sales .sales-form-table thead th:nth-child(11),
    body.role-sales .sales-form-table thead th:nth-child(12) { display: none !important; }
    body.role-sales #lines td:nth-child(11),
    body.role-sales #lines td:nth-child(12) { display: none !important; }
    body.role-sales span:has(> #sumCost),
    body.role-sales span:has(> #sumProfit) { display: none !important; }
    body.role-sales #orders table thead th:nth-child(15),
    body.role-sales #salesOrderRows td:nth-child(15) { display: none !important; }
    body.role-sales #soProfit,
    body.role-sales span:has(> #soProfit) { display: none !important; }
    body.role-sales table:has(#salesReportRows) thead th:nth-child(16),
    body.role-sales table:has(#salesReportRows) thead th:nth-child(17),
    body.role-sales table:has(#salesReportRows) thead th:nth-child(18),
    body.role-sales table:has(#salesReportRows) thead th:nth-child(19),
    body.role-sales #salesReportRows td:nth-child(16),
    body.role-sales #salesReportRows td:nth-child(17),
    body.role-sales #salesReportRows td:nth-child(18),
    body.role-sales #salesReportRows td:nth-child(19) { display: none !important; }
    body.role-sales span:has(> #srCost),
    body.role-sales span:has(> #srProfit),
    body.role-sales span:has(> #srProfitRate),
    body.role-sales span:has(> #srCommission) { display: none !important; }
    body.role-sales #stock table:has(#stockRows) thead th:nth-child(11),
    body.role-sales #stock table:has(#stockRows) thead th:nth-child(14),
    body.role-sales #stockRows td:nth-child(11),
    body.role-sales #stockRows td:nth-child(14) { display: none !important; }
    body.role-sales span:has(> #stockValue) { display: none !important; }
    body.role-sales #stock table:has(#ledgerRows) thead th:nth-child(10),
    body.role-sales #ledgerRows td:nth-child(10) { display: none !important; }
    body.role-sales [data-page="commission"] { display: none !important; }

    /* 成本与毛利分离：库房可看采购/库存成本，但不显示毛利、提成或工时金额。 */
    body.role-no-profit .home-sensitive-card { display: none !important; }
    body.role-no-profit .sales-form-table thead th:nth-child(12),
    body.role-no-profit #lines td:nth-child(12) { display: none !important; }
    body.role-no-profit .sales-sensitive-summary:has(#sumProfit),
    body.role-no-profit #soProfit,
    body.role-no-profit span:has(> #soProfit) { display: none !important; }
    body.role-no-profit #orders table thead th:nth-child(16),
    body.role-no-profit #salesOrderRows td:nth-child(16) { display: none !important; }
    body.role-no-profit table:has(#salesReportRows) thead th:nth-child(17),
    body.role-no-profit table:has(#salesReportRows) thead th:nth-child(18),
    body.role-no-profit table:has(#salesReportRows) thead th:nth-child(19),
    body.role-no-profit #salesReportRows td:nth-child(17),
    body.role-no-profit #salesReportRows td:nth-child(18),
    body.role-no-profit #salesReportRows td:nth-child(19),
    body.role-no-profit article:has(> #srCommission),
    body.role-no-profit article:has(> #srProfit) { display: none !important; }

    /* 库房销售只负责录单，不在销售单中登记收款，也不导出跨店销售单。 */
    body.role-warehouse #sales .footer-form > div:has(#received),
    body.role-warehouse #sales .footer-form > div:has(#payAccount),
    body.role-warehouse #sales .order-summary-card dl > div:has(#salesSummaryReceived),
    body.role-warehouse #sales .order-summary-card dl > div.balance,
    body.role-warehouse #orders .toolbar button[onclick="exportSalesOrdersCsv()"] {
      display: none !important;
    }
    body.role-warehouse #baseMasterTabs button[data-base-type="channels"],
    body.role-warehouse #baseMasterTabs button[data-base-type="staff"] {
      display: none !important;
    }

    .turn-warning { color: var(--orange); font-weight: 600; }
    .turn-danger { color: var(--red); font-weight: 600; }

    /* 报表标签切换 */
    .tab-btn {
      border: 1px solid var(--rule);
      background: var(--card);
      border-radius: var(--radius-md);
      padding: 6px 18px;
      cursor: pointer;
      font-family: var(--font);
      font-size: var(--text-base);
      font-weight: 500;
      color: var(--muted);
      transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
      white-space: nowrap;
    }
    .tab-btn:hover { background: var(--bg-alt); border-color: var(--border2); color: var(--ink); }
    .tab-btn.active { background: var(--ink); color: #fff; font-weight: 600; border-color: var(--ink); }
    .report-tab-bar { display: flex; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--rule); background: var(--bg-alt); }

    /* 提成费率配置抽屉 */
    .drawer-overlay {
      position: fixed; top: 0; left: 0; right: 0; bottom: 0;
      background: rgba(15,23,42,0.4); z-index: 998;
      opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
    }
    .drawer-overlay.open { opacity: 1; pointer-events: auto; }
    .comm-drawer {
      position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, calc(100vw - 24px));
      background: var(--card); z-index: 999;
      display: flex; flex-direction: column;
      transform: translateX(100%); visibility: hidden; pointer-events: none;
      transition: transform 0.3s ease, visibility 0s linear 0.3s;
      box-shadow: var(--shadow);
    }
    .comm-drawer.open {
      transform: translateX(0); visibility: visible; pointer-events: auto;
      transition-delay: 0s;
    }
    .comm-drawer-head {
      display: flex; align-items: center; justify-content: space-between;
      padding: 14px 20px; background: var(--ink); color: #fff;
      flex-shrink: 0;
    }
    .comm-drawer-head h3 { font-size: var(--text-base); font-weight: 700; margin: 0; }
    .comm-drawer-close {
      width: 28px; height: 28px; border-radius: 50%;
      padding: 0; border: 0;
      background: rgba(255,255,255,.15); color: #fff;
      display: flex; align-items: center; justify-content: center;
      cursor: pointer; font-size: 18px; transition: background-color 0.15s ease;
    }
    .comm-drawer-close:hover { background: rgba(255,255,255,.3); }
    .comm-drawer-body {
      flex: 1; min-height: 0; overflow-y: auto; padding: var(--space-3);
      display: flex; flex-direction: column; gap: var(--space-2);
    }
    .comm-version-strip {
      display:flex; flex-direction:column; gap:10px; padding:14px;
      border:1px solid var(--rule); border-radius:var(--radius-md);
      background:linear-gradient(135deg, var(--brand-light), var(--card));
    }
    .comm-version-summary { display:grid; grid-template-columns:auto 1fr; gap:3px 10px; align-items:center; }
    .comm-version-summary span { color:var(--muted); font-size:var(--text-xs); }
    .comm-version-summary strong { color:var(--ink); font-size:var(--text-sm); text-align:right; }
    .comm-version-summary small { grid-column:1 / -1; color:var(--text-secondary); font-size:var(--text-xs); }
    .comm-version-fields { display:grid; grid-template-columns:140px minmax(0,1fr); gap:10px; }
    .comm-version-strip p { margin:0; color:var(--muted); font-size:var(--text-xs); line-height:1.5; }
    .comm-card {
      border: 1px solid var(--rule); border-radius: var(--radius-md);
      overflow: hidden; transition: border-color 0.15s ease; flex-shrink: 0;
    }
    .comm-card:hover { border-color: var(--border2); }
    .comm-card-head {
      display: flex; align-items: center; gap: var(--space-2);
      padding: 10px 14px; cursor: pointer; user-select: none;
      transition: background-color 0.15s ease;
    }
    .comm-card-head:hover { background: var(--bg-alt); }
    .comm-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
    .comm-card-title { font-size: var(--text-sm); font-weight: 600; color: var(--text); }
    .comm-card-desc { font-size: var(--text-xs); color: var(--muted); flex: 1; }
    .comm-arrow { font-size: var(--text-xs); color: var(--muted); transition: transform 0.2s ease; }
    .comm-card.collapsed .comm-arrow { transform: rotate(-90deg); }
    .comm-card.collapsed .comm-card-body { display: none; }
    .comm-card-body {
      padding: 12px 14px; border-top: 1px solid var(--divider);
      display: flex; flex-direction: column; gap: var(--space-2);
    }
    .comm-rate-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; }
    .comm-rate-label { font-size: var(--text-sm); color: var(--text-secondary); font-weight: 500; }
    .comm-rate-pill {
      display: inline-flex; align-items: center; gap: 2px;
      background: var(--bg-alt); border: 1px solid var(--rule);
      border-radius: var(--radius-full); padding: 2px 4px 2px 12px;
    }
    .comm-rate-pill input {
      width: 46px; text-align: center; border: none; background: transparent;
      font-size: var(--text-sm); font-weight: 700; color: var(--ink);
      font-family: "Consolas", monospace; outline: none; height: auto; padding: 0;
    }
    .comm-rate-pill input:focus { color: var(--blue); }
    .comm-rate-pill span { font-size: var(--text-xs); color: var(--muted); padding-right: 8px; }
    .comm-channel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
    .comm-channel-item {
      display: flex; align-items: center; justify-content: space-between;
      padding: 4px 10px; border-radius: var(--radius-sm); border: 1px solid var(--rule);
    }
    .comm-channel-item .ch-name { font-size: var(--text-xs); color: var(--text-secondary); font-weight: 500; }
    .comm-channel-item .ch-input {
      width: 38px; text-align: center; border: 1px solid var(--border2);
      border-radius: var(--radius-sm); padding: 2px 4px; font-size: var(--text-xs);
      font-weight: 700; color: var(--ink); font-family: "Consolas", monospace; height: 26px;
    }
    .comm-channel-item .ch-pct { font-size: 10px; color: var(--muted); }
    .comm-rate-inline { display: inline-flex; align-items: center; gap: 2px; }
    .comm-channel-tone-green { background: var(--green-bg); border-color: #bbf7d0; }
    .comm-channel-tone-green .ch-name, .comm-channel-tone-green .ch-pct { color: #166534; }
    .comm-channel-tone-blue { background: var(--brand-light); border-color: #bfdbfe; }
    .comm-channel-tone-blue .ch-name, .comm-channel-tone-blue .ch-pct { color: #1e40af; }
    .comm-channel-tone-orange { background: var(--orange-bg); border-color: #fed7aa; }
    .comm-channel-tone-orange .ch-name, .comm-channel-tone-orange .ch-pct { color: #9a3412; }
    .comm-channel-tone-purple { background: #f5f3ff; border-color: #f0abfc; }
    .comm-channel-tone-purple .ch-name, .comm-channel-tone-purple .ch-pct { color: #86198f; }
    .comm-channel-tone-teal { background: #ecfdf5; border-color: #a7f3d0; }
    .comm-channel-tone-teal .ch-name, .comm-channel-tone-teal .ch-pct { color: #065f46; }
    .comm-channel-tone-yellow { background: #fefce8; border-color: #fef08a; }
    .comm-channel-tone-yellow .ch-name, .comm-channel-tone-yellow .ch-pct { color: #854d0e; }
    .comm-channel-tone-neutral { background: var(--bg-alt); border-color: var(--border2); }
    .comm-field { display: flex; flex-direction: column; gap: 4px; }
    .comm-field-label { font-size: var(--text-xs); color: var(--text-secondary); font-weight: 600; }
    .comm-input {
      border: 1px solid var(--border2); border-radius: var(--radius-md);
      padding: 0 10px; font-size: var(--text-base); color: var(--text);
      outline: none; transition: border-color 0.15s ease; height: var(--input-height);
    }
    .comm-input:focus { border-color: var(--ink); }
    .comm-field-hint { font-size: var(--text-xs); color: var(--muted); }
    .comm-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 4px; border-radius: var(--radius-sm); }
    .comm-table { width: 100%; min-width: 480px; border-collapse: collapse; font-size: var(--text-xs); }
    .comm-table th {
      background: var(--bg-alt); color: var(--muted);
      padding: 5px 8px; text-align: center; font-weight: 600;
    }
    .comm-table td { padding: 4px 8px; border-bottom: 1px solid var(--divider); text-align: center; color: var(--text); }
    .comm-table input, .comm-table select {
      width: 100%; border: 1px solid var(--border2); border-radius: var(--radius-sm);
      padding: 2px 4px; font-size: var(--text-xs); text-align: center; height: 26px;
    }
    .comm-table .comm-grid-input { width: 50px; }
    .comm-table .comm-grid-name { text-align: left; }
    .comm-table .comm-grid-action { text-align: center; }
    .comm-table .comm-manager-input { min-width: 72px; text-align: left; }
    .comm-table .comm-manager-name { width: 80px; }
    .comm-table .comm-manager-channels { width: 240px; }
    .comm-table .comm-manager-products { width: 120px; }
    .comm-table .comm-manager-rate { width: 50px; text-align: center; }
    .comm-manager-rate-cell { white-space: nowrap; }
    .comm-add-btn {
      margin-top: 8px; font-size: var(--text-xs); padding: 4px 12px;
      background: var(--bg-alt); color: var(--ink); border: 1px dashed var(--border2);
    }
    .comm-drawer-foot {
      padding: 12px 16px; border-top: 1px solid var(--rule);
      display: flex; gap: var(--space-2); flex-shrink: 0;
      background: var(--bg-alt);
    }
    .comm-save-btn { flex: 1; font-weight: 600; }
    .comm-reset-btn { background: var(--card); color: var(--text-secondary); }

    @media (max-width: 520px) {
      .comm-version-fields { grid-template-columns:1fr; }
    }

    /* 系统设置页 */
    .settings-grid {
      display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
      gap: 16px; padding: 16px;
    }
    .settings-card {
      border: 1px solid var(--rule); border-radius: var(--radius-lg);
      background: var(--card); overflow: hidden;
      transition: box-shadow 0.2s ease;
    }
    .settings-card:hover { box-shadow: var(--shadow-sm); }
    .settings-card-title {
      padding: 10px 14px; font-weight: 600; font-size: var(--text-sm);
      background: var(--bg-alt); border-bottom: 1px solid var(--rule);
      color: var(--ink);
    }
    .settings-card-body {
      padding: 14px; display: flex; flex-direction: column; gap: 8px;
    }
    .settings-card-body label { font-size: var(--text-xs); color: var(--muted); }
    .settings-card-body input, .settings-card-body select {
      padding: 0 10px; border: 1px solid var(--border2);
      border-radius: var(--radius-md); font-size: var(--text-base);
    }
    .settings-card-body .btn { margin-top: 4px; }

    .settings-workspace-panel {
      flex: 1; min-height: 0; overflow: auto; padding: 22px 26px 28px;
      background: #f5f7fb;
    }
    .settings-workspace-head {
      max-width: 1440px; margin: 0 auto 14px; display: flex; align-items: flex-start;
      justify-content: space-between; gap: 24px;
    }
    .settings-eyebrow {
      display: block; margin-bottom: 5px; color: #4169df; font-size: 12px;
      font-weight: 700; letter-spacing: .05em;
    }
    .settings-workspace-head h2 { margin: 0; color: #14213d; font-size: 24px; line-height: 1.25; }
    .settings-workspace-head p { margin: 7px 0 0; color: #64748b; font-size: 13px; line-height: 1.65; }
    .settings-head-actions { display: flex; gap: 10px; flex: 0 0 auto; padding-top: 8px; }
    .settings-boundary-note {
      max-width: 1440px; margin: 0 auto 14px; display: grid;
      grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
      padding: 12px 16px; border: 1px solid #cad8ff; border-radius: 12px;
      background: #f7f9ff; color: #53647f; font-size: 12px;
    }
    .settings-boundary-note strong { color: #2347a8; font-size: 13px; }
    .settings-boundary-note em { color: #6b7280; font-style: normal; white-space: nowrap; }
    .settings-view-tabs {
      max-width: 1440px; margin: 0 auto 14px; padding: 5px; display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
      border: 1px solid #dce3ef; border-radius: 13px; background: #fff;
    }
    .settings-view-tabs button {
      min-height: 54px; padding: 8px 14px; border: 0; border-radius: 9px;
      background: transparent; color: #334155; text-align: left; font-size: 14px;
      font-weight: 700; cursor: pointer;
    }
    .settings-view-tabs button small { display: block; margin-top: 3px; color: #8a97aa; font-size: 11px; font-weight: 500; }
    .settings-view-tabs button.active { color: #315dd8; background: #edf2ff; }
    .settings-view { display: none; max-width: 1440px; margin: 0 auto; }
    .settings-view.active { display: block; }
    .settings-account-layout {
      display: grid; grid-template-columns: minmax(360px, .78fr) minmax(520px, 1.35fr);
      gap: 14px; align-items: start;
    }
    .settings-account-list-card, .settings-account-detail, .settings-role-intro, .settings-role-card {
      border: 1px solid #dce3ef; border-radius: 13px; background: #fff;
    }
    .settings-account-list-card { min-height: 520px; overflow: hidden; }
    .settings-self-view { max-width: 1120px; }
    .settings-self-view .settings-account-layout { grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); }
    .settings-self-view .settings-account-list-card,
    .settings-self-view .settings-account-detail { min-height: 0; }
    .settings-self-summary { padding: 18px 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .settings-self-summary > div { padding: 14px 16px; border: 1px solid #e1e7f0; border-radius: 10px; background: #fafbfd; }
    .settings-self-summary span { display: block; color: #7b879a; font-size: 12px; }
    .settings-self-summary strong { display: block; margin-top: 6px; color: #17223b; font-size: 15px; line-height: 1.45; }
    .settings-section-head {
      padding: 16px 18px 12px; display: flex; justify-content: space-between; gap: 12px;
      border-bottom: 1px solid #edf0f5;
    }
    .settings-section-head h3, .settings-role-intro h3 { margin: 0; color: #16213b; font-size: 17px; }
    .settings-section-head p, .settings-role-intro p { margin: 4px 0 0; color: #748198; font-size: 12px; }
    .settings-count { align-self: center; padding: 4px 9px; border-radius: 999px; background: #f0f3f8; color: #5e6d84; font-size: 11px; }
    .settings-search { padding: 12px 16px; border-bottom: 1px solid #edf0f5; }
    .settings-search input { width: 100%; height: 38px; border: 1px solid #d5deeb; border-radius: 9px; padding: 0 11px; }
    .settings-account-rows { max-height: 448px; overflow: auto; padding: 8px; }
    .settings-account-row {
      width: 100%; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto;
      align-items: center; gap: 10px; padding: 11px; border: 1px solid transparent;
      border-radius: 10px; background: transparent; text-align: left; cursor: pointer;
    }
    .settings-account-row:hover { background: #f7f9fc; }
    .settings-account-row.selected { border-color: #aec1ff; background: #f1f5ff; }
    .settings-account-avatar {
      width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px;
      background: #e8eeff; color: #315dd8; font-weight: 800;
    }
    .settings-account-row strong { display: block; color: #18243e; font-size: 14px; }
    .settings-account-row small { display: block; margin-top: 3px; color: #7b879a; font-size: 11px; }
    .settings-account-status { padding: 4px 8px; border-radius: 999px; background: #eaf8f1; color: #187653; font-size: 11px; }
    .settings-account-status.disabled { background: #f1f3f6; color: #778195; }
    .settings-account-detail { min-height: 520px; overflow: hidden; }
    .settings-detail-head { padding: 18px 20px; border-bottom: 1px solid #edf0f5; }
    .settings-detail-head h3 { margin: 0; color: #14213d; font-size: 20px; }
    .settings-detail-head p { margin: 5px 0 0; color: #748198; font-size: 12px; }
    .settings-detail-body { padding: 18px 20px; }
    .settings-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .settings-detail-field { padding: 13px 14px; border: 1px solid #e1e7f0; border-radius: 10px; background: #fafbfd; }
    .settings-detail-field span { display: block; color: #7b879a; font-size: 11px; }
    .settings-detail-field strong { display: block; margin-top: 5px; color: #17223b; font-size: 14px; line-height: 1.5; }
    .settings-access-note { margin-top: 14px; padding: 13px 14px; border-radius: 10px; background: #f1f5ff; color: #4d5f7c; font-size: 12px; line-height: 1.65; }
    .settings-access-note strong { display: block; margin-bottom: 2px; color: #2449ad; font-size: 13px; }
    .settings-detail-actions { margin-top: 16px; display: flex; justify-content: flex-end; gap: 10px; }
    .settings-empty { padding: 36px 20px; color: #8090a5; text-align: center; font-size: 13px; }
    .settings-role-intro { padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
    .settings-role-intro > span { color: #8a621b; font-size: 11px; }
    .settings-role-safety {
      margin-top: 12px; padding: 11px 14px; display: flex; align-items: center; gap: 12px;
      border: 1px solid #d7e1f5; border-radius: 11px; background: #f7f9fd;
      color: #64748b; font-size: 12px; line-height: 1.55;
    }
    .settings-role-safety strong { flex: 0 0 auto; color: #294a9f; font-size: 12px; }
    .settings-role-layout { margin-top: 14px; display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 14px; align-items: start; }
    .settings-role-selector-shell, .settings-role-matrix {
      border: 1px solid #dce3ef; border-radius: 13px; background: #fff; overflow: hidden;
    }
    .settings-role-selector-shell { position: sticky; top: 0; }
    .settings-role-selector-head { padding: 14px 15px 11px; border-bottom: 1px solid #edf0f5; }
    .settings-role-selector-head strong { display: block; color: #17223b; font-size: 13px; }
    .settings-role-selector-head span { display: block; margin-top: 3px; color: #8190a5; font-size: 11px; }
    .settings-role-selector { padding: 7px; }
    .settings-role-selector-item {
      width: 100%; min-height: 58px; padding: 9px 10px; display: flex; align-items: center; justify-content: space-between;
      gap: 8px; border: 1px solid transparent; border-radius: 9px; background: transparent; text-align: left; cursor: pointer;
    }
    .settings-role-selector-item:hover { background: #f7f9fc; }
    .settings-role-selector-item.active { border-color: #b7c8ff; background: #f0f4ff; }
    .settings-role-selector-item strong { display: block; color: #23304a; font-size: 13px; }
    .settings-role-selector-item small { display: block; margin-top: 3px; color: #7d8ba0; font-size: 10px; }
    .settings-role-selector-item em { color: #315dd8; font-size: 10px; font-style: normal; }
    .settings-role-matrix-head {
      padding: 16px 18px 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
      border-bottom: 1px solid #edf0f5; background: #fbfcfe;
    }
    .settings-role-matrix-head > div:first-child > span { color: #4169df; font-size: 10px; font-weight: 800; }
    .settings-role-matrix-head h3 { margin: 4px 0 3px; color: #17223b; font-size: 18px; }
    .settings-role-matrix-head p { margin: 0; max-width: 720px; color: #66758c; font-size: 11px; line-height: 1.55; }
    .settings-role-matrix-head > div:last-child { flex: 0 0 auto; text-align: right; }
    .settings-role-matrix-head > div:last-child strong { display: block; color: #334155; font-size: 11px; }
    .settings-role-matrix-head > div:last-child small { display: block; margin-top: 4px; color: #8390a3; font-size: 10px; }
    .settings-role-permission-groups { padding: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
    .settings-role-permission-group { padding: 11px; border: 1px solid #e2e7ef; border-radius: 10px; background: #f8f9fb; }
    .settings-role-permission-group.enabled { border-color: #d6e0fa; background: #fbfcff; }
    .settings-role-permission-group header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    .settings-role-permission-group header strong { display: block; color: #25334e; font-size: 12px; }
    .settings-role-permission-group header small { display: block; margin-top: 2px; color: #8a96a8; font-size: 9px; }
    .settings-role-page-switch { display: flex; align-items: center; gap: 5px; color: #718096; font-size: 10px; white-space: nowrap; }
    .settings-role-page-switch input, .settings-role-action-toggle input { width: 15px; height: 15px; accent-color: #315dd8; }
    .settings-role-action-list { margin-top: 9px; display: grid; gap: 5px; }
    .settings-role-action-toggle { min-height: 27px; display: flex; align-items: flex-start; gap: 7px; color: #42516a; font-size: 10px; line-height: 1.35; }
    .settings-role-action-toggle input { margin-top: 1px; flex: 0 0 auto; }
    .settings-role-action-toggle > span { min-width: 0; display: grid; gap: 2px; }
    .settings-role-action-toggle strong { color: inherit; font-size: 10px; font-weight: 500; }
    .settings-role-action-toggle small { max-width: 260px; color: #7a8799; font-size: 9px; line-height: 1.45; }
    .settings-role-action-toggle.disabled { color: #a0a9b8; }
    .settings-role-action-toggle.disabled small { color: #a5adba; }
    .settings-role-no-action { display: block; padding: 4px 0; color: #9aa5b5; font-size: 10px; }
    .settings-role-permission-group > p { margin: 7px 0 0; color: #9a6b20; font-size: 9px; line-height: 1.4; }
    .settings-role-scope-summary { padding: 11px 16px 13px; display: flex; gap: 10px; border-top: 1px solid #edf0f5; background: #f7f9fd; font-size: 10px; }
    .settings-role-scope-summary strong { color: #294a9f; }
    .settings-role-scope-summary span { color: #6c7a90; }
    .settings-role-card { padding: 16px 17px; }
    .settings-role-card.locked { background: #fafbfd; }
    .settings-role-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
    .settings-role-card-head > div > span { color: #4169df; font-size: 11px; font-weight: 700; }
    .settings-role-card h3 { margin: 5px 0 3px; color: #17223b; font-size: 17px; }
    .settings-role-card p { margin: 0; color: #66758c; font-size: 12px; line-height: 1.55; }
    .settings-role-lock { padding: 4px 8px; border-radius: 999px; background: #edf1f7; color: #66758c; font-size: 11px; white-space: nowrap; }
    .settings-role-page-grid { margin-top: 13px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .settings-role-toggle {
      min-height: 38px; padding: 8px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
      border: 1px solid #e0e6ef; border-radius: 9px; background: #fafbfd; color: #3f4d65; font-size: 12px;
    }
    .settings-role-toggle input { width: 16px; height: 16px; accent-color: #315dd8; }
    .settings-role-toggle.disabled { color: #8a97aa; background: #f5f6f8; }
    .settings-role-scope { margin-top: 12px; padding-top: 10px; border-top: 1px solid #edf0f5; color: #7a879a; font-size: 11px; }
    .settings-role-savebar {
      position: sticky; bottom: 0; z-index: 3; margin-top: 14px; padding: 13px 15px;
      display: grid; grid-template-columns: minmax(280px, 1fr) auto; align-items: end; gap: 18px;
      border: 1px solid #d7dfec; border-radius: 12px; background: rgba(255,255,255,.96); box-shadow: 0 -6px 18px rgba(30,47,80,.06);
    }
    .settings-role-savebar label span { display: block; margin-bottom: 5px; color: #526078; font-size: 11px; font-weight: 700; }
    .settings-role-savebar input { width: 100%; height: 38px; padding: 0 11px; border: 1px solid #d5deeb; border-radius: 9px; }
    .settings-role-save-actions { display: flex; align-items: center; gap: 9px; }
    .settings-role-save-actions > span { color: #7b879a; font-size: 11px; white-space: nowrap; }
    .settings-tool-grid {
      margin-top: 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px;
    }
    .settings-tool-card {
      min-height: 190px; padding: 20px; display: flex; flex-direction: column; align-items: flex-start;
      border: 1px solid #dce3ef; border-radius: 13px; background: #fff; color: #17223b;
      text-align: left; cursor: pointer; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
    }
    .settings-tool-card:hover { border-color: #aec1ff; box-shadow: 0 8px 22px rgba(35, 71, 168, .08); transform: translateY(-1px); }
    .settings-tool-card:focus-visible { outline: 3px solid rgba(49, 93, 216, .28); outline-offset: 2px; }
    .settings-tool-card > span { color: #4169df; font-size: 11px; font-weight: 800; letter-spacing: .05em; }
    .settings-tool-card strong { margin-top: 10px; color: #17223b; font-size: 19px; }
    .settings-tool-card small { margin-top: 9px; color: #66758c; font-size: 12px; line-height: 1.65; }
    .settings-tool-card em { margin-top: auto; padding-top: 18px; color: #315dd8; font-size: 12px; font-style: normal; font-weight: 700; }
    @media (max-width: 1100px) {
      .settings-account-layout { grid-template-columns: 1fr; }
      .settings-account-list-card { min-height: 0; }
      .settings-account-rows { max-height: 320px; }
      .settings-role-layout { grid-template-columns: 190px minmax(0, 1fr); }
      .settings-role-permission-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .settings-role-savebar { grid-template-columns: 1fr; }
      .settings-tool-grid { grid-template-columns: 1fr; }
    }
    @media (max-width: 760px) {
      .settings-workspace-panel { padding: 16px; }
      .settings-workspace-head, .settings-role-intro { flex-direction: column; }
      .settings-role-safety { align-items: flex-start; flex-direction: column; }
      .settings-boundary-note { grid-template-columns: 1fr; }
      .settings-view-tabs { grid-template-columns: 1fr; }
      .settings-detail-grid, .settings-self-summary { grid-template-columns: 1fr; }
      .settings-role-layout { grid-template-columns: 1fr; }
      .settings-role-selector-shell { position: static; }
      .settings-role-selector { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .settings-role-permission-groups { grid-template-columns: 1fr; }
      .settings-role-page-grid { grid-template-columns: 1fr; }
      .settings-role-save-actions { flex-wrap: wrap; }
    }

    /* 打印样式 */
    @media print {
      .side, .topbar, .toolbar, .filter-bar, .upload-section,
      .nav, .quick, .panel-head .toolbar, .no-print {
        display: none !important;
      }
      .main { margin: 0 !important; padding: 0 !important; }
      .page { display: block !important; }
      .page:not(.active) { display: none !important; }
      body { background: #fff !important; }
      .panel { border: none !important; box-shadow: none !important; }
      table { width: 100% !important; }
      th { background: #333 !important; color: #fff !important; -webkit-print-color-adjust: exact; }
      tbody tr.row-gift, tbody tr.row-loss, tbody tr.row-zero { background: #fff !important; }
    }

    /* ===== 财务利润表页 ===== */
    .finance-sync-picker { display:inline-flex; align-items:center; gap:6px; padding:4px 8px 4px 10px; border:1px solid var(--rule); border-radius:8px; background:var(--bg-alt); color:var(--muted); font-size:.76rem; white-space:nowrap; }
    .finance-sync-picker select { border:0; background:transparent; color:var(--ink); font:inherit; font-weight:600; outline:none; cursor:pointer; }
    .finance-cards {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 12px;
      padding: 14px;
      overflow-y: auto;
      flex: 1;
      min-height: 0;
      align-items: start;
      position: relative;
      z-index: 1;
    }
    .finance-card {
      background: var(--card);
      border: 1px solid var(--rule);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-sm);
      overflow: hidden;
      transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    .finance-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
    .finance-card-total {
      grid-column: 1 / -1;
      background: var(--bg-alt);
      border: 2px solid var(--border);
      font-weight: 700;
    }
    .finance-card-head {
      display: flex;
      flex-direction: column;
      gap: 12px;
      padding: 16px 20px;
      cursor: pointer;
      position: relative;
    }
    .finance-card-total .finance-card-head { cursor: default; }
    .finance-card-title {
      font-size: 1rem;
      font-weight: 700;
      color: var(--ink);
      min-width: 100px;
    }
    .finance-card-total .finance-card-title { font-size: 1.1rem; }
    .finance-card-stats { display: flex; gap: 28px; flex: 1; flex-wrap: wrap; }
    .finance-stat { display: flex; flex-direction: column; gap: 2px; }
    .finance-stat-label { font-size: .72rem; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
    .finance-stat strong { font-size: 1.1rem; font-weight: 800; color: var(--ink); letter-spacing: -0.3px; }
    .finance-profit-positive strong { color: var(--green); }
    .finance-profit-negative strong { color: var(--red); }
    .finance-card-meta { font-size: .78rem; color: var(--muted); }
    .finance-card-arrow {
      position: absolute;
      right: 20px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--muted);
      font-size: .85rem;
      transition: transform 0.2s ease;
    }
    .finance-arrow-up { transform: translateY(-50%) rotate(180deg); }
    .finance-card-detail {
      padding: 0 20px 16px;
      border-top: 1px solid var(--divider);
    }
    .finance-detail-table {
      width: 100%;
      border-collapse: collapse;
      margin-top: 12px;
    }
    .finance-detail-table th {
      background: var(--bg-alt);
      color: var(--muted);
      font-size: .72rem;
      font-weight: 600;
      text-align: left;
      padding: 8px 12px;
      border-bottom: 1px solid var(--rule);
      position: static;
      text-transform: none;
      letter-spacing: 0;
    }
    .finance-detail-table td {
      padding: 7px 12px;
      border-bottom: 1px solid var(--divider);
      font-size: .85rem;
      color: var(--text);
    }
    .finance-detail-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
    .finance-row-income td { font-weight: 600; color: var(--blue); }
    .finance-row-total td { font-weight: 700; border-top: 2px solid var(--border); }
    .finance-row-profit td { font-weight: 800; font-size: .95rem; }
    .finance-card-actions { margin-top: 12px; display: flex; justify-content: flex-end; gap: 8px; }
    /* 月度锁定样式 */
    .finance-card-month-locked { border-left: 3px solid #f59e0b; }
    .finance-post-close-box { width: min(560px, calc(100vw - 32px)); }
    .finance-post-close-subtitle { margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 500; }
    .finance-post-close-form { display: grid; gap: 14px; }
    .finance-post-close-form label { display: grid; gap: 6px; color: var(--text-secondary); font-size: 13px; font-weight: 600; }
    .finance-post-close-form select,
    .finance-post-close-form input { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); font: inherit; }
    .finance-post-close-form select:focus,
    .finance-post-close-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 99, 229, .12); outline: 0; }
    .finance-post-close-hint { padding: 10px 12px; border-radius: 8px; background: #fff7ed; color: #9a5411; font-size: 12px; line-height: 1.55; }
    .month-lock-badge { font-size: .8rem; cursor: help; }

    /* 固定成本编辑模态框 */
    .finance-edit-month { font-size: .88rem; color: var(--muted); margin-bottom: 16px; }
    .finance-edit-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 12px 16px;
      margin-bottom: 16px;
    }
    .finance-edit-field { display: flex; flex-direction: column; gap: 4px; }
    .finance-edit-field label { font-size: .78rem; color: var(--muted); font-weight: 500; }
    .finance-field-row { display: flex; gap: 4px; align-items: center; }
    .finance-field-row input { flex: 1; min-width: 0; }
    .finance-detail-btn { white-space: nowrap; font-size: .7rem; padding: 4px 8px; flex-shrink: 0; }
    /* 费用明细独立弹窗样式（20260717方案A） */
    .expense-detail-list { display: flex; flex-direction: column; gap: 8px; }
    .expense-detail-row { display: flex; gap: 8px; align-items: center; }
    .expense-detail-row.auto-calc-row { background: #f0f7ff; }
    .expense-detail-row.historical-anomaly-row { background: #fff7ed; }
    .expense-detail-name-wrap { display: flex; flex: 1; align-items: center; gap: 4px; min-width: 100px; }
    .expense-detail-name-wrap .expense-detail-name { flex: 1; min-width: 0; }
    .expense-detail-auto-badge { flex-shrink: 0; padding: 0 4px; border: 1px solid #3b82f6; border-radius: 3px; color: #3b82f6; font-size: 10px; white-space: nowrap; }
    .expense-detail-calc-readonly { color: #64748b; background: #f8fafc; cursor: default; }
    .expense-detail-header span { font-size: .72rem; color: var(--muted); font-weight: 600; }
    .expense-detail-header span:nth-child(1) { flex: 1; min-width: 100px; }
    .expense-detail-header span:nth-child(2) { width: 90px; text-align: right; }
    .expense-detail-header span:nth-child(3) { flex: 2.5; min-width: 180px; }
    .expense-detail-header span:nth-child(4) { flex: 1; min-width: 80px; }
    .expense-detail-header span:nth-child(5) { width: 32px; }
    .expense-detail-name { flex: 1; min-width: 100px; font-size: .82rem; padding: 6px 10px; border: 1px solid var(--border2); border-radius: var(--radius-md); }
    .expense-detail-amount { width: 90px; font-size: .82rem; padding: 6px 10px; border: 1px solid var(--border2); border-radius: var(--radius-md); text-align: right; }
    .expense-detail-calc { flex: 2.5; min-width: 180px; font-size: .78rem; padding: 6px 10px; border: 1px solid var(--border2); border-radius: var(--radius-md); }
    .expense-detail-remark { flex: 1; min-width: 80px; font-size: .82rem; padding: 6px 10px; border: 1px solid var(--border2); border-radius: var(--radius-md); }
    .expense-detail-del { width: 32px; flex: 0 0 32px; padding: 6px 0; font-size: .72rem; }
    .expense-detail-empty { font-size: .82rem; color: var(--muted); padding: 12px 0; text-align: center; }
    .expense-detail-total { font-size: .88rem; font-weight: 600; color: var(--ink); padding: 8px 0; border-top: 2px solid var(--border2); margin-top: 4px; text-align: right; }
    .expense-detail-add { font-size: .78rem; padding: 6px 16px; align-self: flex-start; }
    /* 底薪工资明细模式：8列布局 */
    .salary-header { min-width: 0; }
    .salary-header span { flex: 0 0 auto; overflow: hidden; box-sizing: border-box; }
    .salary-header span:nth-child(1) { width: 100px; flex: 0 0 100px; min-width: 0; padding-left: 11px; }  /* 明细名称 - 对齐input padding+border */
    .salary-header span:nth-child(2),
    .salary-header span:nth-child(3),
    .salary-header span:nth-child(4),
    .salary-header span:nth-child(5) { width: 90px; flex: 0 0 90px; min-width: 0; text-align: right; padding-right: 11px; }  /* 4列金额 */
    .salary-header span:nth-child(6) { width: 90px; flex: 0 0 90px; min-width: 0; text-align: right; padding-right: 11px; }  /* 合计 */
    .salary-header span:nth-child(7) { flex: 1; min-width: 80px; padding-left: 11px; }  /* 备注 */
    .salary-header span:nth-child(8) { width: 32px; flex: 0 0 32px; min-width: 0; }
    .salary-detail-row { flex-wrap: nowrap; }
    .salary-detail-row .expense-detail-name { width: 100px; flex: 0 0 100px; min-width: 100px; }
    .salary-detail-row .salary-amt { width: 90px; flex: 0 0 90px; }
    .salary-detail-row .salary-row-total { width: 90px; flex: 0 0 90px; background: #f1f5f9; font-weight: 600; color: #1e293b; }
    .salary-detail-row .expense-detail-remark { flex: 1; min-width: 80px; }
    .salary-amt[data-col="0"] { background: #ecfdf5; color: #166534; }
    .salary-amt[data-col="1"],
    .salary-amt[data-col="2"],
    .salary-amt[data-col="3"] { background: #fff7ed; color: #c2410c; }
    .salary-total-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; font-size: .82rem; }
    .salary-total-row b { color: var(--blue); }
    .finance-edit-field input {
      padding: 0 10px;
      border: 1px solid var(--border2);
      border-radius: var(--radius-md);
      font-size: var(--text-base);
      width: 100%;
      height: var(--input-height);
    }
    .finance-edit-field input:focus {
      outline: none;
      border-color: var(--ink);
    }
    .finance-field-auto input { background: var(--bg-alt); color: var(--muted); }
    /* 底薪工资5列横向布局 */
    .finance-salary-block { grid-column: 1 / -1; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 4px; }
    .finance-salary-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
    .finance-salary-title { font-size: .85rem; font-weight: 700; color: var(--ink); }
    .finance-salary-hint { font-size: .72rem; color: var(--muted); }
    .finance-salary-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px 12px; }
    .finance-salary-grid .finance-edit-field { gap: 3px; }
    .finance-salary-grid label { font-size: .73rem; }
    .finance-salary-grid input { font-size: .82rem; padding: 5px 8px; }
    .finance-field-salary-base input { background: #ecfdf5; color: #166534; border-color: #6ee7b7; }
    .finance-field-deduction input { background: #fff7ed; color: #c2410c; }
    .finance-field-income input { background: #ecfdf5; color: #166534; border-color: #6ee7b7; }
    .finance-field-hint { font-size: .72rem; color: var(--muted); }
    .finance-field-salary-total input { background: #f1f5f9; color: #1e293b; font-weight: 700; border-color: #cbd5e1; }
    .finance-field-row { display: flex; align-items: center; gap: 6px; }
    .finance-field-row input { flex: 1; }
    .auto-calc-tag { font-size: .7rem; cursor: help; opacity: .7; }
    .deduction-tag { font-size: .7rem; color: #c2410c; opacity: .7; }
    .finance-row-income-item td { color: #166534; font-size: .85rem; }
    .finance-row-deduction td { color: #c2410c; font-size: .82rem; }
    .finance-edit-field td { cursor: pointer; }
    .finance-edit-remark { grid-column: 1 / -1; }

    /* 日利润趋势柱状图 */
    .finance-daily-trend {
      margin: 0 14px 14px;
      padding: 14px 16px;
      background: var(--card);
      border-radius: var(--radius-lg);
      border: 1px solid var(--rule);
      position: relative;
      z-index: 1;
    }
    .finance-daily-trend-head {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      margin-bottom: 12px;
    }
    .finance-daily-trend-head h3 { margin: 0; font-size: .95rem; color: var(--ink); font-weight: 600; }
    .finance-trend-chart { min-height: 160px; }
    .trend-bar-wrap { display: flex; align-items: flex-end; gap: 8px; height: 140px; padding-top: 20px; }
    .trend-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
    .trend-bar-value { font-size: .72rem; font-weight: 700; color: var(--text); margin-bottom: 4px; white-space: nowrap; }
    .trend-bar-track { flex: 1; width: 100%; max-width: 48px; display: flex; align-items: flex-end; justify-content: center; }
    .trend-bar {
      width: 100%;
      border-radius: var(--radius-sm) var(--radius-sm) 0 0;
      transition: opacity 0.2s ease, transform 0.2s ease;
      cursor: pointer;
      min-height: 2px;
    }
    .trend-bar:hover { opacity: .85; transform: translateY(-2px); }
    .trend-bar-label { font-size: .72rem; color: var(--muted); font-weight: 600; margin-top: 4px; }
    .trend-bar-sub { font-size: .68rem; color: var(--muted-light); }
    .finance-trend-legend { display: flex; gap: 12px; align-items: center; margin-top: 8px; flex-wrap: wrap; }

    @media (max-width: 640px) {
      .finance-edit-grid { grid-template-columns: 1fr 1fr; }
      .finance-card-stats { gap: 16px; flex-wrap: wrap; }
      .finance-card-head { flex-wrap: wrap; }
      .finance-cards { grid-template-columns: 1fr; }
    }

    /* 财务利润正式迁移版：总览与月度核算使用同一套工作台语言。 */
    #finance { padding: 18px; background: #f5f7fa; }
    #finance.active { display: flex; }
    .finance-workspace { min-width: 0; min-height: 0; flex: 1; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--rule); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
    .finance-workspace-head { position: relative; z-index: 12; min-height: 78px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; overflow: visible; border-bottom: 1px solid var(--rule); }
    .finance-workspace-title { min-width: 260px; }
    .finance-workspace-title > span, .finance-workspace-modal-head > div > span { color: #5670b8; font-size: 10px; font-weight: 760; letter-spacing: .08em; text-transform: uppercase; }
    .finance-workspace-title h2 { margin: 3px 0 2px; color: #182841; font-size: 21px; font-weight: 780; letter-spacing: -.4px; }
    .finance-workspace-title p { margin: 0; color: #687993; font-size: 12px; line-height: 1.5; }
    .finance-workspace-head .toolbar { justify-content: flex-end; flex-wrap: wrap; }
    .finance-overview-strip { min-height: 54px; padding: 10px 18px; display: grid; grid-template-columns: minmax(150px,.7fr) repeat(3,minmax(170px,1fr)); align-items: center; gap: 10px; color: #687993; border-bottom: 1px solid #e4e9f0; background: #f8faff; font-size: 12px; }
    .finance-overview-strip > span { min-width: 0; padding-right: 14px; border-right: 1px solid #dde4ee; }
    .finance-overview-strip > span:last-child { border-right: 0; }
    .finance-overview-strip strong { display: block; margin-top: 3px; color: #20324e; font-size: 16px; font-weight: 780; font-variant-numeric: tabular-nums; }
    .finance-workspace-scroll { min-height: 0; flex: 1; overflow-y: auto; }
    .finance-overview-cards { overflow: visible; flex: none; padding: 16px 18px; }
    .finance-overview-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .finance-overview-cards .finance-card { box-shadow: none; border-color: #dfe5ed; }
    .finance-overview-cards .finance-card:hover { transform: none; border-color: #c9d4e3; box-shadow: 0 8px 20px rgba(36,55,84,.06); }
    .finance-overview-cards .finance-card-head { min-height: 132px; padding: 17px 18px; }
    .finance-overview-cards .finance-card-total .finance-card-head { min-height: auto; }
    .finance-month-gate { margin: 16px 18px 0; display: grid; grid-template-columns: minmax(280px,.82fr) minmax(0,1.4fr); gap: 16px; align-items: stretch; padding: 14px 15px; border: 1px solid #d6e0f1; border-radius: 12px; background: #f7f9fe; }
    .finance-month-gate-summary { min-width: 0; display: grid; align-content: center; gap: 4px; padding-right: 16px; border-right: 1px solid #dce4f0; }
    .finance-month-gate-summary > span, .finance-insight-head span { color: #526dbd; font-size: 10px; font-weight: 760; letter-spacing: .08em; text-transform: uppercase; }
    .finance-month-gate-summary strong { color: #21344f; font-size: 16px; }
    .finance-month-gate-summary small { color: #6d7c92; font-size: 10.5px; line-height: 1.5; }
    .finance-month-gate-centers { min-width: 0; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
    .finance-month-gate-centers > span,
    .finance-month-gate-centers button { min-width: 0; min-height: 54px; display: grid; align-content: center; gap: 4px; padding: 8px 10px; color: #536278; border: 1px solid #dce3ed; border-radius: 9px; background: #fff; text-align: left; }
    .finance-month-gate-centers button:hover,
    .finance-month-gate-centers button.is-selected { border-color: #91a8df; background: #f1f5ff; }
    .finance-month-gate-centers button span { overflow: hidden; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
    .finance-month-gate-centers button strong { color: #9a6516; font-size: 10px; }
    .finance-month-gate-centers button.is-locked strong { color: #17745b; }
    .finance-month-gate-centers > span.is-loading { color: #7a8798; font-size: 10.5px; }
    .finance-insight-grid { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(360px,.85fr); gap: 12px; margin: 0 18px 16px; }
    .finance-composition-panel,
    .finance-insight-grid .finance-daily-trend { min-width: 0; margin: 0; padding: 15px 16px; border: 1px solid #dfe5ed; border-radius: 12px; background: #fff; }
    .finance-insight-head,
    .finance-daily-trend-head { min-height: 42px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
    .finance-insight-head h3,
    .finance-daily-trend-head h3 { margin: 3px 0 0; color: #23354f; font-size: 15px; font-weight: 750; }
    .finance-insight-head > small,
    .finance-daily-trend-head > .small-note { color: #748197; font-size: 10.5px; white-space: nowrap; }
    .finance-composition { display: grid; gap: 9px; }
    .finance-composition-row { display: grid; grid-template-columns: 82px minmax(100px,1fr) 108px; gap: 10px; align-items: center; }
    .finance-composition-row > span { color: #617086; font-size: 10.5px; }
    .finance-composition-row > div { height: 9px; overflow: hidden; border-radius: 999px; background: #edf1f5; }
    .finance-composition-row i { display: block; height: 100%; border-radius: inherit; background: #8da3d8; }
    .finance-composition-row.income i { background: #4b6ed6; }
    .finance-composition-row.profit i { background: #1a8a68; }
    .finance-composition-row.loss i { background: #c74a58; }
    .finance-composition-row strong { color: #34445b; text-align: right; font-size: 11.5px; font-variant-numeric: tabular-nums; }
    .finance-composition-row.profit strong { color: #17745b; }
    .finance-composition-row.loss strong { color: #b83e4c; }
    .finance-insight-grid .finance-trend-chart { min-height: 118px; }
    .finance-insight-grid .trend-bar-wrap { height: 116px; padding-top: 14px; }
    .finance-insight-grid .trend-bar-value { display: none; }
    .finance-insight-grid .finance-trend-legend { margin-top: 5px; font-size: 10px; }
    .finance-insight-grid .ui-state { min-height: 116px; }
    .finance-overview-actions { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; padding: 10px 18px 0; }
    .finance-overview-actions button { min-width: 0; min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; color: #263850; border: 1px solid #dfe5ed; border-radius: 11px; background: #fff; text-align: left; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
    .finance-overview-actions button:hover { border-color: #b8c8e8; background: #f8faff; box-shadow: 0 8px 20px rgba(36,55,84,.06); }
    .finance-overview-actions span { min-width: 0; display: grid; gap: 5px; }
    .finance-overview-actions strong { color: #233650; font-size: 13px; }
    .finance-overview-actions small { color: #718097; font-size: 9.5px; line-height: 1.4; }
    .finance-overview-actions b { color: #5270c6; font-size: 20px; font-weight: 500; }

    .finance-workspace-modal { width: min(1320px, 96vw); max-width: 1320px; height: min(900px, 92vh); max-height: 92vh; padding: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: 15px; }
    .finance-workspace-modal-head { flex: 0 0 auto; min-height: 74px; padding: 14px 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--rule); background: #fff; }
    .finance-workspace-modal-head h3 { margin: 3px 0 0; color: #182841; font-size: 20px; font-weight: 780; letter-spacing: -.35px; }
    .finance-workspace-modal-head .finance-edit-month { margin: 3px 0 0; color: #687993; font-size: 11.5px; }
    .finance-workspace-modal-scroll { min-height: 0; flex: 1; overflow-y: auto; padding: 16px 18px 24px; background: #f5f7fa; }
    .finance-workspace-modal .finance-edit-grid { display: block; margin: 0; }
    .finance-workspace-modal-actions { flex: 0 0 auto; min-height: 66px; margin: 0; padding: 11px 20px; border-top: 1px solid var(--rule); background: rgba(255,255,255,.98); box-shadow: 0 -7px 18px rgba(28,46,73,.05); }
    .finance-workspace-modal-actions .btn.primary { min-width: 170px; }

    .finance-edit-section { margin-bottom: 14px; overflow: hidden; border: 1px solid #dce4ee; border-radius: 12px; background: #fff; }
    .finance-edit-section:last-child { margin-bottom: 0; }
    .finance-edit-section.finance-task-focus { border-color: #8da5e5; box-shadow: 0 0 0 3px rgba(65,103,217,.11); }
    .finance-edit-section-head { min-height: 62px; padding: 11px 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid #e4e9f0; }
    .finance-edit-section-head > div { display: grid; gap: 2px; }
    .finance-edit-section-head span { color: #5871b8; font-size: 9.5px; font-weight: 760; letter-spacing: .07em; text-transform: uppercase; }
    .finance-edit-section-head strong { color: #1d2e48; font-size: 15px; font-weight: 760; }
    .finance-edit-section-head small { color: #708098; font-size: 11px; line-height: 1.45; }
    .finance-edit-section-head em { padding: 5px 8px; color: #667792; border-radius: 999px; background: #f0f3f7; font-size: 10px; font-style: normal; white-space: nowrap; }
    .finance-edit-section-grid { padding: 13px 14px 15px; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
    .finance-edit-section .finance-edit-field { min-width: 0; gap: 6px; }
    .finance-edit-section .finance-edit-field label { color: #42546e; font-size: 11.5px; font-weight: 700; }
    .finance-edit-section .finance-edit-field input { height: 40px; color: #1f304a; border-color: #cad6e5; background: #fff; font-size: 13px; font-weight: 560; }
    .finance-edit-section .finance-field-auto input { color: #4e6079; border-color: #dce4ee; background: #f4f7fb; }
    .finance-auto-section .finance-edit-section-grid { grid-template-columns: repeat(5,minmax(0,1fr)); }
    .finance-auto-source-toggle { flex:0 0 auto; white-space:nowrap; }
    .finance-auto-cost-card { min-width:0; min-height:86px; display:grid; align-content:center; gap:6px; padding:12px 13px; border:1px solid #dfe6ef; border-radius:10px; background:#f8fafc; }
    .finance-auto-cost-card span { overflow:hidden; color:#52637b; font-size:11px; font-weight:700; text-overflow:ellipsis; white-space:nowrap; }
    .finance-auto-cost-card strong { color:#1c304d; font-size:18px; font-weight:780; letter-spacing:-.25px; }
    .finance-auto-cost-card small { color:#79879a; font-size:10px; }
    .finance-auto-source-panel { margin:0 14px 15px; padding:13px; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:9px; border:1px solid #dce5f1; border-radius:10px; background:#f5f8fd; }
    .finance-auto-source-panel[hidden] { display:none; }
    .finance-auto-source-panel article { min-width:0; display:grid; gap:4px; padding:9px 10px; border-right:1px solid #dfe6ef; }
    .finance-auto-source-panel article:last-of-type { border-right:0; }
    .finance-auto-source-panel strong { color:#2e4260; font-size:11px; }
    .finance-auto-source-panel span { color:#6d7d94; font-size:10px; line-height:1.5; }
    .finance-auto-source-panel p { grid-column:1/-1; margin:0; padding:9px 10px 0; color:#5f7088; border-top:1px solid #dfe6ef; font-size:10.5px; line-height:1.55; }
    .finance-salary-section .finance-salary-block { margin: 0; padding: 14px; border: 0; border-radius: 0; background: #fff; }
    .finance-salary-section .finance-salary-header { align-items: center; margin-bottom: 12px; }
    .finance-salary-section .finance-salary-title { color: #243650; font-size: 13px; }
    .finance-salary-section .finance-salary-hint { color: #718198; font-size: 11px; }
    .finance-salary-section .finance-salary-grid { grid-template-columns: repeat(5,minmax(0,1fr)); }
    .finance-salary-section .finance-field-salary-base input, .finance-salary-section .finance-field-deduction input { color: #263952; border-color: #d4deea; background: #fff; }
    .finance-salary-section .finance-field-salary-total input { color: #1d7259; border-color: #c9e5dc; background: #f1faf7; }
    .finance-salary-review { display:flex; align-items:center; justify-content:flex-end; gap:8px; min-width:220px; }
    .finance-salary-review-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; flex-wrap:wrap; }
    .finance-copy-salary-btn { white-space:nowrap; border-style:dashed; color:#3158b8; background:#f7f9ff; }
    .finance-copy-salary-btn:hover { background:#eef3ff; border-color:#7d9ce9; }
    .finance-salary-review small { color:#718198; font-size:11px; white-space:nowrap; }
    .finance-review-badge { display:inline-flex; align-items:center; min-height:24px; padding:3px 9px; border-radius:999px; font-size:11px; font-weight:700; white-space:nowrap; }
    .finance-review-badge.reviewed { color:#176b52; background:#eaf7f2; border:1px solid #c8e9dc; }
    .finance-review-badge.draft { color:#9a5b10; background:#fff7e8; border:1px solid #f3d7a6; }
    .finance-review-badge.neutral { color:#53657d; background:#f2f5f8; border:1px solid #dce3eb; }
    .finance-rebate-section .finance-edit-section-head { background: #fbfcff; }
    .finance-rebate-section .finance-edit-section-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .finance-anomaly-chip {
      display: inline-flex;
      align-items: center;
      flex: 0 0 auto;
      max-width: 164px;
      padding: 2px 7px;
      border: 1px solid #fdba74;
      border-radius: 999px;
      color: #9a3412;
      background: #fff7ed;
      font-size: 11px;
      line-height: 1.35;
      white-space: normal;
    }
    .historical-anomaly-row input:disabled { color: #9a3412; opacity: 1; }
    .finance-expense-section .finance-edit-section-head { background: #fcfcfd; }
    .finance-expense-groups { padding: 13px 14px 15px; display: grid; grid-template-columns: minmax(0,.72fr) minmax(0,1.28fr); gap: 12px; }
    .finance-expense-group { min-width: 0; overflow: hidden; border: 1px solid #e0e7f0; border-radius: 10px; background: #f9fbfd; }
    .finance-expense-group > header { min-height: 55px; padding: 9px 12px; display: grid; gap: 3px; border-bottom: 1px solid #e5ebf2; }
    .finance-expense-group > header strong { color: #263850; font-size: 12.5px; font-weight: 740; }
    .finance-expense-group > header small { color: #748198; font-size: 10.5px; }
    .finance-expense-group .finance-edit-section-grid { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 12px; }
    .finance-expense-group-wide { grid-column: 1 / -1; }
    .finance-expense-group-wide .finance-edit-section-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
    .finance-income-section .finance-edit-section-head { background: #f8fbfa; }
    .finance-income-grid { grid-template-columns: minmax(220px,.35fr) minmax(420px,1fr); }
    .finance-income-grid .finance-edit-remark { grid-column: auto; }

    @media (max-width: 1180px) {
      .finance-workspace-head { align-items: flex-start; flex-direction: column; }
      .finance-workspace-head .toolbar { justify-content: flex-start; }
      .finance-overview-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
      .finance-overview-strip > span:nth-child(2) { border-right: 0; }
      .finance-month-gate { grid-template-columns: 1fr; }
      .finance-month-gate-summary { padding-right: 0; padding-bottom: 12px; border-right: 0; border-bottom: 1px solid #dce4f0; }
      .finance-insight-grid { grid-template-columns: 1fr; }
      .finance-overview-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
      .finance-auto-section .finance-edit-section-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
      .finance-auto-source-panel { grid-template-columns:repeat(3,minmax(0,1fr)); }
      .finance-expense-group-wide .finance-edit-section-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
    }
    @media (max-width: 820px) {
      #finance { padding: 10px; }
      .finance-overview-strip, .finance-overview-cards { padding-left: 12px; padding-right: 12px; }
      .finance-edit-section-grid, .finance-auto-section .finance-edit-section-grid, .finance-rebate-section .finance-edit-section-grid, .finance-expense-group-wide .finance-edit-section-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
      .finance-auto-source-panel { grid-template-columns:repeat(2,minmax(0,1fr)); }
      .finance-expense-groups, .finance-income-grid { grid-template-columns: 1fr; }
      .finance-expense-group-wide { grid-column: auto; }
      .finance-salary-section .finance-salary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
      .finance-month-gate-centers { grid-template-columns: repeat(2,minmax(0,1fr)); }
      .finance-overview-cards,
      .finance-overview-actions { grid-template-columns: 1fr; }
    }

    /* 销售页面防收缩 */
    /* 销售工作台：沿用现有业务字段，统一为正式迁移版的卡片与两层商品行 */
    #sales.sales-workspace {
      gap: 14px;
      padding-top: 20px;
      background: #f5f7fa;
    }
    #sales.sales-workspace.active { display: flex; flex-direction: column; }
    #sales.sales-workspace > * { flex: 0 0 auto; }
    #sales .sales-entry-shell {
      display: flex;
      flex-direction: column;
      gap: 12px;
      overflow: visible;
      border: 0;
      background: transparent;
      box-shadow: none;
    }
    #sales .sales-workspace-head,
    #sales .form,
    #sales .table-wrap,
    #sales .summary-line,
    #sales .footer-form,
    #sales .upload-section {
      border: 1px solid var(--rule);
      border-radius: 14px;
      background: var(--card);
      box-shadow: var(--shadow-sm);
    }
    #sales .sales-workspace-head {
      padding: 16px 18px;
      align-items: center;
    }
    #sales .sales-step-progress { position: absolute; top: 10px; right: 14px; z-index: 2; min-height: 22px; display: inline-flex; align-items: center; padding: 0 8px; color: #7a621e; border: 1px solid #ead7a6; border-radius: 999px; background: #fff9ea; font-size: .63rem; font-weight: 700; }
    #sales .sales-step-progress.is-complete { color: #176c54; border-color: #c3e4d9; background: #edf8f4; }
    #sales .sales-workspace-head h2 {
      margin: 0;
      color: var(--ink);
      font-size: 1.15rem;
      font-weight: 760;
      letter-spacing: -.02em;
    }
    #sales .sales-workspace-head .toolbar { gap: 8px; }
    #sales .sales-workspace-head .toolbar .btn {
      min-height: 36px;
      border-radius: 9px;
      font-weight: 650;
    }
    .workspace-more-menu { position: relative; z-index: 40; }
    .workspace-more-menu > summary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; list-style: none; cursor: pointer; user-select: none; }
    .workspace-more-menu > summary::-webkit-details-marker { display: none; }
    .workspace-more-menu > summary::after { content: "⌄"; color: #6d7b90; font-size: 11px; line-height: 1; }
    .workspace-more-menu[open] > summary { color: #2e56b5; border-color: #aebfea; background: #f5f7ff; }
    .workspace-more-menu-panel { position: absolute; top: calc(100% + 7px); right: 0; z-index: 80; min-width: 190px; display: grid; gap: 3px; padding: 7px; border: 1px solid #d7dee8; border-radius: 10px; background: #fff; box-shadow: 0 16px 36px rgba(31,48,74,.16); }
    .workspace-more-menu-panel .btn { width: 100%; min-height: 36px; justify-content: flex-start; padding: 7px 10px; border-color: transparent; background: transparent; text-align: left; white-space: nowrap; }
    .workspace-more-menu-panel .btn:hover { border-color: #e1e7ef; background: #f4f6f9; }
    .workspace-more-menu-panel .btn.danger { color: #b22f40; }
    .workspace-more-menu-panel .btn.danger:hover { border-color: #f0cbd1; background: #fff5f6; }
    #sales #salesOptionsRefreshBtn {
      color: #315a8f;
      border-color: #cdd9e8;
      background: #f7fafe;
    }
    #sales .form {
      position: relative;
      padding: 0;
    }
    #sales .form::before,
    #sales .table-wrap::before,
    #sales .footer-form::before,
    #sales .upload-section::before {
      display: none;
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 40px;
      display: none;
      align-items: center;
      padding: 0 16px;
      border-bottom: 1px solid var(--divider);
      color: var(--ink);
      font-size: .9rem;
      font-weight: 750;
      letter-spacing: -.01em;
      box-sizing: border-box;
    }
    #sales .form::before { content: "1. 客户与车辆"; }
    #sales .table-wrap::before { content: "2. 商品明细"; }
    #sales .footer-form::before { content: "3. 收款信息"; }
    #sales .upload-section::before { content: "4. 销售单照片"; }
    #sales .form-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 12px 14px;
      padding: 16px 18px 18px;
    }
    #sales .form-grid label,
    #sales .footer-form label {
      margin-bottom: 6px;
      color: #526174;
      font-size: .75rem;
      font-weight: 650;
    }
    #sales .form-grid input,
    #sales .form-grid select,
    #sales .footer-form input,
    #sales .footer-form select {
      height: 38px;
      border-radius: 9px;
      background: #fff;
    }
    #sales #orderNo[readonly] {
      color: #526174;
      background: #f4f7fa;
      cursor: not-allowed;
    }
    #sales .sales-line-toolbar {
      display: flex;
      gap: 8px;
      padding: 0 2px;
    }
    #sales .sales-line-toolbar .btn { min-height: 36px; border-radius: 9px; }
    #sales .table-wrap {
      position: relative;
      overflow: visible;
      padding: 0;
    }
    #sales.sales-workspace .sales-form-table { display: table; width: 100%; table-layout: fixed; }
    #sales.sales-workspace .sales-form-table thead { display: table-header-group; }
    #sales.sales-workspace .sales-form-table tbody { display: table-row-group; }
    #sales.sales-workspace .sales-form-table thead tr,
    #sales.sales-workspace .sales-form-table tbody tr {
      display: table-row;
    }
    #sales.sales-workspace .sales-form-table thead tr {
      padding: 0 10px 7px;
      color: #65748a;
      border-bottom: 1px solid var(--divider);
    }
    #sales.sales-workspace .sales-form-table tbody tr {
      background: #fbfcfe;
    }
    #sales.sales-workspace .sales-form-table th,
    #sales.sales-workspace .sales-form-table td {
      width: auto;
      min-width: 0;
      height: auto !important;
      padding: 10px 7px !important;
      border: 0;
      border-bottom: 1px solid #e3e8ef;
      overflow: hidden;
    }
    #sales.sales-workspace .sales-form-table th {
      position: static;
      color: #65748a;
      background: transparent;
      font-size: .72rem;
      font-weight: 650;
      letter-spacing: 0;
      text-transform: none;
    }
    #sales.sales-workspace .sales-form-table th,
    #sales.sales-workspace .sales-form-table td { display: table-cell; }
    #sales.sales-workspace .sales-form-table td .productSearch { width: 100% !important; }
    #sales.sales-workspace .sales-form-table td .owner-material-toggle {
      margin: 5px 0 0;
      padding: 2px 7px;
    }
    #sales.sales-workspace .sales-form-table td:nth-child(6),
    #sales.sales-workspace .sales-form-table td:nth-child(7),
    #sales.sales-workspace .sales-form-table td:nth-child(12) {
      color: #526174;
      font-size: .78rem;
      white-space: normal;
    }
    #sales.sales-workspace .sales-form-table td:nth-child(12) {
      color: #0f7a5a;
      font-size: .86rem;
      font-weight: 750;
      text-align: right;
    }
    #sales .summary-line {
      justify-content: flex-end;
      gap: 0;
      padding: 12px 16px;
      overflow: hidden;
    }
    #sales .summary-line span {
      padding: 0 18px;
      border-right: 1px solid var(--divider);
      color: #65748a;
      font-size: .76rem;
    }
    #sales .summary-line span:last-child { border-right: 0; }
    #sales .summary-line strong { margin-left: 6px; color: var(--ink); font-size: .9rem; }
    #sales .footer-form {
      position: relative;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px 14px;
      padding: 52px 16px 16px;
    }
    #sales .upload-section {
      position: relative;
      padding: 52px 16px 16px;
    }
    #sales .upload-section > label { display: none; }
    #sales .upload-area {
      min-height: 112px;
      border-radius: 10px;
      background: #fafbfd;
    }
    @media (max-width: 1440px) {
      #sales .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
      #sales .footer-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }
    @media (max-width: 980px) {
      #sales .table-wrap { overflow-x: auto; }
      #sales.sales-workspace .sales-form-table { min-width: 880px; }
    }

    #sales .panel-head,
    #sales .form,
    #sales .summary-line,
    #sales .footer-form,
    #sales .upload-section { flex-shrink: 0; }

    /* 销售三步工作台 + 固定审核摘要。业务字段和后端写入协议保持不变。 */
    #sales .sales-workspace-head > div:first-child { min-width: 0; }
    #sales .sales-workspace-head .workspace-eyebrow {
      display: block;
      margin-bottom: 4px;
      color: #4363c2;
      font-size: .68rem;
      font-weight: 750;
      letter-spacing: .08em;
    }
    #sales .sales-workspace-head p {
      margin: 5px 0 0;
      color: #6c7a8f;
      font-size: .78rem;
      line-height: 1.5;
    }
    #sales .sales-layout {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 300px;
      align-items: start;
      gap: 14px;
    }
    #sales .sales-main { min-width: 0; display: grid; gap: 12px; }
    #sales .sales-step-section { min-width:0; max-width:100%; margin:0; box-shadow:var(--shadow-sm); }
    #sales .sales-line-toolbar { padding: 0; }
    #sales .sales-payment-proof {
      overflow: hidden;
      border: 1px solid var(--rule);
      border-radius: 14px;
      background: #fff;
      box-shadow: var(--shadow-sm);
    }
    #sales .sales-section-head {
      min-height: 68px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      padding: 12px 18px;
      border-bottom: 1px solid var(--divider);
    }
    #sales .sales-section-head > div:first-child { min-width: 0; }
    #sales .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
    #sales .sales-section-head h3 { margin: 0; color: var(--ink); font-size: .94rem; font-weight: 760; }
    #sales .sales-section-head p { margin: 4px 0 0; color: #6f7d91; font-size: .72rem; line-height: 1.45; }
    #sales .sales-section-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
    #sales .sales-section-head .sales-step-progress { position: static; flex: 0 0 auto; }
    #sales .sales-field-help { display: block; margin-top: 4px; color: #7b8798; font-size: .64rem; line-height: 1.4; }
    #sales .sales-search-picker { position: relative; min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) 36px; }
    #sales .sales-search-input { min-width: 0; border-radius: 9px 0 0 9px !important; }
    #sales .sales-search-toggle { min-width: 36px; padding: 0; color: #66748a; border: 1px solid #d6dde7; border-left: 0; border-radius: 0 9px 9px 0; background: #fff; cursor: pointer; }
    #sales .sales-search-toggle:hover { color: #3159b7; background: #f5f7fc; }
    .sales-search-menu { position: fixed; z-index: 1180; max-height: 280px; overflow-y: auto; padding: 6px; border: 1px solid #d7dee8; border-radius: 10px; background: #fff; box-shadow: 0 18px 40px rgba(31,48,74,.18); }
    .sales-search-menu[hidden] { display: none; }
    .sales-search-option { width: 100%; min-height: 36px; display: flex; align-items: center; padding: 7px 10px; color: #34445a; border: 0; border-radius: 7px; background: transparent; cursor: pointer; text-align: left; }
    .sales-search-option:hover,
    .sales-search-option[aria-selected="true"] { color: #2f56b3; background: #f0f4ff; }
    .sales-search-empty { padding: 12px; color: #8590a0; text-align: center; font-size: .72rem; }
    #sales .sales-table-scroll { width:100%; min-width:0; max-width:100%; overflow-x:auto; padding:0 14px 14px; }
    #sales.sales-workspace .sales-modern-lines { min-width:880px; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(1) { width: 24%; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(2) { width: 8%; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(3) { width: 7%; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(4) { width: 10%; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(5) { width: 10%; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(6) { width: 14%; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(7) { width: 9%; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(8) { width: 13%; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(9) { width: 5%; }
    #sales.sales-workspace .sales-modern-lines td { vertical-align:top!important; }
    #sales.sales-workspace .sales-modern-lines td input,
    #sales.sales-workspace .sales-modern-lines td select { width: 100%; min-width: 0; box-sizing: border-box; }
    #sales .sales-product-entry { position: relative; }
    #sales .sales-product-entry .projectName { display:block!important; height:34px!important; min-height:34px!important; max-height:34px!important; margin-top:7px!important; color:#5b6980; background:#f8fafc; border-radius:8px!important; font-size:.76rem!important; }
    #sales .sales-product-entry .productSearch { display:block!important; height:36px!important; min-height:36px!important; max-height:36px!important; border-radius:8px!important; font-size:.78rem!important; font-weight:650; }
    #sales .sales-product-meta { min-height: 18px; display: flex; gap: 6px; margin-top: 5px; color: #718096; font-size: .63rem; }
    #sales .sales-product-meta span:not(:empty) + span:not(:empty)::before { content: "· "; }
    #sales .stock-badge { margin-top: 5px; }
    #sales .sales-gift-chip { display: inline-flex; align-items: center; flex-shrink: 0; box-sizing: border-box; margin: 0; padding: 0 5px; height: 18px; color: #784610; border: 1px solid #e7c889; border-radius: 4px; background: #fff3d6; font-size: 11px; line-height: 16px; font-weight: 700; white-space: nowrap; }
    #sales .sales-product-meta .sales-gift-chip::before,
    #sales .sales-product-meta .sales-gift-chip + span::before { content: none; }
    #sales .sales-gift-chip[hidden] { display: none; }
    #orders .order-line-gift-label { display: inline-flex; align-items: center; margin: 2px 0 2px 6px; padding: 3px 9px; color: #784610; border: 1px solid #e7c889; border-radius: 6px; background: #fff3d6; font-size: 12px; line-height: 18px; font-weight: 700; vertical-align: middle; white-space: nowrap; }
    #sales .sales-warehouse-cell { color: #36465e; font-weight: 650; min-width: 94px; }
    #sales .sales-warehouse-cell .warehouse { min-width: 82px; padding-left: 8px; padding-right: 22px; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(2),
    #sales.sales-workspace .sales-modern-lines td:nth-child(2) { width: 100px!important; min-width: 100px!important; }
    #sales .sales-warehouse-cell small { display: block; margin-top: 4px; color: #7b8798; font-size: .65rem; font-weight: 500; }
    #sales .sales-money-input,
    #sales .sales-money-field { display: flex; align-items: center; gap: 4px; color: #6a778a; }
    #sales .sales-money-input input,
    #sales .sales-money-field input { min-width:0; height:34px!important; min-height:34px!important; max-height:34px!important; margin:0!important; padding:0!important; border:0!important; border-radius:0!important; outline:0; background:transparent!important; box-shadow:none!important; font-size:.78rem!important; }
    #sales .sales-money-input { min-height: 36px; padding: 0 8px; border: 1px solid #d8dee8; border-radius: 8px; background: #fff; }
    #sales .sales-money-input:focus-within,
    #sales .sales-money-field:focus-within { border-color:#6780e4; box-shadow:0 0 0 3px rgba(49,89,217,.09); }
    #sales .sales-cost-cell .sales-money-input { background: #f6f8fb; }
    #sales .sales-cost-cell .cost-mode-hint { display: block; margin-top: 5px; color: #718096; font-size: .61rem; line-height: 1.35; }
    #sales .sales-profit-cell { color: #13795b; text-align: right; font-weight: 760; font-variant-numeric: tabular-nums; }
    #sales .sales-line-remove { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; padding: 0; color: #b33a4a; border: 1px solid #efcbd1; border-radius: 8px; background: #fff7f8; cursor: pointer; font-size: 1rem; }
    #sales .sales-line-remove:hover { background: #ffedef; }
    body.role-sales #sales .sales-modern-lines th:nth-child(6),
    body.role-sales #sales .sales-modern-lines th:nth-child(7),
    body.role-sales #sales .sales-modern-lines td:nth-child(6),
    body.role-sales #sales .sales-modern-lines td:nth-child(7),
    body.role-no-profit #sales .sales-modern-lines th:nth-child(7),
    body.role-no-profit #sales .sales-modern-lines td:nth-child(7) { display: none; }
    #sales .sales-payment-fields {
      display: grid;
      grid-template-columns: 160px 190px minmax(280px, 1fr);
      gap: 14px;
      padding: 16px 18px 10px;
      border: 0;
      border-radius: 0;
      background: transparent;
      box-shadow: none;
    }
    #sales .sales-payment-fields .sales-order-note { min-width: 0; }
    #sales .sales-payment-fields .sales-money-field { min-height:38px; padding:0 10px; border:1px solid #d8dee8; border-radius:9px; background:#fff; }
    #sales .sales-proof-panel {
      padding: 4px 18px 16px;
      border: 0;
      border-radius: 0;
      background: transparent;
      box-shadow: none;
    }
    #sales .sales-proof-panel .upload-area { width:100%; max-width:none; min-height:82px; align-self:stretch; border-width:1px; }
    #sales .sales-proof-panel .upload-placeholder { display: flex; align-items: center; justify-content: center; gap: 10px; }
    #sales .sales-proof-panel .upload-placeholder > span:last-child { display: grid; gap: 2px; text-align: left; }
    #sales .sales-proof-panel .upload-placeholder strong { color: #35445a; font-size: .76rem; }
    #sales .sales-proof-panel .upload-placeholder small { color: #798598; font-size: .64rem; }
    #sales .sales-legacy-fields { margin: 0 18px 16px; border: 1px solid #e1e6ee; border-radius: 9px; background: #fafbfd; }
    #sales .sales-legacy-fields summary { padding: 9px 12px; color: #65748a; cursor: pointer; font-size: .7rem; font-weight: 650; }
    #sales .sales-legacy-fields > div { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; padding: 0 12px 10px; }
    #sales .sales-legacy-fields label { display: grid; gap: 4px; color: #6e7b8f; font-size: .66rem; }
    #sales .sales-legacy-fields input { height: 34px; }
    #sales .sales-legacy-fields p { margin: 0; padding: 0 12px 10px; color: #8993a2; font-size: .62rem; }
    #sales .sales-draft-message {
      min-height: 42px;
      align-items: center;
      padding: 10px 13px;
      color: #a34532;
      background: #fff5f1;
      border: 1px solid #f0cfc4;
      border-radius: 10px;
      font-size: .78rem;
      font-weight: 650;
    }
    #sales .sales-draft-message:not([hidden]) { display: flex; }
    #sales .sales-draft-message.sales-draft-issues { display: block; }
    #sales .sales-draft-issues ul { margin: 6px 0 0; padding-left: 20px; }
    #sales .sales-draft-issues li + li { margin-top: 4px; }
    #sales .sales-issue-link {
      display: inline; padding: 2px 0; border: 0; border-radius: 3px;
      background: transparent; color: inherit; font: inherit; text-align: left;
      text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
      white-space: normal; overflow-wrap: anywhere;
    }
    #sales .sales-issue-link:focus-visible { outline: 2px solid #a34532; outline-offset: 3px; }
    #sales .sales-input-error { border-color: #c94939 !important; box-shadow: 0 0 0 2px rgba(201,73,57,.12); }
    #sales .sales-money-input:has(input.sales-input-error),
    #sales .sales-money-field:has(input.sales-input-error) { border-color: #c94939 !important; box-shadow: 0 0 0 2px rgba(201,73,57,.12); }
    #sales .sales-input-message { display: block; margin-top: 5px; color: #b13629; font-size: .75rem; font-weight: 500; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
    #sales .order-summary-card {
      position: sticky;
      top: 16px;
      overflow: hidden;
      background: #fff;
      border: 1px solid var(--rule);
      border-radius: 14px;
      box-shadow: 0 10px 28px rgba(27,43,67,.07);
    }
    #sales .order-summary-card > .workspace-eyebrow,
    #sales .order-summary-card > h3,
    #sales .order-summary-card > p { margin-left: 18px; margin-right: 18px; }
    #sales .order-summary-card > .workspace-eyebrow {
      display: block;
      margin-top: 18px;
      color: #4363c2;
      font-size: .68rem;
      font-weight: 750;
      letter-spacing: .08em;
    }
    #sales .order-summary-card > h3 { margin-top: 5px; margin-bottom: 4px; color: var(--ink); font-size: 1.02rem; }
    #sales .order-summary-card > p { margin-top: 0; margin-bottom: 14px; color: #758296; font-size: .72rem; }
    #sales .order-summary-card dl { margin: 0; padding: 0 18px; border-top: 1px solid var(--divider); border-bottom: 1px solid var(--divider); }
    #sales .order-summary-card dl > div { min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--divider); }
    #sales .order-summary-card dl > div:last-child { border-bottom: 0; }
    #sales .order-summary-card dt { color: #6c798d; font-size: .72rem; }
    #sales .order-summary-card dd { margin: 0; color: #27354a; font-size: .8rem; font-weight: 750; font-variant-numeric: tabular-nums; }
    #sales .order-summary-card .balance { min-height: 50px; }
    #sales .order-summary-card .balance dd { font-size: 1rem; }
    #sales .summary-safety {
      display: grid;
      gap: 3px;
      margin: 14px;
      padding: 10px;
      color: #3d5bab;
      background: #f1f4ff;
      border-radius: 8px;
    }
    #sales .summary-safety strong { font-size: .72rem; }
    #sales .summary-safety small { color: #65738a; font-size: .64rem; line-height: 1.5; }
    #sales .order-summary-card .full-button { width: calc(100% - 28px); min-height: 40px; margin: 0 14px; }
    #sales .summary-footnote { display: block; padding: 9px 14px 14px; color: #8a95a5; text-align: center; font-size: .62rem; line-height: 1.45; }
    body.role-sales #sales .sales-sensitive-summary { display: none; }
    .sales-order-review-dialog { width: min(660px, calc(100vw - 40px)); overflow: hidden; border-radius: 14px; }
    .sales-order-review-dialog > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 18px 20px 14px; border-bottom: 1px solid var(--divider); }
    .sales-order-review-dialog > header h3 { margin: 4px 0; color: var(--ink); font-size: 1.08rem; }
    .sales-order-review-dialog > header p { margin: 0; color: #6c798d; font-size: .75rem; }
    .sales-order-review-body { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; padding: 16px 20px; }
    .sales-order-review-body > div { min-width: 0; display: grid; gap: 4px; padding: 11px 12px; background: #f7f9fc; border: 1px solid #e4e9f0; border-radius: 9px; }
    .sales-order-review-body span { color: #738095; font-size: .68rem; }
    .sales-order-review-body strong { color: #25344a; font-size: .88rem; overflow-wrap: anywhere; }
    .sales-order-review-warning { margin: 0 20px; padding: 11px 12px; color: #8a5a18; background: #fff8e9; border: 1px solid #eedcb8; border-radius: 9px; font-size: .74rem; line-height: 1.5; }
    .sales-order-review-dialog > footer { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 20px 18px; }
    .sales-order-review-dialog > footer .btn { min-width: 116px; }
    #sales .sales-line-nature { display: block; max-width: 100%; margin: 4px 0 0; padding: 0; border: 0; background: transparent; color: var(--blue); font: inherit; font-size: 11px; line-height: 18px; text-align: left; cursor: pointer; }
    #sales .sales-line-nature:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 3px; }
    .sales-line-nature-dialog { width: min(480px, calc(100vw - 32px)); }
    .sales-line-nature-dialog > p { margin: 12px 0; color: var(--muted); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
    .sales-line-nature-dialog .sales-line-nature-summary { color: var(--ink); font-weight: 600; }
    .sales-line-nature-options { display: grid; gap: 10px; margin-top: 18px; }
    .sales-line-nature-options .modal-btn { width: 100%; min-height: 48px; margin: 0; padding: 10px 14px; border: 1px solid var(--rule); background: var(--card); color: var(--ink); text-align: left; white-space: normal; }
    .sales-line-nature-options .modal-btn:hover:not(:disabled), .sales-line-nature-options .modal-btn:focus-visible { border-color: var(--blue); background: var(--blue-soft, #eef3ff); }
    .sales-line-nature-options .modal-btn:disabled { opacity: .5; cursor: not-allowed; }
    .sales-line-nature-dialog .modal-footer { margin-top: 18px; }
    @media (max-width: 1380px) {
      #sales .sales-layout { grid-template-columns: 1fr; }
      #sales .order-summary-card { position: static; }
      #sales .order-summary-card dl { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
      #sales .order-summary-card dl > div { padding: 0 12px; border-right: 1px solid var(--divider); }
    }

    /* —— 10. 响应式 —— */
    @media (max-width: 1200px) {
      .dashboard { grid-template-columns: repeat(3, minmax(0, 1fr)); }
      .home-focus-grid, .home-trend-layout { grid-template-columns: 1fr; }
      .home-trend-layout .store-chart-wrap { padding:18px 0 0; border-top:1px solid var(--divider); border-left:0; }
      .home-bottom-grid { grid-template-columns:1fr 1fr; }
      .footer-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .home-compact, .scope { grid-template-columns: 1fr; }
      .payment-head { flex-direction: column; }
      .payment-head-actions { justify-content: flex-start; }
      .payment-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }
    @media (max-width: 1024px) {
      .form-grid { grid-template-columns: 1fr 1fr; }
    }
    @media (max-width: 768px) {
      .app { grid-template-columns: 1fr; }
      .side {
        position: fixed; top: 0; left: 0; height: 100vh; width: 240px;
        z-index: 200; transform: translateX(-100%);
        transition: transform 0.28s ease;
        padding-top: 60px; border-right: 1px solid var(--rule);
      }
      .side.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
      .side-overlay {
        display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(15,23,42,0.4); z-index: 199;
      }
      .side-overlay.show { display: block; }
      .brand { margin: 0; padding: 0 12px; justify-content: flex-start; }
      .brand .hamburger { display: block; }
      .nav { grid-template-columns: 1fr; gap: 4px; padding: 0 10px 14px; }
      .nav button { padding: 10px 12px; font-size: .85rem; border-radius: var(--radius-md); text-align: left; display: flex; align-items: center; gap: 8px; }
      .nav button span { display: inline; font-size: 1.1rem; margin-bottom: 0; }
      .nav button span.nav-icon { margin: 0; width: 24px; height: 24px; }
      .topbar { min-height: 50px; padding: 8px 14px; flex-wrap: wrap; gap: 6px; }
      /* R01: wrap topbar controls before they can overflow the viewport. */
      .topbar > .user {
        flex: 1 1 100%;
        max-width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
      }
      .topbar > .user > .operation-center { flex: 0 0 auto; }
      .topbar .operation-center-trigger { white-space: nowrap; }
      .topbar > .user > .run-status {
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
      }
      .topbar .mobile-hamburger { display: flex; align-items: center; justify-content: center; background: none; border: 0; font-size: 1.4rem; cursor: pointer; color: var(--ink); width: 38px; height: 38px; border-radius: var(--radius-md); }
      .topbar .mobile-hamburger:hover { background: var(--bg-alt); }
      .title h1 { font-size: 1.1rem; }
      .dashboard { grid-template-columns: 1fr 1fr; }
      .home-intro { align-items:flex-start; flex-direction:column; gap:12px; }
      .home-intro-actions { width:100%; justify-content:space-between; }
      .home-kpis, body.role-sales .home-kpis, .home-bottom-grid { grid-template-columns:1fr; }
      .home-kpis article { min-height:86px; border-right:0; border-bottom:1px solid var(--divider); }
      .home-kpis article:last-child { border-bottom:0; }
      .home-task-item { grid-template-columns:32px minmax(0,1fr) auto; }
      .home-task-value { grid-column:2; }
      .home-task-arrow { grid-column:3; grid-row:1 / span 2; }
      .form-grid { grid-template-columns: 1fr; }
      .footer-form { grid-template-columns: 1fr; }
      .quick { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
      .page.active { padding: 12px 10px 20px; }
      .home-compact { grid-template-columns: 1fr !important; }
      .modal-box { width: 96vw; max-width: 96vw; max-height: 92vh; padding: 18px 14px; border-radius: var(--radius-lg); }
      .modal-box .form-row { grid-template-columns: 1fr; }
      .payment-tabs { grid-template-columns: 1fr; }
      .payment-filter-bar { grid-template-columns: 1fr 1fr; }
      .payment-filter-bar input { grid-column: 1 / -1; }
      .payment-view-note { align-items: flex-start; flex-direction: column; gap: 3px; }
      .summary-line { flex-wrap: wrap; gap: 6px; }
      .scope { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .form-row { grid-template-columns: 1fr !important; }
      button, select, input, .btn { min-height: 38px; }
      input, select { font-size: 16px !important; }
    }
    @media (max-width: 768px) {
      table:has(#salesReportRows) th:nth-child(n+6):nth-child(-n+13),
      table:has(#salesReportRows) td:nth-child(n+6):nth-child(-n+13),
      table:has(#salesReportRows) th:nth-child(16),
      table:has(#salesReportRows) td:nth-child(16),
      table:has(#salesReportRows) th:nth-child(19),
      table:has(#salesReportRows) td:nth-child(19),
      table:has(#salesReportRows) th:nth-child(20),
      table:has(#salesReportRows) td:nth-child(20) {
        display: none;
      }
      table:has(#salesOrderRows) th:nth-child(n+9):nth-child(-n+14),
      table:has(#salesOrderRows) td:nth-child(n+9):nth-child(-n+14) {
        display: none;
      }
      table:has(#stockRows) th:nth-child(5),
      table:has(#stockRows) td:nth-child(5),
      table:has(#stockRows) th:nth-child(8),
      table:has(#stockRows) td:nth-child(8),
      table:has(#stockRows) th:nth-child(10),
      table:has(#stockRows) td:nth-child(10) {
        display: none;
      }
      .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
      .table-wrap::after { content: "← 滑动查看更多 →"; display: block; text-align: center; font-size: 11px; color: var(--muted); padding: 4px; }
    }
    @media (max-width: 480px) {
      .operation-center { position: static; }
      .operation-center-panel {
        top: calc(100% + 4px);
        left: 10px;
        right: 10px;
        width: auto;
        max-height: calc(100vh - 110px);
      }
      .operation-center-head { align-items: flex-start; }
      .operation-center-head span { max-width: 180px; text-align: right; line-height: 1.4; }
      .dashboard { grid-template-columns: 1fr; }
      .quick { grid-template-columns: repeat(2, 1fr); gap: 6px; }
      .quick button { font-size: .82rem; padding: 10px 6px; }
      .quick button .icon { width: 32px; height: 32px; font-size: .8rem; }
      .quick button .icon svg { width: 18px; height: 18px; }
      .scope { grid-template-columns: 1fr; }
      .modal-box { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; padding: 14px 10px; }
      .topbar { padding: 6px 10px; }
      .page.active { padding: 10px 6px 16px; }
      .payment-head, .payment-kpis, .payment-tabs, .payment-filter-bar, .payment-view { padding-left: 12px; padding-right: 12px; }
      .payment-kpis { grid-template-columns: 1fr; }
      .payment-filter-bar { grid-template-columns: 1fr; }
      .payment-filter-bar input { grid-column: auto; }
      .payment-modal { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; overflow-y: auto; }
      .payment-resolution-source { grid-template-columns: 1fr; }
      .home-compact .mini-title { flex-direction: column; align-items: flex-start; gap: 6px; }
      .home-compact .mini-title h2 { font-size: .95rem; }
      .store-chart-wrap canvas { height: 200px !important; }
    }

    /* 单据工作台：在 1920×1080 下保持经营汇总、单据列表与详情同屏。 */
    #orders.orders-workspace.active {
      display: flex;
      flex-direction: column;
      gap: 14px;
      overflow: hidden;
      background: #f5f7fa;
    }
    #orders.orders-workspace .orders-intro,
    #orders.orders-workspace .orders-kpis,
    #orders.orders-workspace .order-action-guide,
    #orders.orders-workspace .orders-panel {
      flex: 0 0 auto;
      border: 1px solid var(--rule);
      border-radius: 14px;
      background: var(--card);
      box-shadow: var(--shadow-sm);
    }
    #orders.orders-workspace .orders-intro {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 20px;
      padding: 16px 18px;
    }
    #orders.orders-workspace .workspace-eyebrow {
      display: block;
      margin-bottom: 3px;
      color: #5270a3;
      font-size: .7rem;
      font-weight: 750;
      letter-spacing: .08em;
      text-transform: uppercase;
    }
    #orders.orders-workspace .orders-intro h2,
    #orders.orders-workspace .order-action-guide h3,
    #orders.orders-workspace .order-detail-panel h3 { margin: 0; color: var(--ink); letter-spacing: -.02em; }
    #orders.orders-workspace .orders-intro h2 { font-size: 1.2rem; }
    #orders.orders-workspace .orders-intro p,
    #orders.orders-workspace .order-action-guide p { margin: 4px 0 0; color: var(--muted); font-size: .78rem; }
    #orders.orders-workspace .primary-action { color: #fff; border-color: #3f67d7; background: #3f67d7; font-weight: 700; }
    #orders.orders-workspace .orders-kpis {
      display: grid;
      grid-template-columns: repeat(5, minmax(0,1fr));
      overflow: hidden;
    }
    #orders.orders-workspace .orders-kpis article {
      min-width: 0;
      padding: 14px 16px;
      border-right: 1px solid var(--divider);
    }
    #orders.orders-workspace .orders-kpis article:last-child { border-right: 0; }
    #orders.orders-workspace .orders-kpis span,
    #orders.orders-workspace .orders-kpis small { display: block; color: var(--muted); font-size: .7rem; }
    #orders.orders-workspace .orders-kpis strong { display: block; margin: 5px 0 3px; color: var(--ink); font-size: 1.08rem; font-variant-numeric: tabular-nums; }
    #orders.orders-workspace .positive { color: #07855f !important; }
    #orders.orders-workspace .negative { color: #c73950 !important; }
    #orders.orders-workspace .order-action-guide { padding: 13px 16px; }
    #orders.orders-workspace .order-action-guide > header { display:flex; align-items:center; justify-content:space-between; gap:14px; }
    #orders.orders-workspace .order-action-guide > header > span { color:#5b6d84; font-size:.7rem; padding:4px 8px; border-radius:999px; background:#eef3f9; }
    #orders.orders-workspace .order-action-guide h3 { font-size: .9rem; }
    #orders.orders-workspace .order-action-guide-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-top:10px; }
    #orders.orders-workspace .order-action-guide-grid article { display:grid; grid-template-columns:30px minmax(0,1fr); gap:9px; align-items:start; padding:10px 11px; border:1px solid var(--divider); border-radius:10px; background:#fafbfd; }
    #orders.orders-workspace .order-action-guide-grid b { width:28px; height:28px; display:flex; align-items:center; justify-content:center; color:#4468b5; border-radius:8px; background:#edf2ff; font-size:.9rem; }
    #orders.orders-workspace .order-action-guide-grid strong,
    #orders.orders-workspace .order-action-guide-grid small { display:block; }
    #orders.orders-workspace .order-action-guide-grid strong { color:var(--ink); font-size:.76rem; }
    #orders.orders-workspace .order-action-guide-grid small { margin-top:3px; color:var(--muted); font-size:.67rem; line-height:1.45; }
    #orders.orders-workspace .orders-panel { flex:1 1 auto; min-height:0; display:flex; flex-direction:column; overflow:hidden; }
    #orders.orders-workspace .orders-toolbar { display:grid; grid-template-columns:minmax(260px,1fr) auto repeat(2,135px) 130px 130px auto auto auto auto; gap:7px; align-items:center; padding:11px 12px; border-bottom:1px solid var(--divider); }
    #orders.orders-workspace .orders-search { min-width:0; height:36px; display:flex; align-items:center; gap:8px; padding:0 10px; border:1px solid var(--border2); border-radius:9px; background:#fff; }
    #orders.orders-workspace .orders-search span { color:#77879a; font-size:1rem; }
    #orders.orders-workspace .orders-search input { width:100%; min-width:0; height:32px; padding:0; border:0; outline:0; background:transparent; font-size:.78rem; }
    #orders.orders-workspace .orders-range { display:flex; overflow:hidden; border:1px solid var(--border2); border-radius:9px; }
    #orders.orders-workspace .orders-range button { height:34px; padding:0 9px; color:#5d6a7c; border:0; border-right:1px solid var(--divider); background:#fff; font-size:.7rem; cursor:pointer; }
    #orders.orders-workspace .orders-range button:last-child { border-right:0; }
    #orders.orders-workspace .orders-date-input,
    #orders.orders-workspace .orders-toolbar select { width:100%; height:36px; padding:0 8px; border:1px solid var(--border2); border-radius:9px; color:#405064; background:#fff; font-size:.72rem; }
    #orders.orders-workspace .orders-toolbar .btn { height:36px; padding:0 10px; font-size:.72rem; }
    #orders.orders-workspace .orders-body { flex:1; min-height:0; display:grid; grid-template-columns:minmax(0,1fr) 0; overflow:hidden; }
    #orders.orders-workspace .orders-body.with-detail { grid-template-columns:minmax(0,1fr) 340px; }
    #orders.orders-workspace .orders-table-wrap { min-width:0; overflow:auto; }
    #orders.orders-workspace .orders-pagination { min-height:48px; display:flex; align-items:center; justify-content:space-between; gap:16px; padding:8px 12px; color:#6f7e91; border-top:1px solid var(--divider); background:#fbfcfd; font-size:.72rem; }
    #orders.orders-workspace .orders-pagination > div { display:flex; align-items:center; gap:9px; }
    #orders.orders-workspace .orders-pagination strong { min-width:52px; color:#2f4056; font-size:.74rem; text-align:center; font-variant-numeric:tabular-nums; }
    #orders.orders-workspace .orders-pagination .btn { min-width:64px; height:32px; padding:0 10px; font-size:.7rem; }
    #orders.orders-workspace .orders-pagination .btn:disabled { color:#a3adba; border-color:#e4e8ee; background:#f5f7fa; cursor:not-allowed; }
    #orders.orders-workspace .orders-table { width:100%; min-width:1030px; border-collapse:collapse; table-layout:fixed; }
    #orders.orders-workspace .orders-table th { position:sticky; top:0; z-index:2; padding:10px 11px; color:#66768a; border-bottom:1px solid var(--divider); background:#f5f7fa; font-size:.68rem; font-weight:700; text-align:left; }
    #orders.orders-workspace .orders-table td { padding:11px; color:#344356; border-bottom:1px solid var(--divider); font-size:.72rem; vertical-align:middle; }
    #orders.orders-workspace .orders-table tbody tr { cursor:pointer; transition:background .12s ease; }
    #orders.orders-workspace .orders-table tbody tr:hover,
    #orders.orders-workspace .orders-table tbody tr.selected { background:#f2f6ff; }
    #orders.orders-workspace .orders-table td strong,
    #orders.orders-workspace .orders-table td small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    #orders.orders-workspace .orders-table td strong { color:#26364a; font-size:.74rem; }
    #orders.orders-workspace .orders-table td small { margin-top:3px; color:#7b899a; font-size:.65rem; }
    #orders.orders-workspace .orders-table th:nth-child(1) { width:12%; }
    #orders.orders-workspace .orders-table th:nth-child(2) { width:7%; }
    #orders.orders-workspace .orders-table th:nth-child(3) { width:8%; }
    #orders.orders-workspace .orders-table th:nth-child(4) { width:11%; }
    #orders.orders-workspace .orders-table th:nth-child(5) { width:11%; }
    #orders.orders-workspace .orders-table th:nth-child(6) { width:9%; }
    #orders.orders-workspace .orders-table th:nth-child(7),
    #orders.orders-workspace .orders-table th:nth-child(8) { width:10%; }
    #orders.orders-workspace .orders-table th:nth-child(9) { width:16%; }
    #orders.orders-workspace .orders-table th:nth-child(10) { width:6%; }
    #orders.orders-workspace .orders-toolbar {display:flex;flex-wrap:wrap;gap:8px}
    #orders.orders-workspace .orders-toolbar .orders-search {flex:1 1 220px}
    #orders.orders-workspace .orders-toolbar select {width:120px}
    #orders.orders-workspace .orders-toolbar .orders-date-input {width:136px;flex:0 0 136px}
    #orders.orders-workspace .orders-range button.is-selected {background:#eaf0ff;color:#315ed3;box-shadow:inset 0 -2px #4167d9}
    #orders.orders-workspace .orders-result-toolbar {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;padding:12px;border-bottom:1px solid var(--divider)}
    #orders.orders-workspace .orders-result-actions {display:flex;flex-wrap:wrap;gap:8px;margin-left:auto}
    #ordersReadStatus {font-size:12px;line-height:1.6;color:#64748b;flex:1 1 280px}
    #ordersReadStatus[data-state=loading] {color:#4167d9}
    #ordersReadStatus[data-state=error] {color:#a56513}
    #ordersReadStatus[data-state=loading]:before {content:'';display:inline-block;width:12px;height:12px;margin-right:8px;border:2px solid #dbe5fb;border-top-color:#4167d9;border-radius:50%;animation:home-load-spin 1s linear infinite}
    #orders .order-note-preview {display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:none;border:0;padding:4px 0;color:#52647d;font:inherit;cursor:pointer;text-align:left}
    #orders .order-note-preview:hover {color:#315fd4;text-decoration:underline}
    #orders .order-note-empty {color:#94a3b8}
    #orderNoteDialog {max-width:min(480px,90vw);border:1px solid #dce3ed;border-radius:12px;padding:24px;color:#26364a}
    #orderNoteDialog p {white-space:pre-wrap;overflow-wrap:anywhere;max-height:60vh;overflow:auto;line-height:1.7}
    #orderNoteDialog::backdrop {background:#14243d66}
    #stockSummaryReadStatus {font-size:12px;line-height:1.6;color:#64748b;padding:8px 12px;background:#f5f8fc;border-bottom:1px solid #e3e9f1}
    .workspace-refresh-feedback {font-size:12px;line-height:1.6;color:#64748b;max-width:280px;overflow-wrap:anywhere}
    .workspace-refresh-feedback[data-state=loading] {color:#4167d9}
    .workspace-refresh-feedback[data-state=error] {color:#a56513}
    .workspace-filter-feedback {padding:6px 12px;color:#64748b;font-size:12px;line-height:1.6;overflow-wrap:anywhere}
    @media(prefers-reduced-motion:reduce){#ordersReadStatus:before,.data-refresh-control[aria-busy=true]:before{animation:none!important}}
    #orders.orders-workspace .numeric-text { text-align:right; font-variant-numeric:tabular-nums; }
    #orders.orders-workspace .text-action { padding:5px 7px; color:#3f67d7; border:0; background:transparent; font-size:.7rem; font-weight:700; cursor:pointer; }
    #orders.orders-workspace .order-status { display:inline-flex; align-items:center; justify-content:center; min-width:58px; padding:4px 7px; border-radius:999px; color:#526174; background:#edf1f6; font-size:.65rem; font-weight:700; }
    #orders.orders-workspace .order-status.approved { color:#087258; background:#e4f6ef; }
    #orders.orders-workspace .order-status.returned { color:#a96408; background:#fff2dc; }
    #orders.orders-workspace .order-status.voided { color:#b42d47; background:#fde9ed; }
    #orders.orders-workspace .order-detail-panel { min-width:0; overflow:auto; padding:15px 16px; border-left:1px solid var(--divider); background:#fbfcfd; }
    #orders.orders-workspace .order-detail-panel:empty { display:none; }
    #orders.orders-workspace .detail-drawer-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:10px; }
    #orders.orders-workspace .detail-drawer-head h3 { font-size:1rem; }
    #orders.orders-workspace .icon-button { width:30px; height:30px; padding:0; color:#64748b; border:1px solid var(--rule); border-radius:8px; background:#fff; font-size:1.05rem; cursor:pointer; }
    #orders.orders-workspace .detail-customer { display:grid; gap:4px; margin:13px 0; padding:11px; border:1px solid var(--divider); border-radius:10px; background:#fff; }
    #orders.orders-workspace .detail-customer strong { color:var(--ink); font-size:.8rem; }
    #orders.orders-workspace .detail-customer span { color:var(--muted); font-size:.68rem; }
    #orders.orders-workspace .order-detail-panel dl { margin:0; }
    #orders.orders-workspace .order-detail-panel dl > div { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.1fr); gap:12px; padding:9px 0; border-bottom:1px solid var(--divider); }
    #orders.orders-workspace .order-detail-panel dt { color:var(--muted); font-size:.68rem; }
    #orders.orders-workspace .order-detail-panel dd { margin:0; color:#2e3e51; font-size:.72rem; text-align:right; line-height:1.45; }
    #orders.orders-workspace .detail-note { margin-top:12px; }
    #orders.orders-workspace .detail-note span { color:var(--muted); font-size:.68rem; }
    #orders.orders-workspace .detail-note p { margin:5px 0; color:#3f4f61; font-size:.72rem; line-height:1.55; }
    #orders.orders-workspace .detail-timeline { display:grid; gap:6px; margin:12px 0; padding:10px; color:#17755c; border-radius:10px; background:#eaf7f2; font-size:.68rem; }
    #orders.orders-workspace .detail-timeline .void-step { color:#b42d47; }
    #orders.orders-workspace .detail-timeline .pending-step,
    #orders.orders-workspace .order-detail-panel .pending-return { color:#a96408; font-weight:700; }
    #orders.orders-workspace .detail-actions { display:grid; grid-template-columns:1fr 1fr; gap:7px; padding-top:12px; border-top:1px solid var(--divider); }
    #orders.orders-workspace .detail-actions .btn { width:100%; height:34px; padding:0 8px; font-size:.69rem; }
    #orders.orders-workspace .danger-action { color:#fff; border-color:#cf3e55; background:#cf3e55; }
    #orders.orders-workspace .detail-actions button:disabled { color:#8895a5; border-color:#dce2e8; background:#eef1f4; cursor:not-allowed; }
    #orders.orders-workspace .support-order-badge { display:block; width:max-content; margin-top:4px; padding:2px 5px; color:#735c12; border-radius:5px; background:#fff0bd; font-size:.58rem; }
    #salesReturnModal { z-index:1002; padding:24px; }
    #salesReturnModal .sales-return-dialog { width:min(1180px,96vw); max-height:92vh; display:flex; flex-direction:column; overflow:hidden; color:var(--text); border:1px solid var(--divider); border-radius:18px; background:#fff; box-shadow:0 24px 70px rgba(22,38,62,.24); }
    #salesReturnModal .sales-return-head { display:flex; align-items:flex-start; justify-content:space-between; gap:24px; padding:20px 22px 16px; border-bottom:1px solid var(--divider); }
    #salesReturnModal .sales-return-head h3 { margin:3px 0 4px; color:var(--ink); font-size:1.1rem; letter-spacing:-.02em; }
    #salesReturnModal .sales-return-head p { margin:0; color:var(--muted); font-size:.74rem; }
    #salesReturnModal .workspace-eyebrow { color:#4266b2; font-size:.66rem; font-weight:800; letter-spacing:.08em; }
    #salesReturnModal .sales-return-boundary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; padding:14px 22px; border-bottom:1px solid var(--divider); background:#f7f9fc; }
    #salesReturnModal .sales-return-boundary article { min-width:0; padding:11px 12px; border:1px solid #dfe6ef; border-radius:10px; background:#fff; }
    #salesReturnModal .sales-return-boundary b,
    #salesReturnModal .sales-return-boundary strong,
    #salesReturnModal .sales-return-boundary span { display:block; }
    #salesReturnModal .sales-return-boundary b { color:#748297; font-size:.62rem; }
    #salesReturnModal .sales-return-boundary strong { margin:4px 0; color:#26374c; font-size:.75rem; }
    #salesReturnModal .sales-return-boundary span { color:#6e7c8e; font-size:.66rem; line-height:1.48; }
    #salesReturnModal .sales-return-body { min-height:220px; flex:1; overflow:auto; padding:16px 22px 18px; }
    #salesReturnModal .sales-return-loading,
    #salesReturnModal .sales-return-error { min-height:190px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:9px; color:var(--muted); font-size:.76rem; text-align:center; }
    #salesReturnModal .sales-return-error strong { color:var(--ink); font-size:.9rem; }
    #salesReturnModal .sales-return-lines { display:grid; gap:9px; }
    #salesReturnModal .sales-return-line { display:grid; grid-template-columns:minmax(250px,1.35fr) 190px minmax(260px,1.15fr) 130px; gap:13px; align-items:center; padding:12px 14px; border:1px solid var(--divider); border-radius:11px; background:#fff; transition:border-color .15s ease,background .15s ease; }
    #salesReturnModal .sales-return-line.selected { border-color:#9eb5ea; background:#f7f9ff; }
    #salesReturnModal .sales-return-check { min-width:0; display:flex; align-items:center; gap:10px; cursor:pointer; }
    #salesReturnModal .sales-return-check input { width:16px; height:16px; flex:0 0 auto; accent-color:#4268dc; }
    #salesReturnModal .sales-return-check span,
    #salesReturnModal .sales-return-check strong,
    #salesReturnModal .sales-return-check small { min-width:0; display:block; }
    #salesReturnModal .sales-return-check strong { overflow:hidden; color:#233349; font-size:.78rem; text-overflow:ellipsis; white-space:nowrap; }
    #salesReturnModal .sales-return-check small { margin-top:3px; overflow:hidden; color:#738196; font-size:.65rem; text-overflow:ellipsis; white-space:nowrap; }
    #salesReturnModal .sales-return-quantity,
    #salesReturnModal .sales-return-disposition { display:grid; gap:4px; }
    #salesReturnModal .sales-return-quantity span,
    #salesReturnModal .sales-return-disposition > span,
    #salesReturnModal .sales-return-line-value span { color:#718094; font-size:.64rem; }
    #salesReturnModal .sales-return-quantity input,
    #salesReturnModal .sales-return-disposition select { width:100%; height:35px; padding:0 9px; color:#2d3c50; border:1px solid var(--border2); border-radius:8px; background:#fff; font-size:.72rem; }
    #salesReturnModal .sales-return-quantity input:disabled,
    #salesReturnModal .sales-return-disposition select:disabled { color:#9aa5b3; background:#f3f5f7; }
    #salesReturnModal .sales-return-line-value { display:grid; gap:5px; text-align:right; }
    #salesReturnModal .sales-return-line-value strong { color:#233349; font-size:.8rem; font-variant-numeric:tabular-nums; }
    #salesReturnModal .sales-return-form-grid { display:grid; grid-template-columns:minmax(0,1.55fr) minmax(280px,.8fr); gap:14px; margin-top:14px; padding-top:14px; border-top:1px solid var(--divider); }
    #salesReturnModal .sales-return-form-grid label { display:grid; gap:5px; color:#4a596d; font-size:.68rem; font-weight:700; }
    #salesReturnModal .sales-return-form-grid textarea,
    #salesReturnModal .sales-return-form-grid select { width:100%; min-height:42px; padding:9px 10px; color:#2b3a4f; border:1px solid var(--border2); border-radius:9px; background:#fff; font:inherit; font-size:.73rem; }
    #salesReturnModal .sales-return-form-grid textarea { min-height:72px; resize:vertical; }
    #salesReturnModal .sales-return-form-grid small { color:#7b8999; font-size:.63rem; font-weight:400; }
    #salesReturnModal .sales-return-footer { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:14px 22px; border-top:1px solid var(--divider); background:#fbfcfe; }
    #salesReturnModal .sales-return-summary { min-width:0; display:flex; flex-wrap:wrap; gap:9px 18px; color:#6e7c8e; font-size:.68rem; }
    #salesReturnModal .sales-return-summary strong { margin-left:4px; color:#223349; font-size:.76rem; font-variant-numeric:tabular-nums; }
    #salesReturnModal .sales-return-summary .review { color:#a26308; font-weight:700; }
    #salesReturnModal .sales-return-summary .direct { color:#087258; font-weight:700; }
    #salesReturnModal .sales-return-actions { flex:0 0 auto; display:flex; gap:8px; }
    #salesReturnModal .sales-return-actions .btn { min-width:104px; height:36px; }
    #salesReturnReviewModal { z-index:1002; padding:24px; }
    #salesReturnReviewModal .sales-return-review-dialog { width:min(1050px,95vw); max-height:90vh; display:flex; flex-direction:column; overflow:hidden; border:1px solid var(--divider); border-radius:18px; background:#fff; box-shadow:0 24px 70px rgba(22,38,62,.24); }
    #salesReturnReviewModal .sales-return-review-dialog > header { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; padding:20px 22px 16px; border-bottom:1px solid var(--divider); }
    #salesReturnReviewModal .sales-return-review-dialog h3 { margin:3px 0 4px; color:var(--ink); font-size:1.08rem; }
    #salesReturnReviewModal .sales-return-review-dialog header p { margin:0; color:var(--muted); font-size:.72rem; }
    #salesReturnReviewModal .sales-return-review-body { min-height:260px; display:grid; gap:11px; overflow:auto; padding:16px 22px 20px; background:#f7f9fc; }
    #salesReturnReviewModal .return-review-card { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(230px,.65fr); gap:16px 22px; padding:16px; border:1px solid var(--divider); border-radius:12px; background:#fff; }
    #salesReturnReviewModal .return-review-main h4 { margin:8px 0 3px; color:#24354a; font-size:.88rem; }
    #salesReturnReviewModal .return-review-main > p { margin:0 0 10px; color:#6f7d90; font-size:.68rem; }
    #salesReturnReviewModal .return-review-main ul { display:grid; gap:6px; margin:0; padding:0; list-style:none; }
    #salesReturnReviewModal .return-review-main li { display:flex; justify-content:space-between; gap:14px; padding:8px 9px; border-radius:8px; background:#f5f7fa; font-size:.69rem; }
    #salesReturnReviewModal .return-review-main li span { color:#6f7d90; }
    #salesReturnReviewModal .return-review-reason { display:grid; gap:3px; margin-top:10px; color:#6f7d90; font-size:.64rem; }
    #salesReturnReviewModal .return-review-reason strong { color:#344458; font-size:.7rem; font-weight:600; }
    #salesReturnReviewModal .return-review-card dl { margin:0; }
    #salesReturnReviewModal .return-review-card dl > div { display:grid; grid-template-columns:1fr 1.2fr; gap:10px; padding:7px 0; border-bottom:1px solid var(--divider); font-size:.68rem; }
    #salesReturnReviewModal .return-review-card dt { color:#748195; }
    #salesReturnReviewModal .return-review-card dd { margin:0; color:#2c3d51; text-align:right; font-weight:700; }
    #salesReturnReviewModal .return-review-actions { grid-column:1 / -1; display:flex; justify-content:flex-end; gap:8px; padding-top:10px; border-top:1px solid var(--divider); }
    #salesReturnReviewModal .return-review-actions .btn { min-width:120px; height:35px; }
    #salesReturnHistoryModal { z-index:1002; padding:24px; }
    #salesReturnHistoryModal .sales-return-history-dialog { width:min(980px,95vw); max-height:90vh; display:flex; flex-direction:column; overflow:hidden; border:1px solid var(--divider); border-radius:18px; background:#fff; box-shadow:0 24px 70px rgba(22,38,62,.24); }
    #salesReturnHistoryModal .sales-return-history-dialog > header { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; padding:20px 22px 16px; border-bottom:1px solid var(--divider); }
    #salesReturnHistoryModal .sales-return-history-dialog h3 { margin:3px 0 4px; color:var(--ink); font-size:1.08rem; }
    #salesReturnHistoryModal .sales-return-history-dialog header p { margin:0; color:var(--muted); font-size:.72rem; }
    #salesReturnHistoryModal .sales-return-history-body { min-height:260px; display:grid; gap:12px; overflow:auto; padding:16px 22px 20px; background:#f7f9fc; }
    #salesReturnHistoryModal .return-history-card { padding:16px; border:1px solid var(--divider); border-radius:12px; background:#fff; }
    #salesReturnHistoryModal .return-history-card > header { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; }
    #salesReturnHistoryModal .return-history-card h4 { margin:8px 0 3px; color:#24354a; font-size:.88rem; }
    #salesReturnHistoryModal .return-history-card header p { margin:0; color:#6f7d90; font-size:.68rem; }
    #salesReturnHistoryModal .return-next-handler { flex:0 0 auto; display:grid; gap:3px; min-width:138px; padding:9px 11px; border-radius:9px; background:#eef3ff; text-align:right; }
    #salesReturnHistoryModal .return-next-handler span { color:#6b7b91; font-size:.62rem; }
    #salesReturnHistoryModal .return-next-handler strong { color:#3157c7; font-size:.74rem; }
    #salesReturnHistoryModal .return-history-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(280px,.85fr); gap:18px; margin-top:13px; }
    #salesReturnHistoryModal .return-history-grid h5 { margin:0 0 7px; color:#536277; font-size:.67rem; }
    #salesReturnHistoryModal .return-history-products { display:grid; gap:6px; margin:0; padding:0; list-style:none; }
    #salesReturnHistoryModal .return-history-products li { display:flex; justify-content:space-between; gap:14px; padding:8px 9px; border-radius:8px; background:#f5f7fa; font-size:.69rem; }
    #salesReturnHistoryModal .return-history-products span { color:#6f7d90; }
    #salesReturnHistoryModal .return-history-grid dl { margin:0; }
    #salesReturnHistoryModal .return-history-grid dl > div { display:grid; grid-template-columns:78px 1fr; gap:10px; padding:7px 0; border-bottom:1px solid var(--divider); font-size:.68rem; }
    #salesReturnHistoryModal .return-history-grid dt { color:#748195; }
    #salesReturnHistoryModal .return-history-grid dd { margin:0; color:#2c3d51; text-align:right; font-weight:650; }
    #salesReturnHistoryModal .return-history-timeline { display:flex; flex-wrap:wrap; gap:8px 18px; margin:13px 0 0; padding:11px 12px; border-radius:9px; background:#f8fafc; list-style:none; }
    #salesReturnHistoryModal .return-history-timeline li { display:grid; gap:2px; min-width:170px; color:#617086; font-size:.63rem; }
    #salesReturnHistoryModal .return-history-timeline b { color:#33445a; font-size:.68rem; }
    #salesReturnHistoryModal .return-history-timeline small { color:#7a8798; }
    #salesReturnHistoryModal .return-history-card > footer { display:flex; justify-content:flex-end; margin-top:12px; padding-top:11px; border-top:1px solid var(--divider); }
    @media (max-width: 1440px) {
      #orders.orders-workspace .orders-toolbar { grid-template-columns:minmax(240px,1fr) auto repeat(2,120px) 112px 112px auto auto auto auto; }
      #orders.orders-workspace .orders-body.with-detail { grid-template-columns:minmax(0,1fr) 315px; }
    }
    @media (max-width: 1180px) {
      #orders.orders-workspace.active { overflow:auto; }
      #orders.orders-workspace .orders-kpis { grid-template-columns:repeat(3,minmax(0,1fr)); }
      #orders.orders-workspace .orders-kpis article { border-bottom:1px solid var(--divider); }
      #orders.orders-workspace .orders-toolbar { grid-template-columns:minmax(260px,1fr) auto repeat(2,130px); }
      #orders.orders-workspace .orders-toolbar > select,
      #orders.orders-workspace .orders-toolbar > .btn { width:auto; }
      #orders.orders-workspace .orders-panel { min-height:520px; }
    }
    @media (max-width: 980px) {
      #orders.orders-workspace .order-action-guide-grid { grid-template-columns:1fr; }
      #orders.orders-workspace .orders-body,
      #orders.orders-workspace .orders-body.with-detail { display:block; overflow:auto; }
      #orders.orders-workspace .order-detail-panel { border-top:1px solid var(--divider); border-left:0; }
      #orders.orders-workspace .orders-toolbar { grid-template-columns:1fr 1fr; }
      #orders.orders-workspace .orders-search { grid-column:1 / -1; }
      #orders.orders-workspace .orders-pagination { align-items:flex-start; flex-direction:column; }
      #salesReturnModal { padding:0; }
      #salesReturnModal .sales-return-dialog { width:100vw; height:100vh; max-height:100vh; border:0; border-radius:0; }
      #salesReturnModal .sales-return-boundary { grid-template-columns:1fr; }
      #salesReturnModal .sales-return-line { grid-template-columns:1fr 1fr; }
      #salesReturnModal .sales-return-check { grid-column:1 / -1; }
      #salesReturnModal .sales-return-form-grid { grid-template-columns:1fr; }
      #salesReturnModal .sales-return-footer { align-items:stretch; flex-direction:column; }
      #salesReturnReviewModal { padding:0; }
      #salesReturnReviewModal .sales-return-review-dialog { width:100vw; height:100vh; max-height:100vh; border:0; border-radius:0; }
      #salesReturnReviewModal .return-review-card { grid-template-columns:1fr; }
      #salesReturnHistoryModal { padding:0; }
      #salesReturnHistoryModal .sales-return-history-dialog { width:100vw; height:100vh; max-height:100vh; border:0; border-radius:0; }
      #salesReturnHistoryModal .return-history-grid { grid-template-columns:1fr; }
    }

    /* 全量盘点：任务、盲盘录入与差异复核使用同一套工作区语言。 */
    #stockTabCounts { padding:18px; color:#26384d; }
    #stockTabCounts .stock-check-workspace-head,
    #stockTabCounts .stock-check-detail-head { display:flex; align-items:flex-start; justify-content:space-between; gap:22px; }
    #stockTabCounts h3 { margin:0; color:#1f3044; font-size:1rem; line-height:1.35; }
    #stockTabCounts p { margin:5px 0 0; color:#748296; font-size:.69rem; line-height:1.55; }
    #stockTabCounts .stock-check-create-actions,
    #stockTabCounts .stock-check-detail-actions { display:flex; align-items:center; gap:8px; }
    #stockTabCounts .stock-check-create-actions label { color:#66758a; font-size:.68rem; font-weight:700; white-space:nowrap; }
    #stockTabCounts .stock-check-create-actions select { width:126px; height:36px; }
    #stockTabCounts .stock-check-stage-guide { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:1px; overflow:hidden; margin:16px 0 10px; border:1px solid #dde4ee; border-radius:11px; background:#dde4ee; }
    #stockTabCounts .stock-check-stage-guide span { position:relative; display:grid; grid-template-columns:28px 1fr; grid-template-rows:auto auto; column-gap:9px; padding:11px 14px; background:#f8fafc; }
    #stockTabCounts .stock-check-stage-guide b { grid-row:1 / 3; width:28px; height:28px; display:grid; place-items:center; color:#4064d7; border-radius:50%; background:#eaf0ff; font-size:.69rem; }
    #stockTabCounts .stock-check-stage-guide strong { color:#314257; font-size:.73rem; }
    #stockTabCounts .stock-check-stage-guide small { color:#7b899a; font-size:.62rem; }
    #stockTabCounts .stock-check-role-hint { min-height:22px; color:#718095; font-size:.66rem; }
    #stockTabCounts .stock-check-task-table-wrap,
    #stockTabCounts .stock-check-detail-table-wrap { overflow:auto; border:1px solid #dde4ee; border-radius:11px; background:#fff; }
    #stockTabCounts .stock-check-list-table,
    #stockTabCounts .stock-check-detail-table { width:100%; border-collapse:collapse; table-layout:fixed; }
    #stockTabCounts .stock-check-list-table th,
    #stockTabCounts .stock-check-detail-table th { padding:9px 11px; color:#66758a; background:#f7f9fc; font-size:.63rem; font-weight:700; text-align:left; }
    #stockTabCounts .stock-check-list-table td,
    #stockTabCounts .stock-check-detail-table td { padding:10px 11px; border-top:1px solid #e8edf3; color:#334458; font-size:.69rem; vertical-align:middle; }
    #stockTabCounts .stock-check-task-row { cursor:pointer; }
    #stockTabCounts .stock-check-task-row:hover { background:#f8faff; }
    #stockTabCounts .stock-check-no { color:#24364d; font-weight:750; }
    #stockTabCounts .stock-check-row-actions { display:flex; align-items:center; gap:10px; white-space:nowrap; }
    #stockTabCounts .stock-check-status { display:inline-flex; align-items:center; min-height:24px; padding:0 9px; border-radius:999px; font-size:.62rem; font-weight:750; }
    #stockTabCounts .stock-check-status.is-draft { color:#5e6d80; background:#eef1f5; }
    #stockTabCounts .stock-check-status.is-review { color:#9a5a08; background:#fff2db; }
    #stockTabCounts .stock-check-status.is-done { color:#087258; background:#e6f6f0; }
    #stockTabCounts .danger-quiet { color:#bc3348; border-color:#efc8cf; }
    #stockTabCounts .stock-check-detail-head { padding-bottom:14px; border-bottom:1px solid #e3e9f1; }
    #stockTabCounts .stock-check-detail-actions { flex-wrap:wrap; }
    #stockTabCounts .stock-check-detail-actions button:disabled { opacity:.48; cursor:not-allowed; box-shadow:none; }
    #stockTabCounts .text-button { margin:0 0 7px; padding:0; color:#4568ce; border:0; background:transparent; font-size:.67rem; cursor:pointer; }
    #stockTabCounts .stock-check-stage-alert { margin:12px 0; padding:10px 12px; color:#7d570d; border:1px solid #ead19a; border-radius:9px; background:#fff9ec; font-size:.69rem; }
    #stockTabCounts .stock-check-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:9px; margin-bottom:11px; }
    #stockTabCounts .stock-check-metrics > div { display:flex; align-items:center; justify-content:space-between; padding:10px 12px; border:1px solid #e0e6ef; border-radius:9px; background:#fbfcfe; }
    #stockTabCounts .stock-check-metrics span { color:#718095; font-size:.65rem; }
    #stockTabCounts .stock-check-metrics strong { color:#27394e; font-size:.78rem; font-variant-numeric:tabular-nums; }
    #stockTabCounts .stock-check-detail-toolbar { display:grid; grid-template-columns:minmax(280px,1fr) 150px; gap:8px; margin-bottom:10px; }
    #stockTabCounts .stock-check-detail-toolbar .form-control { height:35px; }
    #stockTabCounts .stock-check-detail-table th:nth-child(1) { width:22%; }
    #stockTabCounts .stock-check-detail-table th:nth-child(2) { width:12%; }
    #stockTabCounts .stock-check-detail-table th:nth-child(3),
    #stockTabCounts .stock-check-detail-table th:nth-child(4),
    #stockTabCounts .stock-check-detail-table th:nth-child(5) { width:11%; }
    #stockTabCounts .stock-check-detail-table th:nth-child(6) { width:33%; }
    #stockTabCounts .stock-check-detail-table td strong,
    #stockTabCounts .stock-check-detail-table td small { display:block; }
    #stockTabCounts .stock-check-detail-table td small { margin-top:3px; color:#8290a1; font-size:.61rem; font-weight:400; }
    #stockTabCounts .stock-check-blind-row .stock-check-protected { color:#9aa5b4; font-size:.63rem; }
    #stockTabCounts .stock-check-diff-row { background:#fffdf8; }
    #stockTabCounts .stock-check-detail-table .positive { color:#0d7b5d; }
    #stockTabCounts .stock-check-detail-table .negative { color:#c83e52; }
    #stockTabCounts .stock-check-actual-input { min-width:94px; height:34px; text-align:right; }
    #stockTabCounts .stock-check-detail-table .stock-check-field-error { color:#bc3348; white-space:normal; overflow-wrap:anywhere; }
    #stockTabCounts .stock-check-detail-table .stock-check-field-error[hidden] { display:none; }
    #stockTabCounts .stock-check-feedback { margin:10px 0; padding:10px 12px; border:1px solid #ead19a; border-radius:9px; background:#fff9ec; color:#7d570d; font-size:.69rem; overflow-wrap:anywhere; }
    #stockTabCounts .stock-check-feedback[hidden] { display:none; }
    #stockTabCounts .stock-check-feedback p { margin:6px 0; }
    #stockTabCounts .stock-check-feedback ul { max-height:220px; overflow:auto; margin:8px 0 0; padding-left:20px; }
    #stockTabCounts .stock-check-feedback li { padding:4px 0; }
    #stockTabCounts .stock-check-feedback .text-button { margin:0 0 0 8px; white-space:nowrap; }
    #stockTabCounts .stock-check-review-fields { display:grid; grid-template-columns:minmax(125px,.75fr) minmax(135px,.8fr) minmax(170px,1.2fr); gap:7px; align-items:center; }
    #stockTabCounts .stock-check-review-fields .form-control { width:100%; height:34px; min-width:0; }
    #stockTabCounts .stock-check-surplus-cost { display:grid; grid-template-columns:auto minmax(70px,1fr); align-items:center; gap:6px; color:#68768a; font-size:.62rem; }
    #stockTabCounts .stock-check-cost-note { color:#7c6a49; font-size:.62rem; }
    #stockTabCounts .stock-check-review-readonly { display:grid; gap:3px; }
    #stockTabCounts .stock-check-review-readonly strong { font-size:.67rem; }
    #stockTabCounts .stock-check-review-readonly span,
    #stockTabCounts .stock-check-normal { color:#7e8b9b; font-size:.63rem; }
    #stockTabCounts .stock-check-pagination { display:flex; align-items:center; justify-content:space-between; gap:12px; padding-top:10px; color:#718095; font-size:.66rem; }
    #stockTabCounts .stock-check-pagination > div { display:flex; gap:6px; }
    #stockTabCounts .empty-row { padding:20px !important; text-align:center; color:#8290a1; }
    @media (max-width: 1280px) {
      #stockTabCounts .stock-check-review-fields { grid-template-columns:1fr; }
      #stockTabCounts .stock-check-detail-table th:nth-child(6) { width:27%; }
    }

    @media (max-width: 760px) {
      #stockTabCounts .stock-check-detail-head { flex-direction:column; align-items:stretch; gap:12px; }
      #stockTabCounts .stock-check-detail-head > div { min-width:0; width:100%; }
      #stockTabCounts #checkDetailTitle, #stockTabCounts #checkDetailMeta { overflow-wrap:anywhere; }
      #stockTabCounts .stock-check-detail-actions { justify-content:flex-start; }
      #stockTabCounts .stock-check-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
      #stockTabCounts .stock-check-detail-toolbar { grid-template-columns:minmax(0,1fr); }
      #stockTabCounts .stock-check-detail-table { min-width:680px; }
    }

    /* 资料中心：主档数量较大时使用列表定位，右侧只展示当前资料及其业务边界。 */
    #base.base-workspace { padding:18px; color:#26384d; }
    #base .base-master-workspace { overflow:hidden; }
    #base .base-master-head { display:flex; align-items:flex-end; justify-content:space-between; gap:18px; padding:18px 20px 14px; border-bottom:1px solid #e3e9f1; }
    #base .base-master-eyebrow { display:block; margin-bottom:4px; color:#4568ce; font-size:.63rem; font-weight:750; letter-spacing:.08em; }
    #base .base-master-head h2 { margin:0; color:#1f3044; font-size:1.08rem; line-height:1.3; }
    #base .base-master-head p { margin:5px 0 0; color:#748296; font-size:.69rem; line-height:1.5; }
    #base .base-master-tools { display:grid; grid-template-columns:minmax(220px,300px) 120px auto auto; gap:8px; align-items:center; }
    #base .base-master-tools input,
    #base .base-master-tools select { height:36px; min-width:0; }
    #base .base-master-tabs { display:flex; align-items:center; gap:4px; padding:10px 14px; border-bottom:1px solid #e3e9f1; background:#fafbfd; }
    #base .base-master-tabs button { min-height:34px; padding:0 13px; color:#5e6d80; border:1px solid transparent; border-radius:8px; background:transparent; font-size:.69rem; font-weight:700; cursor:pointer; }
    #base .base-master-tabs button strong { margin-left:5px; color:inherit; font-size:.64rem; }
    #base .base-master-tabs button:hover { color:#355ac7; background:#f0f4ff; }
    #base .base-master-tabs button.active { color:#355ac7; border-color:#c9d6fa; background:#eaf0ff; }
    #base .base-master-tabs .base-master-add { margin-left:auto; color:#fff; border-color:#4568d9; background:#4568d9; }
    #base .base-master-layout { display:grid; grid-template-columns:minmax(330px,.82fr) minmax(0,1.5fr); gap:14px; padding:14px; min-height:610px; background:#f6f8fb; }
    #base .base-master-list-card,
    #base .base-master-detail { min-width:0; overflow:hidden; border:1px solid #dce4ee; border-radius:11px; background:#fff; }
    #base .base-master-list-card { display:flex; flex-direction:column; }
    #base .base-master-list-head { display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:56px; padding:10px 12px; border-bottom:1px solid #e5eaf1; }
    #base .base-master-list-head > div { display:flex; flex-direction:column; gap:3px; }
    #base .base-master-list-head strong { color:#27394e; font-size:.75rem; }
    #base .base-master-list-head span,
    #base .base-master-list-head small { color:#7a889a; font-size:.62rem; font-weight:500; }
    #base .base-master-list { flex:1; min-height:0; max-height:552px; overflow:auto; padding:6px; }
    #base .base-master-list-item { width:100%; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:5px 10px; align-items:center; padding:10px 11px; color:inherit; border:1px solid transparent; border-radius:8px; background:transparent; text-align:left; cursor:pointer; }
    #base .base-master-list-item + .base-master-list-item { margin-top:3px; }
    #base .base-master-list-item:hover { border-color:#e2e7ef; background:#f8fafe; }
    #base .base-master-list-item.selected { border-color:#c8d5fa; background:#edf2ff; box-shadow:inset 3px 0 #4568d9; }
    #base .base-master-item-main { min-width:0; display:flex; align-items:baseline; gap:8px; }
    #base .base-master-item-main strong { overflow:hidden; color:#27394e; font-size:.72rem; text-overflow:ellipsis; white-space:nowrap; }
    #base .base-master-item-main small { flex:none; color:#8a96a6; font-size:.59rem; }
    #base .base-master-item-sub { overflow:hidden; color:#6e7d91; font-size:.63rem; text-overflow:ellipsis; white-space:nowrap; }
    #base .base-master-list-item .status-badge { grid-column:2; grid-row:1 / 3; }
    #base .base-master-empty { min-height:180px; display:grid; place-items:center; padding:24px; color:#8592a3; font-size:.68rem; text-align:center; }

    /* ===== 正式迁移版：经营报表与提成工作台 ===== */
    #reports.report-workspace-shell,
    #commission.commission-workspace-shell { gap:12px; overflow-y:auto; overflow-x:hidden; padding-bottom:86px; }
    .report-workspace-head { flex:0 0 auto; display:flex; align-items:center; justify-content:space-between; gap:24px; min-height:88px; padding:16px 20px; border:1px solid var(--rule); border-radius:12px; background:var(--card); box-shadow:var(--shadow-sm); }
    .report-workspace-head > div:first-child { display:grid; gap:4px; min-width:0; }
    .report-eyebrow { color:#4964ba; font-size:11px; font-weight:750; letter-spacing:.04em; }
    .report-workspace-head h2 { margin:0; color:var(--blue-dark); font-size:19px; line-height:1.25; letter-spacing:-.25px; }
    .report-workspace-head p { margin:0; color:var(--muted); font-size:11.5px; line-height:1.5; }
    .report-head-actions { display:flex; align-items:center; gap:8px; flex:0 0 auto; }
    .report-workspace-nav { flex:0 0 auto; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); overflow:hidden; border:1px solid var(--rule); border-radius:11px; background:var(--card); box-shadow:var(--shadow-sm); }
    .report-workspace-nav button { min-height:58px; display:grid; align-content:center; gap:3px; padding:9px 16px; color:#536176; text-align:left; border:0; border-right:1px solid var(--rule); background:transparent; cursor:pointer; }
    .report-workspace-nav button:last-child { border-right:0; }
    .report-workspace-nav button:hover { color:#3159bd; background:#f6f8fd; }
    .report-workspace-nav button.active { color:#3159bd; background:#edf2ff; box-shadow:inset 0 -3px #4167d9; }
    .report-workspace-nav strong { font-size:13px; }
    .report-workspace-nav small { color:#7b8798; font-size:10.5px; font-weight:500; }
    .report-filter-panel { flex:0 0 auto!important; display:grid!important; grid-template-columns:minmax(300px,1.5fr) repeat(5,minmax(130px,.7fr)) auto; gap:10px; align-items:end; padding:12px 14px; overflow:visible!important; }
    .report-filter-panel label,
    .commission-filter-panel label { display:grid; gap:5px; color:#66748a; font-size:10.5px; }
    .report-filter-panel input,
    .report-filter-panel select,
    .commission-filter-panel select { width:100%; min-width:0; height:36px; padding:0 9px; color:#2f3e55; border:1px solid #d4dce7; border-radius:8px; background:#fff; outline:0; }
    .report-filter-panel input:focus,
    .report-filter-panel select:focus,
    .commission-filter-panel select:focus { border-color:#6b82d8; box-shadow:0 0 0 3px rgba(65,103,217,.12); }
    .report-context-strip { flex:0 0 auto; min-height:54px; display:grid; grid-template-columns:minmax(300px,1.5fr) minmax(150px,.55fr) minmax(170px,.65fr) minmax(260px,1fr); gap:12px; align-items:center; padding:9px 13px; color:#53647c; border:1px solid #d7e1f1; border-radius:10px; background:#f5f8fd; }
    .report-context-strip > div { min-width:0; display:grid; gap:3px; }
    .report-context-strip > div > span { color:#748197; font-size:10.5px; line-height:1.45; }
    .report-context-strip > div > strong { overflow:hidden; color:#344b72; font-size:11.5px; line-height:1.4; text-overflow:ellipsis; white-space:nowrap; }
    .report-context-strip > small { color:#687890; font-size:10.5px; line-height:1.5; }
    .report-context-strip.is-warning { color:#7b561d; border-color:#ead3a8; background:#fff9ee; }
    .report-context-strip.is-warning > div > strong { color:#8d5b16; }
    .report-search-field { min-width:0; display:grid; gap:5px; margin-bottom:5px; color:#66748a; font-size:10.5px; }
    .report-search { height:36px; display:flex; align-items:center; gap:7px; padding:0 10px; border:1px solid #d4dce7; border-radius:8px; background:#fff; }
    .report-search span { color:#7d899a; font-size:18px; line-height:1; }
    .report-search input { flex:1; height:34px; padding:0; border:0; box-shadow:none!important; }
    .report-table-pagination { min-height:48px; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 12px; border-top:1px solid #e2e7ef; color:#6b7890; background:#fff; font-size:12px; }
    .report-table-pagination > div { display:flex; align-items:center; gap:8px; }
    .report-table-pagination strong { color:#40516a; font-weight:650; white-space:nowrap; }
    .report-kpi-grid,
    .commission-kpi-grid { flex:0 0 auto; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
    .report-kpi-grid article,
    .commission-kpi-grid article { min-height:88px; display:grid; align-content:center; gap:5px; padding:13px 15px; border:1px solid var(--rule); border-radius:11px; background:var(--card); box-shadow:var(--shadow-sm); }
    .report-kpi-grid span,
    .commission-kpi-grid span { color:#69768a; font-size:10.5px; }
    .report-kpi-grid strong,
    .commission-kpi-grid strong { color:#25344b; font-size:18px; font-variant-numeric:tabular-nums; }
    .report-kpi-grid small,
    .commission-kpi-grid small { color:#7c8798; font-size:10px; }
    .report-kpi-grid small b,
    .commission-kpi-grid small b { color:#526176; font-weight:650; }
    .report-sensitive-card { background:#f8fafc!important; }
    .commission-warning-card { border-color:#ecd9b4!important; background:#fffaf0!important; }
    .report-table-panel,
    .commission-table-panel { flex:0 0 auto!important; min-height:360px; overflow:visible!important; }
    .report-table-head > div:first-child { display:grid; gap:3px; }

    .report-data-validation {
      margin: 0 16px 12px;
      padding: 10px 12px;
      border: 1px solid #cbd8f5;
      border-radius: 10px;
      background: #f6f8ff;
      color: #475569;
      font-size: 13px;
      line-height: 1.5;
    }
    .report-data-validation.is-warning {
      border-color: #f0c36d;
      background: #fff9ed;
      color: #8a5200;
    }
    .report-table-head p,
    .commission-table-panel .panel-head p { margin:0; color:var(--muted); font-size:10.5px; }
    .report-table-actions { display:flex; align-items:center; gap:10px; }
    .report-table-actions > span { color:#6d7a8e; font-size:11px; }
    .sales-report-columns { position:absolute; top:54px; right:16px; z-index:80; width:min(720px,calc(100vw - 180px)); display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; padding:14px; border:1px solid #d8e0eb; border-radius:10px; background:#fff; box-shadow:0 18px 45px rgba(15,23,42,.16); }
    .sales-report-columns[hidden] { display:none!important; }
    .sales-report-columns > div { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px 10px; align-content:start; }
    .sales-report-columns strong { grid-column:1 / -1; padding-bottom:6px; color:#3b4b63; border-bottom:1px solid var(--rule); font-size:11px; }
    .sales-report-columns label { display:flex; align-items:center; gap:5px; color:#657287; font-size:10.5px; white-space:nowrap; }
    .sales-report-columns input[type="checkbox"] { flex:0 0 14px; width:14px!important; height:14px!important; min-height:0!important; margin:0; padding:0; accent-color:#4167d9; box-shadow:none!important; }
    .report-table-body { display:grid; grid-template-columns:minmax(0,1fr); min-width:0; }
    .report-table-body.with-detail { grid-template-columns:minmax(760px,1fr) 312px; }
    .report-wide-table { max-height:540px; min-width:0; overflow:auto; border-radius:0 0 11px 11px; }
    .report-wide-table table { width:100%; min-width:1040px; table-layout:fixed; }
    .report-wide-table.is-wide table { min-width:2180px; table-layout:auto; }
    .report-wide-table th { top:0; z-index:4; height:40px; padding:0 12px; color:#68758a; background:#f8fafc; font-size:11.5px; font-weight:700; white-space:nowrap; }
    .report-wide-table td { height:48px; padding:8px 12px; overflow:hidden; color:#3d4b60; font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
    .report-wide-table tbody tr { cursor:pointer; }
    .report-wide-table tbody tr:hover td,
    .report-wide-table tbody tr.selected td { background:#f1f5ff; }
    .report-side-detail { min-width:0; padding:14px; border-left:1px solid var(--rule); background:#fbfcfe; }
    .report-side-detail[hidden],
    .commission-detail-panel[hidden] { display:none!important; }
    .report-detail-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding-bottom:12px; border-bottom:1px solid var(--rule); }
    .report-detail-head > div { display:grid; gap:3px; }
    .report-detail-head span { color:#5870bf; font-size:9.5px; font-weight:750; letter-spacing:.04em; }
    .report-detail-head h3 { margin:0; color:#27364c; font-size:15px; }
    .report-detail-head button { width:30px; height:30px; display:grid; place-items:center; color:#66758a; border:1px solid var(--rule); border-radius:8px; background:#fff; font-size:18px; cursor:pointer; }
    .report-side-detail dl { margin:8px 0 14px; }
    .report-side-detail dl > div { display:grid; grid-template-columns:.85fr 1.2fr; gap:10px; padding:9px 0; border-bottom:1px solid var(--rule); }
    .report-side-detail dt { color:#778397; font-size:9.5px; }
    .report-side-detail dd { margin:0; color:#35445a; text-align:right; font-size:10.5px; font-weight:650; line-height:1.45; }
    .report-side-detail dd small { display:block; margin-top:2px; color:#7a8798; font-size:9px; font-weight:500; }
    .report-detail-note { display:grid; gap:3px; margin-top:8px; padding:9px 10px; color:#526176; border:1px solid #dbe3f0; border-radius:8px; background:#f5f8fd; }
    .report-detail-note strong { font-size:10px; }
    .report-detail-note span { font-size:9px; line-height:1.45; }
    .commission-filter-panel { flex:0 0 auto!important; display:grid!important; grid-template-columns:repeat(3,minmax(180px,.65fr)) minmax(300px,1.4fr); gap:12px; align-items:end; padding:12px 14px; overflow:visible!important; }
    .commission-rule-source { min-height:36px; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 11px; color:#5e6d82; border:1px solid #dbe3f0; border-radius:8px; background:#f6f8fc; font-size:10.5px; }
    .commission-rule-source span { color:#3159bd; font-weight:650; }
    .report-rule-note { flex:0 0 auto; display:flex; align-items:center; gap:10px; padding:11px 13px; color:#576984; border:1px solid #d7e0f1; border-radius:10px; background:#f4f7fd; font-size:10.5px; }
    .report-rule-note strong { color:#38529f; white-space:nowrap; }
    .report-rule-note.is-warning { color:#7c5418; border-color:#ead3a8; background:#fff8ea; }
    .report-rule-note.is-warning strong { color:#9a6413; }
    .commission-adjustment-panel[hidden] { display:none!important; }
    .commission-adjustment-panel { flex:0 0 auto!important; overflow:hidden!important; border-color:#ead3a8!important; }
    .commission-adjustment-panel .panel-head { background:#fffaf0; }
    .commission-adjustment-panel .panel-head p { margin:2px 0 0; color:#80623a; font-size:10px; }
    .commission-adjustment-panel .table-wrap { max-height:280px; overflow:auto; }
    .commission-adjustment-panel table { min-width:1420px; }
    .commission-adjustment-panel td small { display:block; margin-top:2px; color:#7f8a9a; font-size:9px; }
    .commission-adjustment-panel tr.is-revoked td { color:#8b95a3; background:#f8fafc; text-decoration-color:#aeb6c1; }
    .commission-adjustment-negative { color:#b84a4a!important; font-weight:750; }
    .commission-adjustment-positive { color:#16806a!important; font-weight:750; }
    .commission-adjustment-state { display:inline-flex; align-items:center; min-height:22px; padding:0 8px; color:#167361; border:1px solid #bae1d7; border-radius:999px; background:#eefaf6; font-size:9px; font-weight:700; }
    .commission-adjustment-state.is-revoked { color:#6f7b8b; border-color:#d8dee7; background:#f4f6f8; }
    .commission-table-panel .table-wrap { max-height:520px; overflow:auto; }
    .commission-table-panel table { min-width:1420px; }
    .commission-value { color:#3159bd!important; font-variant-numeric:tabular-nums; }
    .commission-value.total { font-weight:750; }
    .commission-zero { color:#a56514!important; }
    .commission-manager-note { color:#7a8798; font-size:10px; }
    .commission-manager-row { border-left: 4px solid #3b82f6; background: #eff6ff; }
    .commission-manager-badge { padding: 1px 5px; border-radius: 3px; color: #fff; background: #3b82f6; font-size: .7rem; }
    .commission-detail-panel { flex:0 0 auto!important; margin:0!important; overflow:hidden!important; }
    .commission-detail-panel .table-wrap { max-height:360px; overflow:auto; }
    .commission-detail-panel table { min-width:1420px; }
    .commission-detail-summary { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; padding:14px 16px 0; }
    .commission-detail-summary > div { min-width:0; padding:10px 12px; border:1px solid var(--rule); border-radius:var(--radius-md); background:var(--bg-alt); }
    .commission-detail-summary span { display:block; color:var(--muted); font-size:var(--text-xs); margin-bottom:4px; }
    .commission-detail-summary strong { display:block; color:var(--ink); font-size:var(--text-sm); overflow-wrap:anywhere; }
    .commission-detail-summary small { display:block; color:var(--text-secondary); font-size:var(--text-xs); margin-top:3px; }
    .commission-detail-panel td small { display:block; color:var(--muted); font-size:9px; margin-top:2px; }
    .commission-zero-badge { display:inline-flex; align-items:center; min-height:22px; padding:0 7px; color:#9a6413; border:1px solid #efd39e; border-radius:999px; background:#fff8e8; font-size:9px; font-weight:700; }

    @media (max-width: 1500px) {
      .report-filter-panel { grid-template-columns:minmax(320px,1.5fr) repeat(3,minmax(145px,.7fr)) auto; }
      .report-filter-panel label:nth-of-type(4), .report-filter-panel label:nth-of-type(5) { grid-row:2; }
      .report-table-body.with-detail { grid-template-columns:1fr; }
      .report-side-detail { border-left:0; border-top:1px solid var(--rule); }
    }
    @media (max-width: 1050px) {
      .report-workspace-head { align-items:flex-start; }
      .report-filter-panel { grid-template-columns:repeat(2,minmax(0,1fr)); }
      .report-search { grid-column:1 / -1; }
      .report-filter-panel label:nth-of-type(4), .report-filter-panel label:nth-of-type(5) { grid-row:auto; }
      .report-kpi-grid, .commission-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
      .commission-filter-panel { grid-template-columns:repeat(2,minmax(0,1fr)); }
      .commission-rule-source { grid-column:1 / -1; }
      .commission-detail-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
      .report-context-strip { grid-template-columns:repeat(2,minmax(0,1fr)); }
      .report-context-strip > small { grid-column:1 / -1; }
    }
    #base .base-master-pagination { display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:48px; padding:8px 12px; border-top:1px solid #e5eaf1; color:#748296; font-size:.63rem; }
    #base .base-master-pagination > div { display:flex; align-items:center; gap:7px; }
    #base .base-master-pagination button { min-height:30px; padding:0 10px; color:#4c5f76; border:1px solid #dbe2ec; border-radius:7px; background:#fff; font-size:.63rem; cursor:pointer; }
    #base .base-master-pagination button:disabled { cursor:not-allowed; opacity:.42; }
    #base .base-master-detail { align-self:stretch; padding:18px; }
    #base .base-detail-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; padding-bottom:14px; border-bottom:1px solid #e4eaf2; }
    #base .base-detail-head span:first-child { color:#4568ce; font-size:.62rem; font-weight:750; }
    #base .base-detail-head h3 { margin:4px 0 2px; color:#203247; font-size:1.02rem; }
    #base .base-detail-head p { margin:0; color:#8290a1; font-size:.64rem; }
    #base .base-detail-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1px 18px; margin-top:10px; }
    #base .base-detail-field { min-width:0; display:grid; grid-template-columns:112px minmax(0,1fr); gap:4px 12px; padding:9px 2px; border-bottom:1px solid #edf0f5; }
    #base .base-detail-field > span { color:#748296; font-size:.64rem; }
    #base .base-detail-field > strong { overflow-wrap:anywhere; color:#2b3d52; font-size:.69rem; font-weight:700; }
    #base .base-detail-field > small { grid-column:2; color:#8995a5; font-size:.59rem; line-height:1.45; }
    #base .base-detail-notice { margin-top:14px; padding:12px 14px; border:1px solid #d8e2f4; border-radius:9px; background:#f5f8ff; }
    #base .base-detail-notice strong { color:#34558f; font-size:.68rem; }
    #base .base-detail-notice p { margin:5px 0 0; color:#64758c; font-size:.63rem; line-height:1.55; }
    #base .base-audit-panel { margin-top:14px; padding:12px 14px; border:1px solid #dfe6ef; border-radius:9px; background:#fbfcfe; }
    #base .base-audit-panel .ui-state { min-height:76px; }
    #base .base-audit-head { display:flex; align-items:center; justify-content:space-between; gap:12px; color:#33465d; }
    #base .base-audit-head strong { font-size:.7rem; }
    #base .base-audit-head span { color:#7c8999; font-size:.6rem; }
    #base .base-audit-list { display:grid; gap:8px; margin:10px 0 0; padding:0; list-style:none; }
    #base .base-audit-item { display:grid; gap:4px; padding:9px 10px; border-left:3px solid #6f8fd9; background:#f4f7fc; }
    #base .base-audit-item > div { display:flex; align-items:center; justify-content:space-between; gap:10px; }
    #base .base-audit-item strong { color:#2c4058; font-size:.65rem; }
    #base .base-audit-item span { color:#77869a; font-size:.58rem; }
    #base .base-audit-item p { margin:0; color:#5f7086; font-size:.61rem; line-height:1.45; overflow-wrap:anywhere; }
    #base .base-detail-actions { display:flex; align-items:center; gap:8px; margin-top:16px; }
    #base .base-detail-actions .red-btn { margin-left:auto; }
    @media (max-width: 1280px) {
      #base .base-master-head { align-items:flex-start; flex-direction:column; }
      #base .base-master-tools { width:100%; grid-template-columns:minmax(180px,1fr) 110px auto auto; }
      #base .base-master-layout { grid-template-columns:minmax(290px,.9fr) minmax(0,1.35fr); }
      #base .base-detail-grid { grid-template-columns:1fr; }
    }
    @media (max-width: 900px) {
      #base .base-master-tools { grid-template-columns:1fr 1fr; }
      #base .base-master-tabs { overflow:auto; }
      #base .base-master-layout { grid-template-columns:1fr; }
      #base .base-master-list { max-height:360px; }
    }

    /* ui30: table row actions stay readable; legacy 10px/28px controls looked like stale system widgets. */
    .inventory-status-filter .btn,
    .inventory-row-actions .btn,
    .inventory-pagination .btn,
    .purchase-row-actions .btn {
      min-height:32px;
      height:32px;
      padding:0 10px;
      font-size:.75rem;
      line-height:1;
    }

    /* ui31 visual recovery: structural alignment with the accepted desktop prototype. */
    #home.home-workspace { gap:16px; }
    .home-kpis article { position:relative; padding-left:22px; }
    .home-kpis article::before { content:""; position:absolute; left:0; top:18px; bottom:18px; width:3px; border-radius:0 3px 3px 0; background:#dfe5f1; }
    .home-kpis article:nth-child(1)::before { background:#4167d9; }
    .home-kpis article:nth-child(2)::before { background:#62748b; }
    .home-kpis article:nth-child(3)::before { background:#168066; }
    .home-kpis article:nth-child(4)::before { background:#c34b5b; }
    .home-trend-panel .workspace-eyebrow { display:block; margin-bottom:4px; color:#4866bd; font-size:.62rem; font-weight:780; letter-spacing:.09em; }
    .home-trend-layout { grid-template-columns:minmax(560px,1.1fr) minmax(380px,.9fr); gap:18px; }
    .home-center-summary { overflow:hidden; border:1px solid #e0e5ed; border-radius:10px; background:#fff; }
    .home-center-summary-head,
    .home-center-summary-row { display:grid; grid-template-columns:1.05fr 1fr minmax(170px,1.5fr) 54px; align-items:center; gap:14px; }
    .home-center-summary-head { min-height:36px; padding:0 14px; color:#718095; border-bottom:1px solid #e2e7ee; background:#f8fafc; font-size:.66rem; font-weight:700; }
    .home-center-summary-row { min-height:58px; padding:8px 14px; border-bottom:1px solid #edf0f4; }
    .home-center-summary-row:last-of-type { border-bottom:0; }
    .home-center-summary-row strong { color:#26384d; font-size:.8rem; }
    .home-center-summary-row b { color:#26384d; font-size:.82rem; font-variant-numeric:tabular-nums; }
    .home-center-summary-row em { color:#5e6f86; font-size:.72rem; font-style:normal; font-weight:700; text-align:right; }
    .home-center-spark { height:28px; display:flex; align-items:flex-end; gap:5px; }
    .home-center-spark i { flex:1; height:var(--bar); min-height:3px; border-radius:3px 3px 1px 1px; background:linear-gradient(180deg,#6f8ce9,#4167d9); opacity:.78; }
    .home-center-summary-total { min-height:48px; display:grid; grid-template-columns:1fr auto; align-items:center; gap:2px 16px; padding:8px 14px; border-top:1px solid #d8e0ed; background:#f2f5fb; }
    .home-center-summary-total span { color:#33465f; font-size:.76rem; font-weight:750; }
    .home-center-summary-total strong { color:#24364e; font-size:.9rem; font-variant-numeric:tabular-nums; }
    .home-center-summary-total small { grid-column:1 / -1; color:#7e8998; font-size:.62rem; }
    .home-bottom-grid { gap:0; overflow:hidden; border:1px solid var(--rule); border-radius:12px; background:#fff; box-shadow:var(--shadow-sm); }
    .home-bottom-grid > .home-detail-card { min-height:210px; border:0; border-right:1px solid var(--divider); border-radius:0; box-shadow:none; }
    .home-bottom-grid > .home-detail-card:last-child { border-right:0; }
    .home-detail-card::before,
    #homeDailyProfitCard::before,
    .home-technical-card::before { display:none; }

    #sales .sales-entry-shell { overflow:visible; border:0; background:transparent; box-shadow:none; }
    #sales .sales-workspace-head { min-height:96px; padding:4px 0 16px; border-bottom:0; background:transparent; }
    #sales .sales-workspace-head h2 { font-size:1.45rem; letter-spacing:-.025em; }
    #sales .sales-main { gap:14px; }
    #sales .sales-step-section,
    #sales .sales-payment-proof { border-radius:11px; box-shadow:0 1px 2px rgba(23,34,49,.045); }
    #sales .sales-product-head { flex-wrap:wrap; }
    #sales .sales-product-head .sales-section-actions { width:100%; justify-content:flex-start; }
    #sales .sales-product-head .sales-step-progress { order:3; margin-left:auto; }
    #sales .sales-product-entry { padding:0!important; overflow:hidden; border:1px solid #d6dde8; border-radius:9px; background:#fff; }
    #sales .sales-product-entry .productSearch,
    #sales .sales-product-entry .projectName { width:100%!important; margin:0!important; padding:0 10px!important; border:0!important; border-radius:0!important; background:transparent!important; box-shadow:none!important; }
    #sales .sales-product-entry .productSearch { height:38px!important; }
    #sales .sales-product-entry .projectName { height:34px!important; border-top:1px solid #e5e9f0!important; color:#69778a; }
    #sales .sales-product-entry:focus-within { border-color:#6780e4; box-shadow:0 0 0 3px rgba(49,89,217,.09); }
    #sales .sales-product-meta,
    #sales .stock-badge,
    #sales .owner-material-toggle { margin-left:8px; margin-right:8px; }
    #sales.sales-workspace .sales-modern-lines { min-width:760px; }
    @media (max-width:1200px) {
      #sales .sales-layout { grid-template-columns:1fr; }
      #sales .order-summary-card { position:static; }
      #sales .order-summary-card dl { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); }
      #sales .order-summary-card dl > div { padding:0 12px; border-right:1px solid var(--divider); }
    }
    @media (min-width:1201px) {
      #sales .sales-layout { grid-template-columns:minmax(0,1fr) 286px; }
    }

    .payment-kpis { gap:0; overflow:hidden; margin:16px 24px 0; padding:0; border:1px solid var(--rule); border-radius:11px; background:#fff; }
    .payment-kpis article { border:0; border-right:1px solid var(--divider); border-radius:0; background:#fff; }
    .payment-kpis article:last-child { border-right:0; }
    .payment-tabs { gap:0; margin:14px 24px 0; padding:0; overflow:hidden; border:1px solid var(--rule); border-radius:10px; background:#fff; }
    .payment-tabs button { min-height:62px; border:0; border-right:1px solid var(--rule); border-radius:0; }
    .payment-tabs button:last-child { border-right:0; }
    .payment-tabs button.active { border-color:transparent; background:#edf2ff; box-shadow:inset 0 -3px #4167d9; }
    .payment-tabs button:focus:not(:focus-visible) { outline:0; }
    .payment-table-wrap tbody tr:nth-child(even) td { background:#fff; }
    .payment-table-wrap tbody tr:hover td { background:#f7f9fd; }

    .stock-workspace-nav { gap:0; overflow:hidden; border:1px solid var(--rule); border-radius:10px; background:#fff; }
    .stock-tab { border:0!important; border-right:1px solid var(--rule)!important; border-radius:0!important; box-shadow:none!important; }
    .stock-tab:last-child { border-right:0!important; }
    .stock-tab.active { background:#edf2ff!important; box-shadow:inset 0 -3px #4167d9!important; }
    .stock-tab:focus:not(:focus-visible) { outline:0; }
    .inventory-overview-table tbody tr:nth-child(even) td { background:#fff; }
    .inventory-overview-table tbody tr:hover td { background:#f7f9fd; }
    @media (min-width:1101px) {
      .inventory-overview-table table { min-width:0; }
      .inventory-overview-table th:nth-child(1) { width:7%; }
      .inventory-overview-table th:nth-child(2) { width:18%; }
      .inventory-overview-table th:nth-child(3) { width:8%; }
      .inventory-overview-table th:nth-child(4) { width:10%; }
      .inventory-overview-table th:nth-child(5) { width:11%; }
      .inventory-overview-table th:nth-child(6) { width:12%; }
      .inventory-overview-table th:nth-child(7) { width:13%; }
      .inventory-overview-table th:nth-child(8) { width:11%; }
      .inventory-overview-table th:nth-child(9) { width:10%; }
      .inventory-row-actions { flex-direction:column; align-items:stretch; }
      .inventory-row-actions .btn { width:100%; padding:0 5px; }
    }

    .report-workspace-head { min-height:104px; padding:6px 0 16px; border:0; border-radius:0; background:transparent; box-shadow:none; }
    .report-workspace-head h2 { color:#1f3147; font-size:23px; }
    .report-workspace-nav button:focus:not(:focus-visible) { outline:0; }
    .report-wide-table tbody tr:nth-child(even) td { background:#fff; }

    /* ui32 sales visual correction: compact prototype rhythm and truthful owner-material state. */
    .role-badge { min-width:166px; height:42px; padding:0 10px 0 6px; gap:9px; border-radius:10px; }
    .role-badge .role-avatar { width:30px; height:30px; border-radius:9px; background:#314b67!important; font-size:12px; }
    .role-badge .role-meta { flex:1; min-width:0; }
    .role-badge .role-meta .role-meta-name { font-size:12px; font-weight:700; }
    .role-badge .role-meta .role-meta-role { font-size:9.5px; }

    #sales .sales-workspace-head { min-height:auto; padding:4px 0 14px; border:0; border-radius:0; background:transparent; box-shadow:none; }
    #sales .sales-workspace-head h2 { font-size:25px; font-weight:760; }
    #sales .sales-workspace-head p { font-size:13.5px; }
    #sales .form-grid { align-items:start; gap:11px 14px; padding:13px 18px 15px; }
    #sales .form-grid label,
    #sales .footer-form label { margin-bottom:5px; font-size:11.5px; font-weight:650; }
    #sales .form-grid input,
    #sales .form-grid select,
    #sales .footer-form input,
    #sales .footer-form select { height:39px; border-radius:8px; font-size:12.5px; font-weight:500; }
    #sales .sales-field-help { margin-top:4px; font-size:10px; line-height:1.35; }

    #globalProductDropdown { padding:5px; border-radius:9px; }
    #globalProductDropdown .product-option { min-height:42px; display:grid; align-content:center; gap:2px; padding:7px 9px; border-radius:7px; }
    #globalProductDropdown .product-option.active { background:#eef3ff; }
    #globalProductDropdown .product-option:hover { background:#e9efff; }
    #globalProductDropdown .product-option-title { gap:6px; }
    #globalProductDropdown .product-option-title strong { font-size:12px; font-weight:650; }
    #globalProductDropdown .product-option-meta { gap:0; font-size:10px; line-height:1.35; }
    #globalProductDropdown .product-option-stock { font-weight:750; }
    #globalProductDropdown .product-option-stock.stock-ok,
    #globalProductDropdown .product-option-stock.stock-service { color:#0d7a58; }
    #globalProductDropdown .product-option-stock.stock-low,
    #globalProductDropdown .product-option-stock.stock-manual { color:#a96300; }
    #globalProductDropdown .product-option-stock.stock-zero,
    #globalProductDropdown .product-option-stock.stock-neg { color:#b53648; }

    #sales .sales-table-scroll { padding:0 14px 12px; }
    #sales .sales-field-group-title { grid-column:1/-1; margin:0; font-size:13px; color:#475569; font-weight:600; }
    #sales .sales-quantity-control { display:flex; align-items:center; gap:6px; min-width:104px; }
    #sales .sales-quantity-control .qty { width:76px; min-width:76px; text-align:right; }
    #sales .sales-quantity-control .unit { font-size:13px; color:#475569; white-space:nowrap; }
    #sales.sales-workspace .sales-modern-lines { min-width:1120px; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(3) { min-width:118px; }
    #sales .summary-safety summary { margin-top:4px; cursor:pointer; font-size:12px; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(1) { width:25%; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(2) { width:7%; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(3) { width:6%; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(4) { width:10%; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(5) { width:10%; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(6) { width:17%; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(7) { width:8%; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(8) { width:12%; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(9) { width:5%; }
    #sales.sales-workspace .sales-form-table th { height:36px!important; padding:6px 7px!important; background:#f8fafc; font-size:10.5px; }
    #sales.sales-workspace .sales-form-table td { min-height:58px; padding:8px 7px!important; font-size:11.5px; }
    #sales .sales-product-entry .productSearch { height:34px!important; min-height:34px!important; max-height:34px!important; font-size:12px!important; }
    #sales .sales-product-entry .projectName { height:29px!important; min-height:29px!important; max-height:29px!important; font-size:10.5px!important; }
    #sales .sales-product-meta { min-height:15px; margin-top:3px; font-size:9.5px; }
    #sales .stock-badge { margin-top:3px; padding:2px 6px; font-size:9.5px; }
    #sales .sales-money-input { min-height:34px; }
    #sales .sales-cost-cell .cost-mode-hint { margin-top:3px; font-size:9.5px; }
    #sales .sales-cost-cell .owner-material-toggle { max-width:100%; margin:5px 0 0; padding:2px 6px; gap:4px; border-radius:7px; font-size:9.5px; }
    #sales .owner-material-state { display:none; color:#9a5d0a; font-size:9px; font-style:normal; font-weight:750; }
    #sales .owner-material-toggle:has(input:checked) .owner-material-state { display:inline; }

    #sales .order-summary-card > .workspace-eyebrow { font-size:10.5px; letter-spacing:.06em; }
    #sales .order-summary-card > h3 { font-size:18px; }
    #sales .order-summary-card > p { font-size:11px; }
    #sales .order-summary-card dt { font-size:11.5px; }
    #sales .order-summary-card dd { font-size:12.5px; }
    #sales .order-summary-card .balance dd { font-size:17px; }
    #sales .summary-safety { display:flex; align-items:flex-start; gap:9px; padding:10px 11px; }
    #sales .summary-safety svg { width:18px; height:18px; flex:0 0 auto; fill:none; stroke:#4665c3; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
    #sales .summary-safety > span { display:grid; gap:2px; }
    #sales .summary-safety strong { font-size:11.5px; }
    #sales .summary-safety small { font-size:10px; line-height:1.45; }
    @media (max-width:1380px) {
      #sales .sales-layout { grid-template-columns:1fr; }
      #sales .order-summary-card { position:static; }
      #sales .order-summary-card dl { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); }
      #sales .order-summary-card dl > div { padding:0 12px; border-right:1px solid var(--divider); }
    }

    /* ui33 sales refinement: one-line stock state, semantic totals, one chevron language. */
    #sales .sales-product-meta { align-items:center; flex-wrap:wrap; gap:5px; }
    #sales .sales-product-meta .stock-badge { display:inline-flex; align-items:center; min-height:16px; margin:0; padding:1px 6px; line-height:1.2; }
    #sales .sales-product-meta span:not(:empty) + .stock-badge:not(:empty)::before { content:none; }
    #sales .order-summary-card dd.positive,
    #sales .order-summary-card dd.positive strong { color:#0d7a58!important; }
    #sales .order-summary-card dd.negative,
    #sales .order-summary-card dd.negative strong { color:#c13f4f!important; }
    #sales select:not([hidden]) {
      appearance:none;
      -webkit-appearance:none;
      padding-right:34px!important;
      background-color:#fff;
      background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='%2366748a' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
      background-repeat:no-repeat;
      background-position:right 11px center;
      background-size:12px 12px;
    }
    #sales .sales-search-toggle::before { content:""; width:12px; height:12px; display:block; margin:auto; background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='%2366748a' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px 12px no-repeat; }

    /* ui34: product picker remains anchored; table money columns follow the real visual weight. */
    #globalProductDropdown { width:max-content; min-width:0; max-width:min(440px,calc(100vw - 24px)); }
    #sales.sales-workspace .sales-modern-lines th:nth-child(1) { width:27%; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(6) { width:13%; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(7) { width:9%; text-align:left; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(8) { width:13%; }
    #sales.sales-workspace .sales-modern-lines td:nth-child(7),
    #sales .sales-profit-cell { text-align:left!important; }
    #sales .sales-cost-cell .sales-money-input { max-width:132px; }
    #sales #storeName {
      padding-right:44px!important;
      background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='%2366748a' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
        linear-gradient(#d6dde7,#d6dde7);
      background-position:right 12px center,right 36px center;
      background-size:12px 12px,1px 100%;
      background-repeat:no-repeat;
    }

    /* ui35: the product column uses a real inner control frame; metadata sits close to it. */
    #sales.sales-workspace .sales-modern-lines td.sales-product-entry { overflow:visible; background:transparent; }
    #sales .sales-product-control { overflow:hidden; border:1px solid #d6dde8; border-radius:8px; background:#fff; }
    #sales .sales-product-entry:focus-within { border-color:transparent; box-shadow:none; }
    #sales .sales-product-entry:focus-within .sales-product-control { border-color:#6780e4; box-shadow:0 0 0 3px rgba(49,89,217,.09); }
    #sales .sales-product-control .productSearch { height:32px!important; min-height:32px!important; max-height:32px!important; }
    #sales .sales-product-control .projectName { height:26px!important; min-height:26px!important; max-height:26px!important; }
    #sales .sales-product-meta { min-height:14px; margin:2px 2px 0!important; line-height:1.15; }

    /* Match the prototype: one outer section, three flat segments separated by rules. */
    #orders.orders-workspace .order-action-guide { padding:0; }
    #orders.orders-workspace .order-action-guide > header { padding:13px 16px; }
    #orders.orders-workspace .order-action-guide-grid { gap:0; margin-top:0; border-top:1px solid var(--divider); }
    #orders.orders-workspace .order-action-guide-grid article { min-width:0; display:grid; grid-template-columns:30px minmax(0,1fr); gap:9px; align-items:start; padding:13px 15px; border:0; border-right:1px solid var(--divider); border-radius:0; background:transparent; }
    #orders.orders-workspace .order-action-guide-grid article:last-child { border-right:0; }

    /* 一级页面统一使用开放式页头；边框只承载后续数据区和操作区。 */
    #orders.orders-workspace .orders-intro,
    #stock .stock-module-intro,
    #payment .payment-head,
    #base .base-master-head,
    #finance .finance-workspace-head {
      min-height:auto;
      padding:4px 0 14px;
      border:0;
      border-radius:0;
      background:transparent;
      box-shadow:none;
    }
    #orders.orders-workspace .orders-intro h2,
    #stock .stock-module-intro h2,
    #payment .payment-head h2,
    #base .base-master-head h2,
    #finance .finance-workspace-title h2 { font-size:23px; }
    #payment .payment-workspace,
    #base .base-master-workspace,
    #finance .finance-workspace { border:0; background:transparent; box-shadow:none; }
    #payment .payment-head { margin:0 24px; }
    #base .base-master-head { margin:0 2px; }
    #finance .finance-workspace-head { margin:0 2px; }

    /* ui38: prototype-aligned workspaces. Keep accepted workspaces page-scoped. */
    .workspace-icon-btn { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:36px; padding:0 13px; font-size:12px; font-weight:700; }
    .workspace-icon-btn > span { color:inherit; font-size:15px; font-weight:500; line-height:1; }

    .operation-center-trigger { min-height:36px; padding:0 12px; border-radius:9px; background:#fff; }
    .operation-center-panel { width:min(420px,calc(100vw - 32px)); padding:12px; border-radius:13px; }

    #stock.active { gap:12px; overflow-y:auto; }
    #stock .stock-module-intro { align-items:center; margin:0; padding:4px 2px 14px; }
    #stock .stock-module-intro > div:first-child { max-width:820px; }
    #stock .stock-module-intro h2 { max-width:820px; font-size:22px; line-height:1.28; }
    #stock .stock-module-actions { display:flex; align-items:center; gap:8px; }
    #stock .stock-module-actions[hidden] { display:none; }
    #stock .stock-workspace-nav { min-height:62px; grid-template-columns:repeat(5,minmax(0,1fr)); }
    #stock .stock-tab { min-height:62px; padding:10px 14px; color:#4d5e75; background:#fff; font-size:12.5px; text-align:left; }
    #stock .stock-tab small { margin-top:4px; color:#8490a1; font-size:10px; font-weight:500; }
    #stock .stock-tab.active { color:#315bc3; background:#f0f4ff!important; box-shadow:inset 0 -3px #4268dd!important; }
    #stock .stock-tab-content.active { flex:none; min-height:auto; overflow:visible; }
    #stock .stock-workspace-panel { padding:0; overflow:hidden; border-color:#dce3ec; border-radius:12px; background:#fff; box-shadow:0 1px 2px rgba(24,39,63,.04); }
    #stock .inventory-scope-strip { min-height:38px; display:flex; align-items:center; gap:8px; padding:0 16px; color:#748197; border-bottom:1px solid #e4e9f0; background:#f8fafe; font-size:10.5px; }
    #stock .inventory-scope-strip strong { color:#33475f; font-size:11.5px; }
    #stock .inventory-scope-strip small { margin-left:auto; color:#8792a2; }
    #stock .inventory-kpis { margin:0; padding:0; background:#fff; }
    #stock .inventory-kpis > div { min-height:66px; display:grid; align-content:center; padding:10px 16px; }
    #stock .inventory-kpis strong { font-size:18px; }
    #stock .inventory-filter-grid { margin:0; padding:11px 14px; border-bottom:1px solid #e5eaf0; background:#fbfcfe; }
    #stock .inventory-status-filter { margin:0; padding:9px 14px; }
    #stock .inventory-status-filter .btn { min-height:30px; height:30px; border-radius:7px; }
    #stock .inventory-overview-table { min-height:430px; max-height:520px; margin:0 14px; border-radius:9px; }
    #stock .inventory-overview-table table { min-width:1010px; table-layout:fixed; }
    #stock .inventory-overview-table th { height:38px; padding:0 11px; vertical-align:middle; }
    #stock .inventory-overview-table td { height:58px; padding:8px 11px; text-align:left; vertical-align:middle; }
    #stock .inventory-overview-table td > strong { font-size:11.5px; }
    #stock .inventory-overview-table td > span { margin-top:3px; font-size:9.5px; }
    #stock .inventory-overview-table .purchase-warehouse-tag { display:inline-flex; width:auto; min-width:72px; margin-top:3px; padding:2px 7px; }
    #stock .inventory-row-actions { flex-direction:row; align-items:center; gap:8px; }
    #stock .inventory-row-actions .text-action { min-width:0; padding:0; border:0; background:transparent; color:#4164c8; font-size:10.5px; font-weight:700; cursor:pointer; white-space:nowrap; }
    #stock .inventory-row-actions .text-action:hover { color:#274baf; text-decoration:underline; }
    #stock .inventory-pagination { margin:0 14px; min-height:48px; }
    #stockTabCounts .stock-check-import-help { margin:10px 0 12px; }
    #stockTabCounts .stock-check-import-help-trigger { color:#4f6280; }
    @media (min-width:1101px) {
      #stock .inventory-overview-table th:nth-child(1) { width:7%; }
      #stock .inventory-overview-table th:nth-child(2) { width:17%; }
      #stock .inventory-overview-table th:nth-child(3) { width:12%; }
      #stock .inventory-overview-table th:nth-child(4) { width:12%; }
      #stock .inventory-overview-table th:nth-child(5) { width:11%; }
      #stock .inventory-overview-table th:nth-child(6) { width:14%; }
      #stock .inventory-overview-table th:nth-child(7) { width:13%; }
      #stock .inventory-overview-table th:nth-child(8) { width:10%; }
      #stock .inventory-overview-table th:nth-child(9) { width:9%; }
    }

    /* ui45 库存页逐页验收：原型式导航、单行工具栏、共享数值轴线与分级操作。 */
    #stock.stock-workspace { font-family:var(--ui-font); }
    #stock button,
    #stock input,
    #stock select,
    #stock textarea { font-family:inherit; }
    #stock .sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
    #stock .stock-workspace-nav { min-height:58px; }
    #stock .stock-tab { min-height:58px; display:grid; align-content:center; gap:3px; padding:8px 14px; }
    #stock .stock-tab strong { color:inherit; font-size:12.5px; font-weight:700; }
    #stock .stock-tab small { margin:0; font-size:9.5px; line-height:1.35; }
    #stock .stock-tab.active { background:#eef3ff!important; box-shadow:inset 0 -3px #4167d9!important; }

    #stock .inventory-toolbar {
      display:grid;
      grid-template-columns:minmax(240px,1fr) 118px 150px 120px auto;
      gap:8px;
      align-items:center;
      margin:0;
      padding:12px 14px;
      border-bottom:1px solid #e3e8ef;
      background:#fff;
    }
    #stock .inventory-toolbar > select {
      width:100%;
      min-width:0;
      height:38px;
      padding:0 28px 0 10px;
      color:#4f5e73;
      border:1px solid #ced7e4;
      border-radius:8px;
      background:#fff;
      font-family:var(--ui-font);
      font-size:11.5px;
      font-weight:400;
    }
    #stock .inventory-search-shell {
      min-width:0;
      height:38px;
      display:flex;
      align-items:center;
      gap:8px;
      padding:0 10px;
      border:1px solid #ced7e4;
      border-radius:8px;
      background:#fff;
    }
    #stock .inventory-search-shell svg { width:16px; height:16px; flex:0 0 auto; fill:none; stroke:#74839a; stroke-width:1.7; stroke-linecap:round; }
    #stock .inventory-search-shell input { flex:1; min-width:0; height:36px; padding:0; color:#29374c; border:0; border-radius:0; background:transparent; outline:0; font-family:var(--ui-font); font-size:12.5px; font-weight:400; }
    #stock .inventory-search-shell input::placeholder { color:#7f8b9d; opacity:1; }
    #stock .inventory-toolbar .inventory-status-filter { height:38px; display:flex; align-items:stretch; gap:0; margin:0; padding:0; overflow:hidden; border:1px solid #ced7e4; border-radius:8px; background:#fff; }
    #stock .inventory-toolbar .inventory-status-filter .btn { min-width:64px; height:36px; min-height:36px; padding:0 10px; color:#5f6f84; border:0; border-right:1px solid #dce3ec; border-radius:0; background:#fff; box-shadow:none; font-size:10.5px; font-weight:650; }
    #stock .inventory-toolbar .inventory-status-filter .btn:last-child { border-right:0; }
    #stock .inventory-toolbar .inventory-status-filter .btn:hover { color:#315bc3; background:#f7f9ff; }
    #stock .inventory-toolbar .inventory-status-filter .btn.primary { color:#315bc3; background:#eef3ff; box-shadow:inset 0 -2px #4167d9; }

    #stock .inventory-overview-table { min-height:430px; max-height:520px; }
    #stock .inventory-overview-table table { min-width:1010px; }
    #stock .inventory-overview-table th,
    #stock .inventory-ledger-table th,
    #stock .purchase-workspace-table th { height:38px; padding:0 9px; color:#68758a; background:#f8fafc; font-size:10.5px; font-weight:650; vertical-align:middle; }
    #stock .inventory-overview-table td,
    #stock .inventory-ledger-table td,
    #stock .purchase-workspace-table td { padding:8px 9px; color:#3c4a60; font-size:11px; vertical-align:middle; }
    #stock table th.numeric-text,
    #stock table td.numeric-text,
    #stock table th.num-c,
    #stock table td.num-c,
    #stock table th.num-r,
    #stock table td.num-r { text-align:right; font-variant-numeric:tabular-nums; }
    #stock .inventory-overview-table td > strong,
    #stock .inventory-ledger-table td > strong { font-size:11.5px; }
    #stock .inventory-overview-table td > span,
    #stock .inventory-ledger-table td > span { font-size:9.5px; }
    #stock .inventory-negative-value { color:#b43a4e!important; }
    #stock .inventory-row-actions { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:6px; }
    #stock .inventory-cost-control { min-width:0; display:flex; flex-wrap:wrap; align-items:center; gap:4px 6px; }
    #stock .inventory-cost-layer-action { min-width:0; min-height:42px; display:grid; grid-template-columns:12px minmax(0,1fr); gap:5px; align-items:center; padding:5px 7px; color:#3857b4; border:1px solid #d5defb; border-radius:8px; background:#eef2ff; text-align:left; cursor:pointer; }
    #stock .inventory-cost-layer-action:hover { border-color:#b8c7f5; background:#e8eeff; }
    #stock .inventory-cost-layer-action > span:last-child { min-width:0; display:grid; gap:1px; }
    #stock .inventory-cost-layer-action strong { overflow:hidden; font-size:10.5px; font-weight:700; text-overflow:ellipsis; white-space:nowrap; }
    #stock .inventory-cost-layer-action small { overflow:hidden; color:#7887a2; font-size:8.5px; text-overflow:ellipsis; white-space:nowrap; }
    #stock .inventory-action-chevron { color:#5d78cf; font-size:18px; font-weight:300; line-height:1; }
    #stock .inventory-unified-cost { display:inline-flex; min-height:24px; align-items:center; justify-content:center; padding:0 9px; color:#657287; border-radius:999px; background:#f1f4f7; font-size:9.5px; font-weight:650; }
    #stock .inventory-batch-trace-action { padding:0; color:#4164c8; border:0; background:transparent; font-size:9.5px; font-weight:650; cursor:pointer; white-space:nowrap; }
    #stock .inventory-batch-trace-action:hover { color:#274baf; text-decoration:underline; }
    #stock .inventory-correct-action { min-width:0; padding:0; color:#526785; border:0; background:transparent; font-size:9.5px; font-weight:650; cursor:pointer; white-space:nowrap; }
    #stock .inventory-correct-action:hover { color:#315bc3; text-decoration:underline; }
    @media (min-width:1101px) {
      #stock .inventory-overview-table th:nth-child(1) { width:7%; }
      #stock .inventory-overview-table th:nth-child(2) { width:14%; }
      #stock .inventory-overview-table th:nth-child(3) { width:11%; }
      #stock .inventory-overview-table th:nth-child(4) { width:10%; }
      #stock .inventory-overview-table th:nth-child(5) { width:9%; }
      #stock .inventory-overview-table th:nth-child(6) { width:13%; }
      #stock .inventory-overview-table th:nth-child(7) { width:12%; }
      #stock .inventory-overview-table th:nth-child(8) { width:9%; }
      #stock .inventory-overview-table th:nth-child(9) { width:15%; }
    }
    #stock .purchase-workspace-table table { min-width:1130px; }
    #stock .purchase-workspace-head,
    #stock .inventory-overview-head { min-height:54px; align-items:center; padding:9px 14px; }
    #stock .stock-panel-context { min-width:0; display:flex; align-items:center; gap:9px; }
    #stock .stock-panel-context .purchase-workspace-eyebrow { flex:0 0 auto; margin:0; color:#4967c3; font-size:9.5px; letter-spacing:.04em; }
    #stock .stock-panel-context p { margin:0; color:#7b8798; font-size:10.5px; }
    #stock .purchase-workspace-actions,
    #stock .inventory-overview-actions { flex-wrap:nowrap; }
    #stock .purchase-workspace-actions .btn,
    #stock .inventory-overview-actions .btn { height:34px; padding:0 11px; font-size:10.5px; }
    #stock .purchase-workspace-table th:nth-child(1) { width:105px; }
    #stock .purchase-workspace-table th:nth-child(2) { width:150px; }
    #stock .purchase-workspace-table th:nth-child(3) { width:120px; }
    #stock .purchase-workspace-table th:nth-child(4) { width:100px; }
    #stock .purchase-workspace-table th:nth-child(5) { width:230px; }
    #stock .purchase-workspace-table th:nth-child(6) { width:80px; }
    #stock .purchase-workspace-table th:nth-child(7) { width:105px; }
    #stock .purchase-workspace-table th:nth-child(8) { width:90px; }
    #stock .purchase-workspace-table th:nth-child(9) { width:150px; }
    #stock .purchase-row-actions { display:flex; flex-wrap:nowrap; align-items:center; gap:7px; }
    #stock .inventory-view-action { padding:0; color:#315bc3; border:0; background:transparent; font-size:10.5px; font-weight:700; cursor:pointer; white-space:nowrap; }
    #stock .inventory-view-action:hover { text-decoration:underline; }
    #stock .inventory-danger-action { padding:0; color:#b42d47; border:0; background:transparent; font-size:10px; font-weight:650; cursor:pointer; white-space:nowrap; }
    #stock .inventory-danger-action:hover { text-decoration:underline; }
    #stock .inventory-more-action { height:29px; display:inline-flex; align-items:center; gap:4px; padding:0 8px; color:#52637a; border:1px solid #d4dce7; border-radius:7px; background:#fff; font-size:10px; font-weight:650; cursor:pointer; white-space:nowrap; }
    #stock .inventory-more-action:hover { color:#315bc3; border-color:#b9c6da; background:#f8faff; }
    .purchase-row-action-menu { position:fixed; z-index:10050; width:148px; display:grid; gap:2px; padding:6px; border:1px solid #d7dfe9; border-radius:10px; background:#fff; box-shadow:0 14px 36px rgba(29,45,70,.17); }
    .purchase-row-action-menu button { min-height:32px; padding:0 9px; color:#3d4e65; border:0; border-radius:7px; background:transparent; font:inherit; font-size:11px; text-align:left; cursor:pointer; }
    .purchase-row-action-menu button:hover { background:#f3f6fb; }
    .purchase-row-action-menu button.is-warning { color:#9a6309; }
    .purchase-row-action-menu button.is-danger { color:#b42d47; }
    @media (max-width:1180px) {
      #stock .inventory-toolbar { grid-template-columns:minmax(260px,1fr) repeat(3,minmax(110px,.45fr)); }
      #stock .inventory-toolbar .inventory-status-filter { grid-column:1 / -1; width:max-content; max-width:100%; }
    }
    @media (max-width:760px) {
      #stock .inventory-toolbar { grid-template-columns:1fr 1fr; }
      #stock .inventory-search-shell,
      #stock .inventory-toolbar .inventory-status-filter { grid-column:1 / -1; width:100%; }
      #stock .inventory-toolbar .inventory-status-filter { overflow-x:auto; }
    }

    #payment .payment-head { align-items:center; margin:0 24px; }
    #payment .payment-head-actions { flex-wrap:nowrap; }
    #payment .payment-context-strip { min-height:40px; display:flex; align-items:center; gap:8px; margin:0 24px; padding:0 14px; color:#748197; border:1px solid #dfe5ed; border-radius:9px; background:#f8fafe; font-size:10.5px; }
    #payment .payment-context-strip strong { color:#2d415a; font-size:11.5px; }
    #payment .payment-context-strip small { margin-left:auto; color:#8792a2; }
    #payment .payment-kpis { margin-top:12px; }
    #payment .payment-view-note { align-items:center; }
    #payment .payment-view-note > div { display:grid; gap:3px; }
    #payment .payment-view-note .workspace-icon-btn { margin-left:auto; }

    #base .base-master-workspace { display:flex; flex-direction:column; gap:12px; overflow:visible; }
    /* ui55: the data workspace owns the outer vertical scroll, matching the prototype.
       The large master list remains independently scrollable for fast record scanning. */
    #base.base-workspace.active {
      overflow-x:hidden;
      overflow-y:auto;
      overscroll-behavior:contain;
      scrollbar-gutter:stable;
    }
    #base.base-workspace.active > .base-master-workspace { flex:0 0 auto; min-height:auto; }
    #base .base-master-head { align-items:center; flex-direction:row; margin:0; padding:4px 2px 14px; }
    #base .base-master-head-actions { display:flex; align-items:center; gap:8px; }
    #base .base-health { flex:0 0 auto; overflow:hidden; border:1px solid #dfe5ed; border-radius:11px; background:#fff; }
    #base .base-health-head { min-height:56px; display:flex; align-items:center; justify-content:space-between; gap:16px; padding:10px 15px; border-bottom:1px solid #e5eaf0; }
    #base .base-health-head h3 { margin:0; color:#24364d; font-size:13px; }
    #base .base-health-head p { margin:3px 0 0; color:#7b8797; font-size:10.5px; }
    #base .base-health-head > span { padding:4px 9px; color:#66758b; border-radius:999px; background:#f1f4f8; font-size:10px; }
    #base .base-health-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:0; }
    #base .base-health-card { min-width:0; min-height:64px; display:grid; grid-template-columns:28px minmax(0,1fr) auto; gap:9px; align-items:center; padding:10px 14px; color:#33465d; border:0; border-right:1px solid #e5eaf0; background:#fff; text-align:left; cursor:pointer; }
    #base .base-health-card:last-child { border-right:0; }
    #base .base-health-card:hover { background:#f8faff; }
    #base .base-health-icon { width:26px; height:26px; display:grid; place-items:center; color:#9b650a; border-radius:8px; background:#fff1d6; font-size:12px; font-weight:800; }
    #base .base-health-card.info .base-health-icon { color:#365fc5; background:#eaf0ff; }
    #base .base-health-card.ok .base-health-icon { color:#08775d; background:#e2f6ef; }
    #base .base-health-card > span:nth-child(2) { min-width:0; display:grid; gap:3px; }
    #base .base-health-card strong { overflow:hidden; font-size:11.5px; text-overflow:ellipsis; white-space:nowrap; }
    #base .base-health-card small { overflow:hidden; color:#7c8899; font-size:9.5px; text-overflow:ellipsis; white-space:nowrap; }
    #base .base-health-card b { color:#718096; font-size:17px; font-weight:500; }
    #base .base-master-tabs { flex:0 0 auto; min-height:62px; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); padding:0; overflow:hidden; border:1px solid #dfe5ed; border-radius:10px; background:#fff; }
    #base .base-master-tabs button { min-width:0; min-height:62px; display:grid; align-content:center; gap:4px; padding:8px 14px; border:0; border-right:1px solid #e2e7ee; border-radius:0; background:#fff; color:#4d5e75; text-align:left; }
    #base .base-master-tabs button:last-child { border-right:0; }
    #base .base-master-tabs button.active { color:#315bc3; background:#f0f4ff; box-shadow:inset 0 -3px #4268dd; }
    #base .base-master-tabs button > span { font-size:12px; font-weight:750; }
    #base .base-master-tabs button > small { color:#8490a1; font-size:9.5px; font-weight:500; }
    #base .base-master-tabs button > small strong { color:inherit; font-size:inherit; }
    #base .base-master-tools { flex:0 0 auto; display:grid; grid-template-columns:minmax(280px,1fr) 140px auto; gap:8px; align-items:center; }
    #base .base-master-search { height:36px; display:flex; align-items:center; gap:7px; padding:0 10px; border:1px solid #d4dce7; border-radius:8px; background:#fff; }
    #base .base-master-search > span { color:#7f8b9c; font-size:17px; }
    #base .base-master-search input { flex:1; min-width:0; height:34px; padding:0; border:0; background:transparent; outline:0; }
    #base .base-master-tools > select { height:36px; padding:0 10px; border:1px solid #d4dce7; border-radius:8px; background:#fff; color:#3c4c62; }
    #base .base-master-layout { min-height:520px; grid-template-columns:minmax(660px,1.4fr) minmax(330px,.75fr); }
    #base .base-master-list-card { overflow:hidden; }
    #base .base-master-list { max-height:560px; padding:0; }
    #base .base-master-list-columns,
    #base .base-master-list-item { display:grid; grid-template-columns:minmax(170px,1.15fr) minmax(180px,1.25fr) minmax(130px,.9fr) 74px 54px; gap:12px; align-items:center; }
    #base .base-master-list-columns { position:sticky; top:0; z-index:2; min-height:36px; padding:0 12px; color:#718095; border-bottom:1px solid #dfe5ed; background:#f7f9fc; font-size:9.5px; font-weight:700; }
    #base .base-master-list-item { min-height:58px; padding:8px 12px; border:0; border-bottom:1px solid #e7ecf2; border-radius:0; }
    #base .base-master-list-item + .base-master-list-item { margin:0; }
    #base .base-master-list-item:hover { border-color:#e7ecf2; background:#f8faff; }
    #base .base-master-list-item.selected { border-color:#e7ecf2; background:#eef3ff; box-shadow:inset 3px 0 #4568d9; }
    #base .base-master-item-main { display:grid; gap:3px; }
    #base .base-master-item-main strong { font-size:11.5px; }
    #base .base-master-item-main small { font-size:9.5px; }
    #base .base-master-item-sub,
    #base .base-master-item-usage { min-width:0; overflow:hidden; color:#64758a; font-size:10.5px; text-overflow:ellipsis; white-space:nowrap; }
    #base .base-master-list-item .status-badge { grid-column:auto; grid-row:auto; justify-self:start; }
    #base .base-master-maintain { color:#4164c8; font-size:10.5px; font-weight:700; }
    #baseEditModal .modal-box { width:min(540px,calc(100vw - 32px)); max-height:calc(100vh - 32px); overflow:auto; }
    #baseEditModal .form-row > div > label { color:#43546a; font-size:11px; font-weight:650; }
    #baseEditModal .form-row input:not([type="checkbox"]),
    #baseEditModal .form-row select,
    #baseEditModal .form-row textarea {
      height:38px;
      padding:0 10px;
      border-radius:8px;
      font-family:var(--ui-font);
      font-size:12px;
      font-weight:650;
    }
    #baseEditModal .form-row textarea { min-height:72px; height:auto; padding:9px 10px; line-height:1.5; }
    #baseEditModal .modal-actions {
      position:sticky;
      bottom:-1px;
      z-index:2;
      padding-top:12px;
      border-top:1px solid #e5eaf0;
      background:#fff;
    }

    /* ui58: 资料页按原型的信息层级收口；仅作用于 #base 与资料维护弹窗。 */
    #base .base-master-tools > select {
      height:38px;
      padding:0 11px;
      color:#33465d;
      border:1px solid #d5dde8;
      border-radius:9px;
      background-color:#fff;
      box-shadow:none;
      outline:0;
      font-family:var(--ui-font);
      font-size:11.5px;
      font-weight:600;
    }
    #base .base-master-tools > select:hover { border-color:#b9c6d8; }
    #base .base-master-tools > select:focus { border-color:#6f86d8; box-shadow:0 0 0 3px rgba(66,103,217,.11); }
    #base .base-master-layout { align-items:start; }
    #base .base-master-list-card { align-self:start; }
    #base .base-master-list-item.selected { background:#f2f5fd; box-shadow:inset 3px 0 #4268d9; }
    #base .base-master-detail { align-self:start; padding:0; overflow:hidden; }
    #base .base-detail-head { min-height:82px; padding:16px 18px 14px; border-bottom:1px solid #e3e9f1; background:#fff; }
    #base .base-detail-head span:first-child { color:#4164c8; font-size:10px; font-weight:760; letter-spacing:.03em; }
    #base .base-detail-head h3 { margin:5px 0 3px; color:#203247; font-size:17px; line-height:1.25; letter-spacing:-.2px; }
    #base .base-detail-head p { color:#7d8a9b; font-size:10px; }
    #base .base-detail-context { min-height:54px; display:grid; grid-template-columns:auto minmax(0,1fr); gap:3px 9px; align-content:center; margin:0; padding:10px 18px; color:#50627b; border-bottom:1px solid #d9e2f2; background:#f4f7fd; }
    #base .base-detail-context > span { grid-row:1 / 3; align-self:center; padding:4px 7px; color:#3c61c5; border-radius:7px; background:#e7edff; font-size:9.5px; font-weight:750; }
    #base .base-detail-context > strong { overflow:hidden; color:#2e4362; font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
    #base .base-detail-context > small { color:#718097; font-size:9.5px; line-height:1.45; }
    #base .base-detail-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); border-bottom:1px solid #e4eaf2; background:#fff; }
    #base .base-detail-summary > div { min-width:0; min-height:78px; display:grid; align-content:center; gap:5px; padding:12px 14px; border-right:1px solid #e4eaf2; }
    #base .base-detail-summary > div:last-child { border-right:0; }
    #base .base-detail-summary span { color:#758297; font-size:9.5px; }
    #base .base-detail-summary strong { overflow-wrap:anywhere; color:#263b56; font-size:11.5px; line-height:1.35; }
    #base .base-detail-summary small { color:#8793a3; font-size:9px; line-height:1.4; }
    #base .base-detail-section { margin:14px 16px 0; overflow:hidden; border:1px solid #dfe6ef; border-radius:10px; background:#fff; }
    #base .base-detail-section > header { min-height:43px; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:9px 12px; border-bottom:1px solid #e5eaf1; background:#f8fafc; }
    #base .base-detail-section > header strong { color:#31465f; font-size:11px; }
    #base .base-detail-section > header small { color:#8591a1; font-size:9px; text-align:right; }
    #base .base-detail-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0; margin:0; }
    #base .base-detail-field { min-width:0; min-height:58px; display:grid; grid-template-columns:1fr; align-content:center; gap:5px; padding:10px 12px; border-bottom:1px solid #edf0f5; }
    #base .base-detail-field:nth-child(odd) { border-right:1px solid #edf0f5; }
    #base .base-detail-field > span { color:#78869a; font-size:9.5px; }
    #base .base-detail-field > strong { color:#283d56; font-size:11px; font-weight:700; line-height:1.4; }
    #base .base-detail-field > small { grid-column:1; color:#8793a3; font-size:9px; line-height:1.4; }
    #base .base-detail-notice { margin:14px 16px 0; padding:11px 13px; border-color:#d6e1f6; border-radius:9px; background:#f4f7ff; }
    #base .base-detail-notice strong { color:#3559b7; font-size:10px; }
    #base .base-detail-notice p { margin:4px 0 0; color:#63748c; font-size:9.5px; line-height:1.55; }
    #base .base-audit-panel { margin:14px 16px 0; padding:11px 13px; border-radius:9px; }
    #base .base-detail-actions { min-height:60px; margin:14px 0 0; padding:11px 16px; border-top:1px solid #e3e9f1; background:#fbfcfe; }
    #base .base-detail-actions .btn { min-height:36px; }
    #base .base-inline-edit-head { min-height:68px; padding-top:12px; padding-bottom:10px; background:#fbfcff; }
    #base .base-inline-edit-context { min-height:46px; padding-top:7px; padding-bottom:7px; }
    #base .base-inline-readonly-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); border-bottom:1px solid #e4eaf2; background:#f9fbff; }
    #base .base-inline-readonly-summary > div { min-width:0; display:grid; gap:2px; padding:8px 14px; }
    #base .base-inline-readonly-summary > div + div { border-left:1px solid #e4eaf2; }
    #base .base-inline-readonly-summary span { color:#6f7f95; font-size:9.5px; }
    #base .base-inline-readonly-summary strong { color:#2b405d; font-size:11.5px; }
    #base .base-inline-readonly-summary small { color:#8794a6; font-size:9px; line-height:1.35; }
    #base .base-inline-edit-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px 12px; padding:9px 18px 2px; }
    #base .base-inline-field { min-width:0; display:grid; align-content:start; gap:2px; padding:0; border:0; border-radius:0; background:transparent; }
    #base .base-inline-field.span-2 { grid-column:1 / -1; }
    #base .base-inline-field label { color:#4a5d75; font-size:10px; font-weight:700; }
    #base .base-inline-field input,
    #base .base-inline-field select,
    #base .base-inline-field textarea { width:100%; min-width:0; height:34px; padding:0 10px; color:#263b56; border:1px solid #cfd9e7; border-radius:8px; background:#fff; font-family:var(--ui-font); font-size:11.5px; font-weight:600; }
    #base .base-inline-field textarea { min-height:54px; height:auto; padding:8px 10px; line-height:1.45; resize:vertical; }
    #base .base-inline-field input[readonly],
    #base .base-inline-field input:disabled,
    #base .base-inline-field select:disabled { color:#718097; background:#f3f6fa; cursor:not-allowed; }
    #base .base-inline-field input:focus,
    #base .base-inline-field select:focus,
    #base .base-inline-field textarea:focus { outline:0; border-color:#6f86d8; box-shadow:0 0 0 3px rgba(66,103,217,.11); }
    #base .base-inline-field small { padding-left:8px; color:#5d72a1; border-left:2px solid #a9bbee; font-size:9.25px; line-height:1.4; }
    #base .base-inline-field #editCostModeHint { color:#8a641d; border-left-color:#e4b75c; }
    #base .base-inline-inventory-card { margin:10px 18px 0; overflow:hidden; border:1px solid #dfe6ef; border-radius:9px; background:#fff; }
    #base .base-inline-inventory-card > header { min-height:40px; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:8px 11px; border-bottom:1px solid #e4e9f0; background:#fbfcfe; }
    #base .base-inline-inventory-card > header strong { color:#30445e; font-size:10.5px; }
    #base .base-inline-inventory-card > header small { color:#7d8a9c; font-size:8.75px; text-align:right; }
    #base .base-inline-inventory-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
    #base .base-inline-inventory-grid > div { min-width:0; display:grid; gap:3px; padding:8px 11px; border-bottom:1px solid #edf1f5; }
    #base .base-inline-inventory-grid > div:nth-child(odd) { border-right:1px solid #edf1f5; }
    #base .base-inline-inventory-grid span { color:#78869a; font-size:9px; }
    #base .base-inline-inventory-grid strong { overflow-wrap:anywhere; color:#293e59; font-size:10.25px; line-height:1.35; }
    #base .base-inline-inventory-state { padding:13px 11px; color:#748297; font-size:9.5px; line-height:1.5; }
    #base .base-inline-inventory-link { display:flex; align-items:center; gap:7px; margin:7px 10px 9px; padding:2px 0; color:#315dcc; border:0; background:transparent; font:inherit; font-size:10px; font-weight:720; cursor:pointer; }
    #base .base-inline-inventory-link:hover { color:#214aa9; text-decoration:underline; text-underline-offset:3px; }
    #base .base-inline-inventory-link:focus-visible { outline:2px solid #7890df; outline-offset:3px; border-radius:3px; }
    #base .base-inline-edit-boundary { display:grid; grid-template-columns:minmax(0,1fr); align-items:start; margin:9px 18px 0; padding:9px 10px; color:#6f551e; border:1px solid #ecd39a; border-radius:8px; background:#fff9ec; }
    #base .base-inline-edit-boundary > div { display:grid; gap:3px; }
    #base .base-inline-edit-boundary strong { font-size:9.75px; }
    #base .base-inline-edit-boundary span { font-size:9.25px; line-height:1.45; }
    #base .base-inline-status-field { display:grid; gap:4px; margin:9px 18px 12px; }
    #base .base-inline-status-field label { color:#4a5d75; font-size:10px; font-weight:700; }
    #base .base-inline-status-field select { width:100%; height:34px; padding:0 10px; color:#263b56; border:1px solid #cfd9e7; border-radius:8px; background:#fff; font-family:var(--ui-font); font-size:11.5px; font-weight:600; }
    #base .base-inline-status-field select:focus { outline:0; border-color:#6f86d8; box-shadow:0 0 0 3px rgba(66,103,217,.11); }
    #base .base-inline-edit-actions { min-height:52px; align-items:center; justify-content:space-between; margin-top:8px; padding-top:8px; padding-bottom:8px; }
    #base .base-inline-edit-actions > div { display:flex; gap:8px; }
    #base .base-inline-dirty-state { color:#8793a3; font-size:9.5px; }
    #base .base-inline-dirty-state.is-dirty { color:#ad7619; font-weight:700; }
    #base .base-inline-status-field .inline-check { display:flex; align-items:center; gap:6px; color:#5f7086; font-size:9.5px; font-weight:600; }
    #base .base-inline-status-field .inline-check input { width:14px; height:14px; margin:0; }
    #base .base-inline-edit-form > .staff-scope-group { grid-column:1 / -1; display:grid; gap:6px; padding:8px 10px; border:1px solid #dfe6ef; border-radius:8px; background:#f8faff; }
    #base .base-inline-edit-form > .staff-scope-group[hidden] { display:none!important; }
    #base .base-inline-edit-form > .staff-scope-group > label { color:#4a5d75; font-size:10px; font-weight:700; }
    #base .base-inline-edit-form .staff-scope-options { gap:6px; }
    #base .base-inline-edit-form .staff-scope-options label { min-width:76px; padding:5px 8px; border-radius:7px; font-size:9.5px; }
    #base .base-inline-edit-form .staff-scope-group small { color:#6b7c92; font-size:9px; line-height:1.4; }

    #baseEditModal { padding:16px; }
    #baseEditModal .modal-box { width:min(780px,calc(100vw - 32px)); max-height:calc(100vh - 32px); overflow:auto; padding:0; border:1px solid #dbe3ee; border-radius:15px; background:#f6f8fb; box-shadow:0 24px 70px rgba(24,39,62,.22); }
    #baseEditModal .base-edit-modal-head { position:sticky; top:0; z-index:4; min-height:92px; display:flex; align-items:flex-start; justify-content:space-between; gap:18px; padding:16px 18px 14px; border-bottom:1px solid #dfe6ef; background:#fff; }
    #baseEditModal .base-edit-modal-head > div { min-width:0; display:grid; gap:4px; }
    #baseEditModal .base-edit-modal-head span { color:#4164c8; font-size:10px; font-weight:760; letter-spacing:.04em; }
    #baseEditModal .base-edit-modal-head h3 { margin:0; color:#203247; font-size:18px; line-height:1.25; letter-spacing:-.25px; }
    #baseEditModal .base-edit-modal-head p { margin:0; color:#748297; font-size:10.5px; line-height:1.5; }
    #baseEditModal .base-edit-close { flex:0 0 36px; width:36px; height:36px; display:grid; place-items:center; padding:0; color:#627189; border:1px solid #d8e0eb; border-radius:10px; background:#fff; font:inherit; font-size:18px; line-height:1; cursor:pointer; }
    #baseEditModal .base-edit-close:hover { color:#3159bd; border-color:#bfccec; background:#f4f7ff; }
    #baseEditModal .base-edit-close:focus { outline:0; }
    #baseEditModal .base-edit-close:focus-visible { border-color:#7b91df; box-shadow:0 0 0 3px rgba(66,103,217,.12); }
    #baseEditModal .form-row { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 12px; padding:14px 16px 16px; }
    #baseEditModal .form-row > .base-edit-context { min-height:60px; display:grid; grid-template-columns:auto minmax(0,1fr); gap:3px 10px; align-content:center; padding:10px 12px; color:#50627a; border:1px solid #d8e2f3; border-radius:10px; background:#f1f5fd; }
    #baseEditModal .base-edit-context > span { grid-row:1 / 3; align-self:center; padding:5px 8px; color:#355bc0; border-radius:7px; background:#e2eaff; font-size:9.5px; font-weight:750; }
    #baseEditModal .base-edit-context > strong { color:#2c4261; font-size:11px; }
    #baseEditModal .base-edit-context > small { color:#6f7f96; font-size:9.5px; }
    #baseEditModal .form-row > .base-edit-field { min-width:0; display:grid; align-content:start; gap:6px; padding:10px 11px; border:1px solid #e0e6ef; border-radius:10px; background:#fff; }
    #baseEditModal .form-row > .base-edit-field.span-2,
    #baseEditModal .form-row > .base-edit-context,
    #baseEditModal .form-row > .staff-scope-group { grid-column:1 / -1; }
    #baseEditModal .form-row > div > label { color:#53647a; font-size:10px; font-weight:680; }
    #baseEditModal .form-row input:not([type="checkbox"]),
    #baseEditModal .form-row select,
    #baseEditModal .form-row textarea { width:100%; height:38px; padding:0 10px; color:#273a53; border:1px solid #d5dde8; border-radius:8px; background:#fff; box-shadow:none; outline:0; font-size:12px; font-weight:600; }
    #baseEditModal .form-row input[readonly],
    #baseEditModal .form-row input:disabled,
    #baseEditModal .form-row select:disabled { color:#728095; background:#f3f5f8; }
    #baseEditModal .form-row input:not([type="checkbox"]):focus,
    #baseEditModal .form-row select:focus,
    #baseEditModal .form-row textarea:focus { border-color:#6f86d8; box-shadow:0 0 0 3px rgba(66,103,217,.11); }
    #baseEditModal .form-row textarea { min-height:76px; height:auto; padding:9px 10px; line-height:1.5; resize:vertical; }
    #baseEditModal .form-row small { color:#7f8c9e; font-size:9px; line-height:1.5; }
    #baseEditModal .staff-scope-group { background:#fff; }
    #baseEditModal .staff-scope-group[hidden] { display:none!important; }
    #baseEditModal .modal-actions { position:sticky; bottom:-1px; z-index:4; min-height:64px; margin:0; padding:12px 16px; border-top:1px solid #dfe6ef; background:rgba(255,255,255,.97); }
    #baseEditModal .modal-actions .btn { min-height:38px; padding:0 14px; }

    @media (max-width:720px) {
      #base .base-detail-grid,
      #base .base-inline-edit-form,
      #baseEditModal .form-row { grid-template-columns:1fr; }
      #base .base-inline-field.span-2 { grid-column:1; }
      #base .base-inline-readonly-summary { grid-template-columns:1fr; }
      #base .base-inline-readonly-summary > div + div { border-left:0; border-top:1px solid #e4eaf2; }
      #base .base-inline-inventory-grid { grid-template-columns:1fr; }
      #base .base-inline-inventory-grid > div:nth-child(odd) { border-right:0; }
      #base .base-inline-inventory-card > header { align-items:flex-start; flex-direction:column; gap:2px; }
      #base .base-inline-inventory-card > header small { text-align:left; }
      #base .base-inline-edit-actions { align-items:stretch; flex-direction:column; }
      #base .base-inline-edit-actions > div { width:100%; }
      #base .base-inline-edit-actions > div .btn { flex:1; }
      #base .base-detail-summary { grid-template-columns:1fr; }
      #base .base-detail-summary > div { min-height:56px; border-right:0; border-bottom:1px solid #e4eaf2; }
      #base .base-detail-summary > div:last-child { border-bottom:0; }
      #base .base-detail-field:nth-child(odd) { border-right:0; }
      #baseEditModal .form-row > .base-edit-field.span-2,
      #baseEditModal .form-row > .base-edit-context,
      #baseEditModal .form-row > .staff-scope-group { grid-column:1; }
    }

    /* ui82 — C 版专业高密度标准：第一批仅收口公共壳层与首页。
       作用域刻意挂在 body.ui-c-standard，后续页面逐页接入时不靠无边界全局覆盖。 */
    .ui-c-standard {
      --ui-font: "Segoe UI Variable Text", "Segoe UI Variable", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
      --ui-brand: #4167d9;
      --ui-brand-hover: #3159bd;
      --ui-brand-soft: #eef2ff;
      --ui-ink: #172231;
      --ui-text: #3f4d61;
      --ui-muted: #6b7482;
      --ui-canvas: #f3f5f8;
      --ui-surface: #ffffff;
      --ui-subtle: #f7f9fc;
      --ui-border: #dce2ea;
      --ui-divider: #e9edf2;
      --ui-success: #07845e;
      --ui-success-bg: #e4f5ee;
      --ui-warning: #9a5b00;
      --ui-warning-bg: #fff3d8;
      --ui-danger: #c9374f;
      --ui-danger-bg: #fdebee;
      --ui-control: 36px;
      --ui-control-compact: 32px;
      --ui-row: 44px;
      --ui-radius: 8px;
      --ui-panel-radius: 9px;
      --ui-page-gap: 12px;
      --ui-panel-pad: 16px;
      --ui-shadow: 0 1px 2px rgba(23,34,49,.04);
      font-family: var(--ui-font);
      color: var(--ui-ink);
      background: var(--ui-canvas);
    }
    .ui-c-standard button,
    .ui-c-standard input,
    .ui-c-standard select,
    .ui-c-standard textarea { font-family:inherit; }
    .ui-c-standard .main { background:var(--ui-canvas); }
    .ui-c-standard .side { padding:20px 10px 16px; background:#182330; }
    .ui-c-standard .brand { margin:2px 0 20px; font-size:18px; font-weight:750; letter-spacing:-.3px; }
    .ui-c-standard .nav { gap:4px; }
    .ui-c-standard .nav button {
      min-height:54px;
      padding:4px;
      border-radius:9px;
      font-size:12px;
      line-height:18px;
    }
    .ui-c-standard .nav button span.nav-icon { width:24px; height:24px; margin-bottom:4px; }
    .ui-c-standard .nav button span.nav-icon svg { width:18px; height:18px; }
    .ui-c-standard .nav button.active { border-radius:9px; }
    .ui-c-standard .topbar {
      min-height:64px;
      padding:0 24px;
      border-bottom-color:var(--ui-border);
      background:var(--ui-surface);
    }
    .ui-c-standard .title { gap:12px; }
    .ui-c-standard .title h1 { color:var(--ui-ink); font-size:22px; line-height:30px; font-weight:700; letter-spacing:-.35px; }
    .ui-c-standard .user { gap:8px; font-size:12px; }
    .ui-c-standard .notify-bell { width:36px; height:36px; border-radius:8px; }
    .ui-c-standard .role-badge { min-width:160px; height:36px; padding:0 9px 0 5px; gap:8px; border-radius:8px; }
    .ui-c-standard .role-badge .role-avatar { width:28px; height:28px; border-radius:7px; }
    .ui-c-standard .role-badge .role-meta .role-meta-name { font-size:12px; line-height:16px; }
    .ui-c-standard .role-badge .role-meta .role-meta-role { font-size:11px; line-height:14px; }
    .ui-c-standard .run-status { font-size:12px; line-height:18px; }
    .ui-c-standard .page.active { padding:16px 24px 28px; }

    .ui-c-standard #home.home-workspace { gap:var(--ui-page-gap); padding-top:16px; }
    .ui-c-standard #home .home-intro { min-height:64px; }
    .ui-c-standard #home .home-intro h2 { margin:2px 0; color:var(--ui-ink); font-size:22px; line-height:30px; font-weight:700; letter-spacing:-.35px; }
    .ui-c-standard #home .home-eyebrow { color:var(--ui-muted); font-size:12px; line-height:18px; font-weight:600; }
    .ui-c-standard #home .home-intro p { color:var(--ui-muted); font-size:12px; line-height:18px; }
    .ui-c-standard #home .home-intro-actions { gap:8px; }
    .ui-c-standard #home .home-scope-control summary,
    .ui-c-standard #home .home-update-control {
      min-height:var(--ui-control);
      height:var(--ui-control);
      gap:8px;
      padding:0 12px;
      color:#2c4362;
      border-color:var(--ui-border);
      border-radius:var(--ui-radius);
      box-shadow:none;
      font-size:12px;
    }
    .ui-c-standard #home .home-scope-control summary { min-width:200px; }
    .ui-c-standard #home .home-scope-control strong,
    .ui-c-standard #home .home-update-control strong { font-size:12px; line-height:18px; font-weight:650; }
    .ui-c-standard #home .home-scope-control summary:hover,
    .ui-c-standard #home .home-update-control:hover { border-color:#9fb2e8; background:#f8faff; box-shadow:none; }
    .ui-c-standard #home .home-scope-popover { top:42px; width:248px; gap:4px; padding:12px 14px; border-color:var(--ui-border); border-radius:var(--ui-panel-radius); }
    .ui-c-standard #home .home-scope-popover span,
    .ui-c-standard #home .home-scope-popover small { font-size:12px; line-height:18px; }
    .ui-c-standard #home .home-scope-popover strong { font-size:14px; line-height:22px; }
    .ui-c-standard #home .home-update-control { min-width:108px; }

    .ui-c-standard #home .home-kpis,
    .ui-c-standard #home .home-focus-grid > .panel,
    .ui-c-standard #home .home-monthly-panel,
    .ui-c-standard #home .home-trend-panel {
      border-color:var(--ui-border);
      border-radius:var(--ui-panel-radius);
      box-shadow:var(--ui-shadow);
    }
    .ui-c-standard #home .home-kpis article { min-height:92px; padding:12px var(--ui-panel-pad); }
    .ui-c-standard #home .home-kpis article::before { top:18px; bottom:18px; width:2px; }
    .ui-c-standard #home .home-kpis article > div { gap:3px; }
    .ui-c-standard #home .home-kpis span { font-size:12px; line-height:18px; font-weight:650; }
    .ui-c-standard #home .home-kpis strong { font-size:22px; line-height:30px; font-weight:700; letter-spacing:-.25px; }
    .ui-c-standard #home .home-kpis small { font-size:12px; line-height:18px; }
    .ui-c-standard #home .home-focus-grid { gap:var(--ui-page-gap); }
    .ui-c-standard #home .home-task-panel .panel-head,
    .ui-c-standard #home .home-receivable-panel .panel-head,
    .ui-c-standard #home .home-monthly-panel .panel-head,
    .ui-c-standard #home .home-trend-panel .panel-head { min-height:60px; padding:10px var(--ui-panel-pad); }
    .ui-c-standard #home .home-task-panel .panel-head h2,
    .ui-c-standard #home .home-receivable-panel .panel-head h2,
    .ui-c-standard #home .home-monthly-panel .panel-head h2,
    .ui-c-standard #home .home-trend-panel .panel-head h2 { color:var(--ui-ink); font-size:16px; line-height:24px; font-weight:700; }
    .ui-c-standard #home .home-task-panel .panel-head p,
    .ui-c-standard #home .home-receivable-panel .panel-head p,
    .ui-c-standard #home .home-monthly-panel .panel-head p,
    .ui-c-standard #home .home-trend-panel .panel-head p { color:var(--ui-muted); font-size:12px; line-height:18px; }
    .ui-c-standard #home .home-task-list { padding:0 12px 8px; }
    .ui-c-standard #home .home-task-item { min-height:52px; padding:6px 8px; }
    .ui-c-standard #home .home-task-icon { font-size:12px; line-height:18px; }
    .ui-c-standard #home .home-task-copy strong { font-size:14px; line-height:22px; font-weight:650; }
    .ui-c-standard #home .home-task-copy small,
    .ui-c-standard #home .home-task-value { font-size:12px; line-height:18px; }
    .ui-c-standard #home .home-receivable-list { padding:0 12px; }
    .ui-c-standard #home .home-receivable-item { min-height:52px; padding:6px 4px; }
    .ui-c-standard #home .home-receivable-item strong,
    .ui-c-standard #home .home-receivable-item b { font-size:13px; line-height:20px; }
    .ui-c-standard #home .home-receivable-item small { font-size:12px; line-height:18px; }
    .ui-c-standard #home .home-receivable-action { min-height:var(--ui-control); margin:10px 12px 12px; border-radius:var(--ui-radius); font-size:14px; line-height:22px; font-weight:650; }
    .ui-c-standard #home .home-link-action,
    .ui-c-standard #home .home-row-action { font-size:12px; line-height:18px; }
    .ui-c-standard #home .home-monthly-table th { height:36px; padding:0 12px; color:#536279; border-bottom-color:var(--ui-border); background:var(--ui-subtle); font-size:12px; line-height:18px; font-weight:650; }
    .ui-c-standard #home .home-monthly-table td { height:var(--ui-row); padding:4px 12px; color:var(--ui-text); border-bottom-color:var(--ui-divider); font-size:13px; line-height:20px; }
    .ui-c-standard #home .home-monthly-table td strong { font-size:13px; line-height:20px; font-weight:650; }
    .ui-c-standard #home .home-monthly-table tfoot td { height:var(--ui-row); }
    .ui-c-standard #home .home-month-state { min-height:22px; padding:2px 8px; border-radius:6px; font-size:11px; line-height:16px; }
    .ui-c-standard #home .home-trend-layout.home-trend-compact { gap:var(--ui-page-gap); padding:12px var(--ui-panel-pad) 14px; }
    .ui-c-standard #home .home-trend-layout.home-trend-compact .store-chart-wrap { border-radius:var(--ui-radius); }
    .ui-c-standard #home .store-legend .legend-item,
    .ui-c-standard #home .home-trend-insight > span,
    .ui-c-standard #home .home-trend-insight > small,
    .ui-c-standard #home .home-trend-shares span { font-size:12px; line-height:18px; }
    .ui-c-standard #home .home-trend-insight { min-height:68px; padding:9px 12px; border-color:var(--ui-border); border-radius:var(--ui-radius); }
    .ui-c-standard #home .home-trend-insight > strong { font-size:14px; line-height:22px; font-weight:650; }

    @media (max-width:720px) {
      .ui-c-standard .side { padding:18px 10px; }
      .ui-c-standard .brand { margin:0; font-size:18px; }
      .ui-c-standard .nav button { min-height:44px; padding:6px 10px; font-size:13px; }
      .ui-c-standard .topbar { padding:6px 10px; }
      .ui-c-standard .page.active { padding:10px 8px 18px; }
    }

/* The report workspace now has two real modules; keep both tabs on one axis. */
#reports.report-decision-workspace .report-primary-tabs,
#commission.report-decision-workspace .report-primary-tabs {
  grid-template-columns:repeat(2,minmax(0,1fr));
}
#reports.report-decision-workspace .report-primary-tabs > button,
#commission.report-decision-workspace .report-primary-tabs > button {
  min-width:0;
}

/* ui74：报表与财务利润决策工作区。选择器严格限定，避免影响已冻结页面。 */
#reports.report-decision-workspace,
#commission.report-decision-workspace,
#finance.finance-decision-page {
  font-family:var(--ui-font);
}
#reports.report-decision-workspace,
#commission.report-decision-workspace { gap:12px; overflow-y:auto; }
#reports .report-decision-head,
#commission .report-workspace-head { min-height:92px; padding:10px 2px 16px; }
#reports .report-primary-tabs,
#commission .report-primary-tabs { grid-template-columns:repeat(2,minmax(0,1fr)); }
#reports .report-filter-panel { grid-template-columns:minmax(260px,1.5fr) repeat(5,minmax(132px,.72fr)) auto; }
#reports .report-kpi-grid-five,
#commission .commission-kpi-grid-five { grid-template-columns:repeat(5,minmax(0,1fr)); }
#reports .report-kpi-grid-five article,
#commission .commission-kpi-grid-five article,
#finance .finance-executive-kpis article { min-height:92px; border-radius:10px; box-shadow:0 6px 18px rgba(29,50,82,.045); }
#reports .report-sales-cost-notice { min-height:60px; display:flex; align-items:center; justify-content:space-between; gap:20px; padding:10px 14px; border:1px solid #efca82; border-radius:10px; background:#fff9ed; }
#reports .report-sales-cost-notice[hidden] { display:none; }
#reports .report-sales-cost-notice > div { display:flex; align-items:flex-start; gap:10px; min-width:0; }
#reports .report-sales-cost-notice > div > span { width:18px; height:18px; display:grid; place-items:center; flex:0 0 auto; color:#966016; border:1px solid #c99134; border-radius:999px; font-size:10px; font-weight:800; }
#reports .report-sales-cost-notice p { display:grid; gap:3px; margin:0; }
#reports .report-sales-cost-notice strong { color:#5b3b12; font-size:11px; }
#reports .report-sales-cost-notice small { color:#79684e; font-size:9px; }
#reports .report-sales-cost-notice > button { min-width:210px; }
#reports .report-decision-grid { display:grid; grid-template-columns:minmax(0,2.15fr) minmax(270px,.85fr); gap:10px; }
#reports .report-insight-card { min-width:0; min-height:230px; padding:15px 16px; border:1px solid #dfe5ed; border-radius:11px; background:#fff; box-shadow:0 6px 18px rgba(29,50,82,.04); }
#reports .report-insight-card header,
#finance .finance-section-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
#reports .report-insight-card header span,
#finance .finance-section-head span { color:#5270c6; font-size:10px; font-weight:750; letter-spacing:.06em; }
#reports .report-insight-card h3,
#finance .finance-section-head h3 { margin:4px 0 0; color:#1d3049; font-size:15px; }
#reports .report-insight-card header small,
#finance .finance-section-head small { color:#7a8798; font-size:10px; }
#reports .report-mini-chart { height:170px; display:flex; align-items:stretch; gap:9px; padding-top:15px; }
#reports .report-chart-column { flex:1; min-width:0; display:grid; grid-template-rows:18px 1fr 18px 28px; justify-items:center; gap:3px; color:#6f7f94; font-size:9px; }
#reports .report-chart-column > span { color:#42546e; font-weight:700; white-space:nowrap; }
#reports .report-chart-track { width:22px; height:100%; display:flex; align-items:flex-end; overflow:hidden; border-radius:6px 6px 2px 2px; background:#edf2fb; }
#reports .report-chart-track i { width:100%; border-radius:inherit; background:linear-gradient(180deg,#4168db,#7694ec); }
#reports .report-chart-column strong { color:#607087; font-size:9px; }
#reports .report-chart-column small { max-width:72px; color:#8793a4; text-align:center; font-size:8px; line-height:1.3; }
#reports .report-profit-bridge { display:grid; gap:0; margin-top:12px; }
#reports .report-bridge-row { min-height:31px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid #e7ebf1; color:#68788e; font-size:10.5px; }
#reports .report-bridge-row strong { color:#2c3f59; font-size:12px; font-variant-numeric:tabular-nums; }
#reports .report-bridge-row.cost strong { color:#a56a1a; }
#reports .report-bridge-row.profit strong { color:#0b8466; }
#reports .report-bridge-row.loss strong { color:#c34051; }
#reports .report-bridge-equation { margin-top:10px; padding:8px 9px; color:#536680; border-radius:7px; background:#f1f5ff; font-size:9px; line-height:1.5; }
#reports .report-alert-card header > strong { min-width:28px; height:28px; display:grid; place-items:center; color:#b5414e; border-radius:999px; background:#fff0f2; font-size:13px; }
#reports .report-alert-list { display:grid; gap:7px; margin-top:13px; }
#reports .report-alert-item { width:100%; min-height:47px; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 10px; border:1px solid transparent; border-radius:8px; background:#f8fafc; text-align:left; cursor:pointer; }
#reports .report-alert-item:hover,
#reports .report-alert-item:focus-visible { border-color:#bfd0f5; background:#f2f6ff; outline:none; }
#reports .report-alert-item.is-selected { border-color:#4f72dc; background:#eef3ff; }
#reports .report-alert-item span { display:grid; gap:3px; }
#reports .report-alert-item strong { color:#34475f; font-size:10.5px; }
#reports .report-alert-item small { color:#8490a1; font-size:8.5px; }
#reports .report-alert-item b { min-width:25px; padding:3px 7px; color:#55708f; border-radius:999px; background:#eaf0f6; text-align:center; font-size:10px; }
#reports .report-alert-item b.has-alert { color:#b44650; background:#fdecee; }
#reports .report-alert-empty { min-height:138px; display:grid; place-content:center; gap:6px; margin-top:13px; padding:18px; border-radius:9px; background:#f8fafc; text-align:center; }
#reports .report-alert-empty strong { color:#34475f; font-size:12px; }
#reports .report-alert-empty small { color:#8490a1; font-size:9px; line-height:1.5; }
#reports .report-wide-table table { min-width:1120px; table-layout:fixed; }
#reports #salesReportTable { border-top:0; }
#reports #salesReportTable thead th { height:38px; padding:0 10px; border-top:0; border-bottom:0; }
#reports #salesReportTable tbody tr:first-child td { border-top:1px solid #eaebee; }
#reports #salesReportTable [data-align="center"] { text-align:center; }
#reports .report-wide-table td { border-bottom-color:#e7ebf0; }
#reports .report-wide-table tbody tr.report-row-pending-cost td { background:#fffaf0; }
#reports .report-wide-table tbody tr.report-row-pending-cost:hover td,
#reports .report-wide-table tbody tr.report-row-pending-cost.selected td { background:#fff5df; }
#reports .report-basis-action { min-height:28px; padding:0 9px; color:#315cc5; border:1px solid #ccd8f3; border-radius:7px; background:#fff; font-size:10px; font-weight:700; cursor:pointer; }
#reports .report-basis-action:hover { border-color:#9eb2e7; background:#f4f7ff; }
#reports .report-profit-equation { display:grid; gap:5px; margin:10px 0 12px; padding:12px; border:1px solid #cfe2dc; border-radius:9px; background:#f2faf7; }
#reports .report-profit-equation > span { color:#38705f; font-size:9px; font-weight:750; }
#reports .report-profit-equation > strong { color:#0d7357; font-size:18px; font-variant-numeric:tabular-nums; }
#reports .report-profit-equation p { margin:2px 0 0; color:#354b45; font-size:10.5px; font-weight:650; line-height:1.5; }
#reports .report-profit-equation small { color:#71827c; font-size:8.5px; line-height:1.45; }
#commission .commission-table-panel td strong,#commission .commission-table-panel td span { display:block; }
#commission .commission-table-panel td span { margin-top:3px; color:#7d8999; font-size:8.5px; }

#commission .commission-filter-panel { grid-template-columns:minmax(220px,1.1fr) repeat(4,minmax(130px,.7fr)); gap:10px; }
#commission .commission-filter-panel input { width:100%; min-width:0; height:36px; padding:0 10px; color:#2f3e55; border:1px solid #d4dce7; border-radius:8px; background:#fff; outline:0; }
#commission .commission-keyword-field { display:grid; gap:5px; color:#66748a; font-size:10.5px; }
#commission .commission-context-strip { flex:0 0 auto; min-height:58px; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:0; overflow:hidden; border:1px solid #d8e1f1; border-radius:10px; background:#f5f8fd; }
#commission .commission-context-strip > div { min-width:0; min-height:58px; display:grid; grid-template-rows:auto auto auto; align-content:center; gap:3px; padding:9px 14px; border-right:1px solid #dfe6f1; }
#commission .commission-context-strip > div:last-child { border-right:0; }
#commission .commission-context-strip span,#commission .commission-context-strip small { display:block; min-height:12px; color:#748197; font-size:9px; line-height:1.3; }
#commission .commission-context-strip strong { display:block; min-height:14px; overflow:hidden; color:#35539d; font-size:10.5px; line-height:1.35; text-overflow:ellipsis; white-space:nowrap; }
#commission .commission-kpi-grid strong { font-size:19px; }
#commission .commission-view-tabs { display:flex; align-items:center; gap:6px; padding:5px; border:1px solid #dfe5ed; border-radius:10px; background:#f4f6f9; }
#commission .commission-view-tabs button { min-height:34px; padding:0 16px; color:#627189; border:0; border-radius:7px; background:transparent; font-size:11px; font-weight:650; }
#commission .commission-view-tabs button.active { color:#315cc5; background:#fff; box-shadow:0 2px 8px rgba(33,55,88,.09); }
#commission .commission-view-tabs > span { margin-left:auto; padding-right:9px; color:#6f7c90; font-size:9.5px; }
#commission .commission-table-panel table { min-width:930px; table-layout:fixed; }
#commission .commission-table-panel[hidden] { display:none!important; }
#commission .commission-table-panel thead { position:sticky; z-index:4; top:0; }
#commission .commission-table-panel th { height:49px; padding:7px 11px 6px; color:#51617a; border-top:1px solid #edf0f4; border-bottom:1px solid #dfe5ed; background:#f7f9fc; font-size:10px; vertical-align:middle; }
#commission .commission-table-panel th > span,#commission .commission-table-panel th > small { display:block; line-height:1.25; }
#commission .commission-table-panel th > span { color:#465872; font-weight:750; }
#commission .commission-table-panel th > small { margin-top:3px; color:#8a96a7; font-size:8px; font-weight:500; white-space:nowrap; }
#commission .commission-table-panel th .commission-split-heading { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; }
#commission .commission-table-panel th .commission-split-heading b { color:inherit; font:inherit; }
#commission .commission-table-panel th .commission-split-heading b:last-child { text-align:right; }
#commission .commission-table-panel th[data-align="right"] > span,#commission .commission-table-panel th[data-align="right"] > small { text-align:right; }
#commission .commission-table-panel th[data-align="center"] > span,#commission .commission-table-panel th[data-align="center"] > small { text-align:center; }
#commission .commission-table-panel td { height:58px; padding:8px 11px; vertical-align:middle; border-bottom-color:#e7ebf0; }
#commission .commission-table-panel [data-align="right"] { text-align:right; }
#commission .commission-table-panel [data-align="center"] { text-align:center; }
#commission .commission-table-panel tbody tr:first-child td { border-top:1px solid #e7ebf0; }
#commission .commission-allocation { display:grid; gap:3px; }
#commission .commission-allocation span { display:flex!important; justify-content:space-between; gap:10px; }
#commission .commission-allocation b { color:#415d9f; font-weight:700; }
#commission .commission-settlement-state { width:max-content; min-width:64px; display:inline-flex!important; justify-content:center; padding:4px 8px; color:#8b5c13!important; border-radius:999px; background:#fff2d7; font-weight:700; }
#commission .commission-evidence-action { min-height:28px; padding:0 10px; color:#315cc5; border:1px solid #cdd8ef; border-radius:7px; background:#fff; font-size:9.5px; font-weight:700; cursor:pointer; }
#commission .commission-evidence-action:hover { background:#f3f6fd; }
#commission .commission-month-gate { display:grid; grid-template-columns:minmax(230px,.8fr) minmax(360px,1.4fr) auto; gap:18px; align-items:center; padding:14px 16px; border-bottom:1px solid #ead3a8; background:#fff9ee; }
#commission .commission-month-gate > div { display:grid; gap:3px; }
#commission .commission-month-gate span { color:#8b611e; font-size:9px; font-weight:700; }
#commission .commission-month-gate h3 { margin:0; color:#8b4d0b; font-size:15px; }
#commission .commission-month-gate p { margin:0; color:#7b684c; font-size:9px; }
#commission .commission-month-gate ul { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px 14px; margin:0; padding:0; list-style:none; }
#commission .commission-month-gate li { position:relative; padding-left:14px; color:#627187; font-size:9px; }
#commission .commission-month-gate li::before { position:absolute; left:0; content:"✓"; color:#16806a; font-weight:800; }
#commission .commission-month-gate li.blocked { grid-column:1/-1; color:#a05d10; }
#commission .commission-month-gate li.blocked::before { content:"!"; color:#c17818; }
#commission .commission-month-gate li { min-height:24px; display:flex; align-items:center; gap:8px; }
#commission .commission-month-gate li.blocked { justify-content:flex-start; }
#commission .commission-blocker-actions { grid-column:1 / -1; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; padding-top:11px; border-top:1px solid #ead7b4; }
#commission .commission-blocker-actions[hidden] { display:none!important; }
#commission .commission-blocker-actions header { grid-column:1 / -1; display:flex; align-items:baseline; justify-content:space-between; gap:16px; }
#commission .commission-blocker-actions header strong { color:#7d5317; font-size:10px; }
#commission .commission-blocker-actions header small { color:#8d795d; font-size:8.5px; }
#commission .commission-blocker-actions > button { min-width:0; display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:12px; min-height:38px; padding:7px 10px; color:#76501b; border:1px solid #e5c991; border-radius:8px; background:#fff; text-align:left; cursor:pointer; }
#commission .commission-blocker-actions > button span { overflow:hidden; color:#715d41; font-size:9px; font-weight:500; text-overflow:ellipsis; white-space:nowrap; }
#commission .commission-blocker-actions > button strong { color:#315cc5; font-size:9px; white-space:nowrap; }
#commission .commission-history-protection { display:flex; gap:12px; padding:11px 16px; color:#5d6e85; border-top:1px solid #e5e9ef; background:#f7f9fc; font-size:9.5px; }
#commission .commission-history-protection strong { color:#35539d; white-space:nowrap; }
#commission .commission-adjustment-list { display:grid; gap:9px; padding:12px; }
#commission .commission-adjustment-card { position:relative; display:grid; grid-template-columns:minmax(320px,1.2fr) minmax(220px,.75fr) minmax(180px,.55fr); gap:18px; align-items:center; padding:13px 16px 13px 20px; overflow:hidden; border:1px solid #e0e5ec; border-radius:10px; background:#fff; }
#commission .commission-adjustment-marker { position:absolute; inset:0 auto 0 0; width:4px; background:#2ba77f; }
#commission .commission-adjustment-marker.negative { background:#d85a65; }
#commission .commission-adjustment-main { min-width:0; display:grid; grid-template-columns:minmax(140px,.55fr) minmax(180px,1fr); gap:18px; }
#commission .commission-adjustment-main > div,#commission .commission-adjustment-main p,#commission .commission-adjustment-audit { display:grid; gap:3px; margin:0; }
#commission .commission-adjustment-main span,#commission .commission-adjustment-main small,#commission .commission-adjustment-audit small { color:#7a8798; font-size:8.5px; }
#commission .commission-adjustment-main strong { color:#263951; font-size:10.5px; }
#commission .commission-adjustment-numbers { display:grid; grid-template-columns:1fr auto 1fr; gap:8px; align-items:center; color:#758296; font-size:9px; }
#commission .commission-adjustment-numbers strong { font-size:14px; }
#commission .commission-adjustment-audit { justify-items:end; }
#commission .commission-detail-panel { position:fixed; z-index:1160; top:82px; right:16px; bottom:16px; width:min(540px,calc(100vw - 32px)); margin:0; overflow:auto!important; border:1px solid #d9e1ec; border-radius:13px; background:#fff; box-shadow:0 24px 60px rgba(20,38,67,.22); }
#commission .commission-detail-panel .report-detail-head { position:sticky; z-index:3; top:0; padding:14px 16px 12px; background:rgba(255,255,255,.97); backdrop-filter:blur(8px); }
#commission .commission-detail-summary { display:grid; grid-template-columns:1fr; gap:9px; padding:12px; }
#commission .commission-detail-summary > * { min-width:0; }
#commission .commission-detail-total { display:grid; grid-template-columns:1fr auto; align-items:end; gap:4px 14px; padding:13px 14px; border:1px solid #cfe5dc; border-radius:10px; background:#f1f9f6; }
#commission .commission-detail-total span,#commission .commission-detail-total small { color:#627f75; }
#commission .commission-detail-total strong { grid-row:1 / span 2; grid-column:2; align-self:center; color:#08795c; font-size:20px; font-variant-numeric:tabular-nums; }
#commission .commission-detail-metrics { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
#commission .commission-detail-metrics article { min-width:0; display:grid; align-content:center; gap:3px; min-height:67px; padding:10px 12px; border:1px solid #e0e6ee; border-radius:9px; background:#fafbfd; }
#commission .commission-detail-metrics article.is-wide { grid-column:1 / -1; min-height:58px; }
#commission .commission-detail-summary span,#commission .commission-detail-summary small { color:#7a8799; font-size:8.5px; }
#commission .commission-detail-summary strong { overflow-wrap:anywhere; color:#263951; font-size:11px; }
#commission .commission-evidence-list { display:grid; gap:8px; padding:0 12px 14px; }
#commission .commission-evidence-list .commission-evidence-card { position:relative; padding:13px; overflow:hidden; border:1px solid #e1e6ee; border-radius:10px; background:#fff; }
#commission .commission-evidence-list .commission-evidence-card.is-manager { border-left:3px solid #5a78cf; }
#commission .commission-evidence-list header { display:flex; justify-content:space-between; gap:12px; }
#commission .commission-evidence-list header > div:first-child { display:grid; gap:3px; min-width:0; }
#commission .commission-evidence-list header span,#commission .commission-evidence-list small { color:#7b8799; font-size:8.5px; }
#commission .commission-evidence-amount { flex:0 0 auto; display:grid; justify-items:end; align-content:start; gap:2px; }
#commission .commission-evidence-list header b { color:#11775d; font-size:15px; font-variant-numeric:tabular-nums; }
#commission .commission-evidence-product { display:grid; gap:2px; margin:10px 0; padding:8px 10px; border-radius:7px; background:#f7f9fc; }
#commission .commission-evidence-product > span { color:#2b3d55; font-size:10.5px; font-weight:700; }
#commission .commission-manager-flow { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); align-items:center; gap:5px; margin-bottom:10px; padding:9px; border:1px solid #e1e7f2; border-radius:8px; background:#f4f7fd; }
#commission .commission-manager-flow > div { min-width:0; display:grid; gap:3px; }
#commission .commission-manager-flow > b { display:none; }
#commission .commission-manager-flow span { color:#7b8799; font-size:8px; }
#commission .commission-manager-flow strong { color:#344966; font-size:9.5px; font-variant-numeric:tabular-nums; }
#commission .commission-manager-flow .is-result { padding-left:8px; border-left:1px solid #ced9eb; }
#commission .commission-manager-flow .is-result strong { color:#315cc5; }
#commission .commission-evidence-list dl { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 14px; margin:0; border-top:1px solid #e5e9ef; }
#commission .commission-evidence-list dl div { min-width:0; display:grid; gap:3px; padding:9px 0; }
#commission .commission-evidence-list dl div.is-wide { grid-column:1 / -1; border-top:1px solid #edf0f4; }
#commission .commission-evidence-list dt { color:#8490a1; font-size:8px; }
#commission .commission-evidence-list dd { margin:0; overflow-wrap:anywhere; color:#43556d; font-size:9px; font-weight:650; }

#finance.finance-decision-page { overflow-y:auto; }
#finance .finance-decision-workspace { min-height:max-content; overflow:visible; }
#finance .finance-workspace-scroll { display:grid; gap:12px; overflow:visible; }
#finance .finance-executive-kpis { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; }
#finance .finance-executive-kpis article { display:grid; align-content:center; gap:5px; padding:13px 15px; border:1px solid #dfe5ed; background:#fff; }
#finance .finance-executive-kpis span,#finance .finance-executive-kpis small { color:#758397; font-size:9.5px; }
#finance .finance-executive-kpis strong { color:#20334d; font-size:19px; font-variant-numeric:tabular-nums; }
#finance .finance-center-section,#finance .finance-followup-section { display:grid; gap:10px; padding:15px; border:1px solid #dfe5ed; border-radius:11px; background:#fff; }
#finance .finance-overview-cards { grid-template-columns:repeat(4,minmax(0,1fr)); gap:9px; padding:0; }
#finance .finance-overview-cards > .ui-state { grid-column:1 / -1; min-height:0; }
#finance .finance-overview-cards .finance-card { min-width:0; overflow:hidden; border-radius:9px; }
#finance .finance-overview-cards .finance-card-head { width:100%; min-height:0; display:grid; grid-template-rows:auto auto auto; gap:11px; padding:14px 15px 12px; color:inherit; border:0; background:#fff; text-align:left; }
#finance .finance-card-title { display:flex; align-items:center; justify-content:space-between; gap:8px; }
#finance .finance-card-title > span:first-child { color:#243750; font-size:13px; font-weight:760; }
#finance .finance-open-badge { padding:3px 7px; color:#9a6a17; border-radius:999px; background:#fff2cf; font-size:8px; }
#finance .finance-card-stats { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-areas:"income expense" "profit profit"; gap:0; overflow:hidden; border:1px solid #e2e7ee; border-radius:8px; background:#f8fafc; }
#finance .finance-stat { min-width:0; display:grid; align-content:start; justify-items:start; gap:3px; padding:9px 10px; }
#finance .finance-stat-income { grid-area:income; border-right:1px solid #e2e7ee; }
#finance .finance-stat-expense { grid-area:expense; }
#finance .finance-stat-profit { grid-area:profit; grid-template-columns:1fr auto; align-items:end; padding-top:8px; border-top:1px solid #e2e7ee; background:#fff; }
#finance .finance-stat-profit .finance-stat-label { grid-column:1 / -1; }
#finance .finance-stat strong { font-size:13px; line-height:1.25; }
#finance .finance-stat-profit strong { font-size:17px; letter-spacing:-.02em; }
#finance .finance-stat-profit small { align-self:center; color:#718096; font-size:9px; font-weight:650; }
#finance .finance-card-meta { display:flex; align-items:center; justify-content:space-between; gap:8px; padding-top:1px; color:#718096; font-size:9px; }
#finance .finance-card-meta strong { color:#315fc6; }
#finance .finance-card-arrow { position:static; display:inline-flex; align-items:center; gap:3px; transform:none; color:#315fc6; font-size:9px; font-weight:720; }
#finance .finance-card-arrow span { font-size:14px; line-height:1; transition:transform .18s ease; }
#finance .finance-card-head:hover .finance-card-arrow span { transform:translateX(2px); }
#finance .finance-insight-grid { grid-template-columns:minmax(0,1fr) minmax(0,1fr); padding:0; }
#finance .finance-composition-equation { margin-bottom:4px; padding:9px 10px; color:#536680; border-radius:7px; background:#f1f5ff; font-size:9px; }
#finance .finance-composition-warning { padding:8px 10px; color:#ae3f4c; border-radius:7px; background:#fff0f2; font-size:9px; }
#finance .finance-followup-section .finance-overview-actions { padding:0; }
#finance .finance-overview-actions b { color:#315fc6; font-size:9px; font-weight:700; }
#finance .finance-detail-dialog { width:min(620px,calc(100vw - 32px)); max-height:calc(100vh - 48px); overflow:auto; }
#financeDetailModal .finance-detail-dialog { width:min(620px,calc(100vw - 32px)); max-height:calc(100vh - 48px); overflow:hidden; }
#financeDetailModal .finance-detail-head { padding:16px 18px 13px; background:#fff; }
#financeDetailModal .finance-detail-head h3 { color:#22364f; font-size:16px; }
#financeDetailModal .finance-detail-stats .finance-card-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-top:9px; }
#financeDetailModal .finance-detail-stats .finance-stat { min-width:0; display:grid; gap:2px; }
#financeDetailModal .finance-detail-stats .finance-stat span { color:#7a8798; font-size:9px; }
#financeDetailModal .finance-detail-stats .finance-stat strong { color:#263951; font-size:14px; font-variant-numeric:tabular-nums; }
#financeDetailModal .finance-detail-body { padding:14px 18px 18px; background:#f8fafc; }
#financeDetailModal .finance-detail-evidence { overflow:hidden; border:1px solid #dfe5ed; border-radius:10px; background:#fff; }
#financeDetailModal .finance-detail-evidence-head,
#financeDetailModal .finance-detail-evidence-row { display:grid; grid-template-columns:minmax(0,1fr) 150px; align-items:center; gap:16px; min-height:39px; padding:0 13px; border-bottom:1px solid #e5e9ef; }
#financeDetailModal .finance-detail-evidence-head { min-height:34px; color:#758397; background:#f5f7fa; font-size:9px; font-weight:700; }
#financeDetailModal .finance-detail-evidence-head span:last-child,
#financeDetailModal .finance-detail-evidence-row strong { text-align:right; }
#financeDetailModal .finance-detail-evidence-row > span { color:#56677e; font-size:10px; }
#financeDetailModal .finance-detail-evidence-row > strong { color:#283b54; font-size:11px; font-variant-numeric:tabular-nums; }
#financeDetailModal .finance-detail-evidence-row.is-sub { padding-left:28px; background:#fafbfd; }
#financeDetailModal .finance-detail-evidence-row.is-total { background:#f3f6fb; }
#financeDetailModal .finance-detail-evidence-row.is-profit { border-bottom:0; background:#eef8f4; }
#financeDetailModal .finance-detail-evidence-row.is-profit strong { color:#0b8062; font-size:13px; }
#finance .finance-detail-evidence { overflow:hidden; border:1px solid #dfe5ed; border-radius:10px; }
#finance .finance-detail-evidence-head,#finance .finance-detail-evidence-row { display:grid; grid-template-columns:1fr 150px; align-items:center; gap:16px; min-height:39px; padding:0 13px; border-bottom:1px solid #e5e9ef; }
#finance .finance-detail-evidence-head { min-height:34px; color:#758397; background:#f5f7fa; font-size:9px; font-weight:700; }
#finance .finance-detail-evidence-head span:last-child,#finance .finance-detail-evidence-row strong { text-align:right; }
#finance .finance-detail-evidence-row span { color:#56677e; font-size:9.5px; }
#finance .finance-detail-evidence-row strong { color:#283b54; font-size:10.5px; }
#finance .finance-detail-evidence-row.is-sub { padding-left:28px; background:#fafbfd; }
#finance .finance-detail-evidence-row.is-total { background:#f3f6fb; }
#finance .finance-detail-evidence-row.is-profit { border-bottom:0; background:#eef8f4; }
#finance .finance-detail-evidence-row.is-profit strong { color:#0b8062; font-size:13px; }
#finance .finance-month-gate-centers button small { min-width:0; overflow:hidden; color:#7b8798; font-size:8.5px; line-height:1.25; text-overflow:ellipsis; white-space:nowrap; }
#finance .finance-overview-clear { grid-column:1/-1; min-height:76px; display:grid; place-content:center; gap:5px; color:#496078; text-align:center; }
#finance .finance-overview-clear strong { color:#19745d; font-size:13px; }
#finance .finance-overview-clear small { color:#7a8798; font-size:10px; }
#finance .finance-fixed-costs-panel { display:grid; gap:12px; }
#finance .finance-fixed-costs-panel[hidden] { display:none; }
#finance .finance-fixed-costs-head { min-height:72px; display:flex; align-items:center; justify-content:space-between; gap:18px; padding:13px 16px; border:1px solid #dfe5ed; border-radius:11px; background:#fff; }
#finance .finance-fixed-costs-head > div:first-child { display:grid; gap:3px; }
#finance .finance-fixed-costs-head > div:first-child > span { color:#526dbd; font-size:9.5px; font-weight:760; letter-spacing:.07em; text-transform:uppercase; }
#finance .finance-fixed-costs-head h3 { margin:0; color:#1c2d46; font-size:17px; }
#finance .finance-fixed-costs-head small { color:#748197; font-size:10.5px; }
#finance .finance-fixed-costs-controls { display:flex; align-items:end; gap:8px; }
#finance .finance-fixed-costs-controls label { display:grid; gap:4px; color:#718096; font-size:9px; }
#finance .finance-fixed-costs-controls select { min-width:170px; height:36px; padding:0 10px; border:1px solid #ccd7e5; border-radius:8px; background:#fff; color:#273a53; }
#finance .finance-fixed-cost-tasks { min-height:64px; display:flex; align-items:center; justify-content:space-between; gap:16px; padding:11px 15px; border:1px solid #ebd39f; border-radius:11px; background:#fff9ed; }
#finance .finance-fixed-cost-tasks > div { display:grid; gap:3px; }
#finance .finance-fixed-cost-tasks span { color:#a26a12; font-size:9px; font-weight:760; letter-spacing:.06em; text-transform:uppercase; }
#finance .finance-fixed-cost-tasks strong { color:#493718; font-size:13px; }
#finance .finance-fixed-cost-tasks small { color:#8a6d3d; font-size:10px; }
#finance .finance-detail-read-status { padding:12px 15px; border:1px solid #f0b7bc; border-radius:11px; background:#fff3f4; }
#finance .finance-detail-read-status[hidden] { display:none; }
#finance .finance-detail-read-status > div { display:grid; gap:3px; }
#finance .finance-detail-read-status span { color:#bd3041; font-size:9px; font-weight:760; letter-spacing:.06em; text-transform:uppercase; }
#finance .finance-detail-read-status strong { color:#6f2230; font-size:13px; }
#finance .finance-detail-read-status small { color:#8d4a55; font-size:10px; }
#finance .finance-fixed-costs-panel > .finance-edit-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:12px; }
#finance .finance-fixed-costs-panel .finance-edit-section { margin:0; }
#finance .finance-fixed-costs-panel .finance-edit-section { grid-column:1 / -1; }
#finance .finance-fixed-costs-actions { position:sticky; bottom:10px; z-index:4; min-height:64px; display:flex; align-items:center; justify-content:flex-end; gap:9px; padding:10px 14px; border:1px solid #d9e1ec; border-radius:11px; background:rgba(255,255,255,.98); box-shadow:0 -5px 16px rgba(31,51,84,.06); }
#finance .finance-fixed-costs-actions > div { margin-right:auto; display:grid; gap:3px; color:#52627a; font-size:11px; }
#finance .finance-fixed-costs-actions small { color:#8490a1; font-size:9.5px; }
#finance .finance-fixed-costs-actions .btn.primary { min-width:170px; }

/* ui77：恢复原型财务上下文与页内核对工作区。 */
#finance .finance-context-row { display:grid; grid-template-columns:minmax(220px,320px) minmax(190px,260px) 1fr; gap:18px; align-items:end; padding:12px 16px; border-bottom:1px solid #dfe5ed; background:#fff; }
#finance .finance-context-row label { display:grid; grid-template-columns:72px minmax(0,1fr); align-items:center; gap:10px; color:#65748b; font-size:11px; }
#finance .finance-context-row select,
#finance .finance-context-button { width:100%; height:42px; padding:0 13px; color:#253852; border:1px solid #ccd7e5; border-radius:9px; background:#fff; text-align:left; }
#finance .finance-context-note { min-height:42px; display:flex; align-items:center; justify-content:flex-end; gap:7px; color:#738096; font-size:11px; }
#finance .finance-context-note b { color:#40516a; font-weight:650; }
#finance .finance-deferred-tools { margin-top:16px; display:flex; align-items:center; justify-content:space-between; gap:18px; padding:14px 16px; border:1px dashed #d8e0eb; border-radius:11px; background:#f8fafc; }
#finance .finance-deferred-tools > div:first-child { display:grid; gap:3px; }
#finance .finance-deferred-tools span { color:#74839a; font-size:9.5px; font-weight:750; letter-spacing:.06em; text-transform:uppercase; }
#finance .finance-deferred-tools strong { color:#334660; font-size:13px; }
#finance .finance-deferred-tools small { color:#7c8899; font-size:10.5px; }
#finance .finance-deferred-tool-actions { display:flex; gap:8px; }
#finance .finance-fixed-costs-head { justify-content:flex-start; }
#finance .finance-fixed-costs-controls { display:none; }
#finance .finance-fixed-cost-tasks { align-items:stretch; flex-wrap:wrap; }
#finance .finance-fixed-task-intro { min-width:210px; }
#finance .finance-fixed-task-list { flex:1; display:grid; gap:7px; }
#finance .finance-fixed-task { width:100%; display:grid; grid-template-columns:145px minmax(0,1fr) 18px; align-items:center; gap:12px; padding:9px 12px; color:#243751; border:1px solid #ead8ac; border-radius:8px; background:#fffdf7; text-align:left; }
#finance .finance-fixed-task:hover { border-color:#d4b86d; background:#fffaf0; }
#finance .finance-fixed-task span { font-size:11px; font-weight:750; }
#finance .finance-fixed-task small { color:#6e7785; font-size:10.5px; }
#finance .finance-fixed-task b { color:#9b7625; font-size:18px; text-align:right; }
#finance .finance-sales-cost-inline { flex-basis:100%; min-width:0; display:grid; gap:10px; padding:12px; border-top:1px solid #ecd8ac; }
#finance .finance-sales-cost-inline[hidden] { display:none!important; }
#finance .finance-sales-cost-inline .sales-cost-queue-row { grid-template-columns:minmax(190px,1.15fr) minmax(135px,.7fr) minmax(170px,.8fr) minmax(200px,1.1fr) auto; }
#finance .finance-salary-block input[readonly] { color:#40516a; border-color:#dbe3ed; background:#f4f7fb; }
#finance .finance-inline-detail-workspace { margin:0 14px 16px; padding:14px; border-top:1px solid #e2e8f0; background:#fbfcfe; }
#finance .finance-inline-workspace-head { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:12px; }
#finance .finance-inline-workspace-head > div { display:grid; gap:3px; }
#finance .finance-inline-workspace-head strong { color:#21344e; font-size:14px; }
#finance .finance-inline-workspace-head span { color:#728096; font-size:10.5px; }
#finance .finance-inline-workspace-head em { color:#62728a; font-size:10px; font-style:normal; }
#finance .finance-salary-workspace-head > div:last-child { min-width:120px; padding:8px 11px; border:1px solid #dde5ef; border-radius:8px; background:#fff; }
#finance .finance-salary-workspace-head > div:last-child small { color:#7d899a; font-size:9px; }
#finance .finance-salary-scope { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:12px; }
#finance .finance-salary-scope > div { display:grid; gap:3px; padding:10px 12px; border:1px solid #e0e7f0; border-radius:8px; background:#fff; }
#finance .finance-salary-scope strong { color:#31445f; font-size:10.5px; }
#finance .finance-salary-scope span { color:#758297; font-size:9.5px; }
#finance .finance-inline-salary-head,
#finance .finance-inline-salary-row { display:grid; grid-template-columns:minmax(110px,1.1fr) repeat(4,minmax(82px,.75fr)) minmax(92px,.8fr) minmax(150px,1.4fr) 54px; gap:8px; align-items:center; }
#finance .finance-inline-salary-head { padding:0 7px 7px; color:#6d7c91; font-size:9.5px; }
#finance .finance-inline-salary-row { padding:8px 7px; border-top:1px solid #e2e8f0; }
#finance .finance-inline-salary-row input { min-width:0; height:36px; padding:0 9px; border:1px solid #ccd7e5; border-radius:7px; background:#fff; }
#finance .finance-inline-salary-row > strong { color:#1f7c64; font-size:12px; text-align:right; }
#finance .finance-inline-empty { padding:20px; color:#7b8799; border:1px dashed #d8e0ea; border-radius:8px; background:#fff; text-align:center; font-size:11px; }
#finance .finance-salary-legacy-summary { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-bottom:12px; padding:11px 13px; color:#72591e; border:1px solid #ead8a7; border-radius:8px; background:#fffaf0; }
#finance .finance-salary-legacy-summary > div { display:grid; gap:3px; }
#finance .finance-salary-legacy-summary span { font-size:10px; }
#finance .finance-salary-legacy-summary dl { margin:0; display:grid; grid-template-columns:repeat(4,minmax(72px,1fr)); gap:12px; }
#finance .finance-salary-legacy-summary dl div { display:grid; gap:2px; }
#finance .finance-salary-legacy-summary dt { color:#8a7751; font-size:9px; }
#finance .finance-salary-legacy-summary dd { margin:0; color:#4b3d1b; font-size:11px; font-weight:750; }
#finance .finance-inline-workspace-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:12px; }
#finance .finance-salary-totals { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); margin-top:12px; border:1px solid #dfe6ee; border-radius:8px; background:#fff; }
#finance .finance-salary-totals span { display:grid; gap:4px; padding:9px 11px; color:#748197; border-right:1px solid #e4e9f0; font-size:9px; }
#finance .finance-salary-totals span:last-child { border-right:0; background:#f2faf7; }
#finance .finance-salary-totals strong { color:#2f425c; font-size:12px; }
#finance .finance-salary-totals span:last-child strong { color:#177b60; }
#finance .finance-rebate-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); padding:13px 14px 15px; }
#finance .finance-rebate-summary > div { display:grid; gap:4px; padding:3px 14px; border-right:1px solid #e1e7ef; }
#finance .finance-rebate-summary > div:last-child { border-right:0; }
#finance .finance-rebate-summary span { color:#68778d; font-size:10.5px; }
#finance .finance-rebate-summary strong { color:#21344e; font-size:16px; }
#finance .finance-rebate-summary small { color:#8792a2; font-size:9.5px; }
#finance .finance-rebate-summary .is-effective { background:#f2faf7; }
#finance .finance-rebate-summary .is-effective strong { color:#177b60; }
#finance .finance-rebate-formula-head,
#finance .finance-rebate-formula-row { display:grid; grid-template-columns:62px minmax(170px,1.2fr) minmax(260px,1.7fr) 110px; gap:12px; align-items:center; }
#finance .finance-rebate-formula-head { padding:7px 10px; color:#6f7d91; background:#f0f4f8; font-size:9.5px; }
#finance .finance-rebate-formula-row { padding:11px 10px; border-bottom:1px solid #e1e7ef; background:#fff; }
#finance .finance-rebate-formula-row > span { width:max-content; padding:3px 7px; color:#4868b8; border-radius:999px; background:#edf2ff; font-size:9px; }
#finance .finance-rebate-formula-row > div { display:grid; gap:2px; }
#finance .finance-rebate-formula-row small { color:#7a8798; font-size:9.5px; }
#finance .finance-rebate-formula-row code { color:#50617a; font-family:inherit; font-size:10px; }
#finance .finance-rebate-formula-row b { color:#1b795f; text-align:right; }
#finance .finance-rebate-adjustment-panel { margin-top:14px; padding:12px; border:1px solid #ebd39f; border-radius:10px; background:#fffaf1; }
#finance .finance-rebate-adjustment-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:0 0 10px; border-bottom:1px solid #eadfca; }
#finance .finance-rebate-adjustment-head > div { display:flex; align-items:center; gap:8px; }
#finance .finance-rebate-adjustment-head > div:first-child { display:grid; gap:2px; }
#finance .finance-rebate-adjustment-head span { color:#778498; font-size:10px; }
#finance .finance-rebate-adjustment-row { display:grid; grid-template-columns:minmax(150px,1fr) 130px minmax(220px,1.5fr) 120px 30px; gap:9px; align-items:end; padding:10px 0; border-bottom:1px solid #eadfca; }
#finance .finance-rebate-adjustment-row > label { display:grid; gap:4px; min-width:0; margin:0; }
#finance .finance-rebate-adjustment-row > label > span,
#finance .finance-rebate-audit > span { color:#826c47; font-size:9px; }
#finance .finance-rebate-target-wrap { display:grid; gap:4px; }
#finance .finance-rebate-target-wrap small { color:#8a6d3d; font-size:10px; line-height:1.35; }
#finance .finance-rebate-adjustment-row input,
#finance .finance-rebate-adjustment-row select { min-width:0; height:36px; padding:0 9px; border:1px solid #ccd7e5; border-radius:7px; background:#fff; }
#finance .finance-rebate-money { display:flex; align-items:center; height:36px; padding:0 8px; border:1px solid #ccd7e5; border-radius:7px; background:#fff; }
#finance .finance-rebate-money b { color:#7e8b9d; font-weight:500; }
#finance .finance-rebate-money input { flex:1; height:32px; padding:0 4px; border:0; text-align:right; outline:0; }
#finance .finance-rebate-audit { display:grid; align-self:center; gap:2px; }
#finance .finance-rebate-audit strong { color:#32455f; font-size:10.5px; }
#finance .finance-rebate-audit small { color:#8792a2; font-size:9px; }
#finance .finance-rebate-delete { width:28px; height:28px; align-self:center; color:#7d8999; border:0; background:transparent; font-size:18px; cursor:pointer; }
#finance .finance-rebate-final-bar { display:flex; align-items:center; justify-content:flex-end; gap:20px; padding:12px 4px 0; color:#66758a; font-size:10px; }
#finance .finance-rebate-final-bar strong { margin-left:5px; color:#193153; font-size:12px; }
#finance .finance-rebate-final-bar span:last-of-type strong { color:#16795d; font-size:15px; }
#finance .finance-rebate-anomaly { display:grid; grid-template-columns:190px 1fr 1.4fr; gap:12px; margin-top:8px; padding:10px; color:#775b20; border:1px solid #ead9aa; border-radius:8px; background:#fffaf0; font-size:10px; }
#finance .finance-locked-expense { grid-column:1/-1; display:grid; grid-template-columns:24px 1fr auto auto; align-items:center; gap:10px; margin:0 0 2px; padding:11px 13px; border:1px solid #d5e0f5; border-radius:9px; background:#f2f6ff; }
#finance .finance-fixture-reconciliation { grid-column:1/-1; display:flex; align-items:center; justify-content:space-between; gap:14px; padding:9px 12px; color:#7a5b20; border:1px solid #ecd39b; border-radius:8px; background:#fff8e9; }
#finance .finance-fixture-reconciliation strong { font-size:11px; }
#finance .finance-fixture-reconciliation span { color:#866f49; font-size:9.5px; }
#finance .finance-locked-expense > span { color:#5873b8; font-size:17px; }
#finance .finance-locked-expense > div { display:grid; gap:2px; }
#finance .finance-locked-expense small { color:#6f7d91; font-size:10px; }
#finance .finance-locked-expense b { color:#142b4a; font-size:13px; }
#finance .finance-locked-expense em { padding:3px 7px; color:#4867b3; border-radius:999px; background:#e5edff; font-size:9px; font-style:normal; }
#finance .finance-expense-group-toggle { width:100%; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px; color:#253750; border:0; background:transparent; text-align:left; }
#finance .finance-expense-group-toggle span { display:grid; gap:3px; }
#finance .finance-expense-group-toggle small { color:#7b8798; font-size:10px; }
#finance .finance-expense-group-toggle em { color:#5871b8; font-size:10px; font-style:normal; }
#finance #financeOtherExpenses[hidden] { display:none !important; }

@media (max-width: 1180px) {
  #finance .finance-context-row { grid-template-columns:1fr 1fr; }
  #finance .finance-context-note { grid-column:1/-1; justify-content:flex-start; }
  #finance .finance-inline-salary-head { display:none; }
  #finance .finance-inline-salary-row { grid-template-columns:repeat(4,minmax(0,1fr)); }
  #finance .finance-inline-salary-row .finance-inline-name,
  #finance .finance-inline-salary-row .finance-inline-remark { grid-column:span 2; }
  #finance .finance-salary-totals { grid-template-columns:repeat(3,minmax(0,1fr)); }
  #finance .finance-sales-cost-inline .sales-cost-queue-row { grid-template-columns:1fr 1fr; }
  #finance .finance-rebate-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #finance .finance-rebate-summary > div:nth-child(2) { border-right:0; }
  #finance .finance-rebate-formula-head { display:none; }
  #finance .finance-rebate-formula-row { grid-template-columns:62px 1fr 120px; }
  #finance .finance-rebate-formula-row code { grid-column:2/-1; }
}
#finance .finance-task-workspace .finance-workspace-modal-scroll { background:#f7f8fa; }

@media (max-width:1450px) {
  #reports .report-filter-panel { grid-template-columns:minmax(250px,1.4fr) repeat(3,minmax(130px,.7fr)) auto; }
  #reports .report-filter-panel label:nth-of-type(4),#reports .report-filter-panel label:nth-of-type(5) { grid-row:2; }
  #reports .report-decision-grid { grid-template-columns:minmax(0,1.2fr) minmax(270px,.8fr); }
  #reports .report-alert-card { grid-column:1/-1; min-height:auto; }
  #reports .report-alert-list { grid-template-columns:repeat(3,minmax(0,1fr)); }
  #finance .finance-overview-cards { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:1180px) {
  #reports .report-kpi-grid-five,#commission .commission-kpi-grid-five,#finance .finance-executive-kpis { grid-template-columns:repeat(3,minmax(0,1fr)); }
  #reports .report-decision-grid,#finance .finance-insight-grid { grid-template-columns:1fr; }
  #commission .commission-adjustment-card { grid-template-columns:1fr; }
  #commission .commission-adjustment-audit { justify-items:start; }
}

#finance .finance-task-workspace .finance-edit-section { margin:0; overflow:visible; border:0; border-bottom:1px solid #dde5ee; border-radius:0; box-shadow:none; }
#finance .finance-task-workspace .finance-edit-section:last-child { border-bottom:0; }
#finance .finance-task-workspace .finance-edit-section-head { min-height:58px; padding:12px 2px 9px; border-bottom:0; background:transparent; }
#finance .finance-task-workspace .finance-edit-section-grid { padding:4px 0 16px; }
#finance .finance-task-workspace .finance-expense-group { border-color:#e2e7ee; border-radius:9px; background:#fff; }
#finance .finance-task-workspace .finance-expense-section { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; padding-bottom:16px; }
#finance .finance-task-workspace .finance-expense-section > .finance-edit-section-head { grid-column:1/-1; padding-bottom:0; }
#finance .finance-task-workspace .finance-expense-group-wide { grid-column:1/-1; }

    #reports .report-workspace-nav,
    #commission .report-workspace-nav { grid-template-columns:repeat(2,minmax(0,1fr)); }
    #reports .report-workspace-nav button { min-height:60px; }
    #reports .report-wide-table { max-height:560px; }
    #reports .report-wide-table table { min-width:1000px; table-layout:fixed; }
    #reports .report-wide-table th { height:40px; padding:0 11px; text-align:left; }
    #reports .report-wide-table td { height:56px; padding:7px 10px; text-align:left; vertical-align:middle; white-space:normal; }
    #reports .report-wide-table td > strong { display:block; overflow:hidden; color:#2f4057; font-size:11.5px; text-overflow:ellipsis; white-space:nowrap; }
    #reports .report-wide-table td > span { display:block; overflow:hidden; margin-top:3px; color:#7a8798; font-size:9.5px; text-overflow:ellipsis; white-space:nowrap; }
    #reports .report-row-state { display:flex; align-items:center; justify-content:space-between; gap:8px; }
    #reports #salesReportTable td[data-column="status"] .report-status { width:auto; min-width:52px; min-height:22px; display:inline-flex; align-items:center; justify-content:center; padding:0 7px; border-radius:999px; color:#087258; background:#e4f6ef; font-size:9.5px; font-weight:750; white-space:nowrap; }
    #reports #salesReportTable td[data-column="status"] .report-status.pending { color:#945c09; background:#fff0d2; }
    #reports #salesReportTable td[data-column="status"] .report-status.gift { color:#46617e; background:#eef2f6; }
    #reports .report-row-state .text-action { padding:0; color:#4164c8; border:0; background:transparent; font-size:10.5px; font-weight:700; cursor:pointer; }

    #finance .finance-workspace { display:flex; flex-direction:column; gap:12px; }
    #finance .finance-workspace-head { align-items:center; margin:0; padding:4px 2px 14px; }
    #finance .finance-workspace-tabs { min-height:62px; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); overflow:hidden; border:1px solid #dfe5ed; border-radius:10px; background:#fff; }
    #finance .finance-workspace-tabs button { min-width:0; display:grid; align-content:center; gap:4px; padding:9px 15px; color:#4d5e75; border:0; border-right:1px solid #e2e7ee; background:#fff; text-align:left; cursor:pointer; }
    #finance .finance-workspace-tabs button:last-child { border-right:0; }
    #finance .finance-workspace-tabs button.active { color:#315bc3; background:#f0f4ff; box-shadow:inset 0 -3px #4268dd; }
    #finance .finance-workspace-tabs strong { font-size:12px; }
    #finance .finance-workspace-tabs small { color:#8490a1; font-size:9.5px; }
    #finance .finance-overview-strip { border:1px solid #dfe5ed; border-radius:10px; background:#fff; }
    #finance .finance-workspace-scroll { overflow:visible; }
    #finance .finance-workspace-scroll[hidden],
    #finance .finance-commission-rules-panel[hidden] { display:none !important; }
    #finance .finance-commission-rules-panel { display:grid; gap:14px; min-height:0; }
    #finance .finance-rule-context-host .comm-version-strip { display:grid; grid-template-columns:minmax(220px,.9fr) minmax(420px,1.6fr) minmax(190px,.75fr); gap:0; padding:0; overflow:hidden; border-color:#dce4ef; background:#fff; }
    #finance .finance-rule-context-host .comm-version-summary,
    #finance .comm-priority-summary,
    #finance .comm-history-summary { min-height:86px; padding:14px 16px; display:grid; align-content:center; gap:4px; border-right:1px solid #e5eaf1; }
    #finance .finance-rule-context-host .comm-version-summary { grid-template-columns:1fr auto; }
    #finance .finance-rule-context-host .comm-version-summary span { grid-column:1 / -1; color:#4168db; font-weight:750; }
    #finance .finance-rule-context-host .comm-version-summary strong { color:#17233d; font-size:18px; text-align:left; }
    #finance .finance-rule-context-host .comm-rule-enabled { justify-self:end; align-self:center; padding:4px 8px; color:#08775b; border-radius:999px; background:#e4f5ef; font-size:9px; font-style:normal; }
    #finance .finance-rule-context-host .comm-version-summary small { grid-column:1 / -1; }
    #finance .comm-priority-summary { grid-template-columns:150px minmax(0,1fr); }
    #finance .comm-priority-summary > div { display:grid; gap:3px; }
    #finance .comm-priority-summary small,
    #finance .comm-history-summary small { color:#718098; font-size:10px; }
    #finance .comm-priority-summary ol { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); margin:0; padding:0; overflow:hidden; border:1px solid #d8e0ec; border-radius:8px; list-style:none; }
    #finance .comm-priority-summary li { position:relative; min-height:34px; display:grid; place-items:center; padding:0 13px; color:#334762; border-right:1px solid #dfe5ee; font-size:11px; font-weight:700; }
    #finance .comm-priority-summary li:not(:last-child)::after { content:'›'; position:absolute; right:-4px; z-index:1; color:#7890b2; background:#fff; }
    #finance .comm-priority-summary li:last-child { border-right:0; }
    #finance .comm-history-summary { border-right:0; background:#f4fbf8; }
    #finance .comm-history-summary strong { color:#2b4768; }
    #finance .finance-rule-context-host .comm-version-fields,
    #finance .finance-rule-context-host .comm-version-strip > p { display:none; }
    #finance .finance-rule-layout { display:grid; grid-template-columns:220px minmax(0,1fr); gap:14px; align-items:start; }
    #finance .finance-rule-library,
    #finance .finance-rule-editor { overflow:hidden; border:1px solid #dce3ed; border-radius:12px; background:#fff; }
    #finance .finance-rule-library { padding:8px; }
    #finance .finance-rule-library header { display:grid; gap:3px; padding:10px 10px 12px; }
    #finance .finance-rule-library header strong { color:#18243e; font-size:14px; }
    #finance .finance-rule-library header small { color:#7d899b; font-size:10px; }
    #finance .finance-rule-library button { width:100%; min-height:57px; display:grid; grid-template-columns:minmax(0,1fr) auto; align-content:center; gap:3px 8px; margin:2px 0; padding:9px 11px; color:#41516a; border:0; border-radius:8px; background:transparent; text-align:left; cursor:pointer; }
    #finance .finance-rule-library button strong { font-size:12px; }
    #finance .finance-rule-library button small { grid-column:1; color:#8490a1; font-size:9.5px; }
    #finance .finance-rule-library button b { grid-column:2; grid-row:1 / 3; color:#8497b3; font-size:18px; font-weight:400; }
    #finance .finance-rule-library button.active { color:#315ed6; background:#eef2ff; }
    #finance .finance-rule-library button.active b { color:#4268dd; }
    #finance .finance-rule-editor { min-height:430px; }
    #finance .finance-rule-editor-head { display:flex; justify-content:space-between; gap:16px; padding:16px 18px; border-bottom:1px solid #e5eaf1; }
    #finance .finance-rule-editor-head h3 { margin:0; color:#17233d; font-size:17px; }
    #finance .finance-rule-editor-head p { margin:4px 0 0; color:#748197; font-size:11px; }
    #finance .finance-rule-editor-head em { align-self:center; padding:4px 9px; color:#66758b; border-radius:999px; background:#f0f3f7; font-size:10px; font-style:normal; }
    #finance .finance-rule-card-host { display:grid; }
    #finance .finance-rule-card-host .comm-card { border:0; border-bottom:1px solid #e6eaf0; border-radius:0; }
    #finance .finance-rule-card-host .comm-card:last-child { border-bottom:0; }
    #finance .finance-rule-card-host .comm-card-head { padding:13px 18px 7px; cursor:default; }
    #finance .finance-rule-card-host .comm-card-head:hover { background:transparent; }
    #finance .finance-rule-card-host .comm-dot,
    #finance .finance-rule-card-host .comm-arrow { display:none; }
    #finance .finance-rule-card-host .comm-card-title { color:#20304a; font-size:13px; }
    #finance .finance-rule-card-host .comm-card-desc { font-size:10px; }
    #finance .finance-rule-card-host .comm-card-body { display:grid; grid-template-columns:repeat(4,minmax(150px,1fr)); gap:10px; padding:8px 18px 17px; border-top:0; }
    #finance .finance-rule-card-host [data-card="channel"] .comm-card-body,
    #finance .finance-rule-card-host [data-card="zero"] .comm-card-body,
    #finance .finance-rule-card-host [data-card="special"] .comm-card-body,
    #finance .finance-rule-card-host [data-card="manager"] .comm-card-body { display:block; }
    #finance .finance-rule-card-host .comm-rate-row { min-height:48px; padding:7px 10px; border:1px solid #dce3ed; border-radius:8px; }
    #finance .finance-rule-card-host .comm-rate-pill { border-radius:7px; background:#fff; }
    #finance .finance-rule-card-host .comm-channel-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
    #finance .finance-rule-card-host .comm-channel-item { min-height:48px; padding:7px 10px; background:#fff; border-color:#dce3ed; }
    #finance .finance-rule-card-host .comm-table { min-width:720px; }
    #finance .finance-rule-save-host { position:sticky; bottom:0; z-index:3; min-height:64px; display:flex; align-items:center; justify-content:flex-end; gap:10px; padding:10px 14px; border:1px solid #d9e1ec; border-radius:11px; background:rgba(255,255,255,.97); box-shadow:0 -5px 16px rgba(31,51,84,.05); }
    #finance .finance-rule-save-host > div { margin-right:auto; display:grid; gap:3px; color:#52627a; font-size:11px; }
    #finance .finance-rule-save-host > div small { color:#8490a1; font-size:9.5px; }
    #finance .finance-rule-save-host .comm-version-fields { min-width:390px; display:grid; grid-template-columns:135px minmax(220px,1fr); gap:8px; }
    #finance .finance-rule-save-host .comm-field { gap:3px; }
    #finance .finance-rule-save-host .comm-field-label { font-size:9px; }
    #finance .finance-rule-save-host .comm-input { height:34px; font-size:11px; }
    #finance .finance-rule-save-host .comm-save-btn { flex:0 0 auto; min-width:130px; }
    #finance .finance-rule-save-host .comm-reset-btn { min-width:92px; }
    @media (max-width:1050px) {
      #finance .finance-rule-context-host .comm-version-strip { grid-template-columns:1fr; }
      #finance .finance-rule-context-host .comm-version-summary,
      #finance .comm-priority-summary,
      #finance .comm-history-summary { border-right:0; border-bottom:1px solid #e5eaf1; }
      #finance .finance-rule-layout { grid-template-columns:1fr; }
      #finance .finance-rule-library { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); }
      #finance .finance-rule-library header { grid-column:1 / -1; }
    }
    #finance .finance-overview-actions { gap:0; margin-top:0; padding:0; overflow:hidden; border:1px solid #dfe5ed; border-radius:10px; background:#fff; }
    #finance .finance-overview-actions button { min-height:62px; border:0; border-right:1px solid #e3e8ef; border-radius:0; background:#fff; box-shadow:none; }
    #finance .finance-overview-actions button:last-child { border-right:0; }
    #finance .finance-overview-actions button:hover { background:#f8faff; box-shadow:none; }
    #finance .finance-overview-cards { grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; padding:0; }
    #finance .finance-card { min-width:0; }

    @media (max-width:1500px) {
      #base .base-master-layout { grid-template-columns:minmax(560px,1.2fr) minmax(320px,.8fr); }
      #base .base-master-list-columns,
      #base .base-master-list-item { grid-template-columns:minmax(150px,1.1fr) minmax(160px,1.15fr) minmax(110px,.8fr) 68px 48px; gap:8px; }
      #finance .finance-overview-cards { grid-template-columns:repeat(2,minmax(0,1fr)); }
    }
    @media (max-width:1180px) {
      #stock .stock-workspace-nav { grid-template-columns:repeat(5,minmax(150px,1fr)); overflow-x:auto; }
      #base .base-health-grid { grid-template-columns:1fr; }
      #base .base-health-card { border-right:0; border-bottom:1px solid #e5eaf0; }
      #base .base-master-layout { grid-template-columns:1fr; }
      #reports .report-filter-panel { grid-template-columns:repeat(3,minmax(0,1fr)); }
      #reports .report-search { grid-column:1 / -1; }
      #finance .finance-overview-actions { grid-template-columns:repeat(2,minmax(0,1fr)); }
      #finance .finance-overview-actions button:nth-child(2) { border-right:0; }
      #finance .finance-overview-actions button:nth-child(-n+2) { border-bottom:1px solid #e3e8ef; }
    }
    @media (max-width:1000px) {
      #base .base-master-head { align-items:flex-start; flex-direction:column; }
    }

    /* ui37 draft: owner-first home page. Only #home is changed in this pass. */
    #home.home-workspace { gap:14px; padding-top:20px; }
    #home .home-intro { min-height:76px; align-items:center; }
    #home .home-intro h2 { margin:5px 0 5px; font-size:1.55rem; font-weight:780; letter-spacing:-.035em; }
    #home .home-eyebrow { color:#64748a; font-size:.74rem; letter-spacing:0; }
    #home .home-intro-actions { gap:9px; }
    #home .home-scope-control { position:relative; }
    #home .home-scope-control summary,
    #home .home-update-control { min-height:44px; display:inline-flex; align-items:center; gap:9px; padding:0 14px; color:#263b59; border:1px solid #dce3ed; border-radius:11px; background:#fff; box-shadow:0 1px 2px rgba(29,43,64,.03); font:inherit; font-size:.78rem; cursor:pointer; transition:border-color .16s ease, box-shadow .16s ease, background .16s ease; }
    #home .home-scope-control summary { min-width:214px; list-style:none; }
    #home .home-scope-control summary::-webkit-details-marker { display:none; }
    #home .home-scope-control summary:hover,
    #home .home-update-control:hover { border-color:#bfcbe0; background:#fbfcff; box-shadow:0 4px 12px rgba(49,74,118,.08); }
    #home .home-scope-control summary:focus-visible,
    #home .home-update-control:focus-visible { outline:3px solid rgba(65,103,217,.16); outline-offset:2px; }
    #home .home-scope-control svg,
    #home .home-update-control svg { width:16px; height:16px; flex:0 0 auto; fill:none; stroke:#5d7090; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
    #home .home-scope-control strong,
    #home .home-update-control strong { font-size:.78rem; font-weight:740; white-space:nowrap; }
    #home .home-control-chevron { margin-left:auto; color:#8795a9; font-size:.9rem; transition:transform .16s ease; }
    #home .home-scope-control[open] .home-control-chevron { transform:rotate(180deg); }
    #home .home-scope-popover { position:absolute; z-index:20; top:50px; right:0; width:250px; display:grid; gap:5px; padding:14px 15px; color:#34475f; border:1px solid #dce3ed; border-radius:11px; background:#fff; box-shadow:0 14px 32px rgba(28,43,65,.14); }
    #home .home-scope-popover span { color:#7c899b; font-size:.68rem; }
    #home .home-scope-popover strong { color:#263b59; font-size:.8rem; }
    #home .home-scope-popover small { color:#8793a3; font-size:.66rem; line-height:1.55; }
    #home .home-update-control { min-width:112px; justify-content:center; }
    /* Combined freshness/activity messages must remain readable in narrow windows. */
    #home .home-update-control.home-update-detail { height:auto; min-width:0; max-width:100%; padding-top:6px; padding-bottom:6px; }
    #home .home-update-control.home-update-detail strong { white-space:normal; overflow-wrap:anywhere; text-align:left; }
    #home .home-update-control:disabled { color:#8190a4; cursor:wait; opacity:.78; }
    #home .home-update-control:disabled svg { animation:home-refresh-spin .85s linear infinite; }
    @keyframes home-refresh-spin { to { transform:rotate(360deg); } }

    #home .home-kpis { overflow:hidden; border-color:#dfe5ed; border-radius:12px; box-shadow:0 1px 3px rgba(23,34,49,.045); }
    #home .home-kpis article { min-height:104px; display:grid; grid-template-columns:minmax(0,1fr); align-items:center; align-content:center; padding:16px 20px; }
    #home .home-kpis article::before { display:block; top:22px; bottom:22px; width:2px; background:#8795aa; }
    #home .home-kpis article:nth-child(1)::before { background:#5672c8; }
    #home .home-kpis article:nth-child(2)::before { background:#7a8798; }
    #home .home-kpis article:nth-child(3)::before { background:#2f8a72; }
    #home .home-kpis article:nth-child(4)::before { background:#bf6571; }
    #home .home-kpis article > div { min-width:0; display:grid; gap:5px; }
    #home .home-kpis span { color:#66758a; font-size:.76rem; font-weight:700; }
    #home .home-kpis strong { color:#223249; font-size:1.43rem; font-weight:780; }
    #home .home-kpis small { overflow:hidden; color:#8792a2; font-size:.7rem; text-overflow:ellipsis; white-space:nowrap; }

    #home .home-focus-grid { grid-template-columns:minmax(560px,1.55fr) minmax(310px,.72fr); gap:14px; }
    #home .home-focus-grid > .panel,
    #home .home-monthly-panel,
    #home .home-trend-panel { overflow:hidden; border-color:#dfe5ed; border-radius:12px; box-shadow:0 1px 3px rgba(23,34,49,.045); }
    #home .home-task-panel .panel-head,
    #home .home-receivable-panel .panel-head,
    #home .home-monthly-panel .panel-head,
    #home .home-trend-panel .panel-head { min-height:62px; padding:13px 16px; }
    #home .home-task-panel .panel-head h2,
    #home .home-receivable-panel .panel-head h2,
    #home .home-monthly-panel .panel-head h2,
    #home .home-trend-panel .panel-head h2 { color:#223249; font-size:.98rem; font-weight:760; }
    #home .home-task-panel .panel-head p,
    #home .home-receivable-panel .panel-head p,
    #home .home-monthly-panel .panel-head p,
    #home .home-trend-panel .panel-head p { color:#7d899a; font-size:.72rem; }
    #home .home-task-list { padding:0 12px 10px; }
    #home .home-task-item { min-height:58px; grid-template-columns:42px minmax(210px,1fr) auto 12px; gap:11px; padding:8px 8px; }
    #home .home-task-icon { width:auto; height:auto; display:block; color:#738196; border-radius:0; background:transparent; font-size:.66rem; font-weight:760; letter-spacing:.04em; }
    #home .home-task-icon.warning { color:#9a671c; background:transparent; }
    #home .home-task-icon.danger { color:#ae4b5a; background:transparent; }
    #home .home-task-icon.positive { color:#2e7d69; background:transparent; }
    #home .home-task-copy strong { color:#26374d; font-size:.82rem; font-weight:730; }
    #home .home-task-copy small { color:#7d8999; font-size:.71rem; }
    #home .home-task-value { color:#465872; font-size:.75rem; }

    #home .home-receivable-panel { display:flex; flex-direction:column; }
    #home .home-receivable-list { flex:1; display:grid; align-content:start; padding:0 14px; }
    #home .home-receivable-item { width:100%; min-height:58px; display:flex; align-items:center; justify-content:space-between; gap:14px; padding:8px 4px; color:#26374d; border:0; border-bottom:1px solid #e8edf2; background:transparent; text-align:left; cursor:pointer; }
    #home .home-receivable-item:hover { background:#f8faff; }
    #home .home-receivable-item > span { min-width:0; display:grid; gap:3px; }
    #home .home-receivable-item > span:last-child { justify-items:end; }
    #home .home-receivable-item strong,
    #home .home-receivable-item b { overflow:hidden; color:#293b52; font-size:.77rem; font-weight:740; text-overflow:ellipsis; white-space:nowrap; }
    #home .home-receivable-item b { color:#b03649; font-variant-numeric:tabular-nums; }
    #home .home-receivable-item small { overflow:hidden; color:#8490a1; font-size:.68rem; text-overflow:ellipsis; white-space:nowrap; }
    #home .home-receivable-empty { padding:34px 8px; color:#8490a1; font-size:.75rem; text-align:center; }
    #home .home-receivable-action { min-height:38px; margin:12px 14px 14px; color:#fff; border:0; border-radius:9px; background:#4167d9; font:inherit; font-size:.76rem; font-weight:720; cursor:pointer; }
    #home .home-receivable-action:hover { background:#355bc7; }

    #home .home-link-action,
    #home .home-row-action { display:inline-flex; align-items:center; gap:5px; padding:0; color:#4163c5; border:0; background:transparent; font:inherit; font-size:.74rem; font-weight:720; cursor:pointer; white-space:nowrap; }
    #home .home-link-action span,
    #home .home-row-action span { color:#8b97a7; font-size:1rem; font-weight:400; }
    #home .home-monthly-table-wrap { overflow-x:auto; }
    #home .home-monthly-table { width:100%; border-collapse:collapse; table-layout:fixed; }
    #home .home-monthly-table th { height:36px; padding:0 14px; color:#718095; border-bottom:1px solid #dfe5ed; background:#f7f9fc; font-size:.7rem; font-weight:700; text-align:right; }
    #home .home-monthly-table th:first-child,
    #home .home-monthly-table td:first-child { text-align:left; }
    #home .home-monthly-table td { height:48px; padding:0 14px; color:#3d4e65; border-bottom:1px solid #e8edf2; font-size:.76rem; text-align:right; font-variant-numeric:tabular-nums; }
    #home .home-monthly-table tbody tr:hover td { background:#f8faff; }
    #home .home-monthly-table td strong { color:#25364c; font-size:.79rem; }
    #home .home-monthly-table td.is-profit { color:#08745b; font-weight:750; }
    #home .home-monthly-table td.is-loss { color:#b03649; font-weight:750; }
    #home .home-monthly-table tfoot td { height:46px; color:#33465f; border-bottom:0; background:#f2f5fb; font-weight:750; }
    #home .home-month-state { min-height:22px; display:inline-flex; align-items:center; padding:0 8px; border-radius:999px; color:#8a5b0b; background:#fff2d8; font-size:.67rem; font-weight:750; }
    #home .home-month-state.locked { color:#08745b; background:#e4f6ef; }
    #home .home-month-state.danger { color:#aa3043; background:#fff0f2; }

    #home .home-trend-layout.home-trend-compact { display:grid; grid-template-columns:minmax(0,1fr) 292px; gap:14px; padding:12px 16px 14px; }
    #home .home-trend-layout.home-trend-compact .store-chart-wrap { position:relative; min-width:0; margin:0; padding:9px 12px 7px; border:0; border-radius:10px; background:#f8fafc; }
    #home .store-legend { margin-top:5px; }
    #home .store-legend .legend-item { color:#69788d; font-size:.72rem; }
    #home .home-trend-insights { display:grid; align-content:stretch; gap:9px; }
    #home .home-trend-insight { min-height:72px; display:grid; align-content:center; gap:4px; padding:11px 13px; border:1px solid #e2e8f0; border-radius:10px; background:#fff; }
    #home .home-trend-insight > span { color:#718096; font-size:.69rem; font-weight:680; }
    #home .home-trend-insight > strong { overflow:hidden; color:#26374d; font-size:.9rem; font-weight:760; text-overflow:ellipsis; white-space:nowrap; }
    #home .home-trend-insight > small { color:#8995a5; font-size:.64rem; }
    #home .home-trend-shares { display:flex; flex-wrap:wrap; gap:4px 9px; }
    #home .home-trend-shares span { display:inline-flex; align-items:center; gap:4px; color:#758297; font-size:.64rem; }
    #home .home-trend-shares i { width:6px; height:6px; border-radius:50%; }
    #home .home-trend-shares b { color:#3c4e66; font-weight:750; }
    #home .home-chart-tooltip { position:absolute; z-index:8; width:190px; gap:0; padding:11px 12px 10px; color:#34465e; border:1px solid rgba(207,216,229,.92); border-radius:12px; background:rgba(255,255,255,.98); box-shadow:0 14px 34px rgba(31,49,75,.16), 0 2px 8px rgba(31,49,75,.06); backdrop-filter:blur(8px); pointer-events:none; }
    #home .home-chart-tooltip-date { padding-bottom:8px; color:#263a56; border-bottom:1px solid #e8edf3; font-size:.72rem; font-weight:760; }
    #home .home-chart-tooltip-row { display:flex; align-items:center; justify-content:space-between; gap:14px; padding-top:7px; font-size:.69rem; }
    #home .home-chart-tooltip-row > span { display:inline-flex; align-items:center; gap:6px; color:#6e7d91; }
    #home .home-chart-tooltip-row i { width:8px; height:8px; border-radius:3px; }
    #home .home-chart-tooltip-row strong { color:#33465e; font-size:.71rem; font-weight:720; font-variant-numeric:tabular-nums; }
    #home .home-chart-tooltip-total { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-top:8px; padding-top:8px; color:#263a56; border-top:1px solid #e8edf3; font-size:.72rem; font-weight:740; }
    #home .home-chart-tooltip-total strong { color:#18355f; font-size:.78rem; font-variant-numeric:tabular-nums; }

    @media (max-width:1200px) {
      #home .home-focus-grid { grid-template-columns:1fr; }
      #home .home-receivable-list { grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; padding-top:8px; }
      #home .home-receivable-item { align-items:flex-start; flex-direction:column; border:1px solid #e5eaf0; border-radius:9px; padding:10px; }
      #home .home-receivable-item > span:last-child { justify-items:start; }
      #home .home-trend-layout.home-trend-compact { grid-template-columns:1fr; }
      #home .home-trend-insights { grid-template-columns:repeat(3,minmax(0,1fr)); }
    }
    @media (max-width:900px) {
      #home .home-intro { align-items:flex-start; flex-direction:column; gap:10px; }
      #home .home-intro-actions { width:100%; flex-wrap:wrap; }
      #home .home-scope-control { flex:1; }
      #home .home-scope-control summary { width:100%; min-width:0; }
      #home .home-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
      #home .home-kpis article:nth-child(2) { border-right:0; }
      #home .home-kpis article:nth-child(-n+2) { border-bottom:1px solid var(--divider); }
      #home .home-receivable-list { grid-template-columns:1fr; }
      #home .home-monthly-table { min-width:760px; }
    }

    /* 销售页逐页验收：统一正式版文字层级，并收紧凭证上传占用空间。 */
    #sales.sales-workspace {
      font-family:var(--ui-font);
    }
    #sales button,
    #sales input,
    #sales select,
    #sales textarea,
    #globalProductDropdown { font-family:inherit; }
    #sales .sales-workspace-head .workspace-eyebrow { font-size:11.5px; }
    #sales .sales-workspace-head h2 { font-size:25px; line-height:1.28; }
    #sales .sales-workspace-head p { font-size:13.5px; line-height:1.55; }
    #sales .sales-section-head h3 { font-size:17px; font-weight:700; line-height:1.35; }
    #sales .sales-section-head p { font-size:13px; line-height:1.5; }
    #sales .sales-step-progress { font-size:11px; }
    #sales .form-grid label,
    #sales .footer-form label { color:#46576d; font-size:13px; font-weight:650; }
    #sales .form-grid input,
    #sales .form-grid select,
    #sales .footer-form input,
    #sales .footer-form select { height:41px; color:#27374d; font-size:14px; font-weight:500; }
    #sales input::placeholder,
    #sales textarea::placeholder { color:#8793a3; opacity:1; font-weight:400; }
    #sales option { font-family:var(--ui-font); font-size:14px; }
    .sales-search-menu,
    .sales-search-menu .sales-search-option,
    #globalProductDropdown { font-family:var(--ui-font); }
    .sales-search-menu .sales-search-option { font-size:14px; font-weight:500; }
    #sales .sales-field-help { font-size:11px; line-height:1.45; }
    #sales .sales-workspace-head .toolbar .btn,
    #sales .sales-section-actions .btn,
    #sales .sales-more-menu-panel .btn { font-size:13px; }
    #sales.sales-workspace .sales-form-table th { font-size:11.5px; }
    #sales.sales-workspace .sales-form-table td { font-size:12.5px; }
    #sales.sales-workspace .sales-modern-lines td > input,
    #sales.sales-workspace .sales-modern-lines td > select { font-size:13px; font-weight:500; }
    #sales .sales-product-control .productSearch { font-size:13px!important; font-weight:600; }
    #sales .sales-product-control .projectName { font-size:12px!important; font-weight:400; }
    #sales .sales-product-meta,
    #sales .stock-badge,
    #sales .sales-cost-cell .cost-mode-hint,
    #sales .sales-cost-cell .owner-material-toggle { font-size:10.5px; }
    #sales .sales-money-input input,
    #sales .sales-money-field input { font-size:13.5px!important; }
    #globalProductDropdown .product-option-title strong { font-size:13px; }
    #globalProductDropdown .product-option-meta { font-size:11px; }
    #sales .order-summary-card > .workspace-eyebrow { font-size:11px; }
    #sales .order-summary-card > h3 { font-size:18px; }
    #sales .order-summary-card > p { font-size:12px; }
    #sales .order-summary-card dt { font-size:12.5px; }
    #sales .order-summary-card dd { font-size:13.5px; }
    #sales .summary-safety strong { font-size:12.5px; }
    #sales .summary-safety small,
    #sales .summary-footnote { font-size:11px; }
    #sales .sales-legacy-fields summary { font-size:12px; }

    #sales .sales-proof-panel {
      width:min(420px,calc(100% - 36px));
      margin:4px 18px 16px;
      padding:0;
    }
    #sales .sales-proof-panel .upload-area {
      width:100%;
      max-width:none;
      min-height:64px;
      justify-content:flex-start;
      padding:10px 14px;
      border-width:1px;
      border-radius:9px;
      background:#fafbfd;
      text-align:left;
    }
    #sales .sales-proof-panel .upload-placeholder { width:100%; justify-content:flex-start; gap:11px; }
    #sales .sales-photo-add-mark { margin:0; color:#526fc9; font-size:23px; font-weight:300; line-height:1; }
    #sales .sales-proof-panel .upload-placeholder strong { color:#314258; font-size:13px; }
    #sales .sales-proof-panel .upload-placeholder small { color:#7c8999; font-size:11px; line-height:1.45; }
    #sales .sales-proof-panel .upload-preview { width:100%; }
    #sales .sales-proof-panel .upload-preview img { max-width:100%; }
    #sales .sales-proof-panel .upload-remove-btn { border-radius:7px; }
    @media (max-width:640px) {
      #sales .sales-proof-panel { width:calc(100% - 28px); margin-left:14px; margin-right:14px; }
    }

    /* 单据页逐项验收：沿用正式版字体层级，详情采用不挤压列表的覆盖式抽屉。 */
    #orders.orders-workspace {
      --orders-list-viewport:486px;
      font-family:var(--ui-font);
      flex:0 0 auto;
      min-height:auto;
      overflow:visible;
    }
    #orders button,
    #orders input,
    #orders select { font-family:inherit; }
    #orders.orders-workspace .workspace-eyebrow { font-size:11.5px; }
    #orders.orders-workspace .orders-intro h2 { font-size:25px; font-weight:700; line-height:1.28; }
    #orders.orders-workspace .orders-intro p { font-size:13.5px; line-height:1.55; }
    #orders.orders-workspace .orders-kpis span { font-size:11px; font-weight:400; }
    #orders.orders-workspace .orders-kpis strong { font-size:18px; font-weight:700; }
    #orders.orders-workspace .orders-kpis small { font-size:9.5px; }
    #orders.orders-workspace .order-action-guide h3 { font-size:18px; font-weight:760; }
    #orders.orders-workspace .order-action-guide p { font-size:13px; }
    #orders.orders-workspace .order-action-guide > header > span { font-size:11px; font-weight:650; }
    #orders.orders-workspace .order-action-guide-grid strong { font-size:11.5px; font-weight:700; }
    #orders.orders-workspace .order-action-guide-grid small { font-size:10px; }
    #orders.orders-workspace .orders-search,
    #orders.orders-workspace .orders-date-input,
    #orders.orders-workspace .orders-toolbar select,
    #orders.orders-workspace .orders-toolbar .btn { height:40px; }
    #orders.orders-workspace .orders-search input { height:38px; font-size:13px; font-weight:400; }
    #orders.orders-workspace .orders-range button { font-size:10.5px; font-weight:400; }
    #orders.orders-workspace .orders-date-input,
    #orders.orders-workspace .orders-toolbar select { font-size:11.5px; font-weight:400; }
    #orders.orders-workspace .orders-toolbar .btn { font-size:12px; font-weight:650; }
    #orders.orders-workspace .orders-range button { height:38px; }
    #orders.orders-workspace .orders-panel { flex:0 0 auto; }
    #orders.orders-workspace .orders-body,
    #orders.orders-workspace .orders-body.with-detail { position:relative; height:var(--orders-list-viewport); flex:0 0 var(--orders-list-viewport); display:block; overflow:hidden; }
    #orders.orders-workspace .orders-table-wrap { width:100%; height:var(--orders-list-viewport); overflow:auto; }
    #orders.orders-workspace .orders-table th { height:44px; padding:0 10px; font-size:10.5px; font-weight:650; }
    #orders.orders-workspace .orders-table td { padding:9px 10px; font-size:11px; }
    #orders.orders-workspace .orders-table td strong { font-size:11.5px; font-weight:700; }
    #orders.orders-workspace .orders-table td small { font-size:9.5px; }
    #orders.orders-workspace .orders-table th.numeric-text,
    #orders.orders-workspace .orders-table td.numeric-text { text-align:right; }
    #orders.orders-workspace .order-status { min-width:54px; font-size:10px; }
    #orders.orders-workspace .text-action { font-size:11px; font-weight:650; }
    #orders.orders-workspace .orders-pagination { font-size:11.5px; }
    #orders.orders-workspace .orders-pagination strong,
    #orders.orders-workspace .orders-pagination .btn { font-size:11.5px; }
    #orders.orders-workspace .order-detail-panel {
      position:fixed;
      z-index:40;
      inset:72px 14px 14px auto;
      width:min(400px,calc(100vw - 42px));
      min-width:0;
      overflow:auto;
      padding:16px;
      border:1px solid #d7dfe9;
      border-radius:14px;
      background:rgba(251,252,253,.985);
      box-shadow:-18px 0 42px rgba(30,47,72,.15),-2px 0 8px rgba(30,47,72,.06);
      animation:orders-detail-enter .18s ease-out;
    }
    #orders.orders-workspace .order-detail-panel:empty { display:none; }
    #orders.orders-workspace .detail-drawer-head { position:sticky; z-index:2; top:-16px; margin:-16px -16px 12px; padding:16px 16px 10px; border-bottom:1px solid #e6ebf1; background:rgba(251,252,253,.97); backdrop-filter:blur(8px); }
    #orders.orders-workspace .detail-drawer-head h3 { font-size:16px; font-weight:700; }
    #orders.orders-workspace .icon-button { width:30px; height:30px; font-size:16px; }
    #orders.orders-workspace .detail-customer strong { font-size:12.5px; font-weight:700; }
    #orders.orders-workspace .detail-customer span { font-size:10.5px; }
    #orders.orders-workspace .order-detail-panel dt { font-size:10.5px; }
    #orders.orders-workspace .order-detail-panel dd { font-size:11px; font-weight:650; }
    #orders.orders-workspace .detail-note span,
    #orders.orders-workspace .detail-timeline { font-size:10.5px; }
    #orders.orders-workspace .detail-note p { font-size:11px; line-height:1.5; }
    #orders.orders-workspace .detail-actions .btn { height:36px; font-size:11px; font-weight:720; }
    @keyframes orders-detail-enter {
      from { opacity:0; transform:translateX(18px); }
      to { opacity:1; transform:translateX(0); }
    }
    @media (max-width:980px) {
      #orders.orders-workspace .orders-body,
      #orders.orders-workspace .orders-body.with-detail { position:relative; display:block; overflow:hidden; }
      #orders.orders-workspace .order-detail-panel { position:fixed; inset:68px 10px 10px auto; width:min(420px,calc(100vw - 20px)); border:1px solid #d7dfe9; }
    }
    @media (min-width:981px) and (max-width:1320px) {
      #orders.orders-workspace .orders-toolbar { display:flex; flex-wrap:wrap; }
      #orders.orders-workspace .orders-search { flex:1 1 360px; }
      #orders.orders-workspace .orders-range { flex:0 0 auto; }
      #orders.orders-workspace .orders-date-input { flex:1 1 120px; width:120px; }
      #orders.orders-workspace .orders-toolbar select { flex:1 1 118px; width:118px; }
      #orders.orders-workspace .orders-toolbar .btn { flex:0 0 auto; }
    }

    #sales .sales-edit-mode-banner {
      min-height:58px;
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:18px;
      margin:0 0 14px;
      padding:10px 14px;
      color:#294263;
      border:1px solid #cbd8ee;
      border-left:3px solid #456bd8;
      border-radius:10px;
      background:#f5f8ff;
      box-shadow:0 1px 3px rgba(31,49,75,.05);
    }
    #sales .sales-edit-mode-banner[hidden] { display:none; }
    #sales .sales-edit-mode-banner > div { min-width:0; display:grid; grid-template-columns:auto auto; align-items:center; gap:2px 8px; }
    #sales .sales-edit-mode-banner span { color:#58709a; font-size:11px; font-weight:700; letter-spacing:.04em; }
    #sales .sales-edit-mode-banner strong { overflow:hidden; color:#244a9d; font-size:14px; font-weight:760; text-overflow:ellipsis; white-space:nowrap; }
    #sales .sales-edit-mode-banner small { grid-column:1 / -1; color:#718096; font-size:11.5px; }
    #sales .sales-edit-mode-banner .btn { min-width:84px; height:36px; flex:0 0 auto; color:#3f5575; border-color:#c9d3e2; background:#fff; font-size:12.5px; font-weight:650; }
    #sales .sales-edit-mode-banner .btn:hover { color:#294f9d; border-color:#9fb4dc; background:#fdfefe; }
    @media (max-width:640px) {
      #sales .sales-edit-mode-banner { align-items:flex-start; flex-direction:column; }
      #sales .sales-edit-mode-banner .btn { width:100%; }
    }

    /* ui48 库存逐页收口：单层页签、紧凑状态、盘点工具栏、流水边界与原型式库存更正。 */
    #stock .stock-workspace-nav {
      min-height:59px;
      padding:0;
      border-radius:12px;
    }
    #stock .stock-tab {
      min-height:57px;
      padding:8px 14px;
    }
    #stock .inventory-overview-table td:first-child {
      text-align:left;
    }
    #stock .inventory-overview-table td:first-child .pill {
      width:54px;
      height:22px;
      min-width:54px;
      display:inline-flex;
      align-items:center;
      justify-content:center;
      margin:0;
      padding:0 7px;
      border:0;
      border-radius:999px;
      font-size:10px;
      font-weight:750;
      line-height:1;
      text-align:center;
      white-space:nowrap;
    }
    #stock .inventory-overview-table td:first-child .pill.must {
      color:#116d52;
      background:#e9f7f1;
    }
    #stock .inventory-overview-table td:first-child .pill.later {
      color:#925a16;
      background:#fff5e6;
    }
    #stock .inventory-overview-table td:first-child .pill.ignore {
      color:#9b3542;
      background:#fff0f2;
    }
    #stock .inventory-batch-trace-action {
      min-height:28px;
      display:inline-flex;
      align-items:center;
      justify-content:center;
      padding:0 9px;
      color:#3857b4;
      border:1px solid #d5defb;
      border-radius:7px;
      background:#f5f7ff;
      font-size:9.5px;
      font-weight:700;
      text-decoration:none;
    }
    #stock .inventory-batch-trace-action:hover {
      color:#2949a4;
      border-color:#b8c7f5;
      background:#edf2ff;
      text-decoration:none;
    }

    #stock #stockTabLedger {
      width:100%;
      min-width:0;
      overflow:hidden;
      box-sizing:border-box;
    }
    #stock #stockTabLedger .inventory-overview-head {
      width:100%;
      margin:0;
      box-sizing:border-box;
    }
    #stock #stockTabLedger .ledger-filter-grid {
      width:100%;
      min-width:0;
      box-sizing:border-box;
    }
    #stock #stockTabLedger .inventory-ledger-table {
      width:auto;
      min-width:0;
      margin:12px 14px 0;
      box-sizing:border-box;
    }
    #stock #stockTabLedger .inventory-pagination {
      margin:0 14px;
    }

    #stock #stockTabCounts {
      width:100%;
      min-width:0;
      padding:16px;
      overflow:hidden;
      box-sizing:border-box;
    }
    #stockTabCounts .stock-check-workspace-head {
      align-items:center;
      min-width:0;
    }
    #stockTabCounts .stock-check-boundary-grid {
      display:grid;
      grid-template-columns:repeat(2,minmax(0,1fr));
      gap:10px;
      margin:14px 0 10px;
    }
    #stockTabCounts .stock-check-boundary-grid article {
      min-width:0;
      display:grid;
      gap:3px;
      padding:10px 12px;
      border:1px solid #d8ebe3;
      border-radius:9px;
      background:#f3faf7;
    }
    #stockTabCounts .stock-check-boundary-grid strong {
      color:#2e6b58;
      font-size:11px;
      font-weight:750;
    }
    #stockTabCounts .stock-check-boundary-grid span {
      overflow:hidden;
      color:#6f7e8d;
      font-size:9.5px;
      line-height:1.45;
      text-overflow:ellipsis;
      white-space:nowrap;
    }
    #stockTabCounts .stock-check-toolbar {
      min-width:0;
      display:grid;
      grid-template-columns:auto 150px auto auto;
      align-items:center;
      justify-content:end;
      gap:8px;
      padding:10px 0;
      border-top:1px solid #e7ebf1;
      border-bottom:1px solid #e7ebf1;
    }
    #stockTabCounts .stock-check-toolbar select {
      width:150px;
      height:36px;
      min-width:0;
      border-color:#ced7e4;
      border-radius:8px;
      font-size:11px;
    }
    #stockTabCounts .stock-check-toolbar .stock-check-primary-action {
      height:36px;
      padding:0 13px;
      border-radius:8px;
      font-size:11px;
      font-weight:720;
      white-space:nowrap;
    }
    #stockTabCounts .stock-check-refresh-action {
      min-height:32px;
      padding:0 4px;
      font-size:10.5px;
      white-space:nowrap;
    }
    #stockTabCounts .stock-check-stage-guide {
      margin:10px 0;
      border-radius:9px;
    }
    #stockTabCounts .stock-check-stage-guide span {
      min-width:0;
      padding:9px 12px;
    }
    #stockTabCounts .stock-check-task-table-wrap {
      width:100%;
      min-width:0;
      box-sizing:border-box;
    }
    #stockTabCounts .stock-check-list-table {
      min-width:920px;
      table-layout:fixed;
    }
    #stockTabCounts .stock-check-list-table th,
    #stockTabCounts .stock-check-list-table td {
      min-width:0;
      overflow:hidden;
      text-overflow:ellipsis;
      white-space:nowrap;
    }
    #stockTabCounts .stock-check-list-table th:nth-child(1),
    #stockTabCounts .stock-check-list-table td:nth-child(1) { width:190px; }
    #stockTabCounts .stock-check-list-table th:nth-child(2),
    #stockTabCounts .stock-check-list-table td:nth-child(2) { width:92px; }
    #stockTabCounts .stock-check-list-table th:nth-child(3),
    #stockTabCounts .stock-check-list-table td:nth-child(3) { width:88px; }
    #stockTabCounts .stock-check-list-table th:nth-child(4),
    #stockTabCounts .stock-check-list-table td:nth-child(4),
    #stockTabCounts .stock-check-list-table th:nth-child(5),
    #stockTabCounts .stock-check-list-table td:nth-child(5) { width:72px; }
    #stockTabCounts .stock-check-list-table th:nth-child(6),
    #stockTabCounts .stock-check-list-table td:nth-child(6) { width:96px; }
    #stockTabCounts .stock-check-list-table th:nth-child(7),
    #stockTabCounts .stock-check-list-table td:nth-child(7) { width:92px; }
    #stockTabCounts .stock-check-list-table th:nth-child(8),
    #stockTabCounts .stock-check-list-table td:nth-child(8) { width:82px; }
    #stockTabCounts .stock-check-list-table th:nth-child(9),
    #stockTabCounts .stock-check-list-table td:nth-child(9) { width:108px; }
    #stockTabCounts .stock-check-list-table th.num-r,
    #stockTabCounts .stock-check-list-table td.num-r {
      text-align:right;
    }
    #stockTabCounts .stock-check-row-actions {
      justify-content:flex-start;
      gap:8px;
    }

    #stock #stockTabAdjustment {
      width:100%;
      min-width:0;
      overflow:visible;
      border:0;
      border-radius:0;
      background:transparent;
      box-shadow:none;
    }
    #stockTabAdjustment .stock-adjust-layout {
      width:100%;
      min-width:0;
      display:grid;
      grid-template-columns:minmax(0,1fr) 286px;
      grid-template-rows:auto auto;
      gap:14px;
      align-items:start;
    }
    #stockTabAdjustment .stock-adjust-entry {
      grid-column:1;
      grid-row:1;
      min-width:0;
      margin:0;
      border-color:#dce3ec;
      border-radius:12px;
      box-shadow:0 1px 2px rgba(24,39,63,.04);
    }
    #stockTabAdjustment .stock-adjust-heading {
      min-height:54px;
      align-items:center;
      padding:11px 16px;
      background:#fff;
    }
    #stockTabAdjustment .stock-adjust-heading span:first-child {
      font-size:14px;
      font-weight:750;
    }
    #stockTabAdjustment .stock-adjust-heading p {
      font-size:10.5px;
      line-height:1.45;
    }
    #stockTabAdjustment .stock-adjust-safety {
      padding:0;
      color:#7b8797!important;
      border:0;
      border-radius:0;
      background:transparent;
      font-size:9.5px!important;
      font-weight:550!important;
    }
    #stockTabAdjustment .stock-adjust-grid {
      grid-template-columns:repeat(6,minmax(0,1fr));
      gap:12px 10px;
      padding:14px 16px 16px;
      align-items:end;
    }
    #stockTabAdjustment .stock-adjust-grid > div:nth-child(1) { grid-column:1 / 3; }
    #stockTabAdjustment .stock-adjust-grid > div:nth-child(2) { grid-column:3 / 7; }
    #stockTabAdjustment .stock-adjust-grid > div:nth-child(3) { grid-column:1 / 3; }
    #stockTabAdjustment .stock-adjust-grid > div:nth-child(4) { grid-column:3 / 5; }
    #stockTabAdjustment .stock-adjust-grid > div:nth-child(5) { grid-column:5 / 7; }
    #stockTabAdjustment .stock-adjust-grid > div:nth-child(6) { grid-column:1 / 3; }
    #stockTabAdjustment .stock-adjust-grid > div:nth-child(7) { grid-column:3 / 5; }
    #stockTabAdjustment .stock-adjust-grid > div:nth-child(8) { grid-column:5 / 7; }
    #stockTabAdjustment .stock-adjust-grid > div:nth-child(9) { grid-column:1 / 7; }
    #stockTabAdjustment .stock-adjust-grid:has(#adjustCostField[hidden]) > div:nth-child(7) { grid-column:1 / 4; }
    #stockTabAdjustment .stock-adjust-grid:has(#adjustCostField[hidden]) > div:nth-child(8) { grid-column:4 / 7; }
    #stockTabAdjustment .stock-adjust-grid label {
      margin-bottom:5px;
      color:#5c6a7d;
      font-size:10.5px;
      font-weight:650;
    }
    #stockTabAdjustment .stock-adjust-grid input,
    #stockTabAdjustment .stock-adjust-grid select {
      height:39px;
      min-width:0;
      padding:0 10px;
      border-color:#ced7e4;
      border-radius:8px;
      font-size:12px;
      font-weight:450;
    }
    #stockTabAdjustment .stock-adjust-grid > div:nth-child(3),
    #stockTabAdjustment .stock-adjust-grid > div:nth-child(4),
    #stockTabAdjustment .stock-adjust-grid > div:nth-child(5) {
      padding:9px 10px 10px;
      border:1px solid #e1e7ef;
      border-radius:9px;
      background:#f8faff;
    }
    #stockTabAdjustment .stock-adjust-quantity-hint {
      display:block;
      min-height:14px;
      margin-top:4px;
      color:#7c8898;
      font-size:9px;
      line-height:1.35;
    }
    #stockTabAdjustment .stock-adjust-quantity-hint.is-error { color:#c53b4d; font-weight:650; }
    #stockTabAdjustment #adjustActualQty.field-error { border-color:#e29aa5; box-shadow:0 0 0 3px rgba(197,59,77,.08); }
    #stockTabAdjustment .stock-adjust-preview {
      grid-template-columns:repeat(5,minmax(90px,1fr));
      gap:0;
      padding:0 16px 16px;
    }
    #stockTabAdjustment .stock-adjust-preview-action {
      grid-column:1 / -1;
      justify-content:flex-end;
      margin-top:10px;
    }
    #stockTabAdjustment .stock-adjust-preview-action .btn {
      min-width:136px;
      min-height:36px;
      border-radius:8px;
      font-size:11px;
    }
    #stockTabAdjustment .stock-adjust-flow {
      grid-column:1;
      grid-row:2;
      min-width:0;
      margin:0;
    }
    #stockTabAdjustment .stock-adjust-flow-card {
      overflow:hidden;
      border:1px solid #dce3ec;
      border-radius:12px;
      background:#fff;
      box-shadow:0 1px 2px rgba(24,39,63,.04);
    }
    #stockTabAdjustment .stock-adjust-flow-title {
      display:flex;
      min-height:54px;
      align-items:center;
      justify-content:space-between;
      gap:12px;
      padding:10px 12px;
      border-bottom:1px solid #e5eaf0;
      background:#fff;
    }
    #stockTabAdjustment .stock-adjust-flow-title > span { display:grid; gap:2px; }
    #stockTabAdjustment .stock-adjust-flow-title strong { color:#293a50; font-size:12px; font-weight:750; }
    #stockTabAdjustment .stock-adjust-flow-title small { color:#818d9c; font-size:9px; font-weight:450; }
    #stockTabAdjustment .stock-adjust-flow-list { display:grid; }
    #stockTabAdjustment .stock-adjust-flow-item {
      display:grid;
      grid-template-columns:minmax(0,1fr) auto;
      align-items:center;
      gap:12px;
      min-height:57px;
      padding:9px 12px;
      border-bottom:1px solid #e8edf3;
    }
    #stockTabAdjustment .stock-adjust-flow-item:last-child { border-bottom:0; }
    #stockTabAdjustment .stock-adjust-flow-main {
      display:grid;
      grid-template-columns:auto auto minmax(0,1fr);
      align-items:center;
      gap:6px 9px;
      min-width:0;
    }
    #stockTabAdjustment .stock-adjust-flow-main strong { color:#33445b; font-size:10px; font-weight:700; }
    #stockTabAdjustment .stock-adjust-flow-main small {
      overflow:hidden;
      color:#7a8798;
      font-size:9px;
      text-overflow:ellipsis;
      white-space:nowrap;
    }
    #stockTabAdjustment .stock-adjust-flow-main .inventory-ledger-type { margin:0; }
    #stockTabAdjustment .inventory-ledger-type {
      display:inline-flex;
      width:max-content;
      min-width:50px;
      height:22px;
      align-items:center;
      justify-content:center;
      padding:0 7px;
      border-radius:999px;
      font-size:9px;
      font-weight:750;
      line-height:1;
      white-space:nowrap;
    }
    #stockTabAdjustment .inventory-ledger-type.is-in { color:#116d52; background:#e9f7f1; }
    #stockTabAdjustment .inventory-ledger-type.is-out { color:#3857b4; background:#eef2ff; }
    #stockTabAdjustment .inventory-ledger-type.is-adjust { color:#8a5b0c; background:#fff5df; }
    #stockTabAdjustment .inventory-ledger-type.is-reversal { color:#aa3446; background:#fff0f2; }
    #stockTabAdjustment .inventory-ledger-type.is-other { color:#5f6d80; background:#f0f3f7; }
    #stockTabAdjustment .stock-adjust-flow-impact { display:grid; gap:2px; min-width:94px; text-align:right; }
    #stockTabAdjustment .stock-adjust-flow-impact strong { font-size:11px; font-weight:750; font-variant-numeric:tabular-nums; }
    #stockTabAdjustment .stock-adjust-flow-impact small { color:#7f8b9b; font-size:9px; }
    #stockTabAdjustment .stock-adjust-flow-impact.is-positive strong { color:#07875f; }
    #stockTabAdjustment .stock-adjust-flow-impact.is-negative strong { color:#cf3f52; }
    #stockTabAdjustment .stock-adjust-flow-impact.is-zero strong { color:#7f8b9b; }
    #stockTabAdjustment .stock-adjust-flow-empty {
      display:grid;
      min-height:70px;
      place-items:center;
      color:#8591a1;
      font-size:10px;
    }
    #stockTabAdjustment .stock-adjust-flow-empty.is-error { color:#c53b4d; }
    #stockTabAdjustment .stock-adjust-history {
      grid-column:2;
      grid-row:1 / span 2;
      min-width:0;
      margin:0;
      padding:0;
      overflow:hidden;
      border:1px solid #dce3ec;
      border-radius:12px;
      background:#fff;
      box-shadow:0 1px 2px rgba(24,39,63,.04);
    }
    #stockTabAdjustment .stock-adjust-history-head {
      min-height:54px;
      margin:0;
      padding:10px 12px;
      border-bottom:1px solid #e5eaf0;
    }
    #stockTabAdjustment .stock-adjust-history-title {
      display:grid;
      gap:2px;
      color:#293a50;
      font-size:12px;
      font-weight:750;
    }
    #stockTabAdjustment .stock-adjust-history-title small {
      color:#818d9c;
      font-size:9px;
      font-weight:450;
    }
    #stockTabAdjustment .stock-adjust-history-table-wrap {
      max-height:410px;
      overflow:auto;
      border:0;
      border-radius:0;
    }
    #stockTabAdjustment .stock-adjust-history-table-wrap thead {
      display:none;
    }
    #stockTabAdjustment #adjRecentRows,
    #stockTabAdjustment #adjRecentRows tr {
      display:block;
    }
    #stockTabAdjustment #adjRecentRows tr.stock-adjust-history-row {
      position:relative;
      display:grid;
      grid-template-columns:minmax(0,1fr) auto;
      gap:3px 8px;
      padding:10px 12px;
      border-bottom:1px solid #e8edf3;
    }
    #stockTabAdjustment #adjRecentRows td {
      min-width:0;
      padding:0;
      border:0;
      font-size:9.5px;
      line-height:1.35;
      text-align:left;
    }
    #stockTabAdjustment #adjRecentRows td:nth-child(2) { grid-column:1; grid-row:1; color:#2f4057; font-weight:750; }
    #stockTabAdjustment #adjRecentRows td:nth-child(5) { grid-column:2; grid-row:1; text-align:right; font-size:11px; font-weight:750; }
    #stockTabAdjustment #adjRecentRows td:nth-child(3) { grid-column:1; grid-row:2; color:#607086; }
    #stockTabAdjustment #adjRecentRows td:nth-child(4) { grid-column:2; grid-row:2; color:#7f8b9b; text-align:right; }
    #stockTabAdjustment #adjRecentRows td:nth-child(7) { grid-column:1; grid-row:3; color:#7f8b9b; }
    #stockTabAdjustment #adjRecentRows td:nth-child(1) { grid-column:2; grid-row:3; color:#7f8b9b; text-align:right; }
    #stockTabAdjustment #adjRecentRows td:nth-child(6),
    #stockTabAdjustment #adjRecentRows td:nth-child(8) { display:none; }
    #stockTabAdjustment #adjRecentRows td[colspan] {
      display:block;
      padding:28px 12px;
      text-align:center;
    }
    #stockTabAdjustment .stock-adjust-reversal-note {
      margin:0;
      padding:10px 12px;
      color:#697990;
      border-top:1px solid #e5eaf0;
      background:#f3f6ff;
      font-size:9.5px;
      line-height:1.45;
    }
    @media (max-width:1180px) {
      #stockTabCounts .stock-check-boundary-grid { grid-template-columns:1fr; }
      #stockTabCounts .stock-check-boundary-grid span { white-space:normal; }
      #stockTabCounts .stock-check-toolbar { grid-template-columns:auto minmax(130px,1fr) auto auto; justify-content:stretch; }
      #stockTabAdjustment .stock-adjust-layout { grid-template-columns:1fr; }
      #stockTabAdjustment .stock-adjust-history { grid-column:1; grid-row:3; }
    }
    @media (max-width:760px) {
      #stockTabCounts .stock-check-toolbar { grid-template-columns:1fr 1fr; }
      #stockTabCounts .stock-check-toolbar label { align-self:end; }
      #stockTabCounts .stock-check-toolbar select { width:100%; }
      #stockTabAdjustment .stock-adjust-grid { grid-template-columns:1fr 1fr; }
      #stockTabAdjustment .stock-adjust-grid > div { grid-column:auto!important; }
      #stockTabAdjustment .stock-adjust-product,
      #stockTabAdjustment .stock-adjust-remark { grid-column:1 / -1!important; }
      #stockTabAdjustment .stock-adjust-preview { grid-template-columns:1fr 1fr; gap:8px; }
      #stockTabAdjustment .stock-adjust-preview > div:not(.stock-adjust-preview-action) { border:1px solid var(--rule); border-radius:8px; }
    }

    /* ui49：库存流水业务类型使用低饱和语义色，保持文字可读且不只依赖颜色。 */
    #stockTabLedger .inventory-ledger-type {
      display:inline-flex;
      width:max-content;
      min-width:50px;
      height:24px;
      align-items:center;
      justify-content:center;
      margin-top:4px;
      padding:0 7px;
      border-radius:999px;
      font-size:9px!important;
      font-weight:750;
      line-height:1;
      white-space:nowrap;
    }
    #stockTabLedger .inventory-ledger-type.is-in {
      color:#116d52!important;
      background:#e9f7f1;
    }
    #stockTabLedger .inventory-ledger-type.is-out {
      color:#3857b4!important;
      background:#eef2ff;
    }
    #stockTabLedger .inventory-ledger-type.is-adjust {
      color:#925a16!important;
      background:#fff5e6;
    }
    #stockTabLedger .inventory-ledger-type.is-reversal {
      color:#ad3f54!important;
      background:#fff0f2;
    }
    #stockTabLedger .inventory-ledger-type.is-other {
      color:#596779!important;
      background:#eef1f5;
    }

    /* ui54：收款页四分区均可实测分页；弹窗控件与原型字体参数一致。 */
    #payment .payment-pagination {
      min-height:48px;
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:16px;
      padding:8px 2px 0;
      color:#6f7e91;
      font-size:11.5px;
    }
    #payment .payment-pagination > div { display:flex; align-items:center; gap:9px; }
    #payment .payment-pagination strong {
      min-width:52px;
      color:#2f4056;
      font-size:11.5px;
      text-align:center;
      font-variant-numeric:tabular-nums;
    }
    #payment .payment-pagination .btn { min-width:64px; height:32px; padding:0 10px; font-size:11.5px; }
    #payment .payment-pagination .btn:disabled {
      color:#a3adba;
      border-color:#e4e8ee;
      background:#f5f7fa;
      cursor:not-allowed;
    }
    #paymentEntryModal .form-row input,
    #paymentEntryModal .form-row select,
    #paymentResolutionModal .form-row input,
    #paymentResolutionModal .form-row select,
    #salesReturnRefundModal .form-row input,
    #salesReturnRefundModal .form-row select,
    #salesReturnRefundModal .form-row textarea {
      height:38px;
      padding:0 10px;
      border-radius:8px;
      font-family:var(--ui-font);
      font-size:12px;
      font-weight:650;
    }
    #salesReturnRefundModal .form-row textarea { min-height:72px; height:auto; padding:9px 10px; line-height:1.5; }
    #paymentRefundsView .payment-table-wrap th,
    #paymentRefundsView .payment-table-wrap td { padding-left:12px; padding-right:12px; }
    #paymentRefundsView .payment-table-wrap table { min-width:1040px; }
    #paymentRefundsView .payment-table-wrap th:nth-child(5),
    #paymentRefundsView .payment-table-wrap td:nth-child(5),
    #paymentRefundsView .payment-table-wrap th:nth-child(6),
    #paymentRefundsView .payment-table-wrap td:nth-child(6) { padding-left:18px; }
    @media (min-width:1101px) {
      #paymentRefundsView th:nth-child(1) { width:10%; }
      #paymentRefundsView th:nth-child(2) { width:14%; }
      #paymentRefundsView th:nth-child(3) { width:15%; }
      #paymentRefundsView th:nth-child(4) { width:11%; }
      #paymentRefundsView th:nth-child(5) { width:13%; }
      #paymentRefundsView th:nth-child(6) { width:13%; }
      #paymentRefundsView th:nth-child(7) { width:10%; }
      #paymentRefundsView th:nth-child(8) { width:14%; }
    }
    @media (max-width:760px) {
      #payment .payment-pagination { align-items:flex-start; flex-direction:column; }
    }

    /* ui60：资料页按原型重新统一主从外壳与新增/编辑表单，不影响已冻结页面。 */
    #base.base-workspace,
    #baseEditModal {
      font-family:var(--ui-font);
    }
    #base .base-master-layout {
      min-height:720px;
      align-items:stretch;
      gap:0;
      padding:0;
      overflow:hidden;
      border:1px solid #dce4ee;
      border-radius:12px;
      background:#fff;
    }
    #base .base-master-list-card,
    #base .base-master-detail {
      min-height:720px;
      align-self:stretch;
      border:0;
      border-radius:0;
      background:#fff;
    }
    #base .base-master-list-card {
      border-right:1px solid #dce4ee;
    }
    #base .base-master-detail {
      display:flex;
      flex-direction:column;
      padding:0;
      overflow:hidden;
    }
    #base .base-master-detail > .base-master-empty { flex:1; }
    #base .base-detail-actions { margin-top:auto; }

    /* ui71：桌面主从视图由右侧内容决定整行高度；左侧列表填满同高区域，分页贴底。 */
    @media (min-width:1181px) {
      #base .base-master-list {
        flex:1 1 0;
        height:0;
        max-height:none;
      }
    }

    #base .base-detail-head span:first-child { font-size:10.5px; }
    #base .base-detail-head p { font-size:10.5px; }
    #base .base-detail-context > span { font-size:10px; }
    #base .base-detail-context > strong { font-size:11.5px; }
    #base .base-detail-context > small { font-size:10px; }
    #base .base-detail-summary span { font-size:10px; }
    #base .base-detail-summary strong { font-size:12px; }
    #base .base-detail-summary small { font-size:9.5px; }
    #base .base-detail-section > header strong { font-size:11.5px; }
    #base .base-detail-section > header small { font-size:9.5px; }
    #base .base-detail-field > span { font-size:10px; }
    #base .base-detail-field > strong { font-size:11.5px; }
    #base .base-detail-field > small { font-size:9.5px; }
    #base .base-detail-notice strong { font-size:10.5px; }
    #base .base-detail-notice p { font-size:10px; }
    #base .base-audit-panel,
    #base .base-audit-panel * { font-size:10px; }
    #base #baseAddButton {
      min-width:108px;
      min-height:38px;
      gap:7px;
      justify-content:center;
      color:#315ac4;
      border-color:#c7d4f5;
      background:#f3f6ff;
      box-shadow:0 1px 2px rgba(35,63,128,.05);
      font-family:var(--ui-font);
      font-size:11.5px;
      font-weight:600;
      line-height:1.2;
      letter-spacing:0;
      white-space:nowrap;
    }
    #base #baseAddButton > span[aria-hidden="true"] {
      color:#4268d9;
      font-size:14px;
      font-weight:400;
      line-height:1;
    }
    #base #baseAddButton > [data-base-add-label] {
      font-family:inherit;
      font-size:11.5px;
      font-weight:600;
      line-height:1.2;
    }
    #base #baseAddButton:hover {
      color:#244cae;
      border-color:#9fb3ec;
      background:#eaf0ff;
      box-shadow:0 3px 9px rgba(48,80,156,.10);
      transform:translateY(-1px);
    }
    #base #baseAddButton:active {
      background:#e2eaff;
      box-shadow:0 1px 3px rgba(48,80,156,.08);
      transform:translateY(0);
    }
    #base #baseAddButton:focus-visible {
      outline:2px solid #7890df;
      outline-offset:2px;
    }

    #baseEditModal { padding:24px; }
    #baseEditModal .modal-box {
      width:min(860px,calc(100vw - 48px));
      max-height:calc(100vh - 48px);
      overflow:auto;
      padding:0;
      border:1px solid #dbe3ee;
      border-radius:15px;
      background:#fff;
      box-shadow:0 24px 70px rgba(24,39,62,.22);
    }
    #baseEditModal .base-edit-modal-head {
      position:sticky;
      top:0;
      z-index:4;
      min-height:98px;
      padding:18px 20px 16px;
      background:#fff;
    }
    #baseEditModal .base-edit-modal-head span { font-size:10.5px; }
    #baseEditModal .base-edit-modal-head h3 { font-size:18px; }
    #baseEditModal .base-edit-modal-head p { font-size:11.5px; }
    #baseEditModal .base-edit-close {
      flex-basis:34px;
      width:34px;
      height:34px;
      border-color:transparent;
      border-radius:9px;
      background:transparent;
    }
    #baseEditModal .base-edit-close:hover {
      border-color:#d8e0eb;
      background:#f4f7fb;
    }
    #baseEditModal .base-edit-close:focus-visible {
      border-color:transparent;
      box-shadow:none;
      outline:2px solid rgba(66,103,217,.42);
      outline-offset:2px;
    }
    #baseEditModal .form-row {
      display:grid;
      grid-template-columns:repeat(2,minmax(0,1fr));
      gap:12px;
      margin:0 20px 18px;
      padding:14px;
      border:1px solid #dfe6ef;
      border-radius:11px;
      background:#fafbfd;
    }
    #baseEditModal .form-row > .base-edit-field {
      min-width:0;
      display:grid;
      align-content:start;
      gap:5px;
      padding:0;
      border:0;
      border-radius:0;
      background:transparent;
    }
    #baseEditModal .form-row > .base-edit-field.span-2,
    #baseEditModal .form-row > .staff-scope-group { grid-column:1 / -1; }
    #baseEditModal .form-row > div > label {
      color:#43546a;
      font-size:11px;
      font-weight:700;
    }
    #baseEditModal .form-row input:not([type="checkbox"]),
    #baseEditModal .form-row select,
    #baseEditModal .form-row textarea {
      height:38px;
      padding:0 10px;
      border-radius:8px;
      font-size:12px;
      font-weight:650;
    }
    #baseEditModal .form-row textarea { min-height:72px; height:auto; padding:9px 10px; }
    #baseEditModal .form-row small { font-size:9.5px; }
    #baseEditModal .staff-scope-group {
      padding:12px;
      border:1px solid #e0e6ef;
      border-radius:9px;
      background:#fff;
    }
    #baseEditModal .modal-actions {
      min-height:64px;
      padding:12px 20px;
    }

    @media (max-width:1180px) {
      #base .base-master-layout { grid-template-columns:1fr; }
      #base .base-master-list-card {
        min-height:auto;
        border-right:0;
        border-bottom:1px solid #dce4ee;
      }
      #base .base-master-detail { min-height:620px; }
    }
    @media (max-width:720px) {
      #baseEditModal { padding:12px; }
      #baseEditModal .modal-box {
        width:calc(100vw - 24px);
        max-height:calc(100vh - 24px);
      }
      #baseEditModal .form-row {
        grid-template-columns:1fr;
        margin:0 12px 14px;
        padding:12px;
      }
      #baseEditModal .form-row > .base-edit-field.span-2,
      #baseEditModal .form-row > .staff-scope-group { grid-column:1; }
    }

    /* ui82 — C 版第二批：业务页逐页接入。特殊页签与双行证据表保留语义所需高度。 */
    .ui-c-standard #sales .sales-workspace-head h2,
    .ui-c-standard #orders.orders-workspace .orders-intro h2,
    .ui-c-standard #stock .stock-module-intro h2,
    .ui-c-standard #payment .payment-head h2,
    .ui-c-standard #base .base-master-head h2,
    .ui-c-standard #reports .report-workspace-head h2,
    .ui-c-standard #finance .finance-workspace-title h2,
    .ui-c-standard #settings .settings-workspace-head h2 {
      color:var(--ui-ink);
      font-size:22px;
      line-height:30px;
      font-weight:700;
      letter-spacing:-.35px;
    }
    .ui-c-standard #sales .sales-workspace-head p,
    .ui-c-standard #orders.orders-workspace .orders-intro p,
    .ui-c-standard #stock .stock-module-intro p,
    .ui-c-standard #payment .payment-head p,
    .ui-c-standard #base .base-master-head p,
    .ui-c-standard #reports .report-workspace-head p,
    .ui-c-standard #finance .finance-workspace-title p,
    .ui-c-standard #settings .settings-workspace-head p {
      margin-top:3px;
      color:var(--ui-muted);
      font-size:12px;
      line-height:18px;
    }
    .ui-c-standard #sales .sales-section-head h3,
    .ui-c-standard #orders h3,
    .ui-c-standard #base .base-health-head h3,
    .ui-c-standard #base .base-master-detail h3,
    .ui-c-standard #reports h2:not(.report-workspace-head h2),
    .ui-c-standard #reports h3,
    .ui-c-standard #finance h3,
    .ui-c-standard #settings h3 {
      font-size:16px;
      line-height:24px;
      font-weight:700;
    }

    .ui-c-standard #sales .btn,
    .ui-c-standard #orders .btn,
    .ui-c-standard #stock .stock-module-actions .btn,
    .ui-c-standard #stock .inventory-toolbar .btn,
    .ui-c-standard #payment .payment-head-actions .btn,
    .ui-c-standard #payment .payment-filter-bar .btn,
    .ui-c-standard #base .base-master-head-actions .btn,
    .ui-c-standard #base .base-master-tools .btn,
    .ui-c-standard #reports .report-head-actions .btn,
    .ui-c-standard #reports .report-filter-panel .btn,
    .ui-c-standard #finance .btn,
    .ui-c-standard #settings .btn {
      min-height:var(--ui-control);
      height:var(--ui-control);
      padding:0 14px;
      border-radius:var(--ui-radius);
      font-size:14px;
      line-height:22px;
    }
    .ui-c-standard #sales input:not([type="checkbox"]):not([type="radio"]),
    .ui-c-standard #sales select,
    .ui-c-standard #orders input:not([type="checkbox"]):not([type="radio"]),
    .ui-c-standard #orders select,
    .ui-c-standard #stock .inventory-toolbar input,
    .ui-c-standard #stock .inventory-toolbar select,
    .ui-c-standard #payment .payment-filter-bar input,
    .ui-c-standard #payment .payment-filter-bar select,
    .ui-c-standard #base .base-master-tools input,
    .ui-c-standard #base .base-master-tools select,
    .ui-c-standard #reports .report-filter-panel input,
    .ui-c-standard #reports .report-filter-panel select,
    .ui-c-standard #finance .finance-context-row select,
    .ui-c-standard #finance .finance-context-button,
    .ui-c-standard #settings input:not([type="checkbox"]):not([type="radio"]),
    .ui-c-standard #settings select {
      height:var(--ui-control);
      min-height:var(--ui-control);
      border-radius:var(--ui-radius);
      font-size:14px;
      line-height:22px;
    }

    .ui-c-standard #sales .sales-workspace-head { padding-bottom:12px; }
    .ui-c-standard #sales .sales-section-head h3 { font-size:16px; line-height:24px; }
    .ui-c-standard #sales .sales-section-head p,
    .ui-c-standard #sales .sales-field-help { font-size:12px; line-height:18px; }
    .ui-c-standard #sales .form-grid label,
    .ui-c-standard #sales .footer-form label { font-size:12px; line-height:18px; }
    .ui-c-standard #sales .sales-modern-lines th { height:36px; font-size:12px; line-height:18px; }
    .ui-c-standard #sales .sales-modern-lines td { color:var(--ui-text); font-size:13px; line-height:20px; }

    .ui-c-standard #orders.orders-workspace .orders-intro { padding-bottom:12px; }
    .ui-c-standard #orders.orders-workspace .orders-toolbar select,
    .ui-c-standard #orders.orders-workspace .orders-toolbar .btn { height:var(--ui-control); font-size:14px; }
    .ui-c-standard #orders.orders-workspace .orders-table th { height:36px; padding:0 10px; font-size:12px; line-height:18px; }
    .ui-c-standard #orders.orders-workspace .orders-table td { height:48px; padding:5px 10px; color:var(--ui-text); font-size:13px; line-height:20px; }
    .ui-c-standard #orders.orders-workspace .orders-table td strong { font-size:13px; line-height:20px; font-weight:650; }
    .ui-c-standard #orders.orders-workspace .orders-table td small { margin-top:1px; font-size:11px; line-height:16px; }

    .ui-c-standard #stock .stock-module-intro { padding-bottom:12px; }
    .ui-c-standard #stock .inventory-overview-table th { height:36px; padding:0 10px; font-size:12px; line-height:18px; }
    .ui-c-standard #stock .inventory-overview-table td { height:52px; padding:5px 10px; color:var(--ui-text); font-size:13px; line-height:20px; }
    .ui-c-standard #stock .inventory-overview-table td > strong { font-size:13px; line-height:20px; font-weight:650; }
    .ui-c-standard #stock .inventory-overview-table td > span { margin-top:1px; font-size:11px; line-height:16px; }

    .ui-c-standard #payment .payment-head { padding-bottom:12px; }
    .ui-c-standard #payment .payment-tabs button { min-height:60px; padding:8px 14px; }
    .ui-c-standard #payment .payment-tabs button strong { font-size:14px; line-height:22px; }
    .ui-c-standard #payment .payment-tabs button small { font-size:12px; line-height:18px; }
    .ui-c-standard #payment .payment-table-wrap th { height:36px; padding:0 10px; font-size:12px; line-height:18px; }
    .ui-c-standard #payment .payment-table-wrap td { height:48px; padding:5px 10px; color:var(--ui-text); font-size:13px; line-height:20px; }
    .ui-c-standard #payment .payment-table-wrap td strong { font-size:13px; line-height:20px; font-weight:650; }
    .ui-c-standard #payment .payment-table-wrap td small { margin-top:1px; font-size:11px; line-height:16px; }

    .ui-c-standard #base .base-master-head { padding-bottom:12px; }
    .ui-c-standard #base .base-health { border-radius:var(--ui-panel-radius); }
    .ui-c-standard #base .base-health-head { min-height:56px; padding:9px var(--ui-panel-pad); }
    .ui-c-standard #base .base-health-head h3 { font-size:16px; line-height:24px; }
    .ui-c-standard #base .base-health-head p,
    .ui-c-standard #base .base-health-head > span { font-size:12px; line-height:18px; }
    .ui-c-standard #base .base-health-card { min-height:60px; padding:8px 12px; }
    .ui-c-standard #base .base-health-card strong { font-size:13px; line-height:20px; }
    .ui-c-standard #base .base-health-card small { font-size:11px; line-height:16px; }
    .ui-c-standard #base .base-master-tabs { min-height:60px; border-radius:var(--ui-panel-radius); }
    .ui-c-standard #base .base-master-tabs button { min-height:60px; padding:7px 12px; }
    .ui-c-standard #base .base-master-tabs button > span { font-size:14px; line-height:22px; }
    .ui-c-standard #base .base-master-tabs button > small { font-size:12px; line-height:18px; }
    .ui-c-standard #base .base-master-list-item strong { font-size:13px; line-height:20px; }
    .ui-c-standard #base .base-master-list-item small { font-size:11px; line-height:16px; }

    .ui-c-standard #reports .report-workspace-head { min-height:auto; padding-bottom:12px; }
    .ui-c-standard #reports .report-primary-tabs button { min-height:60px; padding:8px 14px; }
    .ui-c-standard #reports .report-primary-tabs button strong { font-size:14px; line-height:22px; }
    .ui-c-standard #reports .report-primary-tabs button small { font-size:12px; line-height:18px; }
    .ui-c-standard #reports .report-filter-panel label { font-size:12px; line-height:18px; }
    .ui-c-standard #reports .report-wide-table th { height:36px; padding:0 10px; font-size:12px; line-height:18px; }
    .ui-c-standard #reports .report-wide-table td { height:48px; padding:5px 10px; color:var(--ui-text); font-size:13px; line-height:20px; }
    .ui-c-standard #reports .report-wide-table td > strong { font-size:13px; line-height:20px; font-weight:650; }
    .ui-c-standard #reports .report-wide-table td > span { margin-top:1px; font-size:11px; line-height:16px; }

    .ui-c-standard #finance .finance-context-row { gap:12px; padding:10px var(--ui-panel-pad); }
    .ui-c-standard #finance .finance-context-row label,
    .ui-c-standard #finance .finance-context-note { font-size:12px; line-height:18px; }
    .ui-c-standard #finance .finance-workspace-tabs { min-height:60px; border-radius:var(--ui-panel-radius); }
    .ui-c-standard #finance .finance-workspace-tabs button { min-height:60px; padding:8px 14px; }
    .ui-c-standard #finance .finance-workspace-tabs strong { font-size:14px; line-height:22px; }
    .ui-c-standard #finance .finance-workspace-tabs small { font-size:12px; line-height:18px; }

    .ui-c-standard #settings .settings-workspace-panel { padding:16px; }
    .ui-c-standard #settings .settings-workspace-head { padding-bottom:12px; }
    .ui-c-standard #settings .settings-head-actions { gap:8px; padding-top:0; }
    .ui-c-standard #settings .settings-view-tabs { border-radius:var(--ui-panel-radius); }
    .ui-c-standard #settings .settings-view-tabs button { min-height:60px; padding:8px 14px; font-size:14px; line-height:22px; }
    .ui-c-standard #settings .settings-view-tabs button small { margin-top:0; font-size:12px; line-height:18px; }
    .ui-c-standard #settings .settings-account-row { min-height:52px; padding:7px 10px; border-radius:var(--ui-radius); }
    .ui-c-standard #settings .settings-account-row strong { font-size:13px; line-height:20px; }
    .ui-c-standard #settings .settings-account-row small { margin-top:1px; font-size:11px; line-height:16px; }
    .ui-c-standard #settings .settings-detail-head { padding:14px 16px; }
    .ui-c-standard #settings .settings-detail-head h3 { font-size:16px; line-height:24px; }
    .ui-c-standard #settings .settings-detail-head p { margin-top:2px; font-size:12px; line-height:18px; }

    /* Sales quantity and unit share one reserved column, not a clipped legacy 6% cell. */
    #sales.sales-workspace .sales-modern-lines th:nth-child(1) { width:25%; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(2) { width:9%; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(3) { width:12%; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(4) { width:10%; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(5) { width:10%; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(6) { width:11%; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(7) { width:8%; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(8) { width:11%; }
    #sales.sales-workspace .sales-modern-lines th:nth-child(9) { width:4%; }
    #sales .sales-quantity-control { min-width:0; width:100%; gap:8px; }
    #sales .sales-quantity-control .qty { flex:0 0 72px; width:72px; min-width:72px; padding-left:6px; padding-right:6px; }
    #sales .sales-quantity-control .unit { flex:0 0 auto; display:inline-block; min-width:2em; line-height:20px; }
    #sales .sales-modern-lines td:nth-child(4) .sales-money-input,
    #sales .sales-cost-cell .sales-money-input { width:96px; max-width:100%; }
    .ui-c-standard #base .base-master-tools.product-filters { grid-template-columns:minmax(180px,1fr) 140px 120px auto; }
    @media (max-width:760px) {
      .ui-c-standard #base .base-master-tools.product-filters { grid-template-columns:1fr 1fr; }
    }
/* F03: scoped quantity workspace; existing stock panels remain frozen. */
#stock .stock-workspace-nav.has-custom-inventory { grid-template-columns: repeat(6,minmax(0,1fr)); }
#stockTabCustom { gap:16px; }
#stockTabCustom [hidden] { display:none !important; }
#stockTabCustom .ci-head, #stockTabCustom .ci-detail-head, #stockTabCustom .ci-pagination { display:flex; align-items:center; justify-content:space-between; gap:16px; }
#stockTabCustom h3 { margin:5px 0 8px; font-size:18px; line-height:26px; }
#stockTabCustom p { margin:4px 0; color:#64748b; line-height:1.5; }
#stockTabCustom .ci-head>div:last-child, #stockTabCustom .ci-pagination>div { display:flex; gap:8px; }
#stockTabCustom .ci-tag { display:inline-block; padding:2px 7px; background:#edf5f6; color:#376974; border-radius:4px; font-size:11px; }
#stockTabCustom .ci-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; padding:14px 0; border-block:1px solid #e7ebf0; }
#stockTabCustom .ci-kpis span { color:#64748b; font-size:12px; }
#stockTabCustom .ci-kpis strong { display:block; font-size:25px; margin-top:7px; }
#stockTabCustom .ci-filters { display:flex; align-items:end; gap:16px; }
#stockTabCustom .ci-filters label { display:grid; gap:6px; font-size:12px; min-width:180px; }
#stockTabCustom .ci-filters label:first-child { flex:1; }
#stockTabCustom input, #stockTabCustom select, .ci-dialog input, .ci-dialog textarea { padding:9px 10px; min-height:36px; border:1px solid #d8e0e9; border-radius:6px; font:inherit; background:white; color:#172231; }
#stockTabCustom .ci-items-table table { width:100%; min-width:850px; table-layout:fixed; }
#stockTabCustom .ci-items-table th:first-child { width:27%; }
#stockTabCustom .ci-items-table th:nth-child(6) { width:17%; }
#stockTabCustom .ci-items-table th:last-child { width:116px; }
#stockTabCustom th, #stockTabCustom td { padding:12px; vertical-align:middle; overflow-wrap:anywhere; white-space:normal; }
#stockTabCustom td strong { overflow-wrap:anywhere; }
#stockTabCustom th { text-align:left; font-size:12px; }
#stockTabCustom .ci-number { text-align:right; font-variant-numeric:tabular-nums; }
#stockTabCustom td small { display:block; margin-top:5px; color:#64748b; font-size:11px; line-height:1.5; }
#stockTabCustom .ci-warning { background:#fff8ee; }
#stockTabCustom .ci-state { color:#985c16; font-size:12px; }
#stockTabCustom .ci-detail { border-top:1px solid #dce3eb; padding-top:18px; margin-top:6px; }
#stockTabCustom .ci-event-table { margin-top:12px; max-height:420px; overflow:auto; }
#stockTabCustom .ci-event-table table { width:100%; min-width:820px; table-layout:fixed; }
#stockTabCustom .ci-event-table th:nth-child(3) { width:32%; }
#stockTabCustom .ci-event-table th:last-child { width:180px; }
#stockTabCustom .ci-event-actions .btn { margin:3px; }
#stockTabCustom .ci-pagination { font-size:12px; color:#64748b; }
.ci-dialog { width:min(520px,calc(100vw - 40px)); max-height:calc(100vh - 48px); overflow:auto; padding:24px; border:1px solid #d8e0e9; border-radius:12px; box-shadow:0 16px 56px #15264033; }
.ci-dialog::backdrop { background:#17223166; }
.ci-dialog form { display:grid; gap:14px; }
.ci-dialog h3 { margin:0; font-size:19px; }
.ci-dialog p { margin:0; line-height:1.5; color:#64748b; font-size:13px; overflow-wrap:anywhere; }
.ci-dialog label { display:grid; gap:6px; font-size:13px; }
.ci-dialog input:read-only { background:#f4f6f9; }
.ci-dialog .ci-dialog-actions { display:flex; gap:10px; justify-content:flex-end; }
.ci-dialog #ciDialogError { color:#b54736; }
@media(max-width:900px) {
  #stock .stock-workspace-nav.has-custom-inventory { grid-template-columns:repeat(6,minmax(145px,1fr)); overflow-x:auto; }
  #stockTabCustom .ci-filters { flex-wrap:wrap; }
  #stockTabCustom .ci-filters p { flex-basis:100%; }
}
/* Original purchase warehouse correction: all layout stays inside this dialog. */
.modal-overlay.purchase-warehouse-overlay { display: flex; z-index: 10000; }
.modal-overlay .purchase-warehouse-dialog { width: min(780px, calc(100vw - 40px)); max-width: 780px; max-height: calc(100vh - 48px); overflow-y: auto; }
.purchase-warehouse-dialog > p { line-height: 1.6; }
.purchase-warehouse-lines { display: grid; gap: 12px; margin: 16px 0; }
.purchase-warehouse-line { display: grid; grid-template-columns: 1fr minmax(140px, 190px); gap: 8px 16px; padding: 14px; border: 1px solid #dce2ea; border-radius: 8px; }
.purchase-warehouse-line > strong, .purchase-warehouse-responsibility { grid-column: 1 / -1; }
.purchase-warehouse-line > .field-error-tip { grid-column: 1 / -1; }
.purchase-warehouse-responsibility { font-size: 13px; color: #526078; line-height: 1.6; }
.purchase-warehouse-dialog textarea { display: block; width: 100%; margin-top: 8px; box-sizing: border-box; }
.purchase-warehouse-dialog .modal-actions { position: sticky; bottom: 0; background: #fff; padding-top: 12px; }

/* Three record categories; ordinary inventory internals remain unchanged. */
#stock .stock-category-tabs {display:flex;gap:10px;margin:0 0 14px;flex-wrap:wrap;}
#stock .stock-category-tabs .active {color:#fff;background:#315ce7;border-color:#315ce7;}
#stock #ordinaryStockNavigation[hidden] {display:none!important;}
#stock .service-record-filters {display:flex;gap:12px;flex-wrap:wrap;margin:16px 0;}
#stock .service-record-filters label {display:flex;flex-direction:column;gap:6px;min-width:160px;max-width:100%;}
#stockTabServices td {overflow-wrap:anywhere;}

/* Service-only spacing: keep ordinary inventory cards frozen. */
#stockTabServices > .ci-head {display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 20px 0;flex-wrap:wrap;}
#stockTabServices > .ci-head > div:first-child {flex:1;min-width:240px;}
#stockTabServices > .ci-head > div:last-child {display:flex;gap:8px;flex-wrap:wrap;}
#stockTabServices > .ci-head h3 {margin:0 0 8px;}
#stockTabServices > .ci-head p {margin:0;color:#64748b;line-height:1.6;}
#stockTabServices > .service-record-filters {padding:0 20px;}
#stockTabServices > .ci-pagination {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 20px;flex-wrap:wrap;font-size:12px;color:#64748b;}
#stockTabServices > .ci-pagination > div {display:flex;gap:8px;}

/* Pending finance only: reuse existing controls, keep other dialogs frozen. */
#pendingSalesPanel {box-sizing:border-box;width:min(940px,calc(100vw - 32px));max-height:85vh;border:1px solid #e2e8f0;border-radius:16px;padding:24px;overflow:auto;color:var(--text);background:var(--panel,#fff);font-size:14px;line-height:1.6;}
#pendingSalesPanel .pending-finance-header,#pendingSalesPanel [data-toolbar],#pendingSalesPanel .pending-finance-item-title {display:flex;align-items:center;gap:12px;flex-wrap:wrap;}
#pendingSalesPanel .pending-finance-header {justify-content:space-between;}
#pendingSalesPanel h2 {margin:0;font-size:22px;}
#pendingSalesPanel h3 {margin:0;font-size:16px;overflow-wrap:anywhere;min-width:0;}
#pendingSalesPanel .pending-finance-description,#pendingSalesPanel .pending-finance-meta {color:#64748b;margin:8px 0 16px;}
#pendingSalesPanel .pending-finance-item {padding:18px;margin-top:16px;border:1px solid #e2e8f0;border-radius:12px;}
#pendingSalesPanel .pending-finance-state {font-size:13px;color:#334155;background:#f1f5f9;border-radius:6px;padding:2px 8px;}
#pendingSalesPanel .pending-finance-amounts {display:flex;gap:24px;flex-wrap:wrap;margin-bottom:10px;}
#pendingSalesPanel .pending-finance-amounts strong {margin-left:8px;font-variant-numeric:tabular-nums;}
#pendingSalesPanel .pending-finance-identifiers {color:#64748b;margin:8px 0 14px;}
#pendingSalesPanel summary {cursor:pointer;}
#pendingSalesPanel dl {display:grid;grid-template-columns:80px minmax(0,1fr);gap:6px 12px;margin:8px 0;}
#pendingSalesPanel dd {margin:0;overflow-wrap:anywhere;}
#pendingSalesPanel .pending-finance-line {display:grid;grid-template-columns:minmax(0,1fr) 210px;align-items:center;gap:16px;padding:12px 0;border-top:1px solid #eef2f6;}
#pendingSalesPanel .pending-finance-product {overflow-wrap:anywhere;}
#pendingSalesPanel .pending-finance-cost {box-sizing:border-box;width:100%;min-width:0;min-height:38px;font:inherit;padding:7px 10px;border:1px solid #cbd5e1;border-radius:8px;}
#pendingSalesPanel .pending-finance-progress {position:sticky;top:0;z-index:5;display:flex;align-items:center;gap:12px;padding:12px;margin:12px 0;background:#f0f5ff;border:1px solid #d9e4fa;border-radius:8px;color:#334155;}
#pendingSalesPanel .pending-finance-progress .write-feedback-spinner {width:20px;height:20px;flex:0 0 20px;}
#pendingSalesPanel .pending-finance-item > button {margin:12px 8px 0 0;}
#pendingSalesPanel [data-error]:not([hidden]) {padding:10px 12px;border-radius:8px;background:#fff7ed;color:#9a3412;overflow-wrap:anywhere;}
@media(max-width:640px){#pendingSalesPanel{padding:16px;}#pendingSalesPanel .pending-finance-item{padding:12px;}#pendingSalesPanel .pending-finance-line{grid-template-columns:minmax(0,1fr);gap:8px;}}

/* Keep the existing summary card; stack it before it crowds the sales lines. */
@media (min-width:1381px) and (max-width:1640px) {
  #sales .sales-layout {grid-template-columns:1fr;}
  #sales .order-summary-card {position:static;}
  #sales .order-summary-card dl {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));}
  #sales .order-summary-card dl > div {padding:0 12px;border-right:1px solid var(--divider);}
}
#sales.sales-workspace .sales-modern-lines th:nth-child(1) {width:28%;}
#sales.sales-workspace .sales-modern-lines th:nth-child(3) {width:11%;}
#sales.sales-workspace .sales-modern-lines th:nth-child(8) {width:9%;}
@media (max-width:1380px) {
  #sales.sales-workspace .sales-modern-lines {min-width:1070px;}
  #sales.sales-workspace .sales-modern-lines th:nth-child(9),
  #sales.sales-workspace .sales-modern-lines td:nth-child(9) {width:46px;min-width:46px;}
}

    #orders.orders-workspace .detail-drawer-head > div { min-width:0; }
    #orders.orders-workspace .detail-drawer-head h3 { min-width:0; overflow-wrap:anywhere; }
    #orders.orders-workspace .detail-drawer-head > button { flex-shrink:0; }

    #orders.orders-workspace .order-detail-loading { margin-top:16px; padding:20px 16px; border-radius:10px; background:#f0f4fa; color:#334155; }
    #orders.orders-workspace .order-detail-loading strong { font-size:14px; }
    #orders.orders-workspace .order-detail-loading p { margin:10px 0; font-size:13px; line-height:1.6; }
    #orders.orders-workspace .order-detail-loading small { color:#64748b; }
/* Cost correction dialogs only; keep the accepted C layout and other dialogs frozen. */
#costCorrectionsDialog,#costCorrectionDialog {box-sizing:border-box;width:min(640px,calc(100vw - 32px));max-height:85vh;padding:0;border:1px solid #dce3ed;border-radius:14px;background:#fff;color:#243247;font:14px/1.6 var(--font,system-ui,sans-serif);overflow:auto;box-shadow:0 20px 60px #14233c26;}
#costCorrectionsDialog {width:min(800px,calc(100vw - 32px));}
#costCorrectionsDialog::backdrop,#costCorrectionDialog::backdrop {background:#14233c38;}
:is(#costCorrectionsDialog,#costCorrectionDialog) * {box-sizing:border-box;}
:is(#costCorrectionsDialog,#costCorrectionDialog) .cost-correction-header {position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 22px;border-bottom:1px solid #e5eaf1;background:#fff;}
:is(#costCorrectionsDialog,#costCorrectionDialog) .cost-correction-header > div {min-width:0;}
:is(#costCorrectionsDialog,#costCorrectionDialog) .cost-correction-header > button {flex-shrink:0;}
:is(#costCorrectionsDialog,#costCorrectionDialog) h2 {margin:0;font-size:20px;line-height:1.4;}
:is(#costCorrectionsDialog,#costCorrectionDialog) .cost-correction-eyebrow {font-size:12px;color:#61718a;}
:is(#costCorrectionsDialog,#costCorrectionDialog) .cost-correction-body {padding:18px 22px 22px;}
:is(#costCorrectionsDialog,#costCorrectionDialog) .cost-correction-note {margin:0 0 18px;padding:10px 12px;background:#f4f7fb;border-radius:8px;color:#596980;font-size:13px;overflow-wrap:anywhere;}
#costCorrectionsDialog .cost-correction-search {display:flex;align-items:flex-end;gap:10px;margin-bottom:18px;}
#costCorrectionsDialog .cost-correction-search label {flex:1;min-width:0;display:grid;gap:6px;color:#52627a;font-size:13px;}
:is(#costCorrectionsDialog,#costCorrectionDialog) input {width:100%;min-width:0;min-height:40px;padding:8px 10px;border:1px solid #cbd5e1;border-radius:8px;font:inherit;color:inherit;background:#fff;}
:is(#costCorrectionsDialog,#costCorrectionDialog) input:disabled {background:#f3f5f8;color:#64748b;}
#costCorrectionsDialog .cost-correction-items {display:grid;gap:12px;overflow-wrap:anywhere;}
#costCorrectionsDialog .cost-correction-item {display:flex;gap:18px;align-items:center;justify-content:space-between;padding:16px;border:1px solid #e2e8f0;border-radius:10px;}
#costCorrectionsDialog .cost-correction-item-copy {flex:1;min-width:0;}
#costCorrectionsDialog .cost-correction-item > button {flex-shrink:0;}
#costCorrectionsDialog .cost-correction-item-title {display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
#costCorrectionsDialog .cost-correction-tag {padding:2px 7px;background:#eff4fb;border-radius:5px;color:#526884;font-size:12px;}
#costCorrectionsDialog .cost-correction-meta {color:#69788d;font-size:12px;margin:4px 0 8px;}
:is(#costCorrectionsDialog,#costCorrectionDialog) .cost-correction-current {display:flex;gap:12px;flex-wrap:wrap;font-size:13px;color:#52627a;}
:is(#costCorrectionsDialog,#costCorrectionDialog) .cost-correction-current strong {color:#20314d;font-size:16px;font-variant-numeric:tabular-nums;}
#costCorrectionDialog .cost-correction-summary {padding:14px 16px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px;overflow-wrap:anywhere;}
#costCorrectionDialog .cost-correction-summary > strong {display:block;margin-bottom:8px;font-size:15px;}
#costCorrectionDialog details {margin-top:10px;color:#64748b;font-size:12px;}
#costCorrectionDialog summary {cursor:pointer;}
#costCorrectionDialog dl {display:grid;grid-template-columns:70px minmax(0,1fr);gap:6px 12px;}
#costCorrectionDialog dd {margin:0;overflow-wrap:anywhere;}
#costCorrectionDialog .cost-correction-field {display:grid;gap:6px;margin:16px 0;color:#52627a;font-size:13px;}
#costCorrectionDialog .cost-correction-actions {display:flex;justify-content:flex-end;padding-top:6px;}
:is(#costCorrectionsDialog,#costCorrectionDialog) .cost-correction-error:empty {display:none;}
:is(#costCorrectionsDialog,#costCorrectionDialog) .cost-correction-error,#costCorrectionsDialog .cost-correction-warning {color:#a65418;background:#fff6ea;padding:8px 10px;border-radius:6px;font-size:13px;overflow-wrap:anywhere;}
@media(max-width:640px){:is(#costCorrectionsDialog,#costCorrectionDialog) .cost-correction-header,:is(#costCorrectionsDialog,#costCorrectionDialog) .cost-correction-body{padding:16px;}#costCorrectionsDialog .cost-correction-item{flex-wrap:wrap;}#costCorrectionsDialog .cost-correction-item > button{margin-left:auto;}}

/* Local layout for the new request list; keep the existing recent-history cell. */
#stockTabAdjustment #stockAdjustmentReviewPanel { grid-column:1 / -1; grid-row:3; }
@media (max-width:1180px) {
  #stockTabAdjustment #stockAdjustmentReviewPanel { grid-row:4; }
}

/* sales-line-package-20261103.2: compact controls share the product-meta footer; native checkbox semantics unchanged. */
.sales-product-foot{display:flex;align-items:center;justify-content:space-between;gap:4px 8px;flex-wrap:wrap;margin-top:2px;min-height:24px}
#sales .sales-product-foot .sales-product-meta{flex:1 1 120px;min-width:0;min-height:0;margin:0!important}
.sales-line-channel-toggles{display:flex;flex:0 0 auto;align-items:center;gap:4px;margin:0 0 0 auto}
.sales-line-package-toggle{display:inline-flex!important;align-items:center;gap:4px;width:fit-content;max-width:100%;min-height:24px;margin:0;padding:1px 6px;border:1px solid #cbd5e1;border-radius:5px;background:#f1f5f9;color:#334155;font-size:11px;font-weight:650;line-height:16px;white-space:nowrap;cursor:pointer;box-sizing:border-box}
.sales-line-package-toggle input[type=checkbox]{width:14px!important;height:14px!important;min-width:14px;margin:0;accent-color:#2563eb;cursor:pointer}
.sales-line-package-toggle.is-selected{border-color:#2563eb;background:#eff6ff;color:#1d4ed8;box-shadow:0 0 0 1px #bfdbfe}
.sales-line-package-toggle:focus-within{outline:2px solid #2563eb;outline-offset:2px}
.sales-line-package-toggle:has(input:disabled){opacity:.7;cursor:default}
