/* 锐界进销存 · 设计语言（深色侧栏 · 精品质感）
   桌面端：深色侧边导航 + 内容区；移动端：顶部条 + 底部标签栏，表格自动转卡片
   设计基调：深邃藏青侧栏塑造专业稳重气质，内容区大留白 + 精致分层 + 统一圆角，长时间使用不累眼 */
:root {
  /* —— 背景与表面（低饱和浅调，微蓝灰，衬托磨砂玻璃）—— */
  --c-bg: #e9eef6;
  --c-surface: #ffffff;
  --c-surface-2: #f5f8fc;
  --c-surface-3: #eaf0f8;
  --c-border: #e0e6f0;
  --c-border-strong: #cdd7e6;

  /* —— 文本（对比鲜明，层级清晰）—— */
  --c-text: #1a2436;
  --c-text-2: #4e5d72;
  --c-text-3: #8b98ac;

  /* —— 品牌主色（深邃藏青，低饱和）—— */
  --c-primary: #2b4a6f;
  --c-primary-2: #3b6a9a;
  --c-blue: #3b6a9a;
  --c-teal: #2f8f83;
  --c-green: #3d8f6a;
  --c-amber: #b8822f;
  --c-red: #c45b5b;
  --c-indigo: #6b6bbf;

  /* —— 深色侧栏专用色 —— */
  --c-sidebar-bg: #15273c;
  --c-sidebar-bg-2: #1c324c;
  --c-sidebar-text: #c3d2e4;
  --c-sidebar-muted: #8499b2;

  /* —— 玻璃态：半透明磨砂卡片（更透，才能看出背后色彩与模糊）—— */
  --glass-bg: rgba(255, 255, 255, .40);
  --glass-bg-strong: rgba(255, 255, 255, .68);
  --glass-border: rgba(255, 255, 255, .82);
  --glass-blur: 24px;

  /* —— 阴影（柔和弥散，层次分明）—— */
  --shadow-sm: 0 1px 2px rgba(23, 43, 70, .04), 0 4px 14px rgba(23, 43, 70, .05);
  --shadow-md: 0 10px 30px rgba(23, 43, 70, .10);
  --shadow-lg: 0 26px 64px rgba(14, 30, 52, .22);

  /* —— 圆角（大圆角）—— */
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 22px;
  --sidebar-w: 240px;
  --font: "Inter", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font);
  background:
    radial-gradient(900px 620px at 4% 0%, rgba(88, 142, 205, .38), transparent 62%),
    radial-gradient(780px 560px at 98% 4%, rgba(96, 180, 160, .32), transparent 60%),
    radial-gradient(860px 640px at 82% 96%, rgba(158, 126, 202, .32), transparent 62%),
    radial-gradient(720px 540px at 20% 92%, rgba(214, 166, 112, .22), transparent 60%),
    linear-gradient(135deg, #dee7f4 0%, #dbe6f2 40%, #e6e4f1 100%);
  background-attachment: fixed;
  color: var(--c-text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
/* 可见栅格辅助线：内容区铺一层淡网格，呼应设计稿的栅格系统 */
.main {
  position: relative;
}
.main::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(96, 124, 162, .085) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 124, 162, .085) 1px, transparent 1px);
  background-size: 28px 28px;
}
.content { position: relative; z-index: 1; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--c-primary-2); text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #cbd5e3; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 启动态 ---------- */
.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; color: var(--c-text-2); }
.boot-mark { width: 42px; height: 42px; border-radius: 12px; background: var(--c-primary); position: relative; animation: pulse 1.4s ease-in-out infinite; }
.boot-mark::before, .boot-mark::after { content: ""; position: absolute; background: #fff; border-radius: 2px; }
.boot-mark::before { width: 18px; height: 3px; left: 12px; top: 15px; }
.boot-mark::after { width: 18px; height: 3px; left: 12px; top: 24px; opacity: .55; }
/* 启动画面直接展示公司品牌信纸页眉，不再用抽象占位图标 */
.boot-logo { width: min(420px, 78vw); height: auto; display: block; background: #fff; border-radius: 8px; box-shadow: 0 12px 34px rgba(6, 25, 48, .16); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1 } 50% { transform: scale(.985); opacity: .82 } }
.fatal { max-width: 520px; margin: 12vh auto; padding: 32px; background: linear-gradient(135deg, rgba(255,255,255,.86), rgba(255,255,255,.6)); -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4); border: 1px solid var(--glass-border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,.9); }
.fatal h2 { font-size: 18px; margin-bottom: 10px; }
.fatal p { color: var(--c-text-2); margin-bottom: 18px; }

/* ---------- 应用外壳（深色侧栏 · 精品质感）---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, var(--c-sidebar-bg-2) 0%, var(--c-sidebar-bg) 62%, #122035 100%);
  color: var(--c-sidebar-text); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,.05);
  box-shadow: 8px 0 40px rgba(18, 36, 60, .10);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 22px 20px 18px; border-bottom: 1px solid rgba(255,255,255,.07); margin-bottom: 6px; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: #fff; display: grid; place-items: center; flex: none; overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,0,.28); }
.brand-logo-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-mark svg { width: 22px; height: 22px; }
.brand-name { font-size: 15px; font-weight: 700; color: #fff; letter-spacing: .2px; line-height: 1.25; }
.brand-sub { font-size: 11px; color: var(--c-sidebar-muted); letter-spacing: .3px; }
.nav-group { padding: 6px 14px 2px; }
.nav-label { font-size: 10.5px; letter-spacing: 1.4px; color: var(--c-sidebar-muted); padding: 15px 10px 8px; font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px;
  color: var(--c-sidebar-text); font-size: 13.5px; margin-bottom: 3px; transition: background .16s, color .16s;
  border: 0; background: transparent; width: 100%; text-align: left; position: relative;
}
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .72; transition: opacity .16s; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item:hover svg { opacity: 1; }
.nav-item.is-active {
  background: linear-gradient(90deg, rgba(46, 120, 190, .34), rgba(46, 120, 190, .16));
  color: #fff; font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(88, 156, 222, .35);
}
.nav-item.is-active svg { opacity: 1; color: #7db4e6; }
.nav-item.is-active::before { content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%); width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: #5aa7e6; }
.nav-item .nav-count { margin-left: auto; font-size: 11px; background: rgba(255,255,255,.14); color: #d7e6f5; padding: 1px 7px; border-radius: 20px; }
.sidebar-foot { margin-top: auto; padding: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.operator-chip { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #2c6fa8, #4a96d6); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.operator-name { font-size: 13px; color: #fff; font-weight: 600; }
.operator-role { font-size: 11px; color: var(--c-sidebar-muted); }
.cloud-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: #7fd6ac; margin-top: 10px; }
.cloud-dot i { width: 6px; height: 6px; border-radius: 50%; background: #3fd08a; box-shadow: 0 0 0 3px rgba(63,208,138,.18); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px; background: rgba(255,255,255,.62); backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--glass-border); display: flex; align-items: center;
  gap: 14px; padding: 0 26px; position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 17px; font-weight: 700; letter-spacing: -.2px; color: var(--c-text); }
.topbar .crumb { font-size: 12px; color: var(--c-text-3); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.sync-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--c-text-2); background: var(--c-surface-2); border: 1px solid var(--c-border); padding: 6px 11px; border-radius: 20px; }
.sync-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--c-green); }
.content { padding: 24px 26px 48px; max-width: 1560px; width: 100%; margin: 0 auto; }
.mobile-head, .tabbar { display: none; }

/* ---------- 通用元素 ---------- */
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .title { font-size: 20px; font-weight: 700; letter-spacing: -.4px; }
.page-head .desc { color: var(--c-text-2); font-size: 13px; margin-top: 4px; }
.page-head .spacer { flex: 1; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid rgba(205, 215, 230, .85); background: rgba(255, 255, 255, .7);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--c-text);
  border-radius: var(--r-sm); padding: 8px 15px; font-size: 13px; font-weight: 500;
  transition: all .18s; white-space: nowrap; min-height: 36px;
}
.btn svg { width: 15px; height: 15px; }
a.btn { text-decoration: none; }
.btn:hover { border-color: #b7c6d8; background: var(--c-surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: linear-gradient(135deg, var(--c-primary-2), var(--c-primary)); border-color: var(--c-primary); color: #fff; box-shadow: 0 3px 10px rgba(14, 58, 99, .28); }
.btn--primary:hover { background: linear-gradient(135deg, #1e69a8, #11436e); border-color: #11436e; box-shadow: 0 5px 14px rgba(14, 58, 99, .34); }
.btn--accent { background: linear-gradient(135deg, #0f9a8c, var(--c-teal)); border-color: var(--c-teal); color: #fff; box-shadow: 0 3px 10px rgba(12, 133, 122, .26); }
.btn--accent:hover { background: linear-gradient(135deg, #10a99a, #0b736a); border-color: #0b736a; }
.btn--danger { color: var(--c-red); border-color: #f0c9c9; background: #fff; }
.btn--danger:hover { background: #fff5f5; border-color: #e6a5a5; }
.btn--ghost { border-color: transparent; background: transparent; color: var(--c-text-2); }
.btn--ghost:hover { background: var(--c-surface-3); }
.btn--sm { padding: 5px 10px; min-height: 28px; font-size: 12px; }
.btn--block { width: 100%; }

.card {
  background:
    linear-gradient(135deg, rgba(255,255,255,.42) 0%, rgba(255,255,255,.14) 42%, rgba(255,255,255,.26) 100%),
    var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.45);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.45);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  box-shadow: 0 16px 40px rgba(28, 52, 86, .13), inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 0 0 1px rgba(255, 255, 255, .22);
  transition: box-shadow .3s ease, transform .3s ease, border-color .3s ease;
  /* backwards：动画结束后不残留 filter。filter 非 none 会创建 backdrop root，
     使 backdrop-filter 采样不到页面背景，玻璃磨砂感会彻底失效。 */
  animation: glass-in .55s cubic-bezier(.22, .9, .32, 1) backwards;
}
/* 模糊过渡动效由 backdrop-filter 自身从 2px 渐入到 24px 实现 */
@keyframes glass-in {
  from { opacity: 0; transform: translateY(14px) scale(.985); -webkit-backdrop-filter: blur(2px) saturate(1); backdrop-filter: blur(2px) saturate(1); }
  to { opacity: 1; transform: none; -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.45); backdrop-filter: blur(var(--glass-blur)) saturate(1.45); }
}
.card.is-clickable:hover, .card:hover {
  box-shadow: 0 22px 52px rgba(28, 52, 86, .18), inset 0 1px 0 rgba(255,255,255,.95), inset 0 0 0 1px rgba(255,255,255,.28);
}
.card-head { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid rgba(220, 228, 240, .7); }
.card-head h3 { font-size: 14px; font-weight: 700; color: var(--c-text); }
.card-head .spacer { flex: 1; }
.card-head .hint { font-size: 12px; color: var(--c-text-3); }
.card-body { padding: 18px; }
.card-body--flush { padding: 0; }

.grid { display: grid; gap: 16px; }
.grid--kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--main { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }

.kpi { padding: 18px; position: relative; overflow: hidden; border-radius: var(--r-md); }
.kpi::after { content: ""; position: absolute; right: -18px; top: -18px; width: 88px; height: 88px; border-radius: 50%; background: var(--kpi-tint, rgba(23,90,148,.08)); }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--kpi-color, var(--c-blue)); opacity: .55; border-radius: 3px 0 0 3px; }
.kpi-label { font-size: 12px; color: var(--c-text-2); display: flex; align-items: center; gap: 7px; }
.kpi-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--kpi-tint, rgba(23,90,148,.12)); color: var(--kpi-color, var(--c-blue)); }
.kpi-icon svg { width: 16px; height: 16px; }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -.8px; margin: 12px 0 3px; font-variant-numeric: tabular-nums; color: var(--c-text); }
.kpi-value small { font-size: 13px; font-weight: 500; color: var(--c-text-3); margin-left: 3px; }
.kpi-foot { font-size: 11.5px; color: var(--c-text-3); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge--slate { color: #64748b; background: #f1f5f9; border-color: #e2e8f0; }
.badge--blue { color: #1d4ed8; background: #eff6ff; border-color: #dbeafe; }
.badge--indigo { color: #4f46b8; background: #eef2ff; border-color: #e0e7ff; }
.badge--amber { color: #a56205; background: #fffbeb; border-color: #fef3c7; }
.badge--green { color: #0f7a52; background: #ecfdf5; border-color: #d1fae5; }
.badge--teal { color: #0f766e; background: #f0fdfa; border-color: #ccfbf1; }
.badge--red { color: #c03131; background: #fef2f2; border-color: #fee2e2; }

.source { display: inline-flex; align-items: center; font-size: 11px; padding: 2px 8px; border-radius: 5px; white-space: nowrap; }
.source--internal { color: #0f7a52; background: #ecfdf5; }
.source--external { color: #1d4ed8; background: #eff6ff; }
.source--stale { color: #a56205; background: #fffbeb; }

.muted { color: var(--c-text-2); }
.tiny { font-size: 11.5px; }
.autofill-hint {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12px; line-height: 1.6;
  color: #0e7a5a; background: #eafaf3; border: 1px solid #bfe9d8;
  border-radius: var(--r-sm); padding: 9px 12px; margin-bottom: 2px;
}
.autofill-hint svg { width: 15px; height: 15px; flex: none; color: #0e8f6a; }
.autofill-hint > .tiny { flex-basis: 100%; margin-top: -2px; }

/* 货号联想：同一货号在报价目录里有多条规格时，点选要带出的一条 */
.quote-matches {
  border: 1px solid var(--glass-border); border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .42); padding: 10px 12px; margin: 8px 0 2px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.quote-matches__head { font-size: 12px; color: var(--c-text-2); font-weight: 600; margin-bottom: 8px; }
.quote-matches__list { display: grid; gap: 6px; max-height: 250px; overflow: auto; }
.quote-match {
  display: grid; grid-template-columns: minmax(140px, 1.1fr) minmax(150px, 2fr) minmax(100px, 1fr) 88px minmax(90px, 1fr);
  align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 1px solid var(--c-border); border-radius: 8px; padding: 7px 10px;
  background: rgba(255, 255, 255, .6); cursor: pointer; font: inherit; color: inherit;
}
.quote-match:hover { background: rgba(255, 255, 255, .92); border-color: var(--c-primary-2); }
.quote-match__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }

/* 万级列表分页条 */
.pager {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 10px 14px; border-top: 1px solid var(--c-border);
}
.pager .btn[disabled] { opacity: .45; cursor: not-allowed; }
.pg-nums { display: inline-flex; gap: 4px; align-items: center; }
.pg-btn {
  min-width: 28px; height: 28px; padding: 0 8px; border-radius: 6px;
  border: 1px solid var(--c-border); background: var(--c-surface-1);
  color: var(--c-text-1); font-size: 12.5px; cursor: pointer;
  font-variant-numeric: tabular-nums; transition: all .15s;
}
.pg-btn:hover { border-color: var(--c-primary-2); color: var(--c-primary); }
.pg-btn.is-active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }

@media (max-width: 720px) {
  .quote-match { grid-template-columns: 1fr auto; }
  .quote-match > *:nth-child(1),
  .quote-match > *:nth-child(2) { grid-column: 1 / -1; }
  .quote-match > *:nth-child(3),
  .quote-match > *:nth-child(5) { display: none; }
}
.mono { font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.strong { font-weight: 650; }
.nowrap { white-space: nowrap; }
.link { color: var(--c-primary-2); font-weight: 600; cursor: pointer; }
.link:hover { text-decoration: underline; }
.dot-sep { color: var(--c-border-strong); margin: 0 6px; }

/* ---------- 表格 ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 600; color: var(--c-text-2);
  letter-spacing: .3px; padding: 12px 16px; background: rgba(245, 248, 252, .6);
  border-bottom: 1px solid rgba(224, 230, 240, .8); white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid rgba(232, 238, 247, .7); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: rgba(255, 255, 255, .55); }
.table tbody tr.is-clickable { cursor: pointer; }
.table .cell-title { font-weight: 600; color: var(--c-text); }
.table .cell-sub { font-size: 11.5px; color: var(--c-text-3); margin-top: 2px; }
.table .cell-actions { display: flex; gap: 5px; justify-content: flex-end; }
.table-empty { padding: 48px 20px; text-align: center; color: var(--c-text-3); }
.table-empty svg { width: 34px; height: 34px; opacity: .4; margin-bottom: 10px; }

/* ---------- 工具条 / 筛选 ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 380px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--c-text-3); }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--c-border-strong); background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-radius: var(--r-sm); padding: 8px 11px; outline: none; transition: border .18s, box-shadow .18s;
  min-height: 36px;
}
.search .input { padding-left: 34px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--c-primary-2); box-shadow: 0 0 0 3px rgba(47,111,209,.12); }
.input::placeholder { color: var(--c-text-3); }
.textarea { min-height: 74px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a98aa' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
.field { display: block; }
.field > label { display: block; font-size: 12px; color: var(--c-text-2); font-weight: 600; margin-bottom: 6px; }
.field .hint { font-size: 11px; color: var(--c-text-3); margin-top: 5px; }
.field-row { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-stack { display: grid; gap: 16px; }
.segmented { display: inline-flex; background: var(--c-surface-3); border: 1px solid var(--c-border); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; padding: 6px 13px; border-radius: 6px; font-size: 12.5px; color: var(--c-text-2); }
.segmented button.is-active { background: rgba(255,255,255,.88); color: var(--c-primary); font-weight: 650; box-shadow: var(--shadow-sm); }

/* ---------- 模态框 / 抽屉 ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 26, 48, .5); backdrop-filter: blur(2px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .16s ease; }
.modal { width: min(680px, 100%); max-height: min(88vh, 900px); display: flex; flex-direction: column; background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); border: 1px solid var(--glass-border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); animation: rise .2s ease; overflow: hidden; }
.modal--wide { width: min(960px, 100%); }
.modal--narrow { width: min(460px, 100%); }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--c-border); }
.modal-head h3 { font-size: 16px; font-weight: 700; }
.modal-head p { font-size: 12px; color: var(--c-text-3); margin-top: 3px; }
.modal-head .spacer { flex: 1; }
.modal-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--c-border); display: flex; gap: 9px; justify-content: flex-end; background: var(--c-surface-2); }
.icon-btn { width: 30px; height: 30px; border: 0; background: transparent; border-radius: 7px; display: grid; place-items: center; color: var(--c-text-3); }
.icon-btn:hover { background: var(--c-surface-3); color: var(--c-text); }
.icon-btn svg { width: 17px; height: 17px; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.99) } to { opacity: 1; transform: none } }

#toast-host { position: fixed; right: 20px; top: 18px; z-index: 200; display: grid; gap: 9px; pointer-events: none; }
.toast { background: #142b49; color: #fff; padding: 11px 16px; border-radius: 9px; box-shadow: var(--shadow-md); font-size: 13px; display: flex; align-items: center; gap: 9px; animation: rise .2s ease; max-width: 360px; }
.toast svg { width: 16px; height: 16px; flex: none; }
.toast--ok svg { color: #6ee7b7; }
.toast--err { background: #7f2222; }
.toast--err svg { color: #fca5a5; }

/* ---------- 详情 / 关联 ---------- */
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 20px; }
.detail-item .k { font-size: 11.5px; color: var(--c-text-3); margin-bottom: 3px; }
.detail-item .v { font-size: 13.5px; font-weight: 600; }
.section-title { font-size: 13px; font-weight: 700; margin: 22px 0 11px; display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ""; width: 3px; height: 13px; border-radius: 2px; background: var(--c-primary-2); }
.section-title .count { font-size: 11px; color: var(--c-text-3); font-weight: 500; }
.relation-card { border: 1px solid var(--c-border); border-radius: 10px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; background: var(--c-surface-2); margin-bottom: 8px; }
.relation-card .ricon { width: 32px; height: 32px; border-radius: 8px; background: #e8f0fa; color: var(--c-primary-2); display: grid; place-items: center; flex: none; }
.relation-card .ricon svg { width: 17px; height: 17px; }
.relation-card .rbody { flex: 1; min-width: 0; }
.relation-card .rtitle { font-weight: 650; font-size: 13px; }
.relation-card .rsub { font-size: 11.5px; color: var(--c-text-3); }
.relation-card .rright { text-align: right; }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--c-border); }
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--c-primary-2); }
.timeline-item .tt { font-size: 13px; font-weight: 600; }
.timeline-item .td { font-size: 11.5px; color: var(--c-text-3); }

/* ---------- 看板 / 进度 ---------- */
.status-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.status-cell { border: 1px solid var(--glass-border); border-radius: 12px; padding: 13px; background: rgba(255, 255, 255, .48); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: transform .18s, box-shadow .18s, border-color .18s; }
.status-cell:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.status-cell .sc-label { font-size: 11.5px; color: var(--c-text-2); }
.status-cell .sc-value { font-size: 21px; font-weight: 700; margin-top: 5px; font-variant-numeric: tabular-nums; }
.bar { height: 7px; border-radius: 6px; background: var(--c-surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: var(--c-primary-2); }
.bar--green > i { background: var(--c-green); }
.bar--amber > i { background: var(--c-amber); }
.bar--red > i { background: var(--c-red); }
.progress-line { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 12px; }
.progress-line .pl-label { width: 88px; color: var(--c-text-2); flex: none; }
.progress-line .bar { flex: 1; }
.progress-line .pl-val { width: 66px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.flow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.flow-node { border: 1px solid var(--glass-border); background: rgba(255, 255, 255, .5); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-radius: 10px; padding: 7px 11px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.flow-node.is-done { background: #ecfdf5; border-color: #c7eddb; color: #0f7a52; }
.flow-node.is-current { background: #eff6ff; border-color: #c7ddfb; color: #1d4ed8; }
.flow-arrow { color: var(--c-text-3); font-size: 13px; }

/* ---------- 销售单行项目编辑 ---------- */
.lookup { position: relative; }
.lookup-panel { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 5px); background: #fff; border: 1px solid var(--c-border-strong); border-radius: 10px; box-shadow: var(--shadow-md); max-height: 290px; overflow-y: auto; }
.lookup-row { display: flex; align-items: center; gap: 12px; padding: 10px 13px; border-bottom: 1px solid #f0f3f8; cursor: pointer; }
.lookup-row:last-child { border-bottom: 0; }
.lookup-row:hover { background: #f4f8ff; }
.lookup-row .lr-main { flex: 1; min-width: 0; }
.lookup-row .lr-title { font-size: 13px; font-weight: 600; }
.lookup-row .lr-sub { font-size: 11px; color: var(--c-text-3); }
.lookup-row .lr-right { text-align: right; }
.lookup-empty { padding: 18px; text-align: center; color: var(--c-text-3); font-size: 12.5px; }
.items-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.items-table th { font-size: 11px; color: var(--c-text-3); font-weight: 600; text-align: left; padding: 8px 9px; background: var(--c-surface-2); border-bottom: 1px solid var(--c-border); }
.items-table td { padding: 8px 9px; border-bottom: 1px solid #eef2f7; }
.items-table .input, .items-table .select { min-height: 32px; padding: 5px 8px; font-size: 12.5px; }
.items-table .input--num { text-align: right; font-variant-numeric: tabular-nums; }
.total-strip { display: flex; align-items: center; justify-content: flex-end; gap: 22px; padding: 14px 4px 2px; font-size: 13px; }
.total-strip .ts-amount { font-size: 21px; font-weight: 700; color: var(--c-primary); font-variant-numeric: tabular-nums; }

/* ---------- 移动端 ---------- */
@media (max-width: 1100px) {
  .grid--kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--main { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .shell { display: block; }
  .sidebar { display: none; }
  .topbar { display: none; }
  .mobile-head {
    display: flex; align-items: center; gap: 11px; padding: 12px 16px;
    padding-top: max(12px, env(safe-area-inset-top));
    background: linear-gradient(135deg, var(--c-sidebar-bg-2), var(--c-sidebar-bg));
    color: #fff; position: sticky; top: 0; z-index: 25;
    border-bottom: 1px solid rgba(255,255,255,.06);
    box-shadow: 0 2px 12px rgba(8,22,40,.18);
  }
  .mobile-head .m-mark { width: 30px; height: 30px; border-radius: 9px; background: #fff; display: grid; place-items: center; flex: none; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
  .mobile-head .m-mark .brand-logo-img { width: 100%; height: 100%; object-fit: cover; }
  .mobile-head .m-mark svg { width: 19px; height: 19px; }
  .mobile-head .m-title { font-size: 15px; font-weight: 700; color: #fff; }
  .mobile-head .m-sub { font-size: 10.5px; color: var(--c-sidebar-muted); margin-top: -2px; }
  .mobile-head .m-actions { margin-left: auto; display: flex; gap: 6px; }
  .mobile-head .icon-btn { color: #d7e6f5; }
  .mobile-head .icon-btn:hover { background: rgba(255,255,255,.14); color: #fff; }
  .content { padding: 16px 14px calc(88px + env(safe-area-inset-bottom)); }
  .tabbar {
    /* 标签数随角色变化（销售 3 个、管理员 7 个），用 flex 自动均分，避免写死列数导致溢出 */
    display: flex; align-items: stretch;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: rgba(255,255,255,.96); backdrop-filter: blur(14px);
    border-top: 1px solid var(--c-border);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 18px rgba(19,42,74,.06);
  }
  .tabbar button { flex: 1 1 0; min-width: 0; border: 0; background: transparent; padding: 9px 2px 8px; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--c-text-3); font-size: 10.5px; white-space: nowrap; overflow: hidden; }
  .tabbar button svg { width: 20px; height: 20px; }
  .tabbar button.is-active { color: var(--c-primary-2); font-weight: 650; }
  .page-head .title { font-size: 18px; }
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .field-row, .field-row--3 { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal { width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; }
  .modal-foot { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  #toast-host { right: 12px; left: 12px; top: 12px; }
  .toast { max-width: none; }
}
@media (max-width: 720px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border: 1px solid var(--glass-border); border-radius: 12px; margin: 10px 12px; padding: 4px 0; background: rgba(255,255,255,.55); }
  .table td { border-bottom: 1px dashed #eef2f7; padding: 9px 13px; display: flex; align-items: center; justify-content: space-between; gap: 14px; text-align: right; }
  .table td:last-child { border-bottom: 0; }
  .table td::before { content: attr(data-label); font-size: 11.5px; color: var(--c-text-3); font-weight: 500; flex: none; text-align: left; }
  .table td[data-label=""]::before { display: none; }
  /* 卡片式单元格里内嵌的图形 / 长数值不能把整行撑出屏幕 */
  .table td { min-width: 0; overflow-wrap: anywhere; }
  .table td > * { min-width: 0; }
  .biz-bar { display: none !important; }
  .table .cell-actions { justify-content: flex-end; flex-wrap: wrap; }
  .table .cell-sub { text-align: right; }
  .table-empty { margin: 12px; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .grid--kpi { gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 21px; }
  .card-head { padding: 13px 14px; }
  .card-body { padding: 14px; }
  .status-board { gap: 8px; }
  .items-table { font-size: 12px; }
  .items-table th { display: none; }
  .items-table, .items-table tbody, .items-table tr, .items-table td { display: block; width: 100%; }
  .items-table tr { border: 1px solid var(--c-border); border-radius: 9px; margin-bottom: 9px; padding: 6px; }
  .items-table td { border: 0; padding: 4px 6px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .items-table td::before { content: attr(data-label); font-size: 11px; color: var(--c-text-3); flex: none; }
  .items-table td .input, .items-table td .select { max-width: 62%; }
  /* 数据密集型表格（业绩核算等）：窄屏保留表头并横向滚动，
     避免卡片式布局把金额挤出屏幕；默认表格行为保持不变。 */
  .table-wrap--scroll { -webkit-overflow-scrolling: touch; }
  .table-wrap--scroll .table { display: table; min-width: 900px; }
  .table-wrap--scroll .table thead { display: table-header-group; }
  .table-wrap--scroll .table tbody { display: table-row-group; }
  .table-wrap--scroll .table tr { display: table-row; margin: 0; border: 0; border-radius: 0; padding: 0; background: transparent; }
  .table-wrap--scroll .table th { display: table-cell; }
  .table-wrap--scroll .table td { display: table-cell; width: auto; padding: 9px 12px; border-bottom: 1px solid #eef2f7; text-align: right; }
  .table-wrap--scroll .table td::before { display: none; }
  .table-wrap--scroll .table .cell-sub { text-align: right; }
  .table-wrap--scroll .biz-bar { display: none !important; }
  /* 设置页「安装到手机」二维码卡片：窄屏改为上下堆叠，避免说明文字被挤成一条 */
  .install-qr { flex-direction: column; align-items: stretch; }
  .install-qr img { align-self: center; }
}

/* ---------- 可点击下钻 ---------- */
.kpi.is-clickable, .status-cell.is-clickable { cursor: pointer; transition: box-shadow .15s, transform .15s, border-color .15s; }
.kpi.is-clickable:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--c-primary-2); }
.status-cell.is-clickable:hover { border-color: var(--c-primary-2); background: rgba(255, 255, 255, .68); }
.status-cell.is-clickable:active { transform: translateY(1px); }

/* ---------- 客户分类 ---------- */
.cat-filter { display: inline-flex; align-items: center; gap: 7px; }
.cat-filter svg { width: 15px; height: 15px; color: var(--c-text-3); }
.cat-filter .select { min-width: 168px; }
.cat-manager { display: grid; gap: 14px; }
.cat-toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: 10px; padding: 12px 14px; }
.cat-toolbar .tiny { flex: 1; min-width: 220px; }
.cat-tree { border: 1px solid var(--c-border); border-radius: 10px; overflow: hidden; }
.tree-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px calc(14px + var(--depth, 0) * 26px); border-bottom: 1px solid rgba(232,238,247,.7); background: rgba(255,255,255,.5); flex-wrap: wrap; }
.tree-row:last-child { border-bottom: 0; }
.tree-row:nth-child(even) { background: #fcfdff; }
.tree-main { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 200px; flex-wrap: wrap; }
.tree-bullet { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: #eef2ff; color: var(--c-indigo); flex: none; }
.tree-bullet svg { width: 13px; height: 13px; }
.tree-name { font-weight: 650; font-size: 13px; }
.tree-ops { display: flex; gap: 6px; flex-wrap: wrap; }
.cat-editor, .cat-quick { background: #f5f9ff; border: 1px dashed #a9c6ea; border-radius: 10px; padding: 14px; }
.cat-quick { margin-top: 10px; }

/* ---------- 批量导入 ---------- */
.import-summary { display: flex; gap: 20px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--c-border); font-size: 12.5px; color: var(--c-text-2); }
.import-summary b { font-size: 14px; color: var(--c-text); }
details summary { list-style: none; }
details summary::-webkit-details-marker { display: none; }

/* ---------- 外部品牌选择 ---------- */
.brand-pick-list { border: 1px solid var(--c-border); border-radius: 10px; max-height: 260px; overflow: auto; }
.brand-pick-row { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-bottom: 1px solid #eef2f7; flex-wrap: wrap; cursor: pointer; }
.brand-pick-row:last-child { border-bottom: 0; }
.brand-pick-row:hover { background: #f8fbff; }
.brand-pick-row .input { min-height: 30px; padding: 4px 7px; font-size: 12px; }
.brand-pick-check { width: 15px; height: 15px; accent-color: var(--c-primary); flex: none; }

/* ---------- 送货单 ---------- */
.doc-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 18px; align-items: start; }
.doc-config { border: 1px solid var(--c-border); border-radius: 10px; padding: 14px; background: var(--c-surface-2); }
.doc-status { margin-top: 14px; padding: 10px 12px; border-radius: 8px; background: #fff8ec; border: 1px solid #f5dcae; font-size: 12px; color: #8a5b06; line-height: 1.8; }
.doc-status svg { width: 13px; height: 13px; vertical-align: -2px; }
.doc-status.is-done { background: #ecfdf5; border-color: #b9ead3; color: #0f7a52; }
.doc-preview { border: 1px solid var(--c-border); border-radius: 10px; background: #fff; overflow: auto; max-height: 62vh; padding: 6px; }
.delivery-doc { padding: 16px 18px; font-size: 12.5px; color: var(--c-text); line-height: 1.45; background: #fff; }
.delivery-doc .d-company { font-size: 14px; font-weight: 700; color: var(--c-primary); letter-spacing: 1px; }
.delivery-doc .d-title { text-align: center; font-size: 21px; font-weight: 700; letter-spacing: 8px; margin: 8px 0 12px; }
.delivery-doc .d-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 20px; border: 1px solid var(--c-border-strong); padding: 8px 12px; border-radius: 6px; margin-bottom: 9px; font-size: 11.5px; }
.delivery-doc .d-meta div { display: flex; gap: 8px; min-width: 0; }
.delivery-doc .d-meta span { color: var(--c-text-3); min-width: 56px; flex: 0 0 auto; }
.delivery-doc .d-meta b { min-width: 0; overflow-wrap: anywhere; }
.delivery-doc .d-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 9px; }
.delivery-doc .d-parties > div { border: 1px solid var(--c-border-strong); border-radius: 6px; padding: 8px 10px; min-width: 0; }
.delivery-doc .d-label { font-size: 10.5px; color: var(--c-text-3); }
.delivery-doc .d-name { font-size: 13.5px; font-weight: 700; margin: 1px 0 4px; overflow-wrap: anywhere; }
.delivery-doc .d-line { font-size: 11.5px; color: var(--c-text-2); overflow-wrap: anywhere; word-break: break-word; }
.delivery-doc .d-table { width: 100%; border-collapse: collapse; font-size: 11.5px; line-height: 1.4; }
.delivery-doc .d-table th, .delivery-doc .d-table td { border: 1px solid var(--c-border-strong); padding: 4px 6px; vertical-align: middle; overflow-wrap: anywhere; word-break: break-word; }
.delivery-doc .d-table th { background: var(--c-surface-3); font-weight: 600; text-align: left; color: var(--c-text-2); white-space: normal; }
.delivery-doc .d-table tfoot td { background: var(--c-surface-2); padding: 5px 6px; }
.delivery-doc .d-sub { font-size: 10.5px; color: var(--c-text-3); margin-top: 1px; overflow-wrap: anywhere; }
.delivery-doc .c { text-align: center; }
.delivery-doc .r { text-align: right; }
.delivery-doc .num { font-variant-numeric: tabular-nums; }
.delivery-doc .d-note { margin: 8px 0; font-size: 11.5px; color: var(--c-text-2); overflow-wrap: anywhere; }
.delivery-doc .d-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; font-size: 11.5px; }
.delivery-doc .d-sign-cell { position: relative; min-height: 104px; border: 1px solid var(--c-border-strong); border-radius: 6px; padding: 10px 12px; overflow-wrap: anywhere; }
.delivery-doc .d-sign-stamp { margin-top: 10px; color: var(--c-text-3); font-size: 11px; min-height: 18px; padding-right: 84px; }
.delivery-doc .d-seal-img { position: absolute; right: 12px; bottom: 8px; width: 76px; height: 76px; opacity: .82; pointer-events: none; }

@media (max-width: 1100px) {
  .doc-layout { grid-template-columns: 1fr; }
  .doc-preview { max-height: none; }
}
@media (max-width: 720px) {
  .cat-toolbar { gap: 10px; }
  .tree-row { padding-left: calc(12px + var(--depth, 0) * 12px); }
  .tree-ops .btn { font-size: 11px; }
  .delivery-doc { padding: 12px 10px; }
  .delivery-doc .d-meta, .delivery-doc .d-parties, .delivery-doc .d-sign { grid-template-columns: 1fr; }
  .delivery-doc .d-title { font-size: 18px; letter-spacing: 4px; }
}

/* ---------- 送货单品牌页眉 ---------- */
.delivery-doc .d-brand { margin-bottom: 4px; }
.delivery-doc .d-logo { width: 100%; height: auto; display: block; }

/* 打印：改由送货单的自包含独立文档（隐藏 iframe）输出。
   主页面不再用 visibility:hidden 干预打印，避免浏览器裁掉单据内容导致空白 PDF。 */

/* ---------- 新建订单：客户池选择器 ---------- */
.customer-picker { display: grid; gap: 10px; }
.cp-top { display: flex; gap: 10px; align-items: center; }
.cp-search { flex: 1; min-width: 0; }
.cp-filter { width: 190px; flex: none; }
.cp-picked, .cp-empty { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--c-primary-2); border-radius: 9px; background: #f5f9ff; }
.cp-empty { border-style: dashed; border-color: var(--c-border-strong); background: var(--c-surface-2); color: var(--c-text-2); font-size: 12px; }
.cp-empty svg { width: 15px; height: 15px; flex: none; }
.cp-avatar { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: #e6edf6; color: var(--c-primary); font-weight: 700; flex: none; }
.cp-avatar--on { background: var(--c-primary); color: #fff; }
.cp-picked-main { flex: 1; min-width: 0; }
.cp-name { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.cp-discount { font-size: 11px; font-weight: 600; color: var(--c-green); background: #eafaf3; padding: 1px 6px; border-radius: 4px; }
.cp-sub { font-size: 11px; color: var(--c-text-3); line-height: 1.7; overflow: hidden; text-overflow: ellipsis; }
.cp-list { max-height: 210px; overflow: auto; border: 1px solid var(--c-border); border-radius: 9px; background: #fff; }
.cp-row { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-bottom: 1px solid #eef2f7; cursor: pointer; }
.cp-row:last-child { border-bottom: 0; }
.cp-row:hover { background: #f6faff; }
.cp-row svg { width: 14px; height: 14px; color: var(--c-text-3); flex: none; }
.cp-main { flex: 1; min-width: 0; }
.cp-none { padding: 18px; text-align: center; font-size: 12px; color: var(--c-text-3); }
.cp-foot { font-size: 11.5px; color: var(--c-text-3); }
.cp-foot .link { color: var(--c-primary); background: none; border: 0; padding: 0; cursor: pointer; font: inherit; text-decoration: underline; }

/* ---------- 开票：票种税率提示 ---------- */
.tax-hint { padding: 11px 13px; border: 1px solid #cfe0f5; background: #f3f8ff; border-radius: 9px; line-height: 1.75; }
.tax-hint-main { font-size: 12.5px; display: flex; align-items: center; gap: 7px; }
.tax-hint-main svg { width: 15px; height: 15px; color: var(--c-primary); }
.tax-hint-sub { font-size: 11.5px; color: var(--c-text-2); margin-top: 3px; }
.relation-card.is-clickable { cursor: pointer; transition: border-color .15s, background .15s; }
.relation-card.is-clickable:hover { border-color: var(--c-primary-2); background: #f8fbff; }
.flow-node.is-clickable { cursor: pointer; }
.flow-node.is-clickable:hover { filter: brightness(.95); }

/* ---------- 合并开票订单勾选列表 ---------- */
.merge-order-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; max-height: 220px; overflow: auto; }
.merge-order-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--c-border); border-radius: 8px; cursor: pointer; transition: border-color .15s, background .15s; }
.merge-order-item:hover { border-color: var(--c-primary-2); background: #f8fbff; }
.merge-order-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--c-primary); flex: none; }

@media (max-width: 720px) {
  .cp-top { flex-direction: column; align-items: stretch; }
  .cp-filter { width: 100%; }
}

/* ---------- 企业登录 / 应急只读 ---------- */
.auth-gate { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: 20px; overflow: auto; background: radial-gradient(760px 560px at 10% 6%, rgba(78, 152, 218, .58), transparent 62%), radial-gradient(680px 520px at 90% 94%, rgba(132, 104, 198, .52), transparent 60%), radial-gradient(620px 460px at 62% 40%, rgba(58, 168, 156, .28), transparent 62%), linear-gradient(140deg, #071c30 0%, #0e3a63 48%, #175a94 100%); }
.auth-card { width: min(440px, 100%); background: linear-gradient(135deg, rgba(255,255,255,.88), rgba(255,255,255,.62)); -webkit-backdrop-filter: blur(26px) saturate(1.4); backdrop-filter: blur(26px) saturate(1.4); border: 1px solid rgba(255,255,255,.9); border-radius: 22px; padding: 28px 30px; box-shadow: 0 24px 70px rgba(6, 25, 48, .34), inset 0 1px 0 rgba(255,255,255,.95); display: grid; gap: 11px; }
.auth-logo { width: 100%; height: auto; display: block; margin-bottom: 4px; }
.auth-title { font-size: 18px; font-weight: 700; text-align: center; color: var(--c-primary); }
.auth-sub { font-size: 12px; color: var(--c-text-2); line-height: 1.8; text-align: center; }
/* 登录入口下方的辅助链接：注册 / 重置密码为主，验证码登录更弱一级 */
.auth-links { display: grid; gap: 2px; justify-items: center; margin: -2px 0 2px; }
.auth-links__row { display: flex; align-items: center; gap: 10px; }
.auth-links button { border: 0; background: none; padding: 4px 2px; color: var(--c-primary); font-size: 12px; font-weight: 600; cursor: pointer; }
.auth-links button:hover { text-decoration: underline; }
.auth-links__sep { color: var(--c-text-3); font-size: 12px; }
.auth-links .auth-links__alt { color: var(--c-text-2); font-size: 11px; font-weight: 500; }
.auth-links[hidden] { display: none; }
.auth-back { justify-self: start; border: 0; background: none; padding: 2px 0; color: var(--c-primary); font-size: 12px; font-weight: 600; cursor: pointer; }
.auth-back[hidden] { display: none; }
.auth-back:hover { text-decoration: underline; }
.auth-pane { display: grid; gap: 10px; }
.auth-pane[hidden] { display: none; }
.auth-pane .btn--block { width: 100%; }
.auth-wait { width: min(520px, 100%); }
.auth-wait .auth-logo { max-width: 240px; margin: 0 auto 12px; }
.auth-card .field > span { font-size: 12px; font-weight: 600; display: block; margin-bottom: 6px; color: var(--c-text-2); }
.auth-row { display: flex; gap: 8px; }
.auth-row .input { flex: 1; min-width: 0; }
.auth-error { min-height: 18px; font-size: 12px; color: var(--c-red); line-height: 1.6; }
.auth-foot { font-size: 11px; color: var(--c-text-3); line-height: 1.85; border-top: 1px solid var(--c-border); padding-top: 12px; }
.auth-foot a { color: var(--c-primary); text-decoration: underline; }

/* ---------- 我的资料 · 修改密码（当前密码直改 / 邮箱验证码备用） ---------- */
.pwd-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: 10px; }
.pwd-tabs button { border: 0; background: transparent; padding: 8px 6px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--c-text-2); cursor: pointer; }
.pwd-tabs button.is-active { background: rgba(255,255,255,.88); color: var(--c-primary); box-shadow: 0 1px 5px rgba(18, 63, 109, .12); }
.pwd-panel { display: grid; gap: 10px; }
.pwd-panel[hidden] { display: none; }
.pwd-panel code, .auth-pane code { font-size: 11px; background: var(--c-surface-2); padding: 1px 4px; border-radius: 4px; word-break: break-all; }
@media (max-width: 390px) {
  .pwd-tabs { grid-template-columns: 1fr; }
}
.guest-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--c-surface-2); }
.guest-card { width: min(720px, 100%); background: linear-gradient(135deg, rgba(255,255,255,.8), rgba(255,255,255,.52)); -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4); border: 1px solid var(--glass-border); border-radius: var(--r-md); padding: 26px 28px; box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,.9); }
.guest-card .grid--kpi { grid-template-columns: repeat(3, 1fr); }
.topbar-actions .user-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--c-text-2); background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: 20px; padding: 5px 11px; white-space: nowrap; }
.topbar-actions .user-chip svg { width: 13px; height: 13px; }
@media (max-width: 900px) { .topbar-actions .user-chip { display: none; } }
@media (max-width: 720px) { .guest-card .grid--kpi { grid-template-columns: 1fr; } }

/* ---------- 工作台：统计区间 ---------- */
.period-bar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; padding: 9px 13px; margin-bottom: 14px; background: var(--glass-bg); -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur)); border: 1px solid var(--glass-border); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.pb-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--c-text-2); }
.pb-label svg { width: 14px; height: 14px; }
.period-bar .pb-select { width: auto; min-width: 132px; padding: 5px 28px 5px 10px; min-height: 32px; font-size: 12px; }
.period-bar .pb-date { width: auto; min-width: 142px; padding: 5px 9px; min-height: 32px; font-size: 12px; }
.pb-range { font-size: 12px; color: var(--c-text-2); background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: 6px; padding: 6px 10px; }
.pb-tilde { color: var(--c-text-3); }
.pb-count { font-size: 12px; color: var(--c-text-2); }
.pb-count b { color: var(--c-primary-2); font-size: 13px; }
.pb-tip { margin-left: auto; font-size: 11px; color: var(--c-text-3); }
@media (max-width: 1100px) { .pb-tip { display: none; } }
@media (max-width: 720px) {
  .period-bar { gap: 7px; padding: 9px 10px; }
  .period-bar .pb-select { flex: 1; min-width: 120px; }
  .period-bar .pb-date { flex: 1; min-width: 125px; }
  .pb-count { width: 100%; }
}

/* ---------- 工作台：紧凑待办 ---------- */
.todo-card .todo-head { display: flex; align-items: baseline; gap: 10px; padding: 10px 13px; border-bottom: 1px solid var(--c-border); }
.todo-head h3 { font-size: 13px; font-weight: 650; }
.todo-head .hint { font-size: 11px; color: var(--c-text-3); }
.todo-body { padding: 10px 12px 12px; }
.todo-mini { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.todo-chip { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 8px 9px; border: 1px solid var(--glass-border); border-radius: 12px; background: rgba(255, 255, 255, .48); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); cursor: pointer; text-align: left; font: inherit; transition: border-color .18s, background .18s, transform .18s; }
.todo-chip:hover { border-color: var(--c-primary-2); background: rgba(255, 255, 255, .68); transform: translateY(-1px); }
.tc-ico { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; flex: none; }
.tc-ico svg { width: 13px; height: 13px; }
.tc-num { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tc-label { font-size: 11.5px; color: var(--c-text-2); white-space: nowrap; }
.todo-chip.is-on .tc-label { color: var(--c-text); font-weight: 600; }

/* ---------- 明细弹窗：行内动作 / 客户就地建档 ---------- */
.cell-actions { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; }
.cp-quick { margin-top: 9px; padding: 11px; border: 1px dashed var(--c-border-strong); border-radius: 9px; background: var(--c-surface-2); display: grid; gap: 9px; }
.cp-quick .cq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.cp-quick .cq-label { font-size: 11px; color: var(--c-text-2); font-weight: 600; display: block; margin-bottom: 4px; }
.cp-quick .input, .cp-quick .select { min-height: 32px; padding: 5px 9px; font-size: 12px; }
.cp-quick .cq-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cp-quick .cq-tip { font-size: 11px; color: var(--c-text-3); }
@media (max-width: 720px) { .cp-quick .cq-grid { grid-template-columns: 1fr; } }

/* ---------- 送货单：品牌 / 货号分列 + 单价金额 ---------- */
.delivery-doc .d-table { table-layout: fixed; word-break: break-word; overflow-wrap: anywhere; font-size: 11.5px; }
.delivery-doc .d-table th, .delivery-doc .d-table td { padding: 4px 6px; }
.delivery-doc .d-table th.r, .delivery-doc .d-table td.r { text-align: right; }

/* ---------- 附件上传 / 预览 ---------- */
.upload-box { border: 1px dashed var(--c-border-strong); border-radius: 10px; padding: 12px; background: var(--c-surface-2); }
.upload-label { font-size: 12px; font-weight: 650; margin-bottom: 8px; }
.upload-drop { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border: 1px solid var(--glass-border); border-radius: 12px; background: rgba(255,255,255,.5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); cursor: pointer; transition: border-color .15s, background .15s; }
.upload-drop:hover, .upload-drop.is-over { border-color: var(--c-primary); background: #f6faff; }
.upload-drop > svg { width: 20px; height: 20px; color: var(--c-primary); flex: none; }
.upload-drop b { display: block; font-size: 12.5px; }
.upload-drop .tiny { display: block; margin-top: 2px; }
.upload-status { margin-top: 9px; font-size: 12px; color: var(--c-text-2); line-height: 1.8; }
.upload-status svg { width: 13px; height: 13px; vertical-align: -2px; }
.upload-status.is-ok { color: var(--c-green); }
.upload-ocr { margin-top: 4px; padding: 6px 9px; border-radius: 7px; background: #eff6ff; color: var(--c-text-2); font-size: 11.5px; }
.upload-ocr b { color: var(--c-primary); }
.upload-preview { margin-top: 9px; }
.upload-thumb { max-width: 100%; max-height: 170px; border: 1px solid var(--c-border); border-radius: 8px; display: block; }
.upload-thumb--pdf { width: 72px; height: 90px; display: grid; place-items: center; background: #fff1f1; color: var(--c-red); font-weight: 700; letter-spacing: 1px; }
.attachment-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--c-border); border-radius: 9px; background: var(--c-surface-2); }
.attachment-view { max-height: 62vh; overflow: auto; border: 1px solid var(--c-border); border-radius: 9px; background: #fff; padding: 8px; text-align: center; }
.attachment-view img { max-width: 100%; height: auto; display: inline-block; }
.attachment-view iframe { width: 100%; height: 58vh; border: 0; }

/* ---------- 多收货地址编辑 ---------- */
.addr-editor { border-top: 1px solid var(--c-border); padding-top: 14px; }
.addr-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.addr-head b { font-size: 12.5px; }
.addr-head .tiny { margin-left: 8px; }
.addr-list { display: grid; gap: 9px; margin-bottom: 10px; }
.addr-row { border: 1px solid var(--c-border); border-radius: 9px; padding: 10px 11px; background: var(--c-surface-2); }
.addr-row.is-default { border-color: var(--c-primary-2); background: #f8fbff; }
.addr-row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.addr-default { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--c-text-2); cursor: pointer; }
.addr-row .field { margin: 0; }
.addr-row .field .tiny { display: block; margin-bottom: 4px; }
.addr-row .field-row { margin-bottom: 8px; }
.addr-row .input { min-height: 32px; padding: 5px 9px; font-size: 12px; }
@media (max-width: 720px) { .addr-row .field-row--3 { grid-template-columns: 1fr; } }

/* ---------- 删除标记 / 勾选项 / 可点用户条 ---------- */
.row-deleted { opacity: .62; }
.row-deleted td { background: var(--c-surface-2); }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--c-text); line-height: 1.7; cursor: pointer; }
.check-line input { width: 15px; height: 15px; accent-color: var(--c-primary); }

/* ---------- 成员权限勾选面板 ---------- */
.perm-group {
  border: 1px solid var(--glass-border); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px;
  background: rgba(255, 255, 255, .42);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.perm-group__title { font-size: 12px; font-weight: 700; color: var(--c-text-2); letter-spacing: .3px; margin-bottom: 9px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 4px 14px; }
.check-line.is-locked { opacity: .62; cursor: not-allowed; }
.topbar-actions .user-chip.is-clickable { cursor: pointer; transition: border-color .15s, color .15s; }
.topbar-actions .user-chip.is-clickable:hover { border-color: var(--c-primary-2); color: var(--c-primary); }

/* ---------- 采购订单 / 进项发票核对 / 预收预付款 ---------- */
.po-total { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 12px 14px; margin-top: 12px; border-radius: 9px; background: var(--c-surface-2); font-size: 13px; font-weight: 600; }
.po-total b { margin-left: auto; font-size: 19px; color: var(--c-primary-2); font-variant-numeric: tabular-nums; }
.po-total .tiny { width: 100%; font-weight: 400; }
.lookup-list { max-height: 210px; overflow-y: auto; border: 1px solid var(--c-border); border-radius: 9px; background: #fff; }
.lookup-list .lookup-row { width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--c-border); background: #fff; justify-content: space-between; }
.lookup-list .lookup-row:last-child { border-bottom: 0; }
.lookup-list .tiny.muted { padding: 14px; display: block; }
.alert-box { padding: 11px 13px; border-radius: 9px; border: 1px solid #f3d6a5; background: #fffaf0; color: #8a5a12; font-size: 12.5px; line-height: 1.75; }
.toolbar .segmented { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; }
.toolbar .segmented button { white-space: nowrap; }
@media (max-width: 720px) {
  .po-total b { font-size: 17px; }
  .tabbar button { font-size: 9.5px; }
  .tabbar button svg { width: 18px; height: 18px; }
}

/* 购销合同预览（信纸张在独立 iframe 里渲染，避免主界面样式串入） */
.contract-preview-wrap { display: flex; flex-direction: column; gap: 10px; }
.contract-preview-bar { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 8px; background: #eef5f5; color: #35616a; font-size: 12px; line-height: 1.6; }
.contract-preview-bar svg { width: 15px; height: 15px; flex: 0 0 auto; }
.contract-preview-wrap iframe { width: 100%; height: min(68vh, 760px); border: 1px solid var(--c-border); border-radius: 8px; background: #fff; }
@media (max-width: 720px) {
  .contract-preview-wrap iframe { height: 62vh; }
}

/* 账实一致性体检 */
.health-summary { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border-radius: 10px; margin-bottom: 14px; border: 1px solid #bfe3d6; background: #f1fbf6; }
.health-summary.is-bad { border-color: #f3c9c9; background: #fff5f5; }
.health-summary svg { width: 20px; height: 20px; flex: 0 0 auto; }
.health-list-wrap { display: grid; gap: 8px; }
.health-row { border: 1px solid var(--glass-border); border-radius: 12px; padding: 10px 12px; background: rgba(255,255,255,.5); }
.health-row.is-bad { border-color: #f0caca; background: #fffafa; }
.health-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.health-head .spacer { flex: 1; }
.health-dot { width: 8px; height: 8px; border-radius: 50%; background: #18a06a; flex: 0 0 auto; }
.health-row.is-bad .health-dot { background: #d9534f; }
.health-list { margin: 8px 0 0 20px; padding: 0; font-size: 12px; color: #a2443d; line-height: 1.8; }

/* ---------- 销售订单：业务流程指引（待办即筛选项） ---------- */
.flow-guide { display: grid; gap: 10px; padding: 12px 14px; margin-bottom: 14px; border: 1px solid var(--c-border); border-radius: 10px; background: var(--c-surface-2); }
.fg-title { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 650; color: var(--c-text); }
.fg-title svg { width: 15px; height: 15px; color: var(--c-primary); }
.fg-title .tiny { font-weight: 400; }
.fg-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.fg-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--c-border-strong); border-radius: 8px; background: #fff; cursor: pointer; font: inherit; font-size: 12px; color: var(--c-text-2); transition: border-color .15s, background .15s; }
.fg-chip b { font-size: 15px; color: var(--c-text-3); font-variant-numeric: tabular-nums; }
.fg-chip.has-todo b { color: var(--c-primary); }
.fg-chip:hover { border-color: var(--c-primary); }
.fg-chip.is-active { border-color: var(--c-primary); background: #eef5ff; color: var(--c-primary); font-weight: 650; }
.fg-chip.is-active b { color: var(--c-primary); }

/* ---------- 资金往来：收 / 付两侧切换 ---------- */
.fund-switch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.fund-switch > button { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border: 1px solid var(--c-border-strong); border-radius: 9px; background: #fff; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: var(--c-text-2); }
.fund-switch > button svg { width: 15px; height: 15px; }
.fund-switch > button .tiny { font-weight: 400; }
.fund-switch > button.is-active { border-color: var(--c-primary); background: #eef5ff; color: var(--c-primary); }
.fund-switch > button:hover { border-color: var(--c-primary); }
@media (max-width: 720px) {
  .fg-chip { padding: 6px 9px; font-size: 11px; }
  .fg-chip b { font-size: 13px; }
  .fund-switch > button { flex: 1 1 44%; justify-content: center; }
  .fund-switch > .tiny { width: 100%; margin-left: 0 !important; }
}

/* ---------- 往来应收应付（按单位看四笔钱） ---------- */
.ar-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 24px; padding: 20px 24px 14px; margin-bottom: 16px; border-radius: var(--r-md); background: linear-gradient(135deg, #175a94, #0e3a63); color: #fff; box-shadow: 0 8px 22px rgba(14, 58, 99, .24); }
.ar-sum { display: flex; flex-direction: column; gap: 3px; padding: 7px 0; }
.ar-sum span { font-size: 12.5px; color: rgba(255,255,255,.82); letter-spacing: .2px; }
.ar-sum b { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.ar-sum-foot { grid-column: 1 / -1; margin-top: 10px; padding-top: 11px; border-top: 1px solid rgba(255,255,255,.22); font-size: 11.5px; color: rgba(255,255,255,.78); }

.ar-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.ar-toolbar .search { max-width: 340px; }
.ar-toolbar .select { width: auto; min-width: 128px; }
.ar-toolbar #ar-count { white-space: nowrap; }

.ar-list { display: flex; flex-direction: column; gap: 12px; max-height: none; overflow: visible; border: 0; background: transparent; }
.ar-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-md); padding: 16px 18px 15px; box-shadow: var(--shadow-sm); }
.ar-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ar-avatar { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; background: #fff3d9; color: #a86a06; font-size: 13px; font-weight: 700; }
.ar-avatar--supplier { background: #e8f2ff; color: var(--c-primary-2); }
.ar-name { border: 0; background: none; padding: 0; font: inherit; font-size: 15px; font-weight: 650; color: var(--c-text); text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.ar-name:hover { color: var(--c-primary-2); }
.ar-head-right { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: none; }
.ar-tags { font-size: 11.5px; color: var(--c-text-3); white-space: nowrap; }
.ar-side-switch { display: inline-flex; border: 1px solid var(--c-border-strong); border-radius: 6px; overflow: hidden; }
.ar-side-switch button { border: 0; background: #fff; padding: 3px 9px; font: inherit; font-size: 10.5px; color: var(--c-text-3); cursor: pointer; }
.ar-side-switch button + button { border-left: 1px solid var(--c-border); }
.ar-side-switch button.is-active { background: #eef5ff; color: var(--c-primary); font-weight: 650; }

.ar-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 26px; margin-bottom: 14px; }
.ar-cell { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; padding: 4px 0; border-bottom: 1px dashed #f0f3f8; }
.ar-cell .k { font-size: 12px; color: var(--c-text-3); white-space: nowrap; }
.ar-cell .v { font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; overflow-wrap: anywhere; }
.ar-cell .v.is-zero { color: var(--c-text-3); font-weight: 500; }
.ar-cell .v.is-in { color: var(--c-primary); }
.ar-cell .v.is-out { color: var(--c-red); }
.ar-cell--code .v { color: var(--c-text-2); font-size: 11.5px; font-weight: 500; }
.ar-pay-btns { display: inline-flex; gap: 3px; margin-left: 4px; }
.ar-pay-btns button { width: 20px; height: 20px; padding: 0; border: 1px solid var(--c-border-strong); border-radius: 6px; background: #fff; color: var(--c-text-2); font-size: 13px; line-height: 1; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.ar-pay-btns button:hover { border-color: var(--c-primary-2); color: var(--c-primary); background: #f2f7ff; }

.ar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ar-btn { flex: 1 1 0; min-width: 88px; padding: 8px 10px; border: 1px solid var(--c-border-strong); border-radius: 8px; background: #fff; font: inherit; font-size: 12.5px; color: var(--c-text-2); cursor: pointer; white-space: nowrap; transition: border-color .15s, color .15s, background .15s; }
.ar-btn:hover { border-color: var(--c-primary-2); color: var(--c-primary); }
.ar-btn--primary { border-color: var(--c-blue); color: var(--c-blue); }
.ar-btn--primary:hover { background: #f2f7ff; }
.ar-end { text-align: center; padding: 14px 0 4px; font-size: 12px; color: var(--c-text-3); }
.ar-empty { padding: 44px 16px; text-align: center; background: var(--c-surface); border: 1px dashed var(--c-border-strong); border-radius: var(--r-md); color: var(--c-text-3); font-size: 13px; }

.ar-invoice-list { border: 1px solid var(--c-border); border-radius: 9px; overflow: hidden; }
.ar-invoice-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 13px; }
.ar-invoice-row + .ar-invoice-row { border-top: 1px solid var(--c-border); }

.field-label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; }

@media (max-width: 720px) {
  .ar-summary { padding: 16px 18px 12px; gap: 2px 16px; }
  .ar-sum b { font-size: 18px; }
  .ar-toolbar .search { max-width: none; flex: 1 1 100%; }
  .ar-toolbar .select { flex: 1 1 40%; min-width: 0; }
  .ar-toolbar #ar-count { margin-left: 0 !important; }
  .ar-card { padding: 14px 14px 13px; }
  .ar-fields { gap: 1px 14px; }
  .ar-cell .k { font-size: 11.5px; }
  .ar-cell .v { font-size: 12px; }
  .ar-btn { font-size: 12px; min-width: 0; padding: 8px 4px; }
  /* 手机上单位编号常带「CUS-xxx / SUP-xxx」双编号，两列并排会挤到
     右侧「应收款」标签。让编号独占一行，四笔金额回到整齐的 2×2。 */
  .ar-cell--code { grid-column: 1 / -1; }
  .ar-cell--code .v { white-space: normal; overflow-wrap: anywhere; text-align: right; }
}

@media (max-width: 480px) {
  .ar-fields { gap: 2px 12px; }
  .ar-toolbar .select { flex: 1 1 42%; }
}

/* ===== 财务模块统一页签条：财务中心 / 业绩核算 / 往来应收应付共用 ===== */
.fin-hub {
  display: flex; gap: 6px; align-items: stretch;
  margin: 0 0 16px; padding: 4px;
  background: var(--c-surface-3); border: 1px solid var(--c-border);
  border-radius: var(--r-md); overflow-x: auto; scrollbar-width: none;
}
.fin-hub::-webkit-scrollbar { display: none; }
.fin-hub-tab {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 16px; border-radius: 8px; white-space: nowrap;
  font-size: 13px; font-weight: 600; color: var(--c-text-2);
  transition: background .15s, color .15s, box-shadow .15s;
}
.fin-hub-tab:hover { color: var(--c-primary-2); background: rgba(255, 255, 255, .6); }
.fin-hub-tab.is-active {
  color: #fff; background: var(--c-primary);
  box-shadow: 0 2px 8px rgba(14, 58, 99, .32);
}
@media (max-width: 720px) {
  /* 窄屏不横向裁第 4 个页签，直接 2×2 平铺，四个入口一屏看全 */
  .fin-hub { margin-bottom: 12px; padding: 3px; gap: 4px; flex-wrap: wrap; overflow: visible; }
  .fin-hub-tab { flex: 1 1 calc(50% - 4px); padding: 8px 6px; font-size: 12px; }
}

/* ---------- 管理员：邀请码 / 白名单 / 未送达验证码 ---------- */
.invite-code {
  text-align: center; font-size: 38px; font-weight: 700; letter-spacing: .22em;
  color: var(--c-primary); background: var(--c-surface-2);
  border: 1px dashed var(--c-primary); border-radius: 12px;
  padding: 16px 10px; margin-bottom: 8px; user-select: all;
}
.invite-code--sm { font-size: 18px; letter-spacing: .14em; padding: 6px 10px; margin: 0; border-radius: 8px; flex: none; }
.invite-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  border: 1px solid var(--c-border); border-radius: 9px; padding: 10px 12px;
  background: var(--c-surface-2);
}
@media (max-width: 390px) {
  .invite-code { font-size: 30px; letter-spacing: .16em; }
}
