/* Fira Sans + Fira Code (UI Pro Max 推荐: data-dense dashboard) */
@import url('https://fonts.googleapis.com/css2?family=Fira+Sans:wght@300;400;500;600;700&family=Fira+Code:wght@400;500;600&display=swap');

:root {
  /* 文本与边线 (高对比, WCAG AA) */
  --ink:        #0F172A;   /* slate-900 主文本 */
  --muted:      #475569;   /* slate-600 次文本, 至少 4.5:1 */
  --muted-2:    #64748B;   /* slate-500 辅助 */
  --line:       #D9DAD6;   /* 边线(wa-crm 同系暖灰) */
  --line-soft:  #ECEDEA;   /* 斑马纹(暖灰) */
  --surface:    #FFFFFF;
  --soft:       #F2F3F0;   /* 页面背景(wa-crm 米灰) */

  /* 数据密集 ERP 主色 (#1E40AF 蓝) */
  --primary:    #E97700;   /* 主色(wa-crm 橙, 加深一档保证白字对比) */
  --primary-2:  #FF8400;   /* 高亮(wa-crm 橙) */
  --primary-50: #FFF3E5;   /* 浅橙填充 */

  /* CTA (琥珀) */
  --cta:        #F59E0B;
  --cta-hover:  #D97706;

  /* 状态色 */
  --good:       #16A34A;
  --good-soft:  #DCFCE7;
  --warn:       #EA580C;
  --warn-soft:  #FED7AA;
  --bad:        #DC2626;
  --bad-soft:   #FEE2E2;

  /* 侧栏 (深蓝靛, 区别于内容区) */
  --nav:        #E7E8E5;   /* 浅色侧栏(wa-crm 同款) */
  --nav-soft:   #DBDCD9;
  --nav-ink:    #1A1A1A;
  --nav-muted:  #666666;

  /* 兼容旧变量名 */
  --accent: var(--primary);
  --accent-2: var(--cta);

  --shadow:    0 1px 2px rgba(15,23,42,0.04), 0 4px 12px rgba(15,23,42,0.06);
  --shadow-md: 0 2px 4px rgba(15,23,42,0.05), 0 8px 20px rgba(15,23,42,0.08);
  --shadow-lg: 0 8px 24px rgba(15,23,42,0.10);

  --radius:    8px;
  --radius-lg: 12px;
  --ring:      0 0 0 3px var(--primary-50);

  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* 细滚动条 (内容区浅色 / 侧栏深色) */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: #94A3B8; }
.sidebar ::-webkit-scrollbar-thumb { background-color: #334155; }
.sidebar ::-webkit-scrollbar-thumb:hover { background-color: #475569; }

* {
  box-sizing: border-box;
}

/* 尊重用户的 reduced-motion 偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: "Fira Sans", "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--soft);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 数字 + 单号 用等宽字体 */
.metric strong, code, .mono, td:where([class*="num"]), td:where([class*="amount"]) {
  font-family: "Fira Code", "Consolas", monospace;
  font-variant-numeric: tabular-nums;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
}

.sidebar {
  background: var(--nav);
  color: var(--nav-ink);
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-right: 1px solid rgba(0,0,0,0.08);
  overflow: visible;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  border-radius: var(--radius);
  font-weight: 700;
  letter-spacing: 0;
  font-family: "Fira Code", monospace;
  color: #fff;
  box-shadow: 0 2px 8px rgba(233, 119, 0, 0.3);
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.brand p,
.tenant-picker span,
.tenant-static span,
#viewSubtitle {
  margin: 3px 0 0;
  color: var(--nav-muted);
  font-size: 12px;
}
#viewSubtitle { color: var(--muted); }

.tenant-picker {
  display: grid;
  gap: 6px;
}

.tenant-static {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 6px;
  background: var(--nav-soft);
}

.tenant-static strong {
  font-size: 15px;
}

.tenant-picker select,
.search-box input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
  outline: none;
}

.tenant-picker select {
  border-color: rgba(0,0,0,0.15);
  background: var(--nav-soft);
  color: var(--nav-ink);
}

/* 侧栏用户卡 (深色融入式, 替代旧灰块) */
.user-card {
  order: 99;                       /* 挪到侧栏最底部(改密码/登出) */
  margin: 0;
  margin-top: auto;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius);
  background: var(--nav-soft);
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 4px 10px;
  align-items: center;
  font-size: 13px;
}
.user-avatar {
  grid-row: span 2;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  color: #fff;
  font-weight: 600;
  font-size: 13px;
}
.user-card .user-name {
  color: var(--nav-ink);
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-card .user-name small {
  color: var(--nav-muted);
  font-weight: 400;
  margin-left: 4px;
}
.user-card .user-actions {
  display: flex;
  gap: 10px;
}
.user-card .user-actions button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--nav-muted);
  font-size: 12px;
  cursor: pointer;
  transition: color var(--transition);
}
.user-card .user-actions button:hover { color: var(--nav-ink); text-decoration: underline; text-underline-offset: 3px; }

/* ===== 金蝶式窄栏 rail + 悬停二级浮层 ===== */
.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: visible;
  flex: 1;
}
.rail-group { position: relative; }
.rail-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 2px;
  color: var(--nav-ink);
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
}
.rail-item svg { width: 20px; height: 20px; flex-shrink: 0; stroke-width: 1.8; color: var(--nav-muted); transition: color var(--transition); }
.rail-mini {
  font-size: 10px;
  line-height: 1.1;
  text-align: center;
  color: var(--nav-muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color var(--transition);
}
.rail-item:hover { background: rgba(0,0,0,0.06); }
.rail-item:hover svg, .rail-item:hover .rail-mini { color: var(--nav-ink); }
.rail-group.active > .rail-item { background: var(--primary); }
.rail-group.active > .rail-item svg,
.rail-group.active > .rail-item .rail-mini { color: #fff; }

/* 二级浮层 (悬停或点击展开) */
.rail-flyout {
  display: none;
  position: absolute;
  left: calc(100% + 6px);
  top: 0;
  min-width: 182px;
  max-height: 82vh;
  overflow-y: auto;
  background: var(--nav);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.42);
  padding: 8px;
  z-index: 200;
}
.rail-group:hover > .rail-flyout,
.rail-group.open > .rail-flyout { display: block; }
.flyout-title {
  color: #8E8E89;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 4px 10px 8px;
}
.flyout-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  color: var(--nav-ink);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.flyout-item:hover { background: rgba(255,255,255,0.08); }
.flyout-item.active { background: var(--primary); color: #fff; font-weight: 600; }
.flyout-sep { border-top: 1px solid rgba(255,255,255,0.12); margin-top: 6px; padding-top: 10px; }

/* 手机抽屉: 一级横向 + 二级内联展开(点击, 不用浮层, 解决浮层难用) */
@media (max-width: 1180px) {
  .rail-item { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 16px; }
  .rail-item svg { width: 19px; height: 19px; }
  .rail-mini { font-size: 14px; max-width: none; text-align: left; }
  .rail-flyout {
    position: static; left: auto; top: auto;
    min-width: 0; max-height: none;
    background: transparent; border: 0; box-shadow: none;
    padding: 2px 0 6px; margin-left: 18px;
  }
  .flyout-title { display: none; }
  .flyout-item { padding: 10px 14px; }
}

/* 窄栏: 品牌只留标记 / 隐藏租户块 / 用户卡只留头像(悬停弹改密登出) */
.brand { justify-content: center; min-height: 40px; }
.brand > div { display: none; }
.tenant-static { display: none; }
.user-card {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 8px 4px;
  position: relative;
  gap: 6px;
}
.user-card .user-name { display: none; }
.user-card .user-actions {
  position: absolute;
  left: calc(100% + 6px);
  bottom: 0;
  flex-direction: column;
  gap: 8px;
  background: var(--nav);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.42);
  padding: 10px 14px;
  display: none;
  z-index: 200;
  white-space: nowrap;
}
/* 改密/登出已移入"系统管理"菜单, 用户卡不再悬停弹浮层 */

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* 顶部多标签页 (阶段1: 浅色非固定; 阶段2 统一深色+固定) */
.tab-strip {
  position: sticky;
  top: 0;
  z-index: 11;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  overflow-x: auto;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  padding: 8px 14px 0;
  min-height: 42px;
  scrollbar-width: thin;
}
.tab-strip:empty { display: none; }
.tabx {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 9px 9px 0 0;
  background: #eef1f5;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  font-size: 13px;
  max-width: 200px;
  transition: background var(--transition), color var(--transition);
}
.tabx:hover { background: #e2e7ee; }
.tabx.active {
  background: #fff;
  color: var(--primary);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--primary);
}
.tabx-label { overflow: hidden; text-overflow: ellipsis; }
.tabx-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  color: var(--muted);
  flex-shrink: 0;
}
.tabx-close:hover { background: rgba(0,0,0,0.12); color: #b91c1c; }
@media (max-width: 768px) {
  .tab-strip { position: static; }
  .topbar { top: 0; }
}

.topbar {
  position: sticky;
  top: 42px;
  z-index: 10;
  min-height: 70px;
  background: rgba(255,255,255,0.86);
  backdrop-filter: blur(10px) saturate(1.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  border-bottom: 1px solid var(--line);
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.actions {
  display: flex;
  gap: 8px;
}

.icon-button,
.pager button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.primary-button {
  height: 36px;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.primary-button:hover {
  background: #C76600;
  border-color: #C76600;
  box-shadow: 0 2px 8px rgba(233, 119, 0, 0.25);
}

.primary-button:focus-visible {
  outline: 2px solid var(--primary-2);
  outline-offset: 2px;
}

/* CTA variant (橙) */
.primary-button.cta {
  background: var(--cta);
  border-color: var(--cta);
}
.primary-button.cta:hover {
  background: var(--cta-hover);
  border-color: var(--cta-hover);
}

.icon-button:hover,
.pager button:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-50);
}
.icon-button:focus-visible,
.pager button:focus-visible {
  outline: 2px solid var(--primary-2);
  outline-offset: 1px;
}

.dashboard,
.table-view {
  padding: 18px 22px 28px;
  overflow: auto;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 14px 14px 16px;
  box-shadow: var(--shadow);
  min-height: 80px;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.metric:hover {
  border-color: var(--primary-2);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 500;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* 指标卡图标角标 (右上) */
.metric .metric-ico {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-size: 16px;
  background: var(--primary-50);
  color: var(--primary);
}
.metric .metric-ico svg { width: 18px; height: 18px; stroke-width: 1.8; }

/* 指标卡强调色 (左侧色条 + 图标同色), 替代旧 inline border-left */
.metric.accent-blue   { box-shadow: inset 3px 0 0 var(--primary-2), var(--shadow); }
.metric.accent-green  { box-shadow: inset 3px 0 0 var(--good), var(--shadow); }
.metric.accent-amber  { box-shadow: inset 3px 0 0 var(--cta), var(--shadow); }
.metric.accent-orange { box-shadow: inset 3px 0 0 var(--warn), var(--shadow); }
.metric.accent-red    { box-shadow: inset 3px 0 0 var(--bad), var(--shadow); }
.metric.accent-green  .metric-ico { background: var(--good-soft); color: var(--good); }
.metric.accent-amber  .metric-ico { background: #FEF3C7; color: var(--cta-hover); }
.metric.accent-orange .metric-ico { background: var(--warn-soft); color: var(--warn); }
.metric.accent-red    .metric-ico { background: var(--bad-soft); color: var(--bad); }
.metric.accent-green strong  { color: var(--good); }
.metric.accent-red strong    { color: var(--bad); }

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface);
}

.panel-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.mini-table,
.menu-tree {
  padding: 8px 12px 12px;
}

.mini-row,
.tree-row {
  display: grid;
  grid-template-columns: 132px 1fr 90px;
  gap: 10px;
  min-height: 34px;
  align-items: center;
  border-bottom: 1px solid #edf2f4;
  font-size: 13px;
}

.mini-row:last-child,
.tree-row:last-child {
  border-bottom: 0;
}

.mini-row b {
  font-weight: 600;
}

.mini-row.clickable {
  cursor: pointer;
}
.mini-row.clickable:hover {
  background: #f5f9fa;
}

/* 本月概况: 5 列 metric */
.month-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
}
@media (max-width: 1100px) {
  .month-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.mini-row span,
.tree-row span {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-tree {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 14px;
}

.tree-row {
  grid-template-columns: 1fr;
  padding-left: var(--indent);
}

.tree-row.level-1 {
  color: var(--accent);
  font-weight: 700;
}

.tree-row.level-2 {
  font-weight: 600;
}

.table-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.search-box {
  width: min(480px, 100%);
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding-left: 10px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-50);
}

.search-box input {
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  height: 36px;
}

.search-box span {
  color: var(--muted);
  font-size: 16px;
}

.pager {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pager span {
  min-width: 120px;
  text-align: center;
  color: var(--muted);
}

.table-wrap {
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* 表格下方的分页条 (右对齐) */
.pager-bar {
  display: flex;
  justify-content: flex-end;
  padding: 14px 0 4px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 960px;
}

/* 列表主表格: 列宽按内容收缩, 不强行铺满容器 (空列不再被撑宽) */
#dataTable { width: auto; min-width: 0; }

th,
td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  background: var(--soft);
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  z-index: 1;
  border-bottom: 2px solid var(--line);
}

/* 可排序表头 */
th.th-sort {
  cursor: pointer;
  user-select: none;
  position: sticky;
  transition: color var(--transition), background var(--transition);
}
th.th-sort:hover {
  color: var(--primary);
  background: var(--primary-50);
}
th.th-active {
  color: var(--primary);
  background: var(--primary-50);
}
.th-arrow {
  color: var(--primary);
  font-weight: 700;
  margin-left: 2px;
}
th .th-label {
  display: inline-block;
}

/* 列拖把手 */
.th-resize {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 5px;
  cursor: col-resize;
  user-select: none;
  z-index: 3;
  background: transparent;
  transition: background var(--transition);
}
.th-resize:hover {
  background: var(--primary-2);
}

/* 列拖换位置 */
th[draggable="true"] { cursor: grab; }
th[draggable="true"]:active { cursor: grabbing; }
th.th-dragging {
  opacity: 0.5;
  background: var(--primary-50);
}
th.th-drop-target {
  border-left: 3px solid var(--primary) !important;
  background: var(--primary-50);
}

/* td 文本超出省略号 (列宽紧时不撑大) */
td {
  overflow: hidden;
  text-overflow: ellipsis;
}

td {
  color: var(--ink);
}

/* 斑马纹 (奇数行更白) + 行 hover 高亮 */
tbody tr:nth-child(even) {
  background: rgba(241, 245, 249, 0.3);
}
tbody tr {
  transition: background var(--transition);
}
tbody tr:hover {
  background: var(--primary-50) !important;
}

/* 数字列右对齐 + 等宽数字 (识别数字格式: 金额/数量/单价/合计/单数 等) */
td:where([class*="num"]),
th:where([class*="num"]) {
  text-align: right;
}

.empty,
.loading {
  padding: 26px;
  color: var(--muted);
}

/* 状态胶囊 (单据状态列) */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}
.chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.chip-ok      { background: var(--good-soft); color: #15803D; }
.chip-pending { background: #FEF3C7; color: #B45309; }
.chip-bad     { background: var(--bad-soft); color: #B91C1C; }
.chip-muted   { background: var(--line-soft); color: var(--muted); }

.toast {
  position: fixed;
  z-index: 99999;   /* 高于所有 modal(120)/弹层(~10002), 否则弹窗内的提示被盖住看不见 */
  right: 20px;
  bottom: 20px;
  max-width: min(460px, calc(100vw - 40px));
  background: var(--nav);
  color: #fff;
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  border-left: 3px solid var(--primary-2);
  animation: toast-in 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes toast-in {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.hidden {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px) saturate(1.2);
  -webkit-backdrop-filter: blur(6px) saturate(1.2);
  padding: 24px;
  z-index: 120;   /* 高于吸顶 topbar(50) 与手机抽屉按钮以下层 */
  animation: modal-fade 200ms ease;
}
@keyframes modal-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.dialog {
  width: min(1280px, 96vw);
  max-height: min(900px, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
  overflow: hidden;
  animation: dialog-pop 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.dialog.form-modal { width: min(820px, 96vw); }
@keyframes dialog-pop {
  from { transform: scale(0.96); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.dialog-body table th {
  background: #f6f8fa;
  position: sticky;
  top: 0;
  z-index: 1;
}

.dialog-body table th,
.dialog-body table td {
  padding: 7px 10px;
  white-space: nowrap;
}

.dialog-body table tbody tr:nth-child(even) td {
  background: #fafbfc;
}

.dialog-head,
.dialog-foot {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}
.dialog-head { background: var(--soft); }
.dialog-foot { background: #fff; }

.dialog-foot {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
}

.dialog-foot button:not(.primary-button) {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 0 16px;
  cursor: pointer;
  font-size: 13px;
  transition: background var(--transition), border-color var(--transition);
}
.dialog-foot button:not(.primary-button):hover {
  background: var(--soft);
  border-color: var(--muted-2);
}

.dialog h3 {
  margin: 0;
  font-size: 17px;
}

.dialog-body {
  padding: 16px;
  overflow: auto;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--muted);
  font-size: 12px;
}

.field input,
.field textarea,
.field select,
.line-table input,
.tenant-picker select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  outline: 0;
  font-size: 13px;
  background: #fff;
  color: var(--ink);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field input:focus,
.field textarea:focus,
.field select:focus,
.line-table input:focus,
.line-table select:focus,
.filter-bar select:focus,
.filter-bar input:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
}

/* 统一自绘下拉箭头 (替代原生灰箭头) */
.field select,
.line-table select.lv,
.filter-bar .fb-item select,
.picker-cols select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 26px;
}
.field span {
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field textarea {
  resize: vertical;
}

.line-editor {
  margin-top: 16px;
}

.line-editor h4 {
  margin: 0 0 10px;
}

.line-table {
  width: 100%;
  min-width: 860px;
}

.delivery-table {
  min-width: 1120px;
}

.line-table th,
.line-table td {
  padding: 7px;
}

.line-table button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.line-table .del-cell { white-space: nowrap; }
.line-table .line-copy { margin-right: 4px; font-size: 15px; }
#lineTable td.del-cell { overflow: visible; padding-left: 4px; padding-right: 4px; }
/* 下单明细按列宽精排: 分类/形状窄·规格/货号宽·单位/数量/单价/金额小·库存末列 */
#lineTable { table-layout: fixed; }
#lineTable td input, #lineTable td select { width: 100%; min-width: 0; box-sizing: border-box; }
#lineTable td, #lineTable th { overflow: hidden; text-overflow: ellipsis; }

.row-action {
  height: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--primary);
  padding: 0 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.row-action:hover {
  background: var(--primary-50);
  border-color: var(--primary);
}

.row-action:focus-visible {
  outline: 2px solid var(--primary-2);
  outline-offset: 1px;
}

.row-action.danger {
  border-color: var(--line);
  color: var(--bad);
}

.row-action.danger:hover {
  background: var(--bad-soft);
  border-color: var(--bad);
}

.jzbh-cell {
  display: flex;
  gap: 4px;
  align-items: center;
}

.jzbh-cell input {
  flex: 1;
  min-width: 0;
}

.pick-btn {
  flex: 0 0 auto;
  width: 26px;
  height: 30px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: #fff;
  color: var(--accent);
  cursor: pointer;
  line-height: 1;
}

.pick-btn:hover {
  background: var(--primary-50);
}

.picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.picker-overlay.hidden {
  display: none;
}

.picker-panel {
  width: min(720px, 92vw);
  max-height: 86vh;
  background: #fff;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.picker-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #eef0f2;
}

.picker-head h3 {
  margin: 0;
  font-size: 16px;
}

.picker-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 14px 18px;
}

.picker-cols label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: #64748b;
  gap: 4px;
}

.picker-cols select {
  height: 34px;
  border: 1px solid #d7dde3;
  border-radius: 6px;
  padding: 0 8px;
  font-size: 13px;
}

.picker-items {
  padding: 6px 18px 18px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pk-item {
  text-align: left;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
}

.pk-item:hover {
  background: var(--primary-50);
  border-color: var(--accent);
}

.picker-items .empty {
  color: #94a3b8;
  padding: 10px 0;
}

.line-table select.lv,
.line-table input.lv {
  width: 100%;
  min-width: 92px;
  height: 32px;
  border: 1px solid #d7dde3;
  border-radius: 6px;
  padding: 0 6px;
  font-size: 12px;
  background: #fff;
}

.line-table .lv-dw {
  width: 100%;
  text-align: center;
  background: #f6f8fa;
}

.line-table .stock-cell {
  text-align: center;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

.cust-order-box {
  margin-top: 14px;
}

.cust-order-box h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--primary);
}

.cust-order-box .cust-order-empty {
  color: #94a3b8;
  font-size: 13px;
  padding: 6px 0;
}

.cust-order-box .co-qty {
  width: 90px;
  height: 30px;
  border: 1px solid #d7dde3;
  border-radius: 6px;
  padding: 0 6px;
}

.tab-bar {
  display: flex;
  gap: 6px;
  margin: 0 0 10px;
}

.tab-bar.hidden { display: none; }

.tab-bar .tab {
  height: 34px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-bottom: 2px solid transparent;
  background: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.tab-bar .tab:hover {
  color: var(--primary);
  background: var(--primary-50);
}

.tab-bar .tab.active {
  color: var(--primary);
  border-color: var(--line);
  border-bottom-color: var(--primary);
  font-weight: 600;
  background: #fff;
}

.ledger-total td {
  font-weight: 600;
  background: var(--soft);
  color: var(--ink);
}

/* 多选标签 (产品需求) */
.tags-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 6px 8px;
  padding: 2px 0;
}
@media (max-width: 900px) { .tags-grid { grid-template-columns: repeat(3, 1fr); } }
.tag-check {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
  background: #fff;
  transition: border-color var(--transition), background var(--transition);
  user-select: none;
}
.tag-check:hover { border-color: var(--primary); background: var(--primary-50); }
.tag-check input { margin: 0; cursor: pointer; }
.tag-check input:checked ~ span {
  color: var(--primary);
  font-weight: 600;
}
.tag-check:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-50);
}

.custom-view.hidden { display: none; }

.skumap-top {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.skumap-top .field { min-width: 360px; }

.skumap-top input {
  height: 36px;
  border: 1px solid #d7dde3;
  border-radius: 6px;
  padding: 0 10px;
  width: 100%;
}

.skumap-info { color: var(--primary); font-weight: 600; }

.skumap-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.skumap-panel {
  border: 1px solid #e6eaee;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.skumap-panel h4 { margin: 0 0 10px; }

.skumap-q {
  width: 100%;
  height: 34px;
  border: 1px solid #d7dde3;
  border-radius: 6px;
  padding: 0 10px;
  margin-bottom: 10px;
}

.skumap-list {
  max-height: 60vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skumap-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border: 1px solid #eef0f2;
  border-radius: 6px;
  font-size: 13px;
}

.skumap-row i { color: #64748b; font-style: normal; font-size: 12px; }
.skumap-list .empty, .skumap-list .loading { color: #94a3b8; padding: 8px; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.filter-bar.hidden { display: none; }
/* 筛选区: 框与按钮统一 40px 高、垂直居中, 整排对齐 */
.filter-bar .fb-item, .filter-bar .fb-dir, .filter-bar .fb-reset { box-sizing: border-box; height: 40px; }

.filter-bar .fb-item {
  /* wa-crm 框框风: 标签+控件装进一个圆角盒, 聚焦亮橙圈 */
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px 10px;
  transition: border-color .15s, box-shadow .15s;
}
.filter-bar .fb-item:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(233, 119, 0, .12);
}
.filter-bar .fb-item span { white-space: nowrap; font-weight: 600; }

.filter-bar .fb-item select,
.filter-bar .fb-item input {
  height: 30px;
  min-width: 96px;
  border: none;
  border-radius: 0;
  padding: 0 2px;
  font-size: 13px;
  background: transparent;
  outline: none;
}
.filter-bar .fb-item input.fb-num { min-width: 56px; width: 56px; }

.filter-bar .fb-dir,
.filter-bar .fb-reset {
  height: 40px;
  border: 1px solid var(--primary);
  border-radius: 10px;
  background: var(--surface);
  color: var(--primary);
  padding: 0 14px;
  cursor: pointer;
  font-weight: 600;
  transition: all .15s;
}

.filter-bar .fb-reset {
  border-color: var(--line);
  color: var(--muted);
  font-weight: 400;
}

.filter-bar .fb-dir:hover { background: var(--primary-50); }
.filter-bar .fb-reset:hover { background: var(--soft); }

.filter-bar .fb-summary {
  height: 32px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  padding: 0 14px;
  cursor: pointer;
}

.filter-bar .fb-summary:hover { opacity: .9; }

.attach-list {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.attach-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-width: 220px;
  font-size: 12px;
  word-break: break-all;
}

.attach-item img {
  max-width: 200px;
  max-height: 200px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  object-fit: contain;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-grid,
  .split,
  .menu-tree {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar,
  .table-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard,
  .table-view {
    padding: 14px;
  }
}

/* 产品图缩略图与编辑预览 */
.cell-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); cursor: pointer; }
/* 长文本单元格: 默认2行截断, 点击展开/收起 */
.cell-long { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 360px; white-space: normal; cursor: pointer; line-height: 1.4; }
.cell-long.expanded { -webkit-line-clamp: unset; max-width: 480px; }
.field-image .img-preview { margin-top: 6px; }
.field-image .img-preview img { max-width: 120px; max-height: 120px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.field-image .img-preview em { color: var(--muted); font-size: 12px; }

/* ===== 登录页 (2026-06 现代化) ===== */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(59,130,246,0.18), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(233,119,0,0.22), transparent 55%),
    var(--nav);
}
.login-card {
  width: min(380px, calc(100vw - 48px));
  background: #fff;
  border-radius: 16px;
  padding: 32px 30px 26px;
  box-shadow: 0 24px 80px rgba(2, 6, 23, 0.45);
  animation: dialog-pop 240ms cubic-bezier(0.4, 0, 0.2, 1);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.login-brand .brand-mark { width: 44px; height: 44px; font-size: 15px; }
.login-brand h3 { margin: 0; font-size: 19px; letter-spacing: -0.01em; color: var(--ink); }
.login-brand p { margin: 2px 0 0; font-size: 12px; color: var(--muted-2); }
.login-card label { display: block; margin-bottom: 14px; }
.login-card label span {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 5px;
}
.login-card input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  font-size: 14px;
  outline: 0;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.login-card input:focus { border-color: var(--primary); box-shadow: var(--ring); }
.login-err { color: var(--bad); font-size: 13px; margin-bottom: 10px; min-height: 18px; }
.login-submit {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(30, 64, 175, 0.35);
  transition: filter var(--transition), transform var(--transition), box-shadow var(--transition);
}
.login-submit:hover { filter: brightness(1.08); }
.login-submit:active { transform: translateY(1px); }
.login-hint { margin-top: 14px; color: var(--muted-2); font-size: 12px; line-height: 1.5; }


/* ===== 手机端适配 (2026-06-12): 抽屉侧栏 + 表格横滑 + 弹窗全屏 ===== */
.nav-toggle, .nav-backdrop { display: none; }
@media (max-width: 768px) {
  .app-shell { grid-template-columns: 1fr; }
  /* 侧栏 → 抽屉 */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: min(82vw, 320px); z-index: 150;
    transform: translateX(-105%); transition: transform .25s ease;
    overflow-y: auto; box-shadow: 12px 0 40px rgba(0,0,0,.35);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .nav { grid-template-columns: 1fr; }
  .nav-toggle {
    display: flex; align-items: center; justify-content: center;
    position: fixed; left: 14px; bottom: 18px; width: 52px; height: 52px;
    border-radius: 50%; z-index: 160; border: none; cursor: pointer;
    background: var(--primary); color: #fff; font-size: 22px;
    box-shadow: 0 8px 24px rgba(233,119,0,.45);
  }
  body.nav-open .nav-backdrop {
    display: block; position: fixed; inset: 0; z-index: 140;
    background: rgba(15,23,42,.5);
  }
  /* 顶栏吸顶 + 紧凑 */
  .topbar { position: sticky; top: 0; z-index: 50; background: var(--soft); padding: 10px 12px; }
  .dashboard, .table-view { padding: 10px; }
  /* 表格: 横向滑动 + 紧凑 */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #dataTable th, #dataTable td { padding: 8px; font-size: 13px; white-space: nowrap; }
  /* 筛选条: 小胶囊标签, 点开即下拉选取 (仅手机) */
  .filter-bar { flex-wrap: wrap; gap: 6px; overflow: visible; padding: 8px 10px; }
  .filter-bar .fb-item {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px;
    border-radius: 10px;
    padding: 2px 10px; margin: 0;
  }
  .filter-bar .fb-item span { font-size: 11px; color: var(--muted); white-space: nowrap; }
  .filter-bar .fb-item select,
  .filter-bar .fb-item input {
    border: none; background: transparent; padding: 4px 2px;
    width: auto; min-width: 52px; max-width: 110px; min-height: 0;
  }
  .filter-bar .fb-item input[type="date"] { max-width: 128px; }
  .fb-dir, .fb-reset, .fb-summary { border-radius: 10px; padding: 4px 14px; min-height: 38px; flex: 0 0 auto; }
  /* 弹窗全屏 */
  .modal { padding: 0; }
  .modal .dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; display: flex; flex-direction: column; }
  .modal .dialog-body { flex: 1; overflow-y: auto; }
  /* 触控目标 + 防 iOS 聚焦放大(字号≥16px 不触发) */
  input, select, textarea { font-size: 16px; }
  .row-action, .pager button, .fb-dir, .fb-reset, .icon-button { min-height: 40px; min-width: 40px; }
  .actions { flex-wrap: wrap; gap: 8px; }
}

@media (max-width: 768px) {
  /* 表单: 一行一个字段, 不再三列挤压 */
  .form-grid, .modal .dialog-body .form-grid { grid-template-columns: 1fr !important; gap: 10px; }
  .form-grid > * { grid-column: auto !important; }  /* 压平 span 3 等跨列内联样式, 否则会撑出隐式列 */
  .tags-grid, .modal .dialog-body .tags-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px; }
  .modal .dialog-body { padding: 12px; }
  .modal .dialog-head, .modal .dialog-foot { padding: 10px 12px; }
}


/* ===== wa-crm 同款风格补丁 (2026-06-12): 大圆角 + 柔和阴影 ===== */
.metric-card, .panel, .table-wrap, .filter-bar, .dialog {
  border-radius: 14px;
}
.metric-card, .panel {
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
@media (max-width: 768px) {
  .nav-toggle { box-shadow: 0 8px 24px rgba(233,119,0,.45); }
}


/* ===== 客户档案标签墙 (仿 wa-crm, 2026-06-12) ===== */
.facet-board { display: flex; flex-direction: column; gap: 0; padding: 4px 12px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; }
.facet-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--ink); user-select: none; }
.facet-head .facet-on { font-style: normal; background: var(--primary); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: 11px; margin-left: 4px; }
.facet-head .facet-caret { color: var(--primary); }
.facet-tools { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.facet-tools select { max-width: 180px; height: 28px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 12px; padding: 0 6px; }
.facet-tools button { height: 28px; }
.facet-bulk { display: inline-flex; align-items: center; gap: 6px; cursor: default; }
.facet-bulk select { height: 28px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 12px; padding: 0 6px; }
.facet-bulk button { height: 28px; }
.facet-body { display: flex; flex-direction: column; gap: 8px; }
.facet-body.hidden { display: none; }
.facet-row { display: flex; gap: 8px; align-items: center; }
.facet-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1; min-width: 0; }
.facet-dim { flex: 0 0 32px; font-size: 12px; color: var(--muted); font-weight: 600; }
@media (max-width: 768px) {
  /* 手机: 每个维度一行内左右滑, 不叠行 */
  .facet-head { align-items: flex-start; gap: 8px; }
  .facet-tools { flex-wrap: wrap; justify-content: flex-end; }
  .facet-tools select { max-width: 138px; }
  .facet-chips { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .facet-chips::-webkit-scrollbar { display: none; }
  .facet-chip { flex: 0 0 auto; }
}
.facet-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 999px; cursor: pointer; user-select: none;
  background: var(--soft); border: 1px solid transparent; font-size: 13px; color: var(--ink);
  transition: all .15s;
}
.facet-chip small { color: var(--muted); font-family: "Fira Code", monospace; font-size: 11px; }
.facet-chip:hover { border-color: var(--line); }
.facet-chip.active { background: var(--primary); color: #fff; box-shadow: 0 2px 6px rgba(233,119,0,.3); }
.facet-chip.active small { color: rgba(255,255,255,.85); }
.facet-chip.muted { cursor: default; opacity: .65; }


/* ===== 收/付款 记账App式简洁表单 (2026-06-12) ===== */
.fund-clean { display: flex; flex-direction: column; gap: 0; }
.fund-clean .fc-row {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 4px; border-bottom: 1px solid var(--line-soft);
}
.fund-clean .fc-label { flex: 0 0 64px; font-size: 13px; color: var(--muted); }
.fund-clean .fc-row input {
  flex: 1; border: none; background: transparent; padding: 2px 0;
  font-size: 16px; color: var(--ink); outline: none; min-width: 0;
}
.fund-clean .fc-row input:focus { box-shadow: none; }
.fund-clean .fc-partner input.fc-code { flex: 0 0 110px; color: var(--muted); text-align: right; }
.fund-clean .fc-amount-card {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 4px 14px; border-bottom: 1px solid var(--line-soft);
}
.fund-clean .fc-amount {
  flex: 1; border: none; background: transparent; outline: none;
  font-size: 36px !important; font-weight: 700; color: var(--ink); min-width: 0;
  font-family: "Fira Code", monospace;
}
.fund-clean .fc-amount::placeholder { color: #C8CCC9; }
.fund-clean .fc-attach {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 76px; height: 56px; border: 1px dashed var(--line); border-radius: 10px;
  font-size: 12px; color: var(--muted); cursor: pointer; gap: 2px; overflow: hidden;
}
.fund-clean .fc-attach { position: relative; }
.fund-clean .fc-attach input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.fund-clean .fc-attach.has-files { border-color: var(--primary); color: var(--primary); }


/* ===== 消息铃铛 + 手机工作台英雄卡 (2026-06-12) ===== */
#notifButton { position: relative; }
.notif-badge {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px;
  border-radius: 999px; background: #DC2626; color: #fff; font-size: 10px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px; font-weight: 700;
}
.notif-line { display: flex; gap: 10px; padding: 9px 2px; border-bottom: 1px dashed var(--line-soft); font-size: 13px; align-items: baseline; }
.notif-line .nt-time { flex: 0 0 auto; color: var(--muted); font-size: 11px; font-family: "Fira Code", monospace; }
.notif-line .nt-text { flex: 1; }
.mobile-hero { display: none; }
@media (max-width: 768px) {
  .mobile-hero {
    display: block; margin: 0 0 12px; padding: 18px 16px 16px;
    background: linear-gradient(135deg, #FF8C1A 0%, #E97700 60%, #D96A00 100%);
    border-radius: 16px; color: #fff; box-shadow: 0 8px 24px rgba(233,119,0,.3);
  }
  .mobile-hero .mh-label { font-size: 12px; opacity: .9; }
  .mobile-hero .mh-big { font-size: 34px; font-weight: 800; font-family: "Fira Code", monospace; margin: 2px 0 10px; }
  .mobile-hero .mh-cols { display: flex; gap: 24px; }
  .mobile-hero .mh-cols div span { display: block; font-size: 11px; opacity: .85; }
  .mobile-hero .mh-cols div strong { font-size: 16px; font-family: "Fira Code", monospace; }
}


/* ===== 帐王式手机壳: 底部Tab + 左上▦ + 右下✏️ (2026-06-12, 仅手机) ===== */
.nav-grid-btn, .mobile-tabs, .pen-fab, .quick-add { display: none; }
@media (max-width: 768px) {
  .nav-toggle { display: none; }   /* 旧左下☰圆钮退役, 改 左上▦ + 底部"菜单"Tab */
  .nav-grid-btn {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line);
    background: var(--surface); font-size: 18px; color: var(--ink); flex: 0 0 auto;
  }
  /* 顶栏: 左上▦ + 标题一行, 动作钮换行; 🔔 钉右上角 */
  .topbar { position: sticky; display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
  .topbar > div:first-of-type { flex: 1; min-width: 0; padding-right: 44px; }
  .topbar .actions { width: 100%; justify-content: flex-start; }
  #notifButton { position: absolute; top: 10px; right: 12px; }
  #refreshButton { position: absolute; top: 10px; right: 58px; }
  #csAddBtn { position: absolute; top: 10px; right: 104px; }
  #addButton { position: absolute; top: 10px; right: 104px; width: 40px; height: 40px; min-width: 40px; padding: 0; font-size: 0; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); box-shadow: none; display: inline-flex; align-items: center; justify-content: center; }
  #addButton::before { content: "+"; font-size: 24px; line-height: 1; }
  #addButton:hover { background: var(--soft); border-color: var(--line); }
  .main { padding-bottom: 70px; }   /* 给底部Tab留位 */
  .mobile-tabs {
    display: flex; position: fixed; left: 10px; right: 10px; bottom: 10px; height: 58px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
    box-shadow: 0 10px 30px rgba(0,0,0,.15); z-index: 90; overflow: hidden;
  }
  .mobile-tabs button {
    flex: 1; border: none; background: transparent; font-size: 11px; color: var(--muted);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  }
  .mobile-tabs button span { font-size: 18px; line-height: 1; }
  .mobile-tabs button.active { color: var(--primary); font-weight: 700; }
  .pen-fab {
    display: flex; align-items: center; justify-content: center;
    position: fixed; right: 14px; bottom: 84px; width: 54px; height: 54px;
    border-radius: 50%; border: none; z-index: 95; font-size: 22px;
    background: var(--primary); color: #fff; box-shadow: 0 8px 24px rgba(233,119,0,.45);
  }
  .quick-add {
    position: fixed; right: 14px; bottom: 148px; z-index: 95;
    display: flex; flex-direction: column; gap: 12px; align-items: flex-end;
  }
  .quick-add.hidden { display: none; }
  .quick-add button {
    display: flex; align-items: center; gap: 10px; border: none; cursor: pointer;
    background: var(--surface); border-radius: 999px; padding: 6px 14px 6px 6px;
    font-size: 14px; color: var(--ink); box-shadow: 0 6px 20px rgba(0,0,0,.18);
  }
  .quick-add button i {
    width: 38px; height: 38px; border-radius: 50%; color: #fff; font-style: normal;
    display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700;
  }
}

#filterToggle { display: none; }
/* 操作列「⋯ 更多」按钮 + 浮层菜单 (fixed 定位, JS 算坐标, 不被表格 overflow 裁) */
.row-more-btn { font-weight: 700; letter-spacing: 1px; }
.row-more-menu { z-index: 60; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-md, 0 6px 18px rgba(0,0,0,.12)); padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 132px; }
.row-more-menu .row-action { width: 100%; text-align: left; margin: 0; }
.row-more-menu.hidden { display: none; }
/* —— 移动端列表页紧凑化: 缩图标/缩框/收紧留白, 让数据多露出来 —— */
@media (max-width: 768px) {
  .topbar { padding: 7px 12px; gap: 8px; }
  .topbar h2 { font-size: 18px; }
  #viewSubtitle { font-size: 11.5px; }
  .icon-button, #addButton, #notifButton, #refreshButton { width: 36px; height: 36px; min-width: 36px; min-height: 36px; }
  .table-tools { margin-bottom: 7px; }
  .search-box { padding: 1px 10px; }
  .search-box input { padding: 7px 4px; font-size: 14px; }
  .facet-board { padding: 2px 10px 8px; margin-bottom: 8px; border-radius: 12px; }
  .facet-head { padding: 6px 0; font-size: 12.5px; }
  .facet-body { gap: 6px; }
  .filter-bar { padding: 7px 9px; gap: 7px; margin-bottom: 8px; }
  .filter-bar .fb-item { padding: 3px 8px; }
  .filter-bar .fb-item select, .filter-bar .fb-item input { height: 28px; min-width: 76px; font-size: 12.5px; }
  .filter-bar .fb-dir, .filter-bar .fb-reset { height: 32px; }
  .field input, .field select, .field textarea { padding: 7px 9px; font-size: 13px; }
  .field span { font-size: 11.5px; }
  #dataTable th, #dataTable td { padding: 7px 8px; font-size: 12.5px; }
  .pager-bar { padding: 7px 0; }
  .pager select, .pager button { height: 34px; min-height: 34px; min-width: 34px; }
  /* 筛选区默认折叠, 点「筛选」展开 */
  .table-tools { display: flex; gap: 8px; align-items: center; }
  .table-tools .search-box { flex: 1; width: auto; min-width: 0; }
  #filterToggle { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 10px; padding: 0 13px; height: 38px; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; flex: none; }
  #filterToggle.on { background: var(--primary-50); color: var(--primary); border-color: var(--primary); }
  .filter-bar:not(.hidden), .facet-board:not(.hidden) { display: none; }
  body.show-filters .filter-bar:not(.hidden) { display: flex; }
  body.show-filters .facet-board:not(.hidden) { display: flex; }
}

/* === 搜索框移入顶栏(仅列表视图显示) === */
#searchBox { display: none; width: clamp(150px, 18vw, 240px); }
.main:has(#tableView:not(.hidden)) #searchBox { display: grid; }
@media (max-width: 768px) {
  /* mobile: 搜索框移到第二行(actions 内)占满整行, 不再挤第一行把标题压成竖排 */
  #searchBox { position: static; width: 100%; height: 40px; }
  .main:has(#tableView:not(.hidden)) .topbar > div:first-of-type { padding-right: 148px; }
}

/* 下单明细标题行: 标题 + 搜款式主入口 */
.line-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.line-head h4 { margin: 0; }
/* 客户订单弹窗内 AI 识别订货单区 */
.ai-draft-box { background: var(--primary-50, #FFF6EC); border: 1px solid var(--primary, #E97700); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.ai-draft-hint { font-size: 12.5px; color: var(--ink); margin-bottom: 8px; line-height: 1.5; }
.ai-draft-box textarea { width: 100%; box-sizing: border-box; min-height: 46px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 13px; resize: vertical; }
.ai-draft-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.ai-draft-fname { font-size: 12px; color: var(--muted); }
.ai-draft-box.dragover { border-style: dashed; border-width: 2px; background: var(--primary-100, #FFE0C2); }

/* === 搜款式选款器: 复用 picker-*, 顶部搜索框 + 货号列表两行信息 === */
#skuSearchInput { flex: 1; height: 40px; margin-right: 10px; padding: 0 12px; font-size: 15px; border: 1px solid #d7dde3; border-radius: 8px; }
.pk-item .pk-code { display: block; font-weight: 600; font-size: 14.5px; color: var(--ink, #1e293b); }
.pk-item .pk-meta { display: block; font-size: 12px; color: #64748b; margin-top: 2px; }
.pk-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pk-info { display: flex; flex-direction: column; min-width: 0; }
.pk-check { color: var(--primary, #E97700); font-weight: 700; font-size: 13px; white-space: nowrap; }
.pk-item.picked { background: var(--primary-50, #FFF3E5); border-color: var(--primary, #E97700); }
.picker-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid #eef0f2; }
.pk-count { font-size: 13px; color: #64748b; }
#skuPickDone { padding: 9px 22px; }

/* 💬 问数据 (P11) */
.ask-panel { border: 1px solid var(--primary-50, #FFE3C2); }
.ask-row { display: flex; gap: 10px; padding: 4px 0 2px; }
.ask-row input { flex: 1; padding: 11px 14px; border: 1px solid #d8dce0; border-radius: 8px; font-size: 14px; }
.ask-row input:focus { outline: none; border-color: var(--primary, #E97700); }
.ask-row button { padding: 11px 26px; background: var(--primary, #E97700); color: #fff; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.ask-row button:hover { filter: brightness(0.95); }
.ask-result { margin-top: 10px; }
.ask-understood { font-size: 13px; color: #0a7c3e; margin-bottom: 8px; font-weight: 600; }
.ask-msg { font-size: 13px; color: #64748b; padding: 6px 0; }
.ask-err { color: #c0392b; }
.ask-table-wrap { overflow-x: auto; }
.ask-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ask-table th, .ask-table td { padding: 7px 12px; text-align: left; border-bottom: 1px solid #eef0f2; white-space: nowrap; }
.ask-table th { background: #f8f9fa; color: #475569; font-weight: 600; }
.ask-table tbody tr:hover { background: #fcfcfd; }

/* ============================================================
   批1 全站皮肤升级 (2026-06-26): 更大圆角 / 更多留白 / 更柔阴影
   纯追加覆盖, 不改前面任何规则; 要回退删本块即可。保留橙色品牌主色。
   ============================================================ */
:root {
  --radius:    10px;
  --radius-lg: 16px;
  --shadow:    0 1px 3px rgba(15,23,42,0.03), 0 6px 18px rgba(15,23,42,0.05);
  --shadow-md: 0 2px 6px rgba(15,23,42,0.04), 0 12px 30px rgba(15,23,42,0.07);
  --shadow-lg: 0 16px 40px rgba(15,23,42,0.10);
  --soft:      #F5F6F8;   /* 页面背景更干净一档 */
}
/* 内容区留白 */
.dashboard, .table-view { padding: 24px 28px 34px; }
/* 指标卡: 更大、更醒目 */
.metric-grid { gap: 16px; margin-bottom: 22px; }
.metric { padding: 18px 18px 18px 20px; min-height: 96px; }
.metric span { font-size: 12px; }
.metric strong { font-size: 26px; margin-top: 8px; }
.metric .metric-ico { width: 38px; height: 38px; border-radius: 11px; top: 14px; right: 14px; }
/* 面板: 间距更大、表头更高 */
.split { gap: 18px; margin-bottom: 20px; }
.panel { margin-bottom: 18px; }
.split .panel { margin-bottom: 0; }
.panel-head { height: 52px; padding: 0 18px; }
.mini-table, .menu-tree { padding: 10px 16px 14px; }
/* 卡片 hover 更轻盈 */
.metric:hover { transform: translateY(-2px); }

/* ============================================================
   批2 工作台: 右侧经营健康栏 + 指标卡涨跌% + 出货量
   ============================================================ */
/* 左主区 + 右健康栏 */
#dashboardView { display: grid; grid-template-columns: minmax(0, 1fr) 304px; gap: 18px; align-items: start; }
.dash-main { min-width: 0; }
@media (max-width: 1180px) { #dashboardView { grid-template-columns: 1fr; } }
.dash-rail { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 18px; }
/* 指标卡涨跌角标 */
.metric-delta { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 600; font-style: normal; }
.metric-delta.up { color: var(--good); }
.metric-delta.down { color: var(--bad); }
.metric-delta i { color: var(--muted-2); font-weight: 400; font-style: normal; font-size: 11px; }
/* 健康卡 */
.health-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 16px 18px; }
.health-card h4 { margin: 0 0 14px; font-size: 14px; font-weight: 600; color: var(--ink); }
.hm { margin-bottom: 14px; }
.hm:last-child { margin-bottom: 0; }
.hm-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.hm-val { font-weight: 700; font-family: "Fira Code", monospace; }
.hm-val.hm-good { color: var(--good); }
.hm-val.hm-warn { color: var(--cta-hover); }
.hm-val.hm-bad { color: var(--bad); }
.hm-bar { height: 7px; border-radius: 99px; background: #eef0f2; overflow: hidden; }
.hm-fill { height: 100%; border-radius: 99px; transition: width var(--transition); }
.hm-fill.good { background: var(--good); }
.hm-fill.warn { background: var(--cta); }
.hm-fill.bad { background: var(--bad); }
.hm-sub { font-size: 11px; color: var(--muted-2); margin-top: 2px; }
/* 出货量迷你柱 */
.ship-bars { display: flex; align-items: flex-end; gap: 6px; height: 92px; padding-top: 4px; }
.ship-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; height: 100%; }
.ship-bar { width: 100%; background: var(--primary-50); border-radius: 4px 4px 0 0; min-height: 2px; transition: height var(--transition); }
.ship-bar.on { background: var(--primary); }
.ship-d { font-size: 10px; color: var(--muted-2); }
.ship-q { font-size: 10px; color: var(--ink); font-weight: 600; min-height: 13px; }

/* ============================================================
   批3 密度优化 (2026-06-26): 收紧批1过度留白 / 提高信息密度 /
   顶部档案总量卡弱化分层 / 修问数据表格 / 统一间距对齐。纯追加可回退。
   ============================================================ */
/* 内容区 + 工作台栅格收紧 */
.dashboard, .table-view { padding: 16px 20px 24px; }
#dashboardView { gap: 16px; }
/* 指标卡: 把批1 的过大留白拉回 */
.metric-grid { gap: 12px; margin-bottom: 14px; }
.metric { padding: 12px 14px; min-height: 0; }
.metric span { font-size: 11px; letter-spacing: 0; }
.metric strong { font-size: 22px; margin-top: 3px; }
.metric .metric-ico { width: 30px; height: 30px; border-radius: 8px; top: 10px; right: 10px; font-size: 14px; }
.metric:hover { transform: none; }
/* 顶部「档案总量」卡(客户/商品/供应商…): 弱化成软背景小卡, 与本月金额卡分层 */
#metricGrid { gap: 10px; margin-bottom: 14px; }
#metricGrid .metric { padding: 9px 12px; background: var(--soft); border-color: transparent; box-shadow: none; }
#metricGrid .metric strong { font-size: 19px; font-weight: 600; }
#metricGrid .metric .metric-ico { width: 26px; height: 26px; font-size: 13px; background: transparent; }
/* 面板间距统一收紧 */
.panel { margin-bottom: 12px; }
.split { gap: 14px; margin-bottom: 12px; }
.panel-head { height: 44px; padding: 0 16px; }
.mini-table, .menu-tree { padding: 6px 14px 10px; }
.mini-row, .tree-row { padding-top: 5px; padding-bottom: 5px; }
/* 问数据结果表格: 列按内容宽、靠左, 不再撑满整宽留大片空白 */
.ask-result { overflow-x: auto; }
.ask-table { width: auto; min-width: 0; }
.ask-table th, .ask-table td { padding: 6px 28px 6px 0; border-bottom: 1px solid #eef0f2; }
.ask-table th:last-child, .ask-table td:last-child { padding-right: 8px; }
/* 经营健康栏: 进度条更明显、卡片收紧 */
.dash-rail { gap: 14px; top: 16px; }
.health-card { padding: 14px 16px; }
.health-card h4 { margin-bottom: 12px; }
.hm { margin-bottom: 12px; }
.hm-bar { height: 8px; }
.ship-bars { height: 80px; }
/* 新订单 / 最近销售 / 最近入库: 并排一行三列 */
.triple { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 12px; }
.triple .panel { margin-bottom: 0; }
@media (max-width: 960px) { .triple { grid-template-columns: 1fr; } }
/* 窄列里的迷你行收紧(日期窄、行距小) */
.triple .mini-row { grid-template-columns: 70px minmax(0, 1fr) auto; gap: 8px; font-size: 12px; padding: 4px 0; }
.triple .mini-row span:first-child { white-space: nowrap; color: var(--muted-2); }
.triple .mini-row span:last-child { white-space: nowrap; text-align: right; }
.triple .mini-row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
   经营看板 (Azia 风格, 纯 SVG 零依赖)
   ============================================================ */
.board-view { padding: 18px 22px 28px; overflow: auto; }
.board-hi { font-size: 17px; font-weight: 700; color: var(--ink); margin-bottom: 16px; }
.board-hi span { display: block; font-size: 12px; font-weight: 400; color: var(--muted-2); margin-top: 3px; }
.board-row { display: grid; gap: 16px; margin-bottom: 16px; }
.board-row-top { grid-template-columns: 1fr 1fr 1.6fr; }
.board-row-4 { grid-template-columns: repeat(4, 1fr); }
.board-row-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 1100px) { .board-row-top, .board-row-4, .board-row-2 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 680px)  { .board-row-top, .board-row-4, .board-row-2 { grid-template-columns: 1fr; } }
.board-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 18px; }
/* 圆环图 */
.donut-card { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-wrap { position: relative; width: 140px; }
.donut { width: 140px; height: 140px; display: block; }
.donut-bg { fill: none; stroke: #eef0f2; stroke-width: 9; }
.donut-fg { fill: none; stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset 600ms ease; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; }
.donut-center strong { font-size: 26px; font-weight: 700; font-family: "Fira Code", monospace; }
.donut-label { margin-top: 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
/* 折线趋势 */
.trend-card { display: flex; flex-direction: column; }
.bc-head { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.spark { width: 100%; height: 96px; display: block; }
.spark-area { fill: var(--primary-50); stroke: none; }
.spark-line { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.spark-dot { fill: var(--primary); }
.spark-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--muted-2); }
/* 大数字卡 */
.big-card { display: flex; flex-direction: column; gap: 6px; }
.big-card .bc-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }
.big-card strong { font-size: 25px; font-weight: 700; font-family: "Fira Code", monospace; letter-spacing: -0.01em; }
.big-card small { font-size: 11px; color: var(--muted-2); }
.big-good strong { color: var(--good); } .big-bad strong { color: var(--bad); } .big-warn strong { color: var(--warn); }
.big-good { box-shadow: inset 3px 0 0 var(--good), var(--shadow); }
.big-bad  { box-shadow: inset 3px 0 0 var(--bad), var(--shadow); }
.big-warn { box-shadow: inset 3px 0 0 var(--cta), var(--shadow); }
/* 应收应付卡 */
.arap-card .bc-top { margin-bottom: 12px; font-size: 14px; }
.arap-amt { font-size: 22px; font-weight: 700; font-family: "Fira Code", monospace; }
.arap-good { color: var(--good); } .arap-bad { color: var(--bad); }
