
/* === MTW 客户档案 — Design System v2 (2026-09-10 B 改) === */
:root {
  /* 主色 */
  --c-primary: #185FA5;
  --c-primary-dark: #14497f;
  --c-primary-light: #e8f0fa;
  /* 辅色 */
  --c-accent: #F59E0B;
  --c-accent-light: #fff3e0;
  /* 状态色 */
  --c-success: #10B981;
  --c-success-light: #ecfdf5;
  --c-danger: #EF4444;
  --c-danger-light: #fef2f2;
  --c-warn: #F59E0B;
  /* 灰阶 */
  --c-bg: #F5F7FA;
  --c-bg-2: #F9FAFB;
  --c-border: #E5E7EB;
  --c-border-2: #D1D5DB;
  --c-text-1: #1F2937;
  --c-text-2: #4B5563;
  --c-text-3: #9CA3AF;
  --c-text-4: #6B7280;
  /* 阴影 */
  --sh-sm: 0 1px 2px rgba(15, 30, 55, .06);
  --sh-md: 0 4px 12px rgba(15, 30, 55, .08);
  --sh-lg: 0 12px 32px rgba(15, 30, 55, .12);
  /* 圆角 */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", Roboto, sans-serif;
  background: var(--c-bg);
  color: var(--c-text-1);
  font-size: 14px;
  line-height: 1.5;
  padding: 20px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 静态品牌水印（MTW Wear Parts，不影响视觉/点击） */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 9999; pointer-events: none; user-select: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='200'><text x='50%25' y='50%25' font-family='Arial,sans-serif' font-size='14' font-weight='600' fill='%231F2937' fill-opacity='0.05' transform='rotate(-30 160 100)' text-anchor='middle'>MTW Wear Parts</text></svg>");
  background-repeat: repeat;
}

/* === 顶栏（主界面） === */
.topbar {
  background: linear-gradient(135deg, #185FA5 0%, #14497f 100%);
  color: #fff;
  padding: 14px 24px;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.topbar-brand { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 220px; }
.topbar-logo { width: 80px; height: auto; background: #fff; border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 4px 6px; box-shadow: var(--sh-sm); }
.topbar-logo img { width: 100%; height: auto; display: block; }
.topbar-titles { min-width: 0; }
.topbar-title { font-size: 17px; font-weight: 700; line-height: 1.2; letter-spacing: -.3px; white-space: nowrap; }
.topbar-sub { font-size: 11px; color: rgba(255,255,255,.7); margin-top: 2px; white-space: nowrap; }
.topbar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.topbar-btn { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; padding: 7px 14px; font-size: 13px; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 6px; transition: background .15s; font-weight: 500; }
.topbar-btn:hover { background: rgba(255,255,255,.22); }
.topbar-btn.primary { background: #F59E0B; border-color: #F59E0B; }
.topbar-btn.primary:hover { background: #fb8c0f; }
.topbar-btn.active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #F59E0B; }
.topbar-btn.warn { background: #EF4444; border-color: #EF4444; }
.topbar-btn .pill { background: rgba(0,0,0,.18); border-radius: 10px; padding: 1px 8px; font-size: 11px; font-weight: 700; }
.topbar-btn.primary .pill, .topbar-btn.warn .pill { background: rgba(255,255,255,.28); }

.user-badge { background: rgba(255,255,255,.14); color: #fff; border-radius: 20px; padding: 6px 14px 6px 6px; font-size: 13px; display: none; align-items: center; gap: 8px; border: 1px solid rgba(255,255,255,.18); }
.user-badge.show { display: inline-flex; }
.user-badge .avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, #F59E0B 0%, #f97316 100%); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.user-badge .logout { background: rgba(0,0,0,.18); border: none; color: #fff; border-radius: 12px; padding: 2px 10px; font-size: 11px; cursor: pointer; font-family: inherit; }
.user-badge .logout:hover { background: rgba(0,0,0,.32); }

/* === 登录蒙层（全屏渐变 + LOGO） === */
.login-modal { position: fixed; inset: 0; background: linear-gradient(135deg, #0e2a52 0%, #185FA5 60%, #2c80c4 100%); z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 20px; overflow: hidden; }
.login-modal.hidden { display: none; }
.login-modal::before, .login-modal::after {
  content: ''; position: absolute; border-radius: 50%; pointer-events: none;
}
.login-modal::before { width: 480px; height: 480px; top: -180px; right: -120px; background: radial-gradient(circle, rgba(245,158,11,.22), transparent 70%); }
.login-modal::after { width: 380px; height: 380px; bottom: -140px; left: -100px; background: radial-gradient(circle, rgba(255,255,255,.10), transparent 70%); }

.login-box {
  background: #fff;
  border-radius: 16px;
  padding: 40px 44px 32px;
  box-shadow: 0 24px 64px rgba(0,0,0,.32);
  width: 420px;
  max-width: 100%;
  position: relative;
  z-index: 1;
}
.login-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.login-logo .mark { width: 140px; height: auto; background: transparent; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0; }
.login-logo .mark img { width: 100%; height: auto; display: block; }
.login-logo .brand { line-height: 1.2; }
.login-logo .brand .top { font-size: 11px; color: var(--c-text-4); letter-spacing: 1.5px; text-transform: uppercase; font-weight: 600; }
.login-logo .brand .bot { font-size: 18px; color: var(--c-primary); font-weight: 800; letter-spacing: -.3px; margin-top: 2px; }
.login-box h1 { font-size: 22px; color: var(--c-text-1); margin: 0 0 4px; font-weight: 700; letter-spacing: -.5px; }
.login-box .login-sub { color: var(--c-text-4); font-size: 13px; margin-bottom: 24px; }
.login-box label { display: block; font-size: 12px; color: var(--c-text-2); margin-bottom: 6px; margin-top: 14px; font-weight: 600; letter-spacing: .3px; }
.login-box input { width: 100%; box-sizing: border-box; padding: 11px 14px; border: 1.5px solid var(--c-border); border-radius: 8px; font-size: 14px; font-family: inherit; outline: none; transition: all .15s; background: var(--c-bg-2); }
.login-box input:focus { border-color: var(--c-primary); background: #fff; box-shadow: 0 0 0 3px rgba(24,95,165,.12); }
.login-box .login-err { color: var(--c-danger); font-size: 12px; margin-top: 10px; min-height: 16px; }
.login-box .login-submit { margin-top: 22px; width: 100%; background: linear-gradient(135deg, #185FA5 0%, #14497f 100%); color: #fff; border: none; border-radius: 8px; padding: 12px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; box-shadow: 0 4px 14px rgba(24,95,165,.28); transition: all .15s; letter-spacing: .5px; }
.login-box .login-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(24,95,165,.36); }
.login-box .login-submit:active { transform: translateY(0); }
.login-box .login-tip { color: var(--c-text-3); font-size: 11px; margin-top: 22px; text-align: center; line-height: 1.7; border-top: 1px solid var(--c-border); padding-top: 14px; }

/* === 主体容器 / 标题区 === */
.wrap { max-width: 1240px; margin: 0 auto; }
h1 { font-size: 20px; font-weight: 700; color: var(--c-text-1); letter-spacing: -.3px; }
.sub { color: var(--c-text-4); font-size: 13px; margin: 4px 0 16px; }

/* === 搜索栏 === */
.searchbar { background: #fff; border-radius: var(--r-md); padding: 14px; box-shadow: var(--sh-sm); margin-bottom: 14px; }
.filters { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.filters select { border: 1px solid var(--c-border); border-radius: 8px; padding: 11px 14px; font-size: 14px; font-family: inherit; background: #fff; color: var(--c-text-1); min-width: 170px; cursor: pointer; transition: border-color .15s; }
.filters select:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(24,95,165,.10); }
.searchbox { position: relative; flex: 1; min-width: 260px; }
.searchbox input { width: 100%; border: 1px solid var(--c-border); border-radius: 8px; padding: 11px 14px; font-size: 14px; font-family: inherit; transition: all .15s; }
.searchbox input:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(24,95,165,.10); }
.dropdown { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--c-border); border-radius: 8px; box-shadow: var(--sh-md); max-height: 400px; overflow: auto; z-index: 100; display: none; }
.dropdown.show { display: block; }
.tip { color: var(--c-text-3); font-size: 12px; margin-top: 8px; }
.res-item { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--c-bg); cursor: pointer; gap: 10px; transition: background .12s; }
.res-item:hover { background: var(--c-primary-light); }
.res-item:last-child { border-bottom: none; }
.res-code { font-weight: 600; color: var(--c-primary); min-width: 90px; font-family: 'SF Mono','Consolas',monospace; font-size: 13px; }
.res-name { flex: 1; }
.res-tag { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--c-primary-light); color: var(--c-primary); white-space: nowrap; font-weight: 500; }
.res-tag.vip { background: var(--c-accent-light); color: #c2410c; }
.res-tag.suspend { background: var(--c-danger-light); color: var(--c-danger); }
.res-tag.fav { background: #fef3c7; color: #b45309; }

/* === 客户卡片 === */
.card { background: #fff; border-radius: var(--r-md); padding: 18px; margin-bottom: 14px; box-shadow: var(--sh-sm); border: 1px solid var(--c-border); transition: box-shadow .15s; }
.card:hover { box-shadow: var(--sh-md); }
.card h2 { font-size: 15px; font-weight: 700; margin-bottom: 14px; color: var(--c-primary); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid var(--c-bg); }
.card h2 > span:first-child { flex: 1; }
.cust-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 6px; }
.cust-head .nm { font-size: 20px; font-weight: 700; color: var(--c-text-1); letter-spacing: -.3px; }
.badge { font-size: 11px; padding: 3px 10px; border-radius: 12px; font-weight: 600; letter-spacing: .3px; }
.badge.grade { background: var(--c-primary); color: #fff; }
.badge.vip { background: var(--c-accent); color: #fff; }
.badge.suspend { background: var(--c-danger); color: #fff; }
.badge.normal { background: var(--c-bg); color: var(--c-text-2); border: 1px solid var(--c-border); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 16px; }
.grid .kv { font-size: 13px; }
.grid .kv .k { color: var(--c-text-3); font-size: 11px; margin-bottom: 3px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.grid .kv .v { color: var(--c-text-1); font-weight: 500; }

/* === KPI === */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border-radius: var(--r-md); padding: 14px 16px; border: 1px solid var(--c-border); position: relative; overflow: hidden; transition: all .15s; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.kpi::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--c-primary), var(--c-accent)); }
.kpi .num { font-size: 26px; font-weight: 800; color: var(--c-primary); letter-spacing: -.5px; }
.kpi .lbl { font-size: 12px; color: var(--c-text-4); margin-top: 4px; font-weight: 500; }

/* === 表格 === */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--c-bg); text-align: left; }
th { background: var(--c-bg-2); color: var(--c-text-2); font-weight: 600; white-space: nowrap; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr:hover td { background: var(--c-bg-2); }
.req-item { border: 1px solid var(--c-border); border-radius: var(--r-md); padding: 12px; margin-bottom: 10px; transition: all .15s; }
.req-item:hover { border-color: var(--c-primary-light); box-shadow: var(--sh-sm); }
.req-item .r-head { font-weight: 700; margin-bottom: 6px; display: flex; gap: 8px; flex-wrap: wrap; }
.req-item .r-line { font-size: 13px; color: var(--c-text-2); margin: 3px 0; }
.req-item .r-line .rk { color: var(--c-text-3); display: inline-block; min-width: 84px; font-weight: 600; }
.empty { color: var(--c-text-3); font-size: 13px; padding: 32px 0; text-align: center; }
.photos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-top: 6px; }
.photo-card { position: relative; background: var(--c-bg-2); border-radius: 8px; overflow: hidden; cursor: zoom-in; border: 1px solid var(--c-border); }
.photo-card img { width: 100%; height: 180px; object-fit: cover; display: block; }
.lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 9999; align-items: center; justify-content: center; cursor: zoom-out; }
.lightbox.show { display: flex; }
.lightbox img { max-width: 96vw; max-height: 96vh; object-fit: contain; }

/* === Tabs / 业务经理 / RFM / 补充信息弹层 === */
.tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.tab { border: 1px solid var(--c-border); background: #fff; border-radius: 8px; padding: 8px 16px; cursor: pointer; font-size: 13px; font-family: inherit; color: var(--c-text-2); transition: all .15s; font-weight: 500; }
.tab:hover { border-color: var(--c-primary); color: var(--c-primary); }
.tab.active { background: var(--c-primary); color: #fff; border-color: var(--c-primary); box-shadow: 0 2px 8px rgba(24,95,165,.24); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; width: 100%; }
.rfm-btn { background: var(--c-primary); color: #fff; border: none; border-radius: 8px; padding: 8px 16px; cursor: pointer; font-size: 13px; font-weight: 500; font-family: inherit; display: inline-flex; align-items: center; gap: 6px; transition: all .15s; }
.rfm-btn:hover { background: var(--c-primary-dark); transform: translateY(-1px); }
.rfm-btn .pill { background: rgba(255,255,255,.22); border-radius: 10px; padding: 1px 8px; font-size: 11px; font-weight: 700; }
.rfm-btn.warn { background: var(--c-accent); }
.rfm-btn.warn:hover { background: #d97706; }
.rfm-btn.gray { background: #6B7280; }
.rfm-btn.gray:hover { background: #4B5563; }
.owner-sel { background: #fff; border: 1.5px solid var(--c-primary); color: var(--c-primary); border-radius: 8px; padding: 7px 12px; font-size: 13px; font-family: inherit; cursor: pointer; outline: none; font-weight: 500; }
.owner-sel:focus { box-shadow: 0 0 0 3px rgba(24,95,165,.15); }
.owner-bar { display: none; background: linear-gradient(135deg, #dbeafe, #e0f2fe); border: 1px solid #93c5fd; color: #1e40af; padding: 10px 16px; border-radius: 8px; font-size: 12px; margin-bottom: 12px; align-items: center; gap: 8px; }
.owner-bar.show { display: flex; }
.supp-btn { background: #fff; color: var(--c-primary); border: 1px solid var(--c-primary); border-radius: 6px; padding: 4px 12px; cursor: pointer; font-size: 12px; font-family: inherit; margin-left: 10px; vertical-align: middle; transition: all .12s; font-weight: 500; }
.supp-btn:hover { background: var(--c-primary-light); }
.fav-btn { background: #fff; color: #b45309; border: 1px solid var(--c-accent); border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: 12px; font-family: inherit; margin-left: 6px; transition: all .12s; font-weight: 500; }
.fav-btn.active { background: var(--c-accent-light); }
.fav-btn:hover { background: #fef3c7; }
.notes-btn { background: #fff; color: var(--c-primary); border: 1px solid var(--c-primary); border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: 12px; font-family: inherit; margin-left: 6px; transition: all .12s; font-weight: 500; }
.notes-btn:hover { background: var(--c-primary-light); }
.recv-toggle-btn { background: #fff; color: #B91C1C; border: 1px solid #EF4444; border-radius: 6px; padding: 4px 12px; cursor: pointer; font-size: 12px; font-family: inherit; transition: all .12s; font-weight: 600; }
.recv-toggle-btn:hover { background: #FEE2E2; }
.recv-toggle-btn[aria-expanded="true"] { background: #EF4444; color: #fff; }
.recv-toggle-btn[aria-expanded="true"]:hover { background: #DC2626; }

/* === 弹层通用 === */
.modal { display: none; position: fixed; inset: 0; background: rgba(15,30,55,.55); backdrop-filter: blur(2px); z-index: 10001; align-items: center; justify-content: center; padding: 20px; }
.modal.show { display: flex; }
.modal-box { background: #fff; border-radius: var(--r-lg); padding: 0; box-shadow: var(--sh-lg); width: 520px; max-width: 100%; max-height: 88vh; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.modal-head { padding: 20px 28px; border-bottom: 1px solid var(--c-bg); display: flex; align-items: center; gap: 12px; position: relative; }
.modal-head::before { content: ''; width: 4px; height: 24px; background: linear-gradient(180deg, var(--c-primary), var(--c-accent)); border-radius: 2px; flex-shrink: 0; }
.modal-head h2 { font-size: 18px; color: var(--c-text-1); margin: 0; font-weight: 700; letter-spacing: -.3px; flex: 1; }
.modal-head .modal-sub { color: var(--c-text-4); font-size: 12px; margin: 0; }
.modal-body { padding: 20px 28px; overflow: auto; flex: 1 1 auto; min-height: 0; }
.modal-foot { padding: 16px 28px; border-top: 1px solid var(--c-bg); display: flex; gap: 10px; flex-wrap: wrap; background: var(--c-bg-2); }
/* 兼容旧式 modal-box 直接含 h2/sub/label 的写法 */
.modal-box h2 { font-size: 18px; color: var(--c-text-1); margin: 0 0 4px; font-weight: 700; letter-spacing: -.3px; }
.modal-box .modal-sub { color: var(--c-text-4); font-size: 12px; margin-bottom: 18px; }
.modal-box label { display: block; font-size: 12px; color: var(--c-text-2); margin: 14px 0 6px; font-weight: 600; letter-spacing: .3px; }
.modal-box label:first-child { margin-top: 0; }
.modal-box input, .modal-box textarea, .modal-box select { width: 100%; box-sizing: border-box; padding: 9px 12px; border: 1.5px solid var(--c-border); border-radius: 8px; font-size: 14px; font-family: inherit; outline: none; transition: all .15s; background: var(--c-bg-2); }
.modal-box input:focus, .modal-box textarea:focus, .modal-box select:focus { border-color: var(--c-primary); background: #fff; box-shadow: 0 0 0 3px rgba(24,95,165,.10); }
.modal-box textarea { min-height: 80px; resize: vertical; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.modal-actions button { flex: 1; min-width: 110px; border: none; border-radius: 8px; padding: 10px 14px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all .15s; }
.btn-primary { background: linear-gradient(135deg, #185FA5 0%, #14497f 100%); color: #fff; box-shadow: 0 2px 8px rgba(24,95,165,.24); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(24,95,165,.32); }
.btn-secondary { background: var(--c-primary-light); color: var(--c-primary); border: 1px solid var(--c-primary) !important; }
.btn-secondary:hover { background: #d6e4f4; }
.btn-danger { background: var(--c-danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-muted { background: var(--c-bg); color: var(--c-text-2); border: 1px solid var(--c-border) !important; }
.btn-muted:hover { background: var(--c-border); }
.modal-close-row { text-align: center; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--c-bg); }
.modal-close-row button { background: var(--c-primary); color: #fff; border: none; border-radius: 10px; padding: 10px 36px; cursor: pointer; font-size: 14px; font-family: inherit; font-weight: 600; transition: all .15s; box-shadow: 0 2px 6px rgba(24,95,165,.25); }
.modal-close-row button:hover { background: #134a85; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(24,95,165,.35); }
.modal-close-row button:active { transform: translateY(0); box-shadow: 0 1px 3px rgba(24,95,165,.25); }

/* === RFM 健康度仪表盘 === */
.rfm-modal { display: none; position: fixed; inset: 0; background: rgba(245,247,250,.97); z-index: 9000; overflow: auto; }
.rfm-modal.show { display: block; }
.rfm-modal .rfm-head { position: sticky; top: 0; background: linear-gradient(135deg, #185FA5 0%, #14497f 100%); color: #fff; border-bottom: 1px solid var(--c-border); padding: 14px 32px; display: flex; align-items: center; justify-content: space-between; gap: 12px; z-index: 2; }
.rfm-modal h2 { margin: 0; font-size: 18px; color: #fff; }
.rfm-modal .rfm-close { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.24); border-radius: 6px; padding: 6px 14px; cursor: pointer; font-size: 13px; font-family: inherit; }
.rfm-body { max-width: 1400px; margin: 0 auto; padding: 24px 32px 60px; }
.rfm-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 24px; }
.rfm-kpi { background: #fff; border-radius: var(--r-md); padding: 16px 18px; border: 1px solid var(--c-border); cursor: pointer; transition: all .15s; position: relative; overflow: hidden; }
.rfm-kpi::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--c-primary), var(--c-accent)); }
.rfm-kpi:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.rfm-kpi.active { box-shadow: 0 0 0 2px var(--c-primary) inset; }
.rfm-kpi .seg { font-size: 13px; color: var(--c-text-2); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; font-weight: 500; }
.rfm-kpi .dot { width: 8px; height: 8px; border-radius: 50%; }
.rfm-kpi .n { font-size: 26px; font-weight: 800; color: var(--c-text-1); letter-spacing: -.5px; }
.rfm-section { background: #fff; border-radius: var(--r-md); border: 1px solid var(--c-border); margin-bottom: 20px; overflow: hidden; }
.rfm-section h3 { margin: 0; padding: 14px 20px; font-size: 15px; color: var(--c-text-1); border-bottom: 1px solid var(--c-bg); font-weight: 700; background: var(--c-bg-2); }
.rfm-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.rfm-tbl th { background: var(--c-bg-2); color: var(--c-text-2); font-weight: 600; text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--c-border); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.rfm-tbl td { padding: 10px 14px; border-bottom: 1px solid var(--c-bg); color: var(--c-text-1); }
.rfm-tbl tr:hover td { background: var(--c-primary-light); cursor: pointer; }
.rfm-tbl .code { font-family: 'SF Mono','Consolas',monospace; color: var(--c-primary); font-weight: 600; }
.rfm-tbl .seg-tag { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.rfm-tbl .seg-VIP { background: var(--c-accent-light); color: #c2410c; }
.rfm-tbl .seg-重点 { background: #fce7f3; color: #be185d; }
.rfm-tbl .seg-一般 { background: var(--c-success-light); color: #047857; }
.rfm-tbl .seg-沉睡 { background: var(--c-accent-light); color: #c2410c; }
.rfm-tbl .seg-流失 { background: var(--c-bg); color: var(--c-text-3); }
.intel-box { border: 1px solid var(--c-border); border-radius: var(--r-md); padding: 12px; margin-bottom: 10px; background: var(--c-bg-2); }
.intel-line { font-size: 13px; color: var(--c-text-1); margin: 4px 0; line-height: 1.6; }
.intel-line .rk { color: var(--c-text-4); display: inline-block; min-width: 70px; font-weight: 600; }
.intel-desc { font-size: 13px; color: var(--c-text-1); line-height: 1.7; white-space: pre-line; }
.intel-link { color: var(--c-primary); text-decoration: none; font-weight: 500; }
.intel-link:hover { text-decoration: underline; }
.profile-card { border-left: 4px solid var(--c-primary); }
.profile-note { background: var(--c-bg-2); border-radius: 8px; padding: 12px 14px; font-size: 13px; line-height: 1.7; color: var(--c-text-1); white-space: pre-line; }
.profile-meta { color: var(--c-text-3); font-size: 12px; margin-top: 8px; }
.back-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; background: var(--c-bg); border: 1px solid var(--c-border); border-radius: 8px; cursor: pointer; font-size: 13px; font-family: inherit; color: var(--c-text-2); margin-bottom: 12px; font-weight: 500; }
.back-btn:hover { background: var(--c-border); }

/* === 备注列表 === */
.note-item { border: 1px solid var(--c-border); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; background: var(--c-bg-2); position: relative; }
.note-meta { font-size: 11px; color: var(--c-text-3); margin-bottom: 4px; }
.note-meta b { color: var(--c-primary); }
.note-text { font-size: 13px; color: var(--c-text-1); white-space: pre-wrap; word-break: break-word; }
.note-del { position: absolute; top: 8px; right: 8px; background: transparent; border: none; color: var(--c-danger); cursor: pointer; font-size: 12px; }

/* === 状态标签（导出审批用） === */
.st-tag { display: inline-block; padding: 3px 10px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.st-pending { background: var(--c-accent-light); color: #c2410c; }
.st-approved { background: var(--c-success-light); color: #047857; }
.st-denied { background: var(--c-danger-light); color: #b91c1c; }
.st-expired { background: var(--c-bg); color: var(--c-text-3); }

/* === 海关子标签 === */
.subtabs { display: flex; gap: 6px; margin-bottom: 10px; border-bottom: 1px solid var(--c-border); padding-bottom: 0; }
.subtab { padding: 6px 14px; cursor: pointer; font-size: 13px; color: var(--c-text-4); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; transition: all .12s; }
.subtab:hover { color: var(--c-primary); }
.subtab.active { color: var(--c-primary); border-bottom-color: var(--c-primary); font-weight: 600; }
.subtab-panel { display: none; }
.subtab-panel.active { display: block; }

/* === 收藏/最近查看 列表行 === */
.fav-item, .recent-item { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--c-bg); cursor: pointer; gap: 10px; transition: background .12s; }
.fav-item:hover, .recent-item:hover { background: var(--c-primary-light); }

/* === 详情内导出按钮 === */
.export-btn { background: #fff; color: var(--c-primary); border: 1px solid var(--c-primary); border-radius: 6px; padding: 5px 14px; cursor: pointer; font-size: 12px; font-weight: 500; font-family: inherit; transition: all .12s; }
.export-btn:hover { background: var(--c-primary-light); }

/* ============================================================
   工作台首页 Dashboard（2026-09-10 上线）
   极简风格：白底+灰边+细线条 SVG icon+4px 彩色左条
   ============================================================ */
.dashboard { display: flex; flex-direction: column; gap: 18px; padding: 24px 32px; max-width: 1400px; margin: 0 auto; }

/* --- KPI 卡片 --- */
.dash-kpi-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.dash-kpi { background: #fff; border: 1px solid var(--c-bg); border-radius: 10px; padding: 16px 18px; display: flex; align-items: center; gap: 14px; transition: box-shadow .15s, transform .15s; cursor: pointer; }
.dash-kpi:hover { box-shadow: var(--sh-sm); transform: translateY(-1px); }
.dash-kpi-aux { background: #FAFAFA; opacity: 0.85; }
.dash-kpi-aux .dash-kpi-num { font-size: 20px; color: var(--c-text-3); }
.dash-kpi-aux .dash-kpi-icon { width: 36px; height: 36px; }
.dash-kpi-aux .dash-kpi-icon svg { width: 18px; height: 18px; }
.dash-kpi-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--c-primary-light); color: var(--c-primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dash-kpi-icon svg { width: 22px; height: 22px; stroke-width: 1.6; }
.dash-kpi-icon.gray { background: rgba(107,114,128,.10); color: #6B7280; }
.dash-kpi-icon.orange { background: rgba(245,158,11,.10); color: var(--c-warn); }
.dash-kpi-icon.red { background: rgba(239,68,68,.10); color: #EF4444; }
.dash-kpi-icon.green { background: rgba(16,185,129,.10); color: #10B981; }
.dash-kpi-text { min-width: 0; }
.dash-kpi-num { font-size: 26px; font-weight: 700; color: #1F2937; line-height: 1.1; letter-spacing: -.5px; }
.dash-kpi-label { font-size: 12px; color: var(--c-text-3); margin-top: 4px; }

/* --- 待办 & 动态 单行紧凑合并版块（2026-09-14 09:40 上线，替换原 ⭐ 收藏横条） --- */
.dash-todo-feed { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; min-height: 110px; }
.dash-tf-col { background: #fff; border: 1px solid var(--c-bg); border-radius: 10px; padding: 12px 16px; display: flex; flex-direction: column; min-width: 0; }
.dash-tf-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.dash-tf-icon { font-size: 14px; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 5px; flex-shrink: 0; }
.dash-tf-icon.todo { background: rgba(24,95,165,.10); color: var(--c-primary); }
.dash-tf-icon.feed { background: rgba(16,185,129,.10); color: #10B981; }
.dash-tf-title { font-size: 13.5px; font-weight: 600; color: #1F2937; }
.dash-tf-count { background: var(--c-bg); color: var(--c-text-3); border-radius: 10px; padding: 1px 7px; font-size: 11px; font-weight: 600; }
.dash-tf-more { margin-left: auto; background: transparent; border: none; color: var(--c-primary); cursor: pointer; font-size: 11px; padding: 1px 6px; font-family: inherit; }
.dash-tf-more:hover { color: var(--c-primary-dark); text-decoration: underline; }
.dash-tf-list { display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.dash-tf-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; cursor: pointer; transition: background .12s; font-size: 12px; color: #1F2937; }
.dash-tf-row:hover { background: var(--c-bg); }
.dash-tf-row-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.dash-tf-row-dot.high { background: #EF4444; }
.dash-tf-row-dot.normal { background: var(--c-primary); }
.dash-tf-row-dot.low { background: #10B981; }
.dash-tf-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.dash-tf-row-meta { font-size: 11px; color: var(--c-text-3); flex-shrink: 0; }
.dash-tf-empty { color: var(--c-text-3); font-size: 12px; padding: 18px 8px; text-align: center; }

/* --- 原主区双栏（35/35/30 三栏）2026-09-14 09:40 整块下线，留样式防止 JS 引用触发 --- */
.dash-main { display: grid; grid-template-columns: 35fr 35fr 30fr; gap: 18px; min-height: 0; }
.dash-col { background: #fff; border: 1px solid var(--c-bg); border-radius: 10px; padding: 16px 18px; min-width: 0; display: flex; flex-direction: column; min-height: 360px; }
.dash-col-title { font-size: 14px; font-weight: 600; color: #1F2937; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.dash-col-title-count { background: var(--c-bg); color: var(--c-text-3); border-radius: 10px; padding: 1px 8px; font-size: 11px; font-weight: 600; }
.dash-col-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; flex: 1; min-height: 0; }

/* 收藏客户最新备注（竖排，每客户一条）（2026-09-13 23:45 上线，方案 C） */
.dash-favnote-item { padding: 10px 12px; border-radius: 6px; cursor: pointer; transition: background .12s; border: 1px solid var(--c-bg); }
.dash-favnote-item:hover { background: var(--c-bg); }
.dash-favnote-head { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #1F2937; }
.dash-favnote-name { font-weight: 600; color: #185FA5; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-favnote-time { font-size: 10px; color: #999; flex-shrink: 0; }
.dash-favnote-meta { font-size: 10.5px; color: #888; margin: 2px 0 4px; font-family: Consolas, monospace; }
.dash-favnote-text { font-size: 12px; color: #444; line-height: 1.45; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dash-favnote-empty { text-align: center; color: #999; font-size: 12px; padding: 30px 12px; }

/* 仪表盘：收藏客户条（2026-09-13 22:30 上线） */
.dash-favorites { background: #fff; border: 1px solid var(--c-bg); border-radius: 10px; padding: 14px 18px; }
.dash-fav-title { font-size: 14px; font-weight: 600; color: #1F2937; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.favorites-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.fav-card { flex: 0 0 220px; border: 1px solid var(--c-border); border-radius: 8px; padding: 10px 12px; cursor: pointer; transition: all .12s; background: #fff; }
.fav-card:hover { border-color: #185FA5; box-shadow: 0 2px 8px rgba(24,95,165,.12); transform: translateY(-1px); }
.fav-card-name { font-size: 13px; font-weight: 600; color: #185FA5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-card-code { font-family: Consolas, monospace; font-size: 11px; color: #888; margin-top: 2px; }
.fav-card-note { font-size: 11px; color: #555; margin-top: 6px; line-height: 1.4; max-height: 32px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fav-card-meta { font-size: 10px; color: #999; margin-top: 6px; display: flex; gap: 6px; align-items: center; }
.fav-empty { color: #999; font-size: 12px; padding: 12px 0; }

/* 仪表盘：图表 2x2 网格（2026-09-13 22:30 上线） */
.dash-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.dash-chart-card { background: #fff; border: 1px solid var(--c-bg); border-radius: 10px; padding: 16px 18px; min-width: 0; display: flex; flex-direction: column; }
.dash-chart-title { font-size: 14px; font-weight: 600; color: #1F2937; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.dash-chart-hint { font-size: 11px; color: #888; font-weight: 400; }
.dash-chart-body { flex: 1; min-height: 0; overflow-y: auto; }

/* 横条形图 */
.hbar-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; }
.hbar-row:hover { background: #F8FAFC; border-radius: 4px; }
.hbar-label { flex: 0 0 90px; font-size: 12px; color: #1F2937; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { flex: 1; background: var(--c-bg); border-radius: 4px; height: 16px; overflow: hidden; position: relative; }
.hbar-fill { height: 100%; border-radius: 4px; transition: width .3s; }
.hbar-fill.cyan { background: linear-gradient(90deg, #06B6D4, #0891B2); }
.hbar-fill.red { background: linear-gradient(90deg, #EF4444, #DC2626); }
.hbar-fill.orange { background: linear-gradient(90deg, #F59E0B, #D97706); }
.hbar-fill.green { background: linear-gradient(90deg, #10B981, #059669); }
.hbar-fill.purple { background: linear-gradient(90deg, #8B5CF6, #7C3AED); }
.hbar-fill.yellow { background: linear-gradient(90deg, #FACC15, #EAB308); }
.hbar-fill.gray { background: linear-gradient(90deg, #9CA3AF, #6B7280); }
.hbar-value { flex: 0 0 auto; font-size: 11px; color: #555; font-weight: 600; min-width: 70px; text-align: right; }

/* 饼图 */
.pie-wrap { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.pie-svg { width: 140px; height: 140px; flex-shrink: 0; }
.pie-legend { flex: 1; min-width: 120px; display: flex; flex-direction: column; gap: 6px; }
.pie-legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.pie-legend-color { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.pie-legend-label { flex: 1; color: #1F2937; }
.pie-legend-value { font-weight: 600; color: #185FA5; }

@media (max-width: 1100px) {
  .dash-charts { grid-template-columns: 1fr; }
  .dash-favorites .favorites-strip { flex-wrap: wrap; }
}

/* MES 排产进度（2026-09-13 22:45 上线） */
.dash-mes { background: #fff; border: 1px solid var(--c-bg); border-radius: 10px; padding: 16px 18px; }
.dash-mes-title { font-size: 14px; font-weight: 600; color: #1F2937; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.dash-mes-sub { font-size: 11px; color: #888; margin-bottom: 14px; }
/* 2026-09-19 John：新增「排程口径」卡（第 6 张）→ 改自适应栅格，窄屏自动换行，不再挤压 */
.dash-mes-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.dash-mes-kpi-loading { grid-column: 1 / -1; color: #999; font-size: 12px; padding: 20px; text-align: center; }
.dash-mes-kpi-card { background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 100%); border: 1px solid #BAE6FD; border-radius: 8px; padding: 12px 14px; }
.dash-mes-kpi-card.kpi-finished { background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%); border-color: #BBF7D0; }
.dash-mes-kpi-card.kpi-balance { background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%); border-color: #FED7AA; }
.dash-mes-kpi-card.kpi-rate { background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%); border-color: #BFDBFE; }
.dash-mes-kpi-label { font-size: 11px; color: #666; margin-bottom: 4px; }
.dash-mes-kpi-value { font-size: 22px; font-weight: 700; color: #1F2937; }
.dash-mes-kpi-value.green { color: #047857; }
.dash-mes-kpi-value.red { color: #B91C1C; }
.dash-mes-kpi-progress { height: 6px; background: rgba(0,0,0,.06); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.dash-mes-kpi-progress-fill { height: 100%; background: linear-gradient(90deg, #10B981, #059669); transition: width .3s; }
/* 第 5 张 KPI 卡：预计完工日期（2026-09-14 Johnson：并入 KPI 行，数据取自生产排程结果） */
.dash-mes-kpi-card.kpi-eta { background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%); border-color: #C7D2FE; }
.dash-mes-kpi-card.kpi-sched { background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%); border-color: #DDD6FE; }
.dash-mes-controls { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.dash-mes-label { font-size: 12px; color: #666; white-space: nowrap; }
.dash-mes-sel { padding: 3px 8px; border: 1px solid var(--c-border); border-radius: 4px; font-size: 12px; }
/* 2026-09-14 John：客户/订单号改为下拉列表（级联），固定宽度避免撑破筛选条 */
.dash-mes-sel-cust { width: 120px; font-family: Consolas, monospace; }
.dash-mes-sel-order { width: 200px; font-family: Consolas, monospace; }
.dash-mes-input { padding: 3px 8px; border: 1px solid var(--c-border); border-radius: 4px; font-size: 12px; width: 110px; font-family: Consolas, monospace; }
.dash-mes-input-wide { width: 150px; }
.dash-mes-hint { font-size: 11px; color: #888; margin-left: 4px; white-space: nowrap; }
.dash-mes-table-wrap { border: 1px solid var(--c-bg); border-radius: 6px; overflow-x: auto; }
table.mes-table { width: 100%; border-collapse: collapse; font-size: 12px; }
table.mes-table th { background: var(--c-bg); color: var(--c-text-3); padding: 8px 10px; text-align: left; font-weight: 600; font-size: 11px; border-bottom: 1px solid var(--c-border); white-space: nowrap; }
table.mes-table td { padding: 8px 10px; border-bottom: 1px solid var(--c-bg); }
table.mes-table tbody tr { cursor: pointer; }
table.mes-table tbody tr:hover { background: #F8FAFC; }
table.mes-table .num { text-align: right; font-variant-numeric: tabular-nums; }
table.mes-table .order-link { font-family: Consolas, monospace; font-size: 12px; color: #185FA5; font-weight: 600; }
table.mes-table .order-link:hover { text-decoration: underline; }
table.mes-table .rate-cell { font-weight: 600; }
table.mes-table .rate-cell.high { color: #047857; }
table.mes-table .rate-cell.mid { color: #B45309; }
table.mes-table .rate-cell.low { color: #B91C1C; }
table.mes-table .progress-mini { display: inline-block; width: 60px; height: 6px; background: #E5E7EB; border-radius: 3px; vertical-align: middle; margin-right: 6px; }
table.mes-table .progress-mini-fill { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #10B981, #059669); }
table.mes-table .badge-cycle { display: inline-block; padding: 2px 8px; background: #EFF6FF; color: #185FA5; border-radius: 10px; font-size: 10px; font-weight: 600; }
table.mes-table .badge-owner { display: inline-block; padding: 2px 6px; font-size: 10px; color: #555; }
table.mes-table .badge-owner.unmatched { background: #FEE2E2; color: #B91C1C; border-radius: 4px; }

/* MES 订单明细弹窗内表格 */
table.mes-detail-table { width: 100%; border-collapse: collapse; font-size: 12px; }
table.mes-detail-table th { background: #F8FAFC; padding: 6px 10px; text-align: left; font-weight: 600; font-size: 11px; color: #666; border-bottom: 1px solid var(--c-border); white-space: nowrap; }
table.mes-detail-table td { padding: 6px 10px; border-bottom: 1px solid var(--c-bg); }
table.mes-detail-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.mes-order-summary-card { background: linear-gradient(135deg, #F0F9FF 0%, #DBEAFE 100%); border: 1px solid #BFDBFE; border-radius: 6px; padding: 10px 12px; }
.mes-order-summary-label { font-size: 10px; color: #666; margin-bottom: 2px; }
.mes-order-summary-value { font-size: 16px; font-weight: 700; color: #1F2937; }

/* --- 待办卡片 --- */
.dash-item { display: flex; align-items: stretch; gap: 0; border: 1px solid var(--c-bg); border-radius: 8px; padding: 0; cursor: pointer; transition: all .12s; overflow: hidden; background: #fff; }
.dash-item:hover { border-color: var(--c-primary); box-shadow: var(--sh-sm); }
.dash-item-bar { width: 4px; flex-shrink: 0; }
.dash-item-bar.high { background: #EF4444; }
.dash-item-bar.normal { background: var(--c-primary); }
.dash-item-bar.low { background: #10B981; }
.dash-item-body { flex: 1; padding: 12px 14px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.dash-item-title { font-size: 13.5px; font-weight: 600; color: #1F2937; display: flex; align-items: center; gap: 6px; }
.dash-item-priority { font-size: 10px; padding: 1px 6px; border-radius: 4px; font-weight: 600; }
.dash-item-priority.high { background: rgba(239,68,68,.10); color: #EF4444; }
.dash-item-priority.normal { background: rgba(24,95,165,.10); color: var(--c-primary); }
.dash-item-priority.low { background: rgba(16,185,129,.10); color: #10B981; }
.dash-item-sub { font-size: 12px; color: var(--c-text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-item-meta { font-size: 11px; color: var(--c-text-3); margin-top: 2px; }
.dash-empty { padding: 40px 20px; text-align: center; color: var(--c-text-3); font-size: 13px; }

/* --- 动态 feed --- */
.dash-feed-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--c-bg); }
.dash-feed-item:last-child { border-bottom: none; }
.dash-feed-icon { width: 28px; height: 28px; border-radius: 50%; background: var(--c-primary-light); color: var(--c-primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dash-feed-icon svg { width: 14px; height: 14px; stroke-width: 1.6; }
.dash-feed-icon.target { background: rgba(245,158,11,.10); color: var(--c-warn); }
.dash-feed-icon.flag { background: rgba(16,185,129,.10); color: #10B981; }
.dash-feed-body { min-width: 0; flex: 1; }
.dash-feed-title { font-size: 13px; font-weight: 500; color: #1F2937; }
.dash-feed-sub { font-size: 11.5px; color: var(--c-text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-feed-ts { font-size: 10.5px; color: var(--c-text-3); margin-top: 2px; }

/* --- 全部动态弹层（2026-09-15） --- */
#feedModal .modal-box { max-width: 720px; }
.feed-modal-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--c-bg); }
.feed-modal-row:last-child { border-bottom: none; }
.feed-modal-row:hover { background: var(--c-primary-light); }
.feed-modal-icon { flex: 0 0 24px; font-size: 18px; text-align: center; line-height: 1; }
.feed-modal-main { min-width: 0; flex: 1; }
.feed-modal-title { font-size: 14px; font-weight: 600; color: var(--c-text-1); }
.feed-modal-sub { font-size: 12px; color: var(--c-text-2); margin-top: 3px; line-height: 1.35; }
.feed-modal-time { flex: 0 0 auto; font-size: 12px; color: var(--c-text-3); white-space: nowrap; }

/* --- 应收账龄明细弹层（2026-09-16） --- */
.aging-row { cursor: pointer; }
.aging-row:hover { background: var(--c-primary-light); border-radius: 6px; }
.aging-detail-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.aging-detail-table th,
.aging-detail-table td { padding: 10px 8px; border-bottom: 1px solid var(--c-bg); }
.aging-detail-table th { position: sticky; top: 0; background: #fff; font-weight: 600; color: var(--c-text-1); z-index: 1; }
.aging-detail-table tbody tr:hover { background: var(--c-primary-light); }
.aging-detail-table .aging-code { font-size: 11px; color: var(--c-text-3); }

/* --- 移动端响应 --- */
@media (max-width: 1100px) {
  .dash-main { grid-template-columns: 1fr 1fr; }
  .dash-charts { grid-template-columns: 1fr; }
  .dash-favorites .favorites-strip { flex-wrap: wrap; }
}
@media (max-width: 900px) {
  .dash-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .dash-main { grid-template-columns: 1fr; }
}

/* === 报价参考查询（2026-09-16 A 减方案） === */
.qq { max-width: 1400px; margin: 0 auto; padding: 24px 32px; display: flex; flex-direction: column; gap: 14px; }
.qq-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.qq-title { font-size: 20px; font-weight: 700; color: var(--c-text-1); }
.qq-note { font-size: 12px; color: var(--c-text-3); }
.qq-warn { background: #fff8e6; border: 1px solid #f5d68a; color: #8a5b00; border-radius: var(--r-sm); padding: 9px 14px; font-size: 12.5px; line-height: 1.7; }
.qq-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qq-sel { border: 1px solid var(--c-border); border-radius: 8px; padding: 8px 12px; font-size: 13px; font-family: inherit; background: #fff; color: var(--c-text-1); cursor: pointer; }
.qq-input { flex: 1; min-width: 240px; border: 1px solid var(--c-border); border-radius: 8px; padding: 8px 12px; font-size: 13px; font-family: inherit; }
.qq-input:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(24,95,165,.10); }
.qq-btn { border: 1px solid var(--c-border); background: #fff; color: var(--c-text-2); border-radius: 8px; padding: 8px 16px; font-size: 13px; cursor: pointer; font-family: inherit; }
.qq-btn:hover { border-color: var(--c-primary); color: var(--c-primary); }
.qq-btn.primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; font-weight: 600; }
.qq-btn.primary:hover { background: var(--c-primary-dark); color: #fff; }
.qq-btn.green { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.qq-btn.gray { background: var(--c-bg-2); }
.qq-hint { font-size: 12px; color: var(--c-text-3); }
.qq-ta { width: 100%; min-height: 120px; border: 1px solid var(--c-border); border-radius: 8px; padding: 10px 12px; font-size: 13px; font-family: Consolas, Menlo, monospace; resize: vertical; line-height: 1.6; }
.qq-ta:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(24,95,165,.10); }
.qq-sugg { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow: auto; }
.qq-sugg-item { display: flex; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--c-bg); border-radius: var(--r-sm); padding: 7px 12px; font-size: 12.5px; cursor: pointer; }
.qq-sugg-item:hover { border-color: var(--c-primary); background: var(--c-primary-light); }
.qq-sugg-pn { font-family: Consolas, Menlo, monospace; font-weight: 700; color: var(--c-primary); }
.qq-sugg-name { color: var(--c-text-2); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qq-sugg-tag { font-size: 11px; color: var(--c-text-3); background: var(--c-bg); border-radius: 10px; padding: 2px 8px; }
.qq-result { background: #fff; border: 1px solid var(--c-bg); border-radius: var(--r-md); overflow: auto; }
.qq-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.qq-tbl th { background: #f3f5f8; color: var(--c-text-2); font-weight: 600; text-align: right; padding: 9px 10px; border-bottom: 1px solid var(--c-border); white-space: nowrap; position: sticky; top: 0; }
.qq-tbl th:first-child, .qq-tbl th.l { text-align: left; }
.qq-tbl td { padding: 8px 10px; border-bottom: 1px solid #f1f3f5; text-align: right; white-space: nowrap; }
.qq-tbl td.l { text-align: left; }
/* 币种分区：两行表头 + 淡底色（2026-09-20） */
.qq-tbl th.g-cny { background: #fdeeee; color: #b91c1c; text-align: center; border-left: 1px solid var(--c-border); border-right: 1px solid var(--c-border); letter-spacing: .3px; }
.qq-tbl th.g-usd { background: #eaf2fb; color: #185FA5; text-align: center; border-left: 1px solid var(--c-border); border-right: 1px solid var(--c-border); letter-spacing: .3px; }
.qq-tbl thead tr.qq-grp th { height: 30px; padding: 6px 10px; top: 0; z-index: 2; }
.qq-tbl thead tr.qq-grp + tr th { top: 31px; }           /* 第二行紧贴第一行下沿，避免 sticky 重叠 */
.qq-tbl th.cny { background: #fdf6f6; }
.qq-tbl th.usd { background: #f4f8fd; }
.qq-tbl td.cny { background: #fffbfb; border-left: 1px solid #fdeeee; border-right: 1px solid #fdeeee; }
.qq-tbl td.usd { background: #fbfdff; border-left: 1px solid #eaf2fb; border-right: 1px solid #eaf2fb; }
.qq-tbl tr:hover td { background: #fafbfc; }
.qq-sum-cny b { color: #b91c1c; }
.qq-sum-usd b { color: #b45309; }
.qq-tbl .pn { font-family: Consolas, Menlo, monospace; font-weight: 600; color: var(--c-text-1); }
.qq-tbl .fob { font-weight: 700; color: #b45309; }
.qq-tbl .fail { color: var(--c-danger); }
.qq-tbl tfoot td { font-weight: 700; background: #f9fafb; border-top: 2px solid var(--c-border); }
.qq-tbl tfoot td.cny { background: #fdf6f6; }
.qq-tbl tfoot td.usd { background: #f4f8fd; }
.qq-tag { font-size: 11px; border-radius: 10px; padding: 2px 8px; background: var(--c-bg); color: var(--c-text-3); }
.qq-tag.ok { background: #ecfdf5; color: #047857; }
.qq-tag.trade { background: #eff6ff; color: #1d4ed8; }
.qq-tag.bad { background: #fef2f2; color: #b91c1c; }
.qq-sum { display: flex; gap: 18px; flex-wrap: wrap; padding: 10px 14px; background: #f9fafb; border-bottom: 1px solid var(--c-border); font-size: 12.5px; color: var(--c-text-2); }
.qq-sum b { color: var(--c-text-1); }

/* ---- 订单审核（2026-09-19）---- */
.au-cust { max-width: 460px; }
.au-file { flex: 1; min-width: 280px; font-size: 13px; font-family: inherit; padding: 6px 10px; border: 1px solid var(--c-border); border-radius: 8px; background: #fff; color: var(--c-text-1); cursor: pointer; }
.au-file:hover { border-color: var(--c-primary); }
.au-lv { font-size: 11px; border-radius: 10px; padding: 2px 8px; font-weight: 600; white-space: nowrap; }
.au-lv-l1 { background: #ecfdf5; color: #047857; }
.au-lv-l2 { background: #eff6ff; color: #1d4ed8; }
.au-lv-l3 { background: var(--c-accent-light); color: #c2410c; }
.au-lv-none { background: var(--c-bg); color: var(--c-text-3); }
.au-st { font-size: 11px; border-radius: 10px; padding: 2px 8px; font-weight: 700; white-space: nowrap; }
.au-st-critical { background: #fef2f2; color: #b91c1c; }
.au-st-flag { background: #fffbeb; color: #b45309; }
.au-st-ok { background: #ecfdf5; color: #047857; }
.au-row-critical td { background: #fff5f5 !important; }
.au-row-flag td { background: #fffdf3 !important; }
.au-alerts { white-space: normal; color: var(--c-text-2); font-size: 12px; line-height: 1.5; }
.au-ref { white-space: normal; font-size: 11.5px; color: var(--c-text-3); line-height: 1.45; }
.au-diff-up { color: #b91c1c; font-weight: 600; }
.au-diff-dn { color: #047857; font-weight: 600; }

/* ---- M3 校准系数（2026-09-27，仅 admin）---- */
.calib-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.calib-tbl thead th {
  position: sticky; top: 0; z-index: 2;
  background: #f6f8fa; color: var(--c-text-2);
  font-weight: 600; font-size: 12px;
  padding: 7px 8px; text-align: center;
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}
.calib-tbl td {
  padding: 4px 8px; text-align: center;
  border-bottom: 1px solid #f0f2f5;
  white-space: nowrap;
}
.calib-tbl tbody tr:hover td { background: #fafbfc; }
.calib-tbl tr.calib-edited td { background: #fffbe6 !important; }
.calib-tbl tr.calib-edited td:first-child { box-shadow: inset 3px 0 0 #f0b400; }
.calib-in {
  width: 96px; padding: 3px 6px; font-size: 12.5px;
  font-family: ui-monospace, Consolas, monospace;
  text-align: right;
  border: 1px solid #dfe3e8; border-radius: 4px;
  background: #fffdf5; color: var(--c-text-1);
}
.calib-in:focus { outline: none; border-color: var(--c-primary); background: #fff; box-shadow: 0 0 0 2px rgba(37,99,235,.12); }
.calib-tbl input[data-f="manual"] { background: #f0f7ff; }

/* ---- M3 校准「调%」快捷档（2026-09-27）---- */
.calib-tbl input.calib-pct {
  width: 64px; text-align: center; font-weight: 600; color: #8a5a00;
  background: #fffdf2; border-color: #e8d9a8;
}
.calib-tbl input.calib-pct:focus { border-color: #e0a000; box-shadow: 0 0 0 2px rgba(224,160,0,.18); }
.calib-tbl input.calib-pct::placeholder { color: #c9b98a; font-weight: 400; }
