/* ============================================================
   厨赞财务系统 · CUZAN-FIN
   基底: Linear × Stripe · 主色 #4F46E5 · 强调橙 #F59E0B
   依据 DESIGN.md v1.0 生成
   ============================================================ */

:root {
  /* ── Primary & Brand ── */
  --color-primary: #4F46E5;
  --color-primary-hover: #4338CA;
  --color-primary-soft: #EEF2FF;
  --color-primary-deep: #312E81;
  --gradient-brand: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);

  /* ── Accent / Interactive ── */
  --color-accent: #F59E0B;
  --color-accent-soft: #FEF3C7;
  --color-accent-deep: #B45309;
  --color-link: #2563EB;

  /* ── Neutral / Gray ── */
  --gray-900: #111827; --gray-800: #1F2937; --gray-700: #374151;
  --gray-500: #6B7280; --gray-400: #9CA3AF; --gray-300: #D1D5DB;
  --gray-200: #E5E7EB; --gray-100: #F3F4F6; --gray-50: #F9FAFB;

  /* ── Surface & Borders ── */
  --surface-page: #FFFFFF; --surface-card: #FFFFFF; --surface-elevated: #FFFFFF;
  --surface-muted: #F9FAFB;
  --border-subtle: #F3F4F6; --border-default: #E5E7EB;

  /* ── Semantic ── */
  --success: #16A34A; --success-soft: #DCFCE7; --success-text: #15803D;
  --warning: #D97706; --warning-soft: #FEF3C7; --warning-text: #B45309;
  --error: #DC2626;   --error-soft: #FEE2E2;   --error-text: #B91C1C;
  --info: #2563EB;    --info-soft: #DBEAFE;    --info-text: #1D4ED8;
  --neutral: #6366F1;

  /* ── 业务专用角色色 ── */
  --biz-revenue: #16A34A;
  --biz-cost: #DC2626;
  --biz-net-profit: #4F46E5;
  --biz-chuzan-share: #312E81;
  --biz-qingcang-share: #6366F1;
  --biz-employee: #F59E0B;
  --biz-third: #7C3AED;

  /* ── Shadow ── */
  --shadow-xs: 0 1px 2px rgba(17,24,39,.04);
  --shadow-sm: 0 1px 2px rgba(17,24,39,.04), 0 1px 3px rgba(17,24,39,.06);
  --shadow-md: 0 2px 4px rgba(17,24,39,.05), 0 4px 12px rgba(17,24,39,.06);
  --shadow-lg: 0 8px 24px rgba(17,24,39,.08), 0 2px 6px rgba(17,24,39,.06);
  --shadow-xl: 0 20px 40px rgba(17,24,39,.16), 0 4px 12px rgba(17,24,39,.08);
  --shadow-2xl: 0 32px 64px rgba(17,24,39,.20), 0 8px 16px rgba(17,24,39,.08);
  --shadow-primary: 0 4px 12px rgba(79,70,229,.30);

/* ── KPI 彩条 ── */
--kpi-border-primary: #4F46E5;
--kpi-border-success: #16A34A;
--kpi-border-warning: #F59E0B;
--kpi-border-error: #DC2626;
--kpi-border-info: #2563EB;
--kpi-border-accent: #7C3AED;

/* ── KPI 类型主色 + 软色（v1.80 视觉升级）── */
--kpi-success:        #16A34A;
--kpi-success-soft:   #DCFCE7;
--kpi-success-bg:     linear-gradient(135deg, #ECFDF5 0%, #FFFFFF 60%);
--kpi-error:          #DC2626;
--kpi-error-soft:     #FEE2E2;
--kpi-error-bg:       linear-gradient(135deg, #FEF2F2 0%, #FFFFFF 60%);
--kpi-primary:        #4F46E5;
--kpi-primary-soft:   #EEF2FF;
--kpi-primary-bg:     linear-gradient(135deg, #EEF2FF 0%, #FFFFFF 60%);
--kpi-info:           #2563EB;
--kpi-info-soft:      #DBEAFE;
--kpi-info-bg:        linear-gradient(135deg, #EFF6FF 0%, #FFFFFF 60%);
--kpi-accent:         #7C3AED;
--kpi-accent-soft:    #F3E8FF;
--kpi-accent-bg:      linear-gradient(135deg, #F5F3FF 0%, #FFFFFF 60%);
--kpi-warning:        #F59E0B;
--kpi-warning-soft:   #FEF3C7;
--kpi-warning-bg:     linear-gradient(135deg, #FFFBEB 0%, #FFFFFF 60%);

  /* ── Spacing / Radius ── */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-12: 48px;
  --radius-sm: 6px; --radius-md: 8px; --radius-lg: 12px; --radius-xl: 14px; --radius-pill: 999px;

  /* ── Fonts ── */
  --font-sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-num: "JetBrains Mono", "SF Mono", Menlo, Consolas, "PingFang SC", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--gray-50);
  color: var(--gray-900);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
a { color: var(--color-link); text-decoration: none; }

/* ============================================================
   登录页
   ============================================================ */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1000px 500px at 85% -10%, rgba(79,70,229,.10), transparent 60%),
    radial-gradient(800px 400px at -10% 110%, rgba(245,158,11,.08), transparent 55%),
    var(--gray-50);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 400px;
  background: #fff;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 36px 32px 28px;
  box-shadow: var(--shadow-lg);
}
.login-brand { text-align: center; margin-bottom: 24px; }
.login-ico {
  width: 52px; height: 52px; margin: 0 auto 14px;
  border-radius: 14px;
  background: var(--gradient-brand);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px;
  box-shadow: var(--shadow-primary);
}
.login-title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.login-sub { font-size: 13px; color: var(--gray-500); margin-top: 4px; }
.login-tabs {
  display: flex; gap: 6px; margin-bottom: 20px;
  background: var(--gray-100); border-radius: 10px; padding: 4px;
}
.login-tab {
  flex: 1; border: none; cursor: pointer;
  background: transparent; color: var(--gray-500);
  font-size: 13.5px; font-weight: 500;
  padding: 8px 10px; border-radius: 8px;
  font-family: var(--font-sans);
  transition: all .15s;
}
.login-tab.active { background: #fff; color: var(--color-primary); font-weight: 600; box-shadow: var(--shadow-xs); }
.login-error {
  min-height: 20px; margin-top: 10px;
  font-size: 13px; color: var(--error); text-align: center;
}
.login-tip {
  margin-top: 18px; padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px; color: var(--gray-400); text-align: center;
}
.code-row { display: flex; gap: 8px; }
.code-row .input { flex: 1; }
.btn-block { width: 100%; justify-content: center; margin-top: 6px; }

/* ============================================================
   顶栏导航
   ============================================================ */
.nav {
  background: rgba(249,250,251,.92);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-default);
  min-height: 60px; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  position: sticky; top: 0; z-index: 100;
  flex-wrap: wrap;
}
.nav-left { display: flex; align-items: center; }
.nav-logo { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; color: var(--gray-900); white-space: nowrap; }
.nav-logo .ico {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--gradient-brand);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px;
  box-shadow: var(--shadow-primary);
}
.brand-sub { font-weight: 400; color: var(--gray-500); font-size: 12px; margin-left: 4px; letter-spacing: .05em; }
.nav-tabs { display: flex; gap: 2px; overflow-x: auto; }
.nav-tabs a {
  padding: 8px 13px; border-radius: 8px;
  font-size: 13.5px; font-weight: 500; color: var(--gray-500);
  text-decoration: none; white-space: nowrap;
  transition: background .15s, color .15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.nav-tabs a:hover { background: var(--gray-100); color: var(--gray-900); }
.nav-tabs a.active { background: var(--color-primary-soft); color: var(--color-primary-deep); font-weight: 600; }
.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-user { font-size: 13px; color: var(--gray-700); display: inline-flex; align-items: center; gap: 6px; }

/* ============================================================
   容器 / 页面
   ============================================================ */
.container { max-width: 1440px; margin: 0 auto; padding: 24px; }
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-sub { font-size: 13px; font-weight: 400; color: var(--gray-500); }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.month-input {
  border: 1px solid var(--gray-300); border-radius: 8px;
  padding: 6px 10px; font-size: 14px; font-family: var(--font-sans);
  color: var(--gray-900); background: #fff;
}
.month-input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-soft); }
.app-footer {
  text-align: center; padding: 24px;
  font-size: 12px; color: var(--gray-400);
}

/* ============================================================
   按钮
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 8px; padding: 8px 16px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: none; transition: opacity .15s, background .15s, border-color .15s, transform .1s;
  font-family: var(--font-sans); line-height: 1.4;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--gradient-brand); color: #fff; box-shadow: var(--shadow-xs); }
.btn-primary:hover { box-shadow: var(--shadow-primary); }
.btn-secondary { background: var(--surface-card); color: var(--gray-900); border: 1px solid var(--gray-300); font-weight: 500; }
.btn-secondary:hover { background: var(--gray-100); border-color: var(--gray-400); }
.btn-ghost { background: transparent; color: var(--gray-500); font-weight: 500; padding: 8px 12px; }
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-900); }
.btn-danger { background: var(--error-soft); color: var(--error); font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 6px; }
.btn-danger:hover { background: #FECACA; }
.btn-success { background: var(--success); color: #fff; font-weight: 500; }
.btn-success:hover { background: var(--success-text); }
.btn-icon { padding: 8px; border-radius: 8px; }
.btn-sm { padding: 4px 10px; font-size: 12.5px; border-radius: 6px; }

/* ============================================================
   卡片 / KPI
   ============================================================ */
.card {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: var(--shadow-xs);
  margin-bottom: 18px;
}
.card-title {
  font-size: 16px; font-weight: 600;
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.card-title i { color: var(--color-primary); }
/* v1.50 标题栏右侧加按钮（如"导出 Excel"）—— 用 .card-title-row 触发左右两端对齐 */
.card-title.card-title-row { justify-content: space-between; }
.card-title.card-title-row > span { display: inline-flex; align-items: center; gap: 8px; }
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 18px;
}
.kpi {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--kpi-border-primary);
  border-radius: 14px;
  padding: 18px 20px 16px;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.kpi::before {
  /* 右上角软色圆点装饰 */
  content: "";
  position: absolute;
  top: -30px; right: -30px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--kpi-primary-soft);
  opacity: .55;
  pointer-events: none;
}
.kpi.k-success { border-left-color: var(--kpi-success); background: var(--kpi-success-bg); }
.kpi.k-success::before { background: var(--kpi-success-soft); }
.kpi.k-warning { border-left-color: var(--kpi-warning); background: var(--kpi-warning-bg); }
.kpi.k-warning::before { background: var(--kpi-warning-soft); }
.kpi.k-error   { border-left-color: var(--kpi-error);   background: var(--kpi-error-bg); }
.kpi.k-error::before   { background: var(--kpi-error-soft); }
.kpi.k-info    { border-left-color: var(--kpi-info);    background: var(--kpi-info-bg); }
.kpi.k-info::before    { background: var(--kpi-info-soft); }
.kpi.k-accent  { border-left-color: var(--kpi-accent);  background: var(--kpi-accent-bg); }
.kpi.k-accent::before  { background: var(--kpi-accent-soft); }
.kpi.k-neutral { border-left-color: var(--neutral); }
.kpi.k-primary { border-left-color: var(--kpi-primary); background: var(--kpi-primary-bg); }
.kpi.k-primary::before { background: var(--kpi-primary-soft); }

/* 头部：icon + label + 标签 */
.kpi-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}
.kpi-icon {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--kpi-primary-soft);
  color: var(--kpi-primary);
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.kpi.k-success .kpi-icon { background: var(--kpi-success-soft); color: var(--kpi-success); }
.kpi.k-error   .kpi-icon { background: var(--kpi-error-soft);   color: var(--kpi-error); }
.kpi.k-info    .kpi-icon { background: var(--kpi-info-soft);    color: var(--kpi-info); }
.kpi.k-accent  .kpi-icon { background: var(--kpi-accent-soft);  color: var(--kpi-accent); }
.kpi.k-warning .kpi-icon { background: var(--kpi-warning-soft); color: var(--kpi-warning); }
.kpi.k-primary .kpi-icon { background: var(--kpi-primary-soft); color: var(--kpi-primary); }
.kpi.k-neutral .kpi-icon { background: var(--gray-100); color: var(--neutral); }
.kpi-label {
  font-size: 12.5px; color: var(--gray-700); font-weight: 600;
  white-space: nowrap;
  flex: 1;
}
.kpi-tag {
  font-size: 10px;
  color: var(--gray-500);
  background: rgba(255,255,255,.7);
  border: 1px solid var(--border-default);
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 500;
  flex-shrink: 0;
}
.kpi-value {
  font-size: 28px;
  font-weight: 700;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  color: var(--gray-900);
  position: relative;
  z-index: 1;
  line-height: 1.1;
}
.kpi-sub {
  font-size: 11.5px;
  color: var(--gray-500);
  margin-top: 6px;
  position: relative;
  z-index: 1;
}
/* 数值正负着色（v1.80） */
.kpi.kpi-positive .kpi-value { color: var(--success-text); }
.kpi.kpi-negative .kpi-value { color: var(--error-text); }

/* ============================================================
   表格
   ============================================================ */
.tbl-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  background: #fff;
}
.tbl { width: 100%; border-collapse: collapse; min-width: 720px; }
/* v1.239 资金流水明细表限定宽度（不溢出 viewport，操作列始终可见） */
#finTable { table-layout: fixed; font-size: 12.5px; }  /* v1.245 数据行基础字号 11.5→12.5（表头 .tbl th 保持 12.5px 不变） */
#finTable th, #finTable td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0;
  padding: 6px 4px;     /* v1.243 减小列内边距，降低字间距 */
  letter-spacing: -0.1px; /* v1.243 减小字间距 */
}
/* v1.243 列宽可拖动：col-resizable 在右侧 4px 显示拖动手柄，悬停高亮 */
#finTable th { position: relative; user-select: none; }
#finTable th::after {
  content: "";
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 4px;
  cursor: col-resize;
  background: transparent;
}
#finTable th:hover::after { background: rgba(99,102,241,.3); }
#finTable th.col-resizing::after { background: var(--primary, #4338ca); }
#finTable .td-actions { white-space: nowrap; padding: 4px; }
#finTable .td-actions .btn-icon { padding: 5px 7px; font-size: 12px; }

/* === v1.245 资金流水明细表 3 项体验优化 ===
   1) 日期列固定贴左（水平滚动时日期列始终可见，紧贴最左侧）
   2) 表头紧凑化：缩小左右 padding，垂直居中（vertical-align middle 已在 line 2428）
   3) 数据行字体加大（基础 11.5→12.5，日期列 12.5→13.5）—— 字号由上面 #finTable 基础行 + #finTable td.acc-dt 控制 */

/* 1) 日期列 sticky 固定贴左 —— 紧贴表格最左边缘，水平滚动时不动 */
#finTable th:first-child,
#finTable td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface-card);  /* 数据行白底，避免透出下方滚动内容 */
  box-shadow: 1px 0 0 var(--border-default);  /* 右侧 1px 分隔线，区别于滚动列 */
}
#finTable th:first-child {
  background: var(--surface-muted);  /* 表头灰底（与 .tbl th 一致） */
  z-index: 3;  /* 表头在数据行之上 */
}
/* tr:hover 时整行变深色（v1.256 加强高亮：用主题蓝紫 #E0E7FF，比 gray-50 明显，背景和细行交替区分清晰） */
#finTable tbody tr:hover td { background: #E0E7FF; }
#finTable tbody tr:hover td:first-child { background: #E0E7FF; }

/* 2) 表头紧凑化 —— 左右 padding 6px（v1.245 的 2px 太挤，导致右对齐列紧贴左对齐列；v1.246 改为 6px 留出合理间距），垂直居中（middle 已设）
   配套：js/app.js 渲染时把「金额」「账户余额」表头从 th-right 改为 th-center，与数据行 td-center 对齐，消除"金额↔账户""账户余额↔类别"文字紧挨 */
#finTable th { padding: 6px 6px; }
.tbl th {
  background: var(--surface-muted); color: var(--gray-700);
  text-align: right; padding: 9px 12px;
  font-size: 12.5px; font-weight: 600;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
.tbl th:first-child, .tbl th.text-left { text-align: left; }
.tbl td {
  padding: 9px 12px; text-align: right;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
  font-family: var(--font-num); font-variant-numeric: tabular-nums;
  white-space: nowrap; height: 42px;
}
.tbl td.text-left, .tbl td:first-child { text-align: left; font-family: var(--font-sans); }
.tbl tr:hover td { background: #E0E7FF; }
.tbl tfoot td {
  font-weight: 600; color: var(--gray-900);
  border-top: 2px solid var(--gray-300);
  background: var(--surface-muted);
  padding: 11px;
  font-family: var(--font-num);
}
/* v1.50 电脑端表头锁定：仪表盘本月项目总表 + 项目明细表
   - 给容器加 max-height + overflow-y 让表体在容器内独立滚动
   - thead 用 sticky 保持可见；tfoot 合计行也固定在底部
   - 仅电脑端（≥1024px）生效，手机端保持自然页面滚动 */
@media (min-width: 1024px) {
  #dashTableWrap, #projTableWrap {
    max-height: 70vh;
    overflow: auto;
  }
  #dashTableWrap thead th, #projTableWrap thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--surface-muted);
    box-shadow: inset 0 -1px 0 var(--gray-200);
  }
  #dashTableWrap tfoot td, #projTableWrap tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 4;
  }
}
/* ============ v1.143 项目明细表 (#projTable) 列宽约束 ============
   截图问题：默认无列宽 + 长 select 选项文本 → 整表被横向撑出显示器。
   这里给每列显式 width + 给 状态/操作 收紧 → 整表 ≤ 1180px 不撑出。*/
#projTable { table-layout: fixed; min-width: 1040px; }
#projTable thead th:nth-child(1), #projTable tbody td:nth-child(1) { width: 56px; }    /* 日期 */
#projTable thead th:nth-child(2), #projTable tbody td:nth-child(2) { width: 60px; }    /* 销售模式 */
#projTable thead th:nth-child(3), #projTable tbody td:nth-child(3) { width: 200px; }   /* 项目（类目·合作方） */
#projTable thead th:nth-child(4), #projTable tbody td:nth-child(4) { width: 80px; }    /* 收入 */
#projTable thead th:nth-child(5), #projTable tbody td:nth-child(5) { width: 78px; }    /* 总支出 */
#projTable thead th:nth-child(6), #projTable tbody td:nth-child(6) { width: 80px; }    /* 总利润 */
#projTable thead th:nth-child(7), #projTable tbody td:nth-child(7) { width: 168px; }   /* 合作方（双行：分配利润+应结） */
#projTable thead th:nth-child(8), #projTable tbody td:nth-child(8) { width: 72px; }    /* 未回款 */
#projTable thead th:nth-child(9), #projTable tbody td:nth-child(9) { width: 116px; }   /* 状态 */
#projTable thead th:nth-child(10), #projTable tbody td:nth-child(10) { width: 130px; }  /* 操作 */
/* 状态 select 与 filter 收紧 */
#projTable td .status-sel,
#projTable .status-filter-th select {
  width: 100%;
  font-size: 12px;
  padding: 4px 6px;
  min-width: 0;
}
#projTable td .status-sel option,
#projTable .status-filter-th select option { padding: 2px 6px; }
/* 操作列：分两行显示 —— 第一行「明细 + 重新锁定/解锁」，第二行「编辑 + 删除」 */
/* 注意：.td-actions 是 <td> 内部的 <div>，不是 td 本身 —— 选择器必须用后代选择器 */
#projTable td > .td-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}
#projTable td > .td-actions .td-act-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  justify-content: flex-start;
}
#projTable td > .td-actions .td-act-row .link-btn {
  font-size: 12px;
  padding: 2px 6px;
  flex: 0 0 auto;
  white-space: nowrap;
}
/* 主操作「明细」稍突出 */
#projTable td > .td-actions .td-act-view {
  font-weight: 600;
  padding: 2px 8px;
}
/* 第二行（编辑/删除）：让只读的「已锁定」占满宽提示 */
#projTable td > .td-actions .td-act-editrow .link-btn.locked {
  flex: 1 1 auto;
  text-align: center;
}
/* 第一行（明细+锁定）在锁定项目且非厨赞时可自动下移换行不挤 */
#projTable td > .td-actions .td-act-row { min-width: 0; }
/* 项目列（col-project）允许项目名换行、内部 chips 居中 */
#projTable td.col-project {
  word-break: break-word;
  overflow-wrap: anywhere;
}
/* 合作方单元格（双行）：收紧 padding */
#projTable td.ps-cell { padding: 6px 8px !important; }
#projTable td.ps-cell .ps-block { font-size: 12px; gap: 4px; }
@media (max-width: 1280px) {
  #projTable thead th:nth-child(3), #projTable tbody td:nth-child(3) { width: 170px; }
  #projTable thead th:nth-child(7), #projTable tbody td:nth-child(7) { width: 140px; }
  #projTable thead th:nth-child(10), #projTable tbody td:nth-child(10) { width: 116px; }
}
.tbl-foot-note { font-size: 12px; color: var(--gray-500); margin-top: 10px; }
.text-pos { color: var(--biz-revenue); }
.text-neg { color: var(--biz-cost); }
/* v1.165 资金账户实时余额负数=红色+加粗（防止看不清账户透支） */
.num.balance-negative,
.acc-balance.balance-negative {
  color: var(--biz-cost);
  font-weight: 700;
}
.num.balance-positive { color: var(--biz-revenue); font-weight: 600; }
.text-profit { color: var(--biz-net-profit); font-weight: 600; }
.text-chuzan { color: var(--biz-chuzan-share); font-weight: 600; }
.text-qingcang { color: var(--biz-qingcang-share); font-weight: 600; }
.text-emp { color: var(--biz-employee); font-weight: 600; }
.text-third { color: var(--biz-third); font-weight: 600; }
.text-muted { color: var(--gray-400); }

/* 人员分配徽章（含每人分得金额） */
.assignee-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; margin: 0 4px 4px 0;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 500;
  background: var(--gray-100); color: var(--gray-700);
  white-space: nowrap;
}
.assignee-badge b { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-weight: 600; }
.assignee-badge.k-biz  { background: var(--color-primary-soft); color: var(--color-primary-deep); }
.assignee-badge.k-sale { background: var(--warning-soft); color: var(--warning-text); }
.assignee-badge.k-be   { background: var(--success-soft); color: var(--success-text); }
.assignee-badge.k-tmp  { background: var(--gray-100); color: var(--gray-500); border: 1px dashed var(--gray-300); }

/* v1.4 人员分配简化：仅显示员工名（hover tooltip 显示提成） */
.assignee-name {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; margin: 0 3px 4px 0;
  border-radius: 999px;
  font-size: 12px; font-weight: 500;
  background: var(--color-primary-soft); color: var(--color-primary-deep);
  white-space: nowrap;
  cursor: default;
}
.assignee-name i { font-size: 10px; opacity: .85; }
.assignee-name.k-tmp {
  background: var(--gray-100); color: var(--gray-500);
  border: 1px dashed var(--gray-300);
}

/* v1.16 合作方分账（分配利润 / 应结）— 名称 + 2 列等距布局 */
.ps-cell { padding: 10px 8px !important; vertical-align: top; min-width: 260px; }
.ps-block { display: flex; flex-direction: column; gap: 4px; }
.ps-line {
  display: grid;
  grid-template-columns: 64px repeat(2, 1fr);
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  padding: 3px 0;
}
/* v1.80 表头行：与下方数据列严格对齐（合作方 + 2 列数字标题） */
.ps-line.ps-header {
  grid-template-columns: 64px repeat(2, 1fr);
  gap: 6px;
  padding: 0;
  border-bottom: 1px solid var(--border-default);
  padding-bottom: 6px;
  margin-bottom: 4px;
}
.ps-head-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  text-align: left;
  padding-left: 2px;
  border-right: 1px solid var(--border-subtle);
  padding-right: 6px;
  white-space: nowrap;
}
.ps-head-cell {
  display: flex; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  white-space: nowrap;
  padding: 0 4px;
}
.ps-head-cell i { font-size: 9px; opacity: 0.7; }
/* 收紧 ps-name 列宽到 64px（与表头对齐） */
.ps-name {
  font-weight: 700;
  font-size: 12px;
  text-align: left;
  padding-left: 2px;
  border-right: 1px solid var(--border-subtle);
  padding-right: 6px;
  white-space: nowrap;
  color: var(--gray-700);
  min-width: 64px;
}
.ps-cell-num {
  display: flex; align-items: center; gap: 2px;
  padding: 3px 4px;
  background: var(--gray-50);
  border-radius: 4px;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  color: var(--gray-700);
  font-weight: 600;
  white-space: nowrap;
  justify-content: flex-end;
  min-width: 0;
}
.ps-cell-num.pos { background: var(--success-soft) !important; color: var(--success-text) !important; }
.ps-cell-num.neg { background: var(--error-soft) !important; color: var(--error-text) !important; }
.ps-cell-num.alloc { background: var(--color-primary-soft) !important; color: var(--color-primary-deep) !important; }
.ps-cell-num i { font-size: 9px; opacity: 0.65; }
@media (max-width: 1100px) {
  .ps-line { grid-template-columns: 52px repeat(2, 1fr); }
  .ps-cell-num:nth-child(n+3) { grid-column: span 1; }
}

/* v1.6 人员提成分配单元格：每员工一列 */
.emp-col-th {
  background: var(--color-primary-soft) !important;
  color: var(--color-primary-deep) !important;
  font-weight: 600 !important;
  border-bottom: 2px solid var(--color-primary) !important;
}
/* v1.9 居中显示：人员提成分配 / 提成小计 表头组 */
.tbl th.text-center,
.tbl th[colspan].text-center,
.tbl thead tr:nth-child(2) th { text-align: center !important; }
/* v1.9 居中显示：第一列（项目）— 覆盖 .text-left 强制居中对齐 */
.tbl td:first-child { text-align: center !important; font-family: var(--font-sans); }
.tbl th:first-child,
.tbl thead th:first-child { text-align: center !important; }
/* v1.10 居中显示：项目名列（第二列 = "项目（类目 · 合作方）"）— 解决仪表盘 序号 + 项目 两列居中问题 */
.tbl .col-project { text-align: center !important; font-family: var(--font-sans); }
.tbl .col-project > b { display: inline-block; }
.tbl .col-project > div { justify-content: center; }
/* v1.9 合作结算：已结清的项目一行变灰 */
.settle-proj-row.settled { opacity: 0.55; background: var(--success-soft) !important; }
.settle-proj-row.settled .spr-name::after { content: "  ✓"; color: var(--success-text); font-weight: 700; }

/* v1.7 提成维度单选 */
.mode-radio-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-radio {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid var(--border-default);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: all .15s;
  position: relative;
}
.mode-radio input { position: absolute; opacity: 0; pointer-events: none; }
.mode-radio:hover { border-color: var(--color-primary); background: var(--color-primary-soft); }
.mode-radio.checked {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  box-shadow: var(--shadow-sm);
}
.mode-radio.checked::after {
  content: "✓";
  position: absolute;
  top: 6px; right: 8px;
  width: 18px; height: 18px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.mr-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gray-100);
  color: var(--gray-500);
  border-radius: 8px;
  font-size: 16px;
}
.mode-radio.checked .mr-icon {
  background: var(--color-primary);
  color: #fff;
}
.mr-title { font-size: 14px; font-weight: 600; color: var(--gray-800); }
.mode-radio.checked .mr-title { color: var(--color-primary-deep); }
.mr-sub { font-size: 11.5px; color: var(--gray-500); margin-top: 2px; line-height: 1.5; }

/* v1.7 状态列筛选下拉 */
.status-filter-th { padding: 4px 6px !important; }
.status-filter-th select {
  width: 100%;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  padding: 4px 6px;
  background: #fff;
  color: var(--gray-700);
  cursor: pointer;
}
.status-filter-th select:focus { outline: none; border-color: var(--color-primary); }

/* v1.8 项目表单：员工提成表（每员工一行 2 选项） */
.comm-table {
  display: grid;
  gap: 6px;
  font-size: 13px;
}
.comm-head, .comm-row {
  display: grid;
  grid-template-columns: 60px 80px 90px 110px 130px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
}
.comm-head {
  background: var(--gray-50);
  color: var(--gray-500);
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
}
.comm-row {
  background: #fff;
  border: 1px solid var(--border-subtle);
  transition: border-color .15s;
}
.comm-row:hover { border-color: var(--color-primary); }
.comm-emp { font-weight: 600; color: var(--gray-900); }
.comm-role { font-size: 12px; }
.comm-mode { min-height: 32px !important; padding: 4px 8px !important; font-size: 12.5px; }
.comm-val-wrap { display: flex; align-items: center; gap: 4px; }
.comm-val { min-height: 32px !important; padding: 4px 8px !important; font-size: 13px; }
.comm-unit { font-size: 12px; color: var(--gray-500); white-space: nowrap; min-width: 16px; }
.comm-hint { font-size: 11.5px; }
@media (max-width: 768px) {
  .comm-head, .comm-row { grid-template-columns: 1fr 1fr; }
}

/* v1.8 表格内可编辑状态下拉（替代徽章） */
.status-sel {
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
  background: var(--gray-100);
}

/* v1.53 checkbox chip 组（替代 <select multiple>，手机端友好）
   - 用于"对方"多选：iOS Safari 对 multiple select 支持极差，改用 checkbox
   - :has() 选择器自动同步"选中"样式（无需 JS）*/
.checkbox-group {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 4px 0;
}
.check-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border: 1.5px solid var(--border-default);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--gray-700);
  transition: all .15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
/* v1.59 自定义勾选框：隐藏原生 checkbox，用伪元素画统一的圆角方形 + 对勾（跨端一致） */
.check-pill input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 17px; height: 17px;
  margin: 0; flex: none;
  border: 1.5px solid var(--gray-300);
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: background .15s, border-color .15s;
}
.check-pill input[type="checkbox"]:checked {
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.check-pill input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4.5px; top: 1px;
  width: 5px; height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.check-pill:has(input:checked) {
  background: var(--color-primary-soft);
  border-color: var(--color-primary);
  color: var(--color-primary-deep);
  font-weight: 600;
}
.check-pill:hover { border-color: var(--color-primary); }

/* v1.53 把错位的 .status-sel 剩余属性修正：补回 color / transition（之前 Edit 误删） */
.status-sel {
  color: var(--gray-700);
  transition: all .15s;
}
.status-sel:hover { border-color: var(--color-primary); }
.status-sel:focus { outline: none; border-color: var(--color-primary); background: #fff; }
.status-sel.status-pending  { background: var(--info-soft);    color: var(--info-text); }
.status-sel.status-progress { background: var(--warning-soft); color: var(--warning-text); }
.status-sel.status-complete { background: var(--success-soft); color: var(--success-text); }
.status-sel.status-done     { background: var(--error-soft);   color: var(--error-text); }

/* v1.10 状态下拉选项颜色 */
.status-sel option[value="pending"]  { background: var(--info-soft);    color: var(--info-text);    font-weight: 600; }
.status-sel option[value="progress"] { background: var(--warning-soft); color: var(--warning-text); font-weight: 600; }
.status-sel option[value="complete"] { background: var(--success-soft); color: var(--success-text); font-weight: 600; }
.status-sel option[value="done"]     { background: var(--error-soft);   color: var(--error-text);   font-weight: 600; }
#projStatusFilter option[value="pending"]  { background: var(--info-soft);    color: var(--info-text); }
#projStatusFilter option[value="progress"] { background: var(--warning-soft); color: var(--warning-text); }
#projStatusFilter option[value="complete"] { background: var(--success-soft); color: var(--success-text); }
#projStatusFilter option[value="done"]     { background: var(--error-soft);   color: var(--error-text); }

/* v1.11 状态锁定（已结清项目） */
.status-sel.status-locked {
  background: var(--success-soft) !important;
  color: var(--success-text) !important;
  border: 1px solid var(--success);
  cursor: not-allowed;
  opacity: 0.85;
}

/* v1.12 合作结算：项目数据字体加大 + 收入/支出/净利标签 */
.settle-proj-row .spr-meta { font-size: 12px; }
.settle-proj-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; }
.settle-proj-row .spr-amounts {
  display: inline-flex; gap: 12px; align-items: center; margin-left: auto;
  font-size: 15px; font-weight: 700;
}
.settle-proj-row .spr-amounts > span { display: inline-flex; align-items: center; gap: 4px; }
.settle-proj-row .spr-amounts .spr-lbl { font-size: 11px; color: var(--gray-500); font-weight: 500; }
.settle-proj-row .spr-amounts .spr-amount { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

/* v1.12 互相结算黄底消息字体加大 */
#settleSettleBlock .arrow {
  font-size: 15px !important;
  font-weight: 600 !important;
  padding: 10px 0 4px !important;
  line-height: 1.6 !important;
}
#settleSettleBlock .arrow b { font-size: 17px; color: #15803D; }

/* v1.12 回收类目可拖动排序 */
.cat-chip[draggable="true"] { cursor: move; }
.cat-chip.dragging { opacity: 0.4; }
.cat-chip.drag-over { border-color: var(--color-primary) !important; background: var(--color-primary-soft) !important; transform: scale(1.05); }

/* v1.12 员工提成行：选择框 */
.comm-row .comm-check {
  display: flex; align-items: center; justify-content: center;
  padding: 8px 0;
}
.comm-row .comm-check input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--color-primary);
  cursor: pointer;
}
/* v1.11 记一笔结算：收/付 4 选 1 卡组 */
.settle-dir-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}
.settle-dir-opt {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: #fff;
  border: 1.5px solid var(--border-default);
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s;
  overflow: hidden;
}
.settle-dir-opt i {
  grid-row: 1 / 3;
  font-size: 16px;
}
.settle-dir-opt .sdo-main {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gray-900);
}
.settle-dir-opt .sdo-sub {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 1px;
}
.settle-dir-opt input { position: absolute; opacity: 0; pointer-events: none; }
.settle-dir-opt:hover { border-color: var(--color-primary); background: var(--color-primary-soft); }
.settle-dir-opt.checked {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  box-shadow: 0 0 0 2px rgba(79,70,229,.15);
}
.settle-dir-opt.checked::after {
  content: "✓";
  position: absolute;
  top: 6px; right: 8px;
  width: 18px; height: 18px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
/* v1.11 记一笔结算：收/付 4 选 1 卡组 */
.settle-dir-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}
.settle-dir-opt {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: #fff;
  border: 1.5px solid var(--border-default);
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s;
  overflow: hidden;
}
.settle-dir-opt i {
  grid-row: 1 / 3;
  font-size: 16px;
}
.settle-dir-opt .sdo-main {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gray-900);
}
.settle-dir-opt .sdo-sub {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 1px;
}
.settle-dir-opt input { position: absolute; opacity: 0; pointer-events: none; }
.settle-dir-opt:hover { border-color: var(--color-primary); background: var(--color-primary-soft); }
.settle-dir-opt.checked {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  box-shadow: 0 0 0 2px rgba(79,70,229,.15);
}
.settle-dir-opt.checked::after {
  content: "✓";
  position: absolute;
  top: 6px; right: 8px;
  width: 18px; height: 18px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
@media (max-width: 768px) {
  .settle-dir-row { grid-template-columns: 1fr; }
}

/* v1.22 分摊明细 chip（清账时显示每个 debtor 的应付款） */
.settle-party-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  background: var(--color-primary-soft);
  border: 1px solid var(--color-primary);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-primary-deep);
}
.settle-party-chip b { color: var(--color-primary-deep); font-weight: 700; }
/* v1.24 我方对应 chip（高亮绿框 + ✅） */
.settle-party-chip.settle-party-mine {
  background: var(--success-soft) !important;
  border-color: var(--success) !important;
  color: var(--success-text) !important;
}
.settle-party-chip.settle-party-mine b { color: var(--success-text) !important; }
.settle-party-chip.settle-party-mine::after {
  content: "（我方）";
  font-size: 10px;
  font-weight: 600;
  color: var(--success);
  margin-left: 2px;
}

/* v1.26 已结清项目 · 编辑锁定按钮 */
.link-btn.locked {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--gray-500);
  background: var(--gray-100);
  border: 1px dashed var(--gray-300);
  border-radius: 6px;
  padding: 3px 8px;
  cursor: not-allowed;
  user-select: none;
}
.link-btn.locked i { color: var(--gray-400); }

/* v1.7 参数设置：提成规则编辑卡 */
.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.rules-grid .rule-item {
  background: var(--gray-50);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 14px;
}
.rules-grid .rule-item .lbl { font-size: 11.5px; color: var(--gray-500); font-weight: 600; }
.rules-grid .rule-item .val-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.rules-grid .rule-item .input { flex: 1; min-height: 32px; font-size: 13px; padding: 4px 8px; }
.rules-grid .rule-item .unit { font-size: 12px; color: var(--gray-500); white-space: nowrap; }
.rules-grid .rule-item .hint { font-size: 10.5px; color: var(--gray-400); margin-top: 2px; line-height: 1.4; }

/* v1.6 打印 / PDF 导出样式（仅在 body.printing-settle 时生效） */
@media print {
  body.printing-settle * { visibility: hidden !important; }
  body.printing-settle #settleModal,
  body.printing-settle #settleModal * { visibility: visible !important; }
  body.printing-settle #settleModal {
    position: absolute !important;
    top: 0 !important; left: 0 !important; right: 0 !important;
    background: #fff !important;
    padding: 24px !important;
  }
  body.printing-settle .modal-backdrop {
    background: #fff !important;
    backdrop-filter: none !important;
  }
  body.printing-settle .modal {
    box-shadow: none !important;
    max-height: none !important;
    border: none !important;
  }
  body.printing-settle .form-actions { display: none !important; }
}

/* v1.4 合作结算：项目勾选列表 */
.settle-month-block {
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
  background: #fff;
}
.smb-head {
  background: var(--surface-muted);
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gray-700);
  border-bottom: 1px solid var(--border-subtle);
}
.smb-list { display: grid; gap: 0; }
.settle-proj-row {
  display: grid;
  grid-template-columns: 22px 1.5fr 2.2fr 18px;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  transition: background .12s;
}
.settle-proj-row:last-child { border-bottom: none; }
.settle-proj-row:hover { background: var(--gray-50); }
/* v1.149 记一笔结算：下拉多选组件（类别下拉框样式 + 每项前小方框打勾，手机/电脑都好用） */
.proj-dd { position: relative; }
.proj-dd-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;            /* 触屏友好 */
  padding: 8px 12px;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--gray-50);
  font-size: 13px;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.proj-dd-trigger:hover { border-color: var(--color-primary); }
.proj-dd-trigger.open { border-color: var(--color-primary); background: #fff; box-shadow: 0 0 0 3px var(--color-primary-soft); }
.proj-dd-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.5;
}
.proj-dd-label.has-sel { color: var(--color-primary-deep); font-weight: 600; }
.proj-dd-caret { flex: none; font-size: 11px; color: var(--gray-500); transition: transform .18s; }
.proj-dd-trigger.open .proj-dd-caret { transform: rotate(180deg); }
.proj-dd-panel {
  display: none;
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 4px);
  z-index: 60;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
  overflow: hidden;
}
.proj-dd-panel.open { display: block; }
.proj-dd-list { max-height: 300px; overflow-y: auto; padding: 4px; -webkit-overflow-scrolling: touch; }
.proj-dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;            /* 触屏好点 */
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.proj-dd-item:hover { background: var(--gray-50); }
.proj-dd-item input[type="checkbox"] { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.proj-dd-box {
  flex: none;
  width: 17px; height: 17px;
  border: 1.5px solid var(--border-default);
  border-radius: 4px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  transition: background .12s, border-color .12s;
}
.proj-dd-item.checked .proj-dd-box,
.proj-dd-item input:checked + .proj-dd-box {
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.proj-dd-item.checked .proj-dd-box::after,
.proj-dd-item input:checked + .proj-dd-box::after { content: "✓"; font-weight: 700; }
.proj-dd-text {
  flex: 1;
  min-width: 0;
  line-height: 1.45;
  word-break: break-all;
}
.proj-dd-item.checked .proj-dd-text,
.proj-dd-item input:checked ~ .proj-dd-text { color: var(--color-primary-deep); font-weight: 600; }
.proj-dd-empty { padding: 18px 12px; text-align: center; font-size: 12.5px; color: var(--gray-500); }
.settle-proj-row.checked { background: var(--color-primary-soft); }
.settle-proj-row.checked .spr-name { color: var(--color-primary-deep); font-weight: 600; }
.settle-proj-row input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
}
.settle-proj-row .spr-name { font-weight: 500; }
.settle-proj-row .spr-meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.settle-proj-row .spr-check {
  color: var(--color-primary);
  font-size: 14px;
  opacity: 0;
  transition: opacity .15s;
}
.settle-proj-row.checked .spr-check { opacity: 1; }

/* 员工工资核算表（项目明细页下方） */
.salary-summary-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.salary-summary-bar .sum-cell {
  background: var(--surface-muted);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  padding: 10px 14px;
}
.salary-summary-bar .sum-cell .lbl { font-size: 11px; color: var(--gray-500); font-weight: 600; }
.salary-summary-bar .sum-cell .val {
  font-family: var(--font-num); font-variant-numeric: tabular-nums;
  font-size: 19px; font-weight: 700; color: var(--gray-900);
}

/* 单元格操作
   v1.244 关键修复：限定为 div.td-actions（projTable 操作列在 <div> 里，finTable 直接 <td class="td-actions">）
   不能用 .td-actions —— 否则会把 <td> 的 display 强制改为 flex，破坏 table-cell 布局
   导致 finTable 操作列 td 实际只有 padding 宽度（~8px），按钮溢出到前一列被 overflow:hidden 裁切而完全看不见 */
div.td-actions { display: flex; gap: 4px; justify-content: flex-end; align-items: center; }
.link-btn {
  border: none; background: transparent; cursor: pointer;
  color: var(--color-primary); font-size: 12.5px; font-weight: 500;
  font-family: var(--font-sans); padding: 2px 4px; border-radius: 4px;
  display: inline-flex; align-items: center; gap: 4px;
}
.link-btn:hover { background: var(--color-primary-soft); }
.link-btn.danger { color: var(--error); }
.link-btn.danger:hover { background: var(--error-soft); }

/* ============================================================
   表单
   ============================================================ */
.input, .field input, .field select {
  background: #fff; color: var(--gray-900);
  border: 1px solid var(--gray-300); border-radius: 8px;
  padding: 7px 10px; font-size: 14px;
  font-family: var(--font-sans); width: 100%;
  min-height: 36px;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .field input:focus, .field select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}
.input-num { font-family: var(--font-num); font-variant-numeric: tabular-nums; text-align: right; }
.input[readonly] { background: var(--gray-50); color: var(--gray-700); cursor: not-allowed; }
::placeholder { color: var(--gray-400); font-size: 13px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--gray-500); margin-bottom: 4px; font-weight: 600; }
.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 14px; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; justify-content: flex-end; }

/* 参数编辑器 */
.partner-editor, .emp-editor { margin-bottom: 16px; }
.partner-row, .emp-row {
  display: grid; gap: 10px; align-items: end;
  background: var(--gray-50);
  border: 1px solid var(--border-subtle);
  border-radius: 10px; padding: 12px 14px;
  margin-bottom: 10px;
}
.partner-row { grid-template-columns: 1.2fr 1fr 1fr 40px; }
.emp-row { grid-template-columns: 1fr .9fr .8fr .8fr .8fr 40px; }
.partner-row .field, .emp-row .field { margin-bottom: 0; }
.field-label-sm { font-size: 11px; color: var(--gray-400); margin-bottom: 2px; }

/* ============================================================
   员工管理卡片（v1.4 全新布局：头像 + 双行字段 + 在职开关）
   ============================================================ */
.emp-card {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: start;
  background: #fff;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-xs);
  transition: border-color .15s, box-shadow .15s;
}
.emp-card:hover { border-color: var(--gray-300); box-shadow: var(--shadow-sm); }
.emp-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  box-shadow: var(--shadow-primary);
}
.emp-main { display: grid; gap: 10px; min-width: 0; }
.emp-line1 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 10px;
}
.emp-line2 {
  display: grid;
  grid-template-columns: repeat(4, minmax(84px, 1fr)) 44px;
  gap: 10px;
}
.emp-line1 .field, .emp-line2 .field { margin-bottom: 0; }
.emp-line1 .input, .emp-line2 .input { min-height: 34px; font-size: 13px; }
.emp-del-wrap { display: flex; align-items: flex-end; }
.emp-del-wrap .btn { width: 36px; height: 36px; }
/* v1.155 员工预支余额显示 */
.adv-bal {
  display: inline-block;
  min-height: 34px;
  line-height: 34px;
  font-size: 13px;
  font-weight: 500;
  padding: 0 4px;
}
.adv-bal-owe { color: var(--danger); }
.adv-bal-zero { color: var(--gray-500); font-weight: 400; }

/* 在职开关 */
.switch {
  position: relative; display: inline-block;
  width: 40px; height: 22px; margin-top: 4px; flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0;
  background: var(--gray-300);
  border-radius: 999px;
  transition: background .2s;
  cursor: pointer;
}
.switch .slider::before {
  content: "";
  position: absolute; left: 3px; top: 3px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: var(--shadow-xs);
}
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* ============================================================
   项目类目多选 Chips
   ============================================================ */
.cat-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 2px 0 6px;
}
.cat-chip {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  font-size: 12.5px; font-weight: 500;
  background: var(--gray-50);
  color: var(--gray-700);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  cursor: pointer; user-select: none;
  transition: all .15s;
}
.cat-chip input[type="checkbox"] { display: none; }
.cat-chip .chip-box {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px;
  border: 1.5px solid var(--gray-400);
  border-radius: 3px;
  background: #fff;
  color: transparent;
  font-size: 9px;
  transition: all .15s;
}
.cat-chip:hover { border-color: var(--color-primary); color: var(--color-primary); }
.cat-chip.checked {
  background: var(--color-primary-soft);
  border-color: var(--color-primary);
  color: var(--color-primary-deep);
  font-weight: 600;
}
.cat-chip.checked .chip-box {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.cat-chip .x {
  margin-left: 2px; opacity: .55; font-size: 10px;
  cursor: pointer;
}
.cat-chip .x:hover { opacity: 1; }

/* v1.5 自定义类目：X 删除按钮 + 新增输入 */
.chip-label { margin-left: 2px; }
.chip-rm {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px;
  margin-left: 6px;
  border-radius: 50%;
  font-size: 9px;
  color: var(--gray-400);
  background: transparent;
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
}
.chip-rm:hover {
  color: #fff;
  background: var(--error);
}
.cat-chip:hover .chip-rm { color: var(--gray-700); }
.cat-chip.checked .chip-rm { color: var(--color-primary-deep); opacity: .7; }
.cat-chip.checked:hover .chip-rm { color: var(--color-primary-deep); }

.cat-add-row {
  display: flex; gap: 8px; align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-subtle);
}
.cat-add-row .input {
  flex: 1; min-width: 0;
  background: var(--gray-50);
  font-size: 13px;
  min-height: 34px;
  padding: 5px 10px;
}
.cat-add-row .input:focus {
  background: #fff;
}
.cat-add-row .btn {
  flex-shrink: 0;
  padding: 6px 14px;
  font-size: 12.5px;
}

/* ============================================================
   收支明细编辑器（项目新增/编辑弹窗）
   ============================================================ */
.detail-block {
  background: var(--gray-50);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 10px;
}
.detail-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.detail-head .title {
  font-size: 13px; font-weight: 700; color: var(--gray-800);
  display: inline-flex; align-items: center; gap: 6px;
}
.detail-head .title .count {
  font-size: 11px; font-weight: 500;
  background: var(--color-primary-soft); color: var(--color-primary-deep);
  padding: 1px 8px; border-radius: 999px;
}
.detail-rows {
  display: grid; gap: 8px;
}
.detail-row {
  display: grid;
  gap: 6px;
  align-items: center;
}
.detail-row[data-kind="exp"] {
  /* v1.90 付款人(公司)/账号/责任人(员工)/备注/删除 */
  /* v1.104 日期列 100→140px，避免 2026/08/15 被截断 */
  grid-template-columns: 140px 100px 110px 110px 110px 110px 1fr 36px;
}
.detail-row[data-kind="inc"] {
  /* v1.90 收款人(公司)/账号/是否回款/责任人(员工)/备注/删除 */
  /* v1.104 日期列 100→140px，避免 2026/08/15 被截断 */
  grid-template-columns: 140px 100px 110px 110px 110px 100px 110px 1fr 36px;
}
.detail-row .input,
.detail-row select {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 13px;
}
.detail-row .input-num { text-align: right; }
/* v1.72 账号列容器：grid cell 内嵌一层，保证 select 和 "非厨赞无需账号" 文字都能占位，
   隐藏/显示由 JS 控制，不破坏 grid 列数 */
.detail-row .acc-cell {
  display: flex;
  align-items: center;
  min-width: 110px;
}
.detail-row .acc-cell > select,
.detail-row .acc-cell > span {
  flex: 1;
  min-width: 0;
}
.detail-row .row-del {
  width: 32px; height: 32px;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  color: var(--gray-400);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.detail-row .row-del:hover {
  background: var(--error-soft);
  border-color: var(--error);
  color: var(--error);
}
.detail-foot {
  margin-top: 10px;
  display: flex; justify-content: space-between; align-items: center;
}
.detail-foot .total-line {
  font-size: 13px; font-weight: 600;
  color: var(--gray-700);
}
.detail-foot .total-line b {
  font-family: var(--font-num); font-variant-numeric: tabular-nums;
  font-size: 16px;
  color: var(--gray-900);
  margin-left: 4px;
}
.detail-foot .btn { padding: 5px 12px; font-size: 12.5px; }

/* 已回款/未回款状态色（v1.4：蓝=已回款，红=未回款） */
.paid-no  { background: var(--error-soft); color: var(--error-text); font-weight: 500; border: 1px solid var(--error); }
.paid-yes { background: var(--info-soft);  color: var(--info-text);  font-weight: 600; border: 1px solid var(--info); }

/* 互相结算黄底（结算抽屉） */
.settle-settle {
  background: #FEF9C3;
  border: 1px solid #FDE047;
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 14px;
}
.settle-settle h5 {
  font-size: 13px; font-weight: 700;
  color: #854D0E;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.settle-settle .row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0;
  font-size: 14px;
  color: #713F12;
  font-weight: 600;
}
.settle-settle .row .amt {
  font-family: var(--font-num); font-variant-numeric: tabular-nums;
  font-size: 16px;
}
.settle-settle .row .amt.neg { color: #B91C1C; }
.settle-settle .row .amt.pos { color: #15803D; }
.settle-settle .row .lbl { font-weight: 500; color: #713F12; }
.settle-settle .arrow {
  text-align: center; font-size: 12px; color: #A16207;
  font-weight: 500; padding: 4px 0;
}

.detail-empty {
  padding: 14px 12px;
  text-align: center;
  color: var(--gray-400);
  font-size: 12.5px;
  background: #fff;
  border: 1px dashed var(--border-default);
  border-radius: 8px;
}

/* 顶部汇总只读 */
.summary-readonly {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.summary-readonly .sum-card {
  background: var(--color-primary-soft);
  border: 1px solid var(--color-primary);
  border-radius: 10px;
  padding: 10px 14px;
}
.summary-readonly .sum-card.income { border-color: var(--success); background: var(--success-soft); }
.summary-readonly .sum-card.cost   { border-color: var(--error);   background: var(--error-soft); }
.summary-readonly .sum-card .lbl { font-size: 11px; font-weight: 600; color: var(--gray-700); margin-bottom: 2px; }
.summary-readonly .sum-card .val {
  font-family: var(--font-num); font-variant-numeric: tabular-nums;
  font-size: 22px; font-weight: 700; color: var(--gray-900);
  letter-spacing: -.01em;
}

/* 现有 input/select 类目重复但确保 modal 内可用 */
.detail-block select.input { min-width: 0; }
@media (max-width: 1100px) {
  .detail-row[data-kind="exp"] { grid-template-columns: 1fr 1fr 1fr 1fr; }
  .detail-row[data-kind="inc"] { grid-template-columns: 1fr 1fr 1fr 1fr; }
  .detail-row .row-del { grid-column: 4; justify-self: end; }
}

/* 规则说明 */
.rule-list { list-style: none; }
.rule-list li { padding: 6px 0 6px 20px; position: relative; font-size: 13px; color: var(--gray-700); }
.rule-list li::before { content: "•"; color: var(--color-primary); position: absolute; left: 4px; font-weight: 800; }

/* ============================================================
   徽章
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; line-height: 1.7;
  white-space: nowrap;
}
.badge-success { background: var(--success-soft); color: var(--success-text); }
.badge-warning { background: var(--warning-soft); color: var(--warning-text); }
.badge-error   { background: var(--error-soft);   color: var(--error-text); }
.badge-info    { background: var(--info-soft);    color: var(--info-text); }
.badge-primary { background: var(--color-primary-soft); color: var(--color-primary-deep); }
.badge-accent  { background: var(--color-accent-soft); color: var(--warning-text); }
.badge-gray    { background: var(--gray-100); color: var(--gray-700); }
.badge-neutral { background: #EEF2FF; color: var(--neutral); }
.status-done       { background: var(--error-soft); color: var(--error-text); }
.status-progress   { background: var(--warning-soft); color: var(--warning-text); }
.status-complete   { background: var(--success-soft); color: var(--success-text); }
.status-pending    { background: var(--info-soft); color: var(--info-text); }

/* v1.108 销售模式徽标（onsite 现场 / warehouse 仓库） */
.dim-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 600;
  vertical-align: middle;
  white-space: nowrap;
}
.dim-onsite    { background: #DBEAFE; color: #1E40AF; }
.dim-warehouse { background: #FEF3C7; color: #92400E; }

/* v1.108 类别管理 */
.cat-mgr-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 8px;
  background: var(--bg-soft, #fafafa);
}
.cat-mgr-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  font-size: 13px;
  cursor: grab;          /* v1.260.4 拖动排序：鼠标指针 */
  user-select: none;     /* 拖动时禁止文本选中 */
}
.cat-mgr-item:active { cursor: grabbing; }
.cat-mgr-item.dragging { opacity: 0.4; }
.cat-mgr-item.drag-over { border-top: 2px solid #3b82f6; }
.cat-mgr-item .cat-mgr-grip {
  color: #94a3b8;
  font-size: 12px;
  cursor: grab;
  padding: 0 2px;
}

/* v1.260.6 修复：参数设置 → 类别管理底部「新支出/收入类别」输入框无法编辑
   原因：父级 .cat-mgr-list 设了 user-select: none（拖动时禁止文本选中）会沿继承链向下传递，
   加上 input 在视觉上紧贴 list，浏览器在某些情况下把 input 也当 list 的扩展禁用选择/编辑。
   修复：input 显式 user-select:text + position:relative + z-index 抬高 + 关闭拖动手势。 */
#catMgrExpName, #catMgrIncName {
  position: relative;
  z-index: 5;
  -webkit-user-select: text;
  user-select: text;
  pointer-events: auto;
  background: #fff;
}
#catMgrExpName:focus, #catMgrIncName:focus {
  z-index: 6;
}
.cat-mgr-item .cat-mgr-name { flex: 1; word-break: break-all; }
.cat-mgr-item .cat-mgr-del {
  border: none;
  background: transparent;
  color: var(--danger, #dc2626);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
  border-radius: 4px;
}
.cat-mgr-item .cat-mgr-del:hover { background: #fee2e2; }

/* v1.260.7 类别名称点击原地编辑：
   名称区 = 文本 + 铅笔图标，整体可点；点击后变为输入框（显式 user-select:text，
   规避 v1.260.4 父级 user-select:none 沿继承链污染 input 无法编辑的老问题） */
.cat-mgr-item .cat-mgr-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  cursor: text;
}
.cat-mgr-item .cat-mgr-name .cat-mgr-name-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-mgr-item .cat-mgr-name .cat-mgr-edit-icon {
  flex: none;
  font-size: 11px;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 2px;
}
.cat-mgr-item .cat-mgr-name:hover .cat-mgr-edit-icon { color: #3b82f6; }
.cat-mgr-item .cat-mgr-name.editing { cursor: auto; }
.cat-mgr-item .cat-mgr-name-input {
  flex: 1;
  min-width: 0;
  height: 26px;
  padding: 2px 8px;
  font-size: 13px;
  border: 1px solid #3b82f6;
  border-radius: 4px;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
  pointer-events: auto;
  background: #fff;
  color: var(--text-color, #1f2937);
}

/* ============================================================
   Tabs
   ============================================================ */
.tabs {
  display: flex; gap: 6px; border-bottom: 1px solid var(--border-default);
  margin-bottom: 18px; overflow-x: auto;
}
.tab {
  padding: 10px 16px; font-size: 14px; font-weight: 500;
  color: var(--gray-500); cursor: pointer;
  border: none; background: transparent;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px; white-space: nowrap;
  font-family: var(--font-sans);
  transition: color .15s, border-color .15s, background .15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.tab:hover { color: var(--gray-900); }
.tab.active {
  color: var(--color-primary); border-bottom-color: var(--color-primary);
  background: var(--color-primary-soft);
  border-radius: 8px 8px 0 0; font-weight: 600;
}

/* ============================================================
   Modal / Toast
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15,23,42,.45);
  /* v1.52：去掉 backdrop-filter — iOS Safari 上 backdrop-filter 会拦截原生 <select> picker 的指针事件，导致下拉选项无法点击（webkKit 已知 BUG） */
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .15s ease-out;
}

/* v1.260.5 自定义确认弹窗（替代 window.confirm，手机/电脑通用） */
.ui-confirm-msg {
  font-size: 14px;
  line-height: 1.65;
  color: var(--gray-700, #374151);
  white-space: pre-line;       /* 保留 \n 换行 */
  word-break: break-word;
  padding: 8px 0 4px;
}
.ui-confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 18px;
  flex-wrap: wrap;
}
.ui-confirm-actions .btn { min-width: 88px; }   /* 手机端防误点，按钮够大 */
@media (max-width: 480px) {
  .ui-confirm-actions { flex-direction: column-reverse; }   /* 手机端纵向，确定按钮在底部更顺手 */
  .ui-confirm-actions .btn { width: 100%; min-width: 0; }
}
.modal {
  background: #fff; border-radius: 14px;
  padding: 22px 24px; max-width: 1000px; width: 100%;
  box-shadow: var(--shadow-2xl);
  max-height: 92vh; overflow-y: auto;
  animation: slideUp .2s ease-out;
}
.modal-lg { max-width: 1200px; }
.modal-title {
  font-size: 18px; font-weight: 700; margin-bottom: 16px;
  display: flex; justify-content: space-between; align-items: center;
}
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  z-index: 2000;
  background: var(--gray-900); color: #fff;
  padding: 10px 20px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 8px;
  animation: slideUp .2s ease-out;
}
.toast.ok { background: var(--success-text); }
.toast.err { background: var(--error-text); }

/* 结算抽屉明细 */
.settle-block { margin-bottom: 16px; }
.settle-block h4 {
  font-size: 13px; font-weight: 600; color: var(--gray-500);
  margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}
.settle-line {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; border-bottom: 1px dashed var(--border-subtle);
  font-size: 14px;
}
.settle-line .amt { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-weight: 600; }
.settle-summary {
  margin-top: 14px; padding: 14px 16px;
  background: var(--color-primary-soft);
  border-radius: 10px;
  display: grid; gap: 8px;
}
.settle-summary .line { display: flex; justify-content: space-between; font-size: 14px; }
.settle-summary .line.total { font-weight: 700; font-size: 16px; color: var(--color-primary-deep); border-top: 1px solid rgba(79,70,229,.2); padding-top: 8px; }

/* 空态 */
.empty-tip { color: var(--gray-400); text-align: center; padding: 32px 0; font-size: 13px; }
.empty-tip i { font-size: 22px; display: block; margin-bottom: 8px; color: var(--gray-300); }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 768px) {
  .nav { padding: 10px 16px; }
  .nav-tabs { order: 3; width: 100%; padding-bottom: 2px; }
  .container { padding: 16px; }
  .page-title { font-size: 20px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-value { font-size: 22px; }
  .field-grid { grid-template-columns: 1fr; }
  .partner-row { grid-template-columns: 1fr 1fr; }
  .emp-row { grid-template-columns: 1fr 1fr; }
  .emp-card { grid-template-columns: 44px 1fr; padding: 14px; gap: 10px; }
  .emp-avatar { width: 40px; height: 40px; font-size: 15px; }
  .emp-line1, .emp-line2 { grid-template-columns: repeat(2, 1fr); }
  .modal { padding: 16px; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   v1.260 手机端「编辑项目」快录按钮行（仅 ≤768 显示，桌面隐藏）
   ============================================================ */
.proj-mobile-quickadd { display: none; }
.proj-mobile-quickadd .qa-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  margin: 6px 0 10px;
  background: var(--surface-2, #f7f8fa);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
}
.proj-mobile-quickadd .qa-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary, #2563eb);
  background: #fff;
  border: 1.5px solid var(--primary, #2563eb);
  border-radius: 999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.proj-mobile-quickadd .qa-btn:active { background: var(--primary-soft, #e0e7ff); }
.proj-mobile-quickadd .qa-total {
  flex: 1 1 auto;
  text-align: right;
  font-size: 13.5px;
  color: var(--gray-600, #475569);
}
.proj-mobile-quickadd .qa-total b {
  margin-left: 4px;
  color: var(--text, #1f2937);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-num, system-ui);
}
@media (max-width: 768px) {
  .proj-mobile-quickadd { display: block; }
}

/* ============================================================
   v1.29 手机适配版（<768px 手机 / <480px 小屏）
   同一链接：电脑打开桌面版，手机打开自动切移动版
   ============================================================ */
@media (max-width: 768px) {

  /* ---------- 全局触控 ---------- */
  body { font-size: 15px; }
  .input, select.input, textarea.input, button, .btn, .link-btn, .month-input {
    font-size: 16px !important;          /* iOS 聚焦防自动放大 */
    min-height: 44px;                    /* 触控目标 ≥44px */
  }
  .input-num { min-height: 44px; }
  .link-btn.locked { min-height: 30px; font-size: 13px !important; }

  /* ---------- 导航：横向滑动 5 个 tab ---------- */
  .nav-tabs {
    display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch;
    white-space: nowrap; gap: 2px; scrollbar-width: none;
  }
  .nav-tabs::-webkit-scrollbar { display: none; }
  .nav-tabs a { flex: 0 0 auto; padding: 9px 12px; font-size: 13.5px; }
  .nav-logo .brand-sub { display: none; }   /* 省宽度 */
  .nav-right { margin-left: auto; }

  /* ---------- 页头 / 操作按钮 ---------- */
  .page-head { flex-wrap: wrap; gap: 8px; }
  .page-actions { flex-wrap: wrap; gap: 6px; width: 100%; }
  .page-actions .btn { flex: 1 1 auto; justify-content: center; }

  /* ---------- 弹窗全屏（手机=全屏抽屉） ---------- */
  .modal-backdrop { padding: 0; align-items: stretch; }
  .modal {
    max-width: 100%; width: 100%;
    height: 100dvh; max-height: 100dvh;
    border-radius: 0; padding: 14px 12px 20px;
  }
  .modal-lg { max-width: 100%; }
  .modal-title { font-size: 17px; position: sticky; top: 0; background: #fff; z-index: 5; padding: 4px 0 10px; }
  .form-actions {
    position: sticky; bottom: 0; background: #fff;
    padding-top: 10px; margin-top: 14px; gap: 8px;
  }
  .form-actions .btn { flex: 1 1 auto; justify-content: center; }

  /* ---------- 核心：收入/支出 明细行 卡片化 ---------- */
  .detail-row {
    grid-template-columns: 1fr 1fr !important;   /* 2 列卡片 */
    position: relative;
    background: var(--gray-50);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 46px 10px 12px;
    margin-bottom: 4px;
  }
  .detail-row .row-del {
    position: absolute; top: 8px; right: 8px;
    width: 34px; height: 34px;
  }
  .detail-row .input, .detail-row select { width: 100%; min-height: 40px; font-size: 14px; padding: 8px 10px; }
  .detail-row .input-num { text-align: left; }
  /* 金额占整行（醒目） */
  .detail-row [data-k="amount"] { grid-column: 1 / -1; font-size: 20px !important; font-weight: 700; min-height: 46px; }
  .detail-row [data-k="note"]   { grid-column: 1 / -1; }
  .detail-row [data-k="responsible"] { grid-column: 1 / -1; }   /* 责任人占整行，醒目 */
  /* 标签视觉提示：用 ::before 给前 6 字段加小标签（v1.258 手机端体验优化） */
  .detail-row > [data-k]:not([data-k="amount"]):not([data-k="note"]):not([data-k="responsible"]) { font-size: 14px; }
  .detail-empty { padding: 20px 0; font-size: 14px; }
  .detail-foot { flex-wrap: wrap; gap: 8px; }

  /* v1.258 超小屏（≤480）：单列堆叠，更宽的输入 */
  @media (max-width: 480px) {
    .detail-row { grid-template-columns: 1fr !important; padding: 46px 8px 10px; }
    .detail-row [data-k="amount"], .detail-row [data-k="note"], .detail-row [data-k="responsible"] { grid-column: 1 / -1; }
    .detail-row .input, .detail-row select { min-height: 42px; font-size: 15px; }
  }

  /* ---------- 表格：保持横向滚动，行内操作竖排 ---------- */
  .tbl-wrap { -webkit-overflow-scrolling: touch; }
  .td-actions { flex-direction: column; align-items: stretch; gap: 4px; }
  .td-actions .link-btn { justify-content: flex-start; padding: 6px 4px; }
  .tbl-foot-note { font-size: 12px; line-height: 1.5; }

  /* ---------- 合作方分账 cell ---------- */
  .ps-line { grid-template-columns: 48px repeat(2, minmax(0, 1fr)) !important; gap: 3px; }
  .ps-cell-num { font-size: 11px; padding: 3px 4px; }

  /* ---------- 员工提成表 ---------- */
  .comm-head, .comm-row { grid-template-columns: 1fr 1fr !important; gap: 6px; font-size: 14px; }
  .comm-head span:nth-child(3), .comm-head span:nth-child(4), .comm-head span:nth-child(5),
  .comm-row .comm-mode, .comm-row .comm-val-wrap, .comm-row .comm-hint { grid-column: auto; }

  /* ---------- 结算弹窗 ---------- */
  .settle-line { font-size: 14.5px; padding: 8px 0; }
  .settle-line .amt { font-size: 15px; }
  .settle-dir-row { grid-template-columns: 1fr 1fr; }   /* 4 选项 2x2 */
  .settle-dir-opt { padding: 10px; }
  .settle-dir-opt .sdo-sub { font-size: 11px; }
  .settle-party-chip { font-size: 12.5px; padding: 6px 12px; }
  #s_breakdownTip { font-size: 12.5px; }

  /* ---------- 结算页项目列表 ---------- */
  .settle-proj-row { flex-wrap: wrap; gap: 4px; padding: 10px; }
  .spr-meta { flex-wrap: wrap; }

  /* ---------- 参数设置 ---------- */
  .emp-card { grid-template-columns: 1fr !important; }
  .emp-line1, .emp-line2 { grid-template-columns: repeat(2, 1fr); }
  .partner-row { grid-template-columns: 1fr !important; }

  /* ---------- 月份/日期输入 ---------- */
  .month-input, input[type="month"], input[type="date"] { font-size: 16px; }
}

/* 小屏 (<480px)：detail-row 单列更稳 */
@media (max-width: 480px) {
  .detail-row { grid-template-columns: 1fr !important; }
  .settle-dir-row { grid-template-columns: 1fr; }
  .kpi-value { font-size: 20px; }
  .kpi-sub { font-size: 10.5px; }
  .page-title { font-size: 18px; }
  .nav-tabs a { padding: 8px 10px; font-size: 13px; }
}

/* v1.31 密码框眼睛切换 */
.pwd-row { position: relative; }
.pwd-row .input { padding-right: 44px; }
.pwd-eye {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  background: transparent; border: none;
  color: var(--gray-500); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  transition: background .15s, color .15s;
}
.pwd-eye:hover { background: var(--gray-100); color: var(--color-primary); }
.pwd-eye:focus { outline: 2px solid var(--color-primary-soft); outline-offset: 1px; }
.pwd-eye i { font-size: 15px; }

/* v1.31 本地数据导入横幅 */
.import-banner {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  z-index: 1500;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #78350f;
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: var(--shadow-xl);
  font-size: 14px;
  display: flex; align-items: center; gap: 12px;
  max-width: 90vw;
  z-index: 2000;
}
.import-banner i.fa-cloud-arrow-up { font-size: 18px; color: #b45309; }
.import-banner .btn-sm { padding: 4px 12px; font-size: 12.5px; }

/* v1.31 用户管理 */
.user-mgr-card { max-width: 920px; margin: 0 auto; }
.user-table th, .user-table td { text-align: left; padding: 9px 12px; font-size: 13px; }
.user-table .role-badge {
  display: inline-block; padding: 2px 10px;
  border-radius: 999px; font-size: 11.5px; font-weight: 600;
}
.user-table .role-admin { background: var(--error-soft); color: var(--error-text); }
.user-table .role-editor { background: var(--color-primary-soft); color: var(--color-primary-deep); }
.user-table .role-viewer { background: var(--info-soft); color: var(--info-text); }
.user-add-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr auto;
  gap: 10px; align-items: end;
  margin-bottom: 14px;
}
@media (max-width: 768px) {
  .user-add-row { grid-template-columns: 1fr; }
}

/* v1.56 仪表盘"本月项目总表"状态多选筛选器 */
.dash-status-th { position: relative; }
.dash-status-filter { position: relative; display: inline-block; }
.dsf-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface-muted); color: var(--gray-700);
  border: 1px solid var(--gray-200); border-radius: 6px;
  padding: 3px 8px; font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: var(--font-sans); white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s;
}
.dsf-btn:hover { border-color: var(--color-primary); color: var(--color-primary-deep); background: var(--color-primary-soft); }
.dsf-btn i { font-size: 10px; opacity: .7; }

.dsf-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 300;
  min-width: 150px; background: #fff;
  border: 1px solid var(--border-default); border-radius: 10px;
  box-shadow: var(--shadow-lg); padding: 6px;
  text-align: left;
}
.dsf-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 6px;
  font-size: 13px; color: var(--gray-700); cursor: pointer;
  font-family: var(--font-sans); font-weight: 500;
  transition: background .12s;
}
.dsf-opt:hover { background: var(--gray-50); }
.dsf-opt input { margin: 0; accent-color: var(--color-primary); cursor: pointer; }
.dsf-opt span { white-space: nowrap; }
.dsf-actions {
  display: flex; gap: 4px; align-items: center;
  margin-top: 4px; padding: 6px 10px 2px;
  border-top: 1px solid var(--gray-100);
}
.dsf-link {
  background: none; border: none; padding: 3px 8px;
  font-size: 12px; font-weight: 600; color: var(--color-primary);
  cursor: pointer; border-radius: 6px; font-family: var(--font-sans);
  transition: background .12s;
}
.dsf-link:hover { background: var(--color-primary-soft); }
.dsf-link.dsf-close { color: var(--gray-500); }
.dsf-link.dsf-close:hover { background: var(--gray-100); color: var(--gray-700); }

/* v1.58 仪表盘表格行双击打开结算清单：手机端操作列常被横向滚动推出屏幕外，
   补"双击行"入口（行为等同点"明细"按钮），用 cursor + 按下色暗示"行可双击" */
#dashTable tbody tr[data-id] { cursor: pointer; -webkit-tap-highlight-color: #E0E7FF; }
#dashTable tbody tr[data-id]:hover { background: #E0E7FF; }
#dashTable tbody tr[data-id]:active { background: #E0E7FF; }

/* v1.83 项目明细表格行双击进入编辑：同样为手机端补入口 */
#projTable tbody tr[data-id] { cursor: pointer; -webkit-tap-highlight-color: #E0E7FF; }
#projTable tbody tr[data-id]:hover { background: #E0E7FF; }
#projTable tbody tr[data-id]:active { background: #E0E7FF; }

/* v1.59 亏本项目（总利润<0）整行红色加粗：仪表盘总表 / 项目明细 / 员工提成明细通用 */
tr[data-loss] td,
tr[data-loss] td * {
  color: var(--error) !important;
  font-weight: 700 !important;
}
tr[data-loss] .badge { border: 1px solid rgba(220,38,38,.25); }


/* ============ v1.60 员工提成发放（勾选小方框 + 划线/变淡） ============ */

/* 员工提成明细：每个格子前的勾选框（小方框，复用 check-pill 的伪元素勾样式） */
.comm-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  white-space: nowrap;
}
.comm-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 15px; height: 15px;
  margin: 0; flex: none;
  border: 1.5px solid var(--gray-300);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: background .15s, border-color .15s;
  vertical-align: middle;
}
.comm-check input[type="checkbox"]:checked {
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.comm-check input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px; top: 1px;
  width: 4px; height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.comm-check:hover input[type="checkbox"] { border-color: var(--color-primary); }

/* 提成数字本身（默认） */
.comm-num { transition: opacity .15s, text-decoration .15s; }

/* 部分发放：变淡 */
.comm-check.comm-partial .comm-num { opacity: .45; }
/* 已发完：划线（只划数字本身） */
.comm-check.comm-full .comm-num {
  text-decoration: line-through;
  text-decoration-color: var(--error);
  text-decoration-thickness: 1.5px;
  opacity: .75;
}
/* 已发放小标签 */
.comm-paid-tag {
  font-size: 10.5px;
  color: var(--success-deep, #0f7a4d);
  background: rgba(15, 122, 77, .1);
  border-radius: 4px;
  padding: 0 5px;
  line-height: 16px;
  display: inline-block;
  font-weight: 600;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}
/* 员工列头的小方框（全选/取消本列） */
.emp-head-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px;
  border: none;
  background: transparent;
  font-weight: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  color: inherit;
}
.emp-head-check:hover { border-color: transparent; }

/* ============ v1.161 工资表：实发后两列（工资预支 / 发工资 按钮） ============ */
/*  - 替代 v1.60 起的「发放记录子行 + 确认框 + 锁按钮 + 点击金额发工资」合并胶囊 UI
 *  - 行尾两列各放一个独立按钮，触屏友好、视觉清晰，避免 N 行重复 audit
 */
#projSalaryPanel table.tbl th:nth-last-child(-n+2),
#projSalaryPanel table.tbl td:nth-last-child(-n+2) {
  white-space: nowrap;
  text-align: center;
  width: 1%;
}
#projSalaryPanel .btn-sm {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 6px;
  white-space: nowrap;
  min-height: 28px;
  line-height: 1.2;
}
#projSalaryPanel [data-salary-advance]:hover {
  background: var(--primary-soft, #ede9fe);
  color: var(--primary-deep, #5b21b6);
}
#projSalaryPanel [data-salary-pay-btn] {
  background: var(--primary, #7c3aed);
  color: #fff;
  border-color: var(--primary, #7c3aed);
}
#projSalaryPanel [data-salary-pay-btn]:hover {
  background: var(--primary-deep, #5b21b6);
  border-color: var(--primary-deep, #5b21b6);
  filter: brightness(1.05);
}
#projSalaryPanel [data-salary-pay-btn]:active { transform: scale(.97); }
#projSalaryPanel [data-salary-advance]:active { transform: scale(.97); }
@media (max-width: 900px) {
  #projSalaryPanel .btn-sm { padding: 6px 8px; font-size: 11.5px; }
}

/* ============ v1.164 工资表行内勾选 + 已发提成撤消按钮 ============ */
.row-pay-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.row-pay-cell input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}
.row-pay-cell input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: .35;
}
.row-pay-cell input[type="checkbox"]:disabled + span { opacity: .5; }
.btn-icon-only { padding: 4px 8px !important; min-width: 32px; }
.btn-icon-only:hover { background: var(--gray-100); border-color: var(--warning, #d97706); color: var(--warning, #d97706); }

/* v1.164 已发提成列点击高亮（提示「可点撤消」） */
.salary-paid-cell { cursor: default; }
/* 撤消按钮本身 hover 提示 */
[data-salary-undo]:hover { background: var(--warning-soft, #fef3c7); color: var(--warning-deep, #92400e); border-color: var(--warning, #d97706); }

/* v1.164 员工提成明细表已发完灰显（替代 v1.107 的 .comm-locked） */
.comm-check.comm-paid { cursor: not-allowed; opacity: .7; background: var(--gray-50, #f9fafb); }
.comm-check.comm-paid input[type="checkbox"] {
  background: var(--gray-300, #d1d5db);
  border-color: var(--gray-400, #9ca3af);
  cursor: not-allowed;
}
.comm-check.comm-paid input[type="checkbox"]:checked {
  background: var(--gray-500, #6b7280);
  border-color: var(--gray-500, #6b7280);
}
.comm-check.comm-paid input[type="checkbox"]:checked::after { border-color: #fff; }
.comm-check.comm-paid .comm-num { text-decoration: line-through; text-decoration-color: var(--gray-500, #6b7280); color: var(--gray-600, #4b5563); }
.comm-check.comm-paid .comm-paid-tag { color: var(--gray-600, #4b5563); }

/* v1.164 工资表 tfoot 加 1 列（待发提成） + 表头待发列图标 */
#projSalaryPanel thead th[title*="待发提成"],
#projSalaryPanel thead th:has(i.fa-square-check) {
  position: relative;
}
/*  工资发放弹窗（openSalaryPayModal）里的明细格子 + 列表行仍会用到 .comm-locked / .comm-lock-tag / .comm-rec-confirmed / .comm-rec-cell
 *  这些只在弹窗内部生效，不影响工资表（已删除相关子行）
 */
.comm-check.comm-locked { cursor: not-allowed; opacity: .85; }
.comm-check.comm-locked input[type="checkbox"] {
  background: var(--gray-200);
  border-color: var(--gray-300);
  cursor: not-allowed;
}
.comm-check.comm-locked input[type="checkbox"]:checked {
  background: var(--gray-400);
  border-color: var(--gray-400);
}
.comm-check.comm-locked input[type="checkbox"]:checked::after { border-color: #fff; }
.comm-check.comm-locked .comm-num { text-decoration: line-through; text-decoration-color: var(--gray-500); }
.comm-lock-tag { font-size: 10.5px; color: var(--gray-500); margin-left: 2px; }
tr.comm-rec-confirmed td { background: rgba(22, 163, 74, .06); }
tr.comm-rec-confirmed td:first-child::after {
  content: " ✓";
  color: var(--success-deep, #0f7a4d);
  font-weight: 700;
}
.comm-rec-cell { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border: 1px solid var(--border-default); border-radius: 6px; background: #fff; font-variant-numeric: tabular-nums; }
.comm-rec-cell.confirmed { border-color: var(--success, #16a34a); background: rgba(22, 163, 74, .08); }
.comm-rec-cell.pending { border-color: var(--warning, #d97706); background: rgba(217, 119, 6, .06); }
.comm-rec-cell.pending .cr-date, .comm-rec-cell.pending .cr-amt { color: var(--warning-deep, #92400e); }
.comm-rec-cell.comm-locked { cursor: default; }
.comm-rec-cell.comm-locked .cr-amt { opacity: .75; text-decoration: none; }
.cr-date { color: var(--gray-600); font-weight: 600; }
.cr-amt { color: var(--biz-employee, #b45309); font-weight: 700; }
.cr-amt:hover { text-decoration: underline; text-decoration-color: var(--primary); text-underline-offset: 2px; }

/* ============ v1.64 放大镜搜索（本月项目总表 / 项目明细表） ============ */
/* v1.65 仪表盘搜索已从标题行移到"项目"列表头内（.dash-proj-search-th 系列）；项目明细页仍用 .proj-toolbar */
.dash-proj-search-th {
  min-width: 150px;
}
.dash-proj-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}
.dash-proj-search .dps-title {
  font-weight: 700;
}
.dash-proj-search .dps-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--gray-500);
  cursor: pointer;
  border-radius: 6px;
  padding: 0;
  font-size: 12px;
}
.dash-proj-search .dps-btn:hover {
  background: var(--gray-100);
  color: var(--primary);
}
.dash-proj-search .dps-input {
  width: 120px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 400;
}
.proj-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.proj-search-count {
  padding: 3px 8px;
  background: var(--info-soft);
  border-radius: 6px;
  font-weight: 600;
}

/* ============ v1.66 资金账户 ============ */
.acc-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.acc-card { background: var(--card-bg, #fff); border: 1px solid var(--border-default); border-radius: 10px; padding: 14px 16px; }
.acc-card .acc-label { font-size: 12px; color: var(--gray-500); margin-bottom: 6px; }
.acc-card .acc-value { font-size: 24px; font-weight: 700; font-family: var(--font-num); font-variant-numeric: tabular-nums; color: var(--gray-900); }
.acc-card .acc-unit { font-size: 13px; color: var(--gray-400); font-weight: 500; margin-left: 2px; }
.switch-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--gray-700); margin-top: 4px; cursor: pointer; }
.acc-type-icon { width: 20px; text-align: center; color: var(--primary); }
#accountsTable .num { text-align: right; }

/* ============ v1.67 费用收支 / 资金流水 ============ */
.fin-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; overflow-x: visible; padding-bottom: 2px; }
.fin-toolbar > .fin-reset { margin-left: auto; flex: 0 0 auto; }
.fin-filter { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--gray-500); font-weight: 600; flex: 0 0 auto; }
.fin-filter .input { min-width: 0; font-weight: 400; }
.fin-filter > .input,
.fin-filter > select { width: 110px; }
.fin-filter #finMonth { width: 130px; }
.fin-filter #finType { width: 90px; }
/* v1.231 日期筛选器：一排横排 */
.fin-date-range { display: inline-flex; gap: 4px; align-items: center; flex-wrap: nowrap; }
.fin-date-range .fin-date { width: 130px; flex: 0 0 auto; }
.fin-date-range .fin-date-sep { color: #94a3b8; flex: 0 0 auto; }
.fin-filter #finAmtMin,
.fin-filter #finAmtMax { width: 78px; }
.fin-filter #finProject,
.fin-filter #finNote { width: 130px; }
/* v1.159 金额范围子容器：让 min ~ max 在 fin-filter 列内水平排开，不被 column 撑成两行 */
.fin-amt-range { display: inline-flex; align-items: center; gap: 4px; }
.fin-amt-tilde { padding: 0 2px; line-height: 1; }
/* v1.113 移动端：筛选条整行 grid 2 列，所有输入框按列对齐（月份/类型/账户/类别同宽） */
/* v1.120 修 iOS Safari：<input type="month"> 默认 min-content 宽导致 grid 退化为单列，强制 width:100% + max-width:100% + appearance:none 让 UA 别撑宽 */
/* v1.159 桌面端单行（flex nowrap + overflow-x auto），窄屏（≤768px）降级为 2 列网格允许换行 */
@media (max-width: 768px) {
  .fin-toolbar { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; row-gap: 10px; align-items: end; flex-wrap: wrap; overflow: visible; }
  .fin-toolbar > .fin-reset { margin-left: 0; grid-column: 1 / -1; justify-self: stretch; }
  .fin-filter { width: 100%; min-width: 0; }
  .fin-filter .input { min-width: 0; width: 100%; max-width: 100%; box-sizing: border-box; padding: 6px 8px; }
  .fin-filter > .input,
  .fin-filter > select { width: 100%; }
  .fin-filter input[type="month"],
  .fin-filter input[type="date"],
  .fin-filter select { -webkit-appearance: none; appearance: none; min-width: 0; width: 100%; max-width: 100%; box-sizing: border-box; }
  .fin-filter span { font-size: 11.5px; }
}
/* 分段按钮（流水类型切换） */
.seg { display: inline-flex; gap: 4px; background: var(--gray-100); border-radius: 8px; padding: 4px; }
.seg-btn { border: 0; background: transparent; padding: 6px 14px; border-radius: 6px; font-size: 13px; color: var(--gray-600); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.seg-btn:hover { color: var(--gray-900); }
.seg-btn.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-xs); font-weight: 600; }
.seg-btn.active[data-tt="income"] { color: var(--success-text); }
.seg-btn.active[data-tt="expense"] { color: var(--error-text); }
/* 类别徽标颜色 */
.badge.fin-cat-red    { background: #FEE2E2; color: #B91C1C; }
.badge.fin-cat-orange { background: #FFEDD5; color: #C2410C; }
.badge.fin-cat-blue   { background: #DBEAFE; color: #1D4ED8; }
.badge.fin-cat-purple { background: #EDE9FE; color: #6D28D9; }
.badge.fin-cat-teal   { background: #CCFBF1; color: #0F766E; }
.badge.fin-cat-cyan   { background: #CFFAFE; color: #0E7490; }
.badge.fin-cat-amber  { background: #FEF3C7; color: #B45309; }
.badge.fin-cat-green  { background: #DCFCE7; color: #15803D; }
.badge.fin-cat-gray   { background: #F3F4F6; color: #6B7280; }

/* ============ v1.68 账户互转 ============ */
.seg-btn.active[data-tt="transfer"] { color: var(--neutral); }
#finTable .badge-neutral { white-space: nowrap; }
/* v1.104 资金流水明细新增「备注」列；v1.121 改为限宽自动换行（不再省略号截断），字多切下一行 */
#finTable td.fin-note {
  max-width: 200px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.4;
  vertical-align: top;
}
/* v1.160 对应项目列加宽：项目名/编号长短不一，避免短名列被压窄、长名被挤换行 */
#finTable td.fin-proj { min-width: 140px; vertical-align: middle; }
#finTable th.fin-proj-th, #finTable thead th:nth-child(7) { min-width: 140px; }
@media (max-width: 900px) {
  #finTable td.fin-note { max-width: 150px; }
  #finTable td.fin-proj, #finTable th.fin-proj-th, #finTable thead th:nth-child(7) { min-width: 110px; }
}

/* v1.121 流水表：金额/账户余额居中、日期列显示时分秒、账户/类别列左对齐，避免数字与文字错位 */
#finTable th.th-center, #finTable td.td-center, .acc-detail-table th.th-center, .acc-detail-table td.td-center {
  text-align: center !important;
}
#finTable th.th-left, #finTable td.td-left, .acc-detail-table th.th-left, .acc-detail-table td.td-left {
  text-align: left !important;
}
#finTable .acc-dt, .acc-detail-table .acc-dt {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-num);
}
#finTable td.td-actions, #finTable th:last-child { text-align: center; }
/* 账户滚动余额：数字等宽右/中，突出当笔发生后的结余 */
#finTable td.fin-bal, .acc-detail-table td.acc-bal {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  color: var(--text, #1f2937);
}
/* v1.121 表格不超出页面：表容器最大宽度 + 允许内部横向滚动兜底 */
.tbl-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
#finTable { max-width: 100%; table-layout: auto; }
.acc-detail-table { max-width: 100%; table-layout: auto; }
@media (max-width: 768px) {
  #finTable .acc-dt, .acc-detail-table .acc-dt { white-space: normal; word-break: break-word; }
}
/* ============ v1.142 资金流水表 UI 排版优化 ============
   目标一：表格收进视口不撑出显示器 —— 数字/徽章列 nowrap 且窄，
           文字列（对应项目/责任人/备注）限宽 + 自动换行。
   目标二：表头与数据逐列对齐 —— 类别/对应项目/责任人/审批号 一律左对齐。 */
#finTable .acc-dt { white-space: nowrap; }
#finTable th, #finTable td { vertical-align: middle; }
/* v1.243 日期列加宽 + 字号放大，方便阅读 */
#finTable td.acc-dt { width: 108px; font-size: 13.5px; font-weight: 500; }  /* v1.245 日期列数据行 12.5→13.5 */
#finTable th.acc-dt { font-size: 12.5px; }
/* v1.266 日期列对齐（用户 2026-09-17 指定，仅动日期列）：表头「日期」居中，数据行日期贴左。
   背景：.tbl td:first-child/th:first-child 的 text-align:center 把日期列整体居中了；
   这两条用 ID 选择器 + !important 压过它（特异性 1,1,x > 0,2,x），其余列不受影响。 */
#finTable td.acc-dt, .acc-detail-table td.acc-dt { text-align: left !important; }
#finTable thead th:first-child, .acc-detail-table thead th:first-child { text-align: center !important; }
/* 类型/金额/账户余额 居中列 */
#finTable td.td-center, #finTable th.th-center { white-space: nowrap; }
/* 备注列：v1.241 进一步限宽，把更多空间让给操作列 —— 26%→14%，max-width 340px→180px，避免长备注撑爆表格挤掉操作列 */
#finTable td.fin-note { width: 14%; min-width: 80px; max-width: 180px; white-space: normal; word-break: break-word; overflow-wrap: anywhere; line-height: 1.4; }
@media (max-width: 1024px) {
  #finTable td.fin-note { width: 12%; min-width: 70px; max-width: 140px; }
}
/* 对应项目：限宽换行，不把表撑宽 */
#finTable td.fin-proj { max-width: 150px; white-space: normal; word-break: break-word; }
#finTable td.fin-approval { max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* v1.106 结算抽屉备注列：限宽 + 自动换行（防止长备注撑爆表格把操作列推出页面）
   v1.109 修复：.tbl td 默认 white-space:nowrap 优先级更高，需提升选择器/加 !important 才能换行 */
.tbl td.settle-note, td.settle-note {
  max-width: 320px;
  word-break: break-word;
  white-space: normal !important;
  line-height: 1.5;
  vertical-align: middle;
}
@media (max-width: 768px) {
  .tbl td.settle-note, td.settle-note { max-width: 180px; }
}

/* ============ v1.106 资金账户：双击账户名展开流水明细 ============ */
.acc-name-cell:hover { background: rgba(0,0,0,.03); }
tr.acc-row-expanded td { background: var(--surface-2, #f7f8fa); }
.acc-detail-row > td {
  padding: 0 !important;
  background: var(--surface-2, #f7f8fa);
  border-top: none;
}
.acc-detail-box {
  margin: 8px 16px 12px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  /* v1.126b 桌面也允许横向滚动，备注加宽后不把页面撑出显示器 */
  overflow-x: auto;
  max-width: 100%;
}
.acc-detail-title {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text, #1f2937);
  font-size: 13.5px;
}
.acc-detail-table { width: 100%; border-collapse: collapse; }
.acc-detail-table th,
.acc-detail-table td {
  padding: 6px 8px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}
.acc-detail-table thead th {
  background: var(--surface-2, #f7f8fa);
  color: var(--gray-500, #6b7280);
  font-weight: 600;
}
.acc-detail-table tbody tr:hover { background: #E0E7FF; }
/* v1.126 备注列加宽：240px → 360px（不超页面），让余账对账说明等长文本完整可读 */
.acc-detail-note {
  max-width: 360px;
  min-width: 160px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.4;
}
@media (max-width: 768px) {
  .acc-detail-box { margin: 6px 8px 10px; padding: 8px 8px; overflow-x: auto; }
  .acc-detail-table { min-width: 560px; }
  /* v1.126 移动端窄屏：备注列减窄回 240px，避免撑出屏幕 */
  .acc-detail-note { max-width: 240px; min-width: 120px; }
}

/* v1.267 明细表一屏放下（用户 2026-09-29 要求）：固定布局按百分比分列，备注列 23% 且换行，
   其它列超长省略号 —— 整表宽度恒等于 100%，不再被长备注撑出屏幕。
   （此前 table-layout:auto + 各列 nowrap，长备注会撑破 .acc-detail-box） */
.acc-detail-table { table-layout: fixed; }
.acc-detail-table th:nth-child(1) { width: 11%; }  /* 日期 */
.acc-detail-table th:nth-child(2) { width: 7%;  }  /* 类型 */
.acc-detail-table th:nth-child(3) { width: 11%; }  /* 金额 */
.acc-detail-table th:nth-child(4) { width: 14%; }  /* 类别/对方账户 */
.acc-detail-table th:nth-child(5) { width: 12%; }  /* 账户余额 */
.acc-detail-table th:nth-child(6) { width: 13%; }  /* 对应项目 */
.acc-detail-table th:nth-child(7) { width: 9%;  }  /* 责任人 */
.acc-detail-table th:nth-child(8) { width: 23%; }  /* 备注 */
.acc-detail-table td { overflow: hidden; text-overflow: ellipsis; }
.acc-detail-note { max-width: none; min-width: 0; white-space: normal; word-break: break-word; overflow-wrap: anywhere; }

/* ============ v1.69 账户对账 ============ */
.reconcile-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
}
.reconcile-status.reconciled {
  background: #DCFCE7;
  color: #15803D;
}
.reconcile-status.unreconciled {
  background: #FEF3C7;
  color: #B45309;
}

.reconcile-summary {
  background: #F9FAFB;
  border: 1px solid var(--border-default, #E5E7EB);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.7;
}
.reconcile-summary .rs-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.reconcile-summary .rs-row + .rs-row {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed #E5E7EB;
}
.reconcile-summary .rs-label {
  color: var(--gray-600, #4B5563);
}
.reconcile-summary .rs-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.reconcile-result {
  border-radius: 8px;
  padding: 14px;
  margin: 12px 0;
  font-size: 13px;
  line-height: 1.7;
}
.reconcile-result.match {
  background: #DCFCE7;
  border: 1px solid #86EFAC;
  color: #15803D;
}
.reconcile-result.diff {
  background: #FEE2E2;
  border: 1px solid #FCA5A5;
  color: #B91C1C;
}
.reconcile-result .rr-diff {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: block;
  text-align: center;
  margin: 6px 0;
}
.reconcile-result .rr-hint {
  background: rgba(255,255,255,0.6);
  border-radius: 6px;
  padding: 8px 10px;
  margin-top: 10px;
  font-size: 12.5px;
  line-height: 1.65;
}
.reconcile-result .rr-hint b {
  color: inherit;
}

.acc-action-row {
  display: inline-flex;
  gap: 4px;
  flex-wrap: nowrap;
}

/* ============ v1.259 账户停用/隐藏 ============ */
tr.acc-row-hidden td { opacity: .62; }
tr.acc-row-hidden td.acc-name-cell b { color: var(--gray-500, #6b7280); font-weight: 600; }
.badge.acc-hidden-badge { background: #F1F5F9; color: #64748B; }
tr.acc-sep-row td {
  text-align: center;
  padding: 5px 4px !important;
  background: var(--surface-2, #f7f8fa);
  border-top: 1px dashed var(--border, #e5e7eb);
  border-bottom: 1px dashed var(--border, #e5e7eb);
}
.acc-toggle-hidden { cursor: pointer; }
button.acc-act-show { color: var(--success, #15803D); }

/* ============ v1.71 对账手动调整区 + 调整流水徽标 ============ */
.reconcile-adjust {
  background: #FEFCE8;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 12px 0;
  font-size: 13px;
}
.reconcile-adjust .ra-title {
  font-weight: 600;
  color: #854D0E;
  margin-bottom: 10px;
  font-size: 13.5px;
}
.reconcile-adjust .field {
  margin-bottom: 8px;
}
.reconcile-adjust .field label {
  display: block;
  font-size: 12.5px;
  color: #78350F;
  margin-bottom: 4px;
}
.badge.badge-warning {
  background: #FEF3C7;
  color: #B45309;
}
.badge.badge-neutral {
  background: #F3F4F6;
  color: #6B7280;
}

/* ============ v1.75 「对应项目」筛选条 ============ */
/* 流水登记弹窗内：月份 + 状态 + 文本搜索，实时过滤下方项目下拉 */
.proj-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  background: var(--gray-50);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 8px;
}
.proj-filter-bar .input {
  min-height: 32px;
  font-size: 13px;
  font-weight: 400;
  min-width: 0;
}
.proj-filter-bar .proj-filter-month { flex: 0 0 auto; width: 130px; }
.proj-filter-bar .proj-filter-status { flex: 0 0 auto; width: 108px; }
.proj-filter-bar .proj-filter-search { flex: 1 1 auto; min-width: 120px; }
.proj-filter-bar .proj-filter-count {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  padding: 0 2px;
}
/* 计数状态色：无匹配时用 warning 提示 */
.proj-filter-bar .proj-filter-count.is-empty { color: var(--warning-text); }
/* 移动端：筛选条折行占满，控件各自成行，方便触控 */
@media (max-width: 480px) {
  .proj-filter-bar .proj-filter-month,
  .proj-filter-bar .proj-filter-status { flex: 1 1 45%; width: auto; }
  .proj-filter-bar .proj-filter-search { flex: 1 1 100%; min-width: 0; }
  .proj-filter-bar .proj-filter-count { width: 100%; text-align: right; }
}

/* ============ v1.76 操作日志 ============ */
#auditTable .badge.fin-cat-red { background: #FEE2E2; color: #B91C1C; }
#auditTable .badge.fin-cat-blue { background: #DBEAFE; color: #1D4ED8; }
#auditTable .badge.fin-cat-purple { background: #EDE9FE; color: #6D28D9; }
#auditTable .badge.fin-cat-green { background: #DCFCE7; color: #15803D; }
#auditTable .badge.fin-cat-amber { background: #FEF3C7; color: #B45309; }
.audit-toolbar .input { font-weight: 400; }

/* ============ v1.109 可滚动单选下拉（ScrollSelect）============ */
.ss-pop {
  position: fixed;
  z-index: 1200;
  display: none;
  background: var(--surface, #fff);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
  overflow: hidden;
  font-size: 13px;
}
.ss-list {
  max-height: min(50vh, 280px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 4px;
}
.ss-item {
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.1s;
}
.ss-item:hover { background: var(--gray-100, #f3f4f6); }
.ss-item.selected { color: var(--color-primary, #5b21b6); font-weight: 600; background: var(--gray-50, #f9fafb); }
.ss-empty { padding: 12px; color: var(--gray-400, #9ca3af); text-align: center; font-size: 12.5px; }
/* 输入框右侧下拉箭头提示（仅当前使用该类时） */
.ss-anchor { padding-right: 26px; background-image: linear-gradient(45deg, transparent 50%, var(--gray-500, #6b7280) 50%), linear-gradient(135deg, var(--gray-500, #6b7280) 50%, transparent 50%); background-position: calc(100% - 15px) calc(50% - 2px), calc(100% - 11px) calc(50% - 2px); background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; }
@media (max-width: 768px) {
  .ss-item { padding: 12px 14px; }
}

.audit-diff-toggle:hover { text-decoration: underline; }
/* 详情弹窗：变更前后两块 */
.audit-detail-block { margin-bottom: 12px; }
.audit-detail-title {
  font-size: 12px; font-weight: 600; color: var(--gray-500);
  margin-bottom: 6px;
}
.audit-detail-pre {
  background: var(--gray-50);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  font-family: var(--font-mono, "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace);
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--gray-800);
  max-height: 220px;
  overflow: auto;
  margin: 0;
}
/* v1.125 操作日志详情改「正常文字」：自然语言一句 + 可读字段行 */
.audit-detail-narrative {
  padding: 10px 12px;
  background: var(--gray-50);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--gray-800);
}
.audit-detail-lines {
  background: var(--gray-50);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 6px 0;
  max-height: 240px;
  overflow: auto;
}
.audit-detail-line {
  padding: 3px 12px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.audit-detail-line:nth-child(odd) { background: rgba(0,0,0,0.015); }
.audit-detail-empty {
  padding: 10px 12px;
  font-size: 12px;
  color: var(--gray-400);
  border: 1px dashed var(--border-default);
  border-radius: 8px;
}

/* ============ v1.125 ③结算记录 筛选器（日期范围 + 关联项目） ============ */
.settle-rec-filter { margin-left: auto; }
.settle-rec-filter input[type="date"] { -webkit-appearance: none; appearance: none; min-width: 0; }
@media (max-width: 768px) {
  .settle-rec-filter { width: 100%; margin-left: 0; }
  .settle-rec-filter .input { flex: 1 1 auto; min-width: 0; max-width: 100%; }
}


/* v1.204 项目附件上传器（localStorage） */
.att-toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:8px}
.att-stat{font-size:12px;color:var(--muted, #64748b);flex:1}
.att-list{display:flex;flex-direction:column;gap:6px;max-height:280px;overflow-y:auto}
.att-item{display:flex;align-items:center;gap:8px;padding:6px 8px;border:1px solid #e2e8f0;border-radius:8px;background:#f8fafc}
.att-thumb{width:48px;height:48px;object-fit:cover;border-radius:6px;border:1px solid #e2e8f0;flex-shrink:0;cursor:pointer;background:#fff}
.att-thumb-wrap{width:48px;height:48px;position:relative;flex-shrink:0;cursor:zoom-in;border-radius:6px;overflow:hidden;border:1px solid #e2e8f0;background:#fff}
.att-thumb-wrap:hover{box-shadow:0 0 0 2px rgba(99,102,241,.25)}
.att-thumb-wrap .att-thumb-img{width:100%;height:100%;object-fit:cover;display:block}
.att-thumb.att-icon{display:flex;align-items:center;justify-content:center;font-size:20px;background:#e0e7ff;color:#4338ca}
.att-info{flex:1;min-width:0}
.att-name{font-size:13px;font-weight:600;color:#0f172a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}
.att-name:hover{color:#4338ca;text-decoration:underline}
.att-preview-btn{color:#4338ca !important}
.att-preview-btn:hover{background:#e0e7ff !important}
.att-meta{font-size:11px;color:#64748b;margin-top:1px}
.att-btn{padding:3px 10px;border-radius:6px;background:#fff;border:1px solid #cbd5e1;font-size:12px;color:#0f172a;text-decoration:none;cursor:pointer;font-family:inherit}
.att-btn:hover{border-color:#94a3b8}
.att-btn.att-del{background:#fee2e2;color:#dc2626;border-color:#fecaca;margin-left:4px}
.att-btn.att-del:hover{background:#fecaca}
.att-empty{font-size:12.5px;color:#64748b;text-align:center;padding:14px 10px;border:1px dashed #e2e8f0;border-radius:8px;background:#fbfdff}

/* v1.204 附件预览灯箱 */
.att-preview-mask{position:fixed;inset:0;background:rgba(15,23,42,.88);display:none;align-items:center;justify-content:center;z-index:10000;padding:20px}
.att-preview-mask.open{display:flex}
.att-preview{background:#0f172a;color:#e2e8f0;border-radius:14px;max-width:94vw;max-height:94vh;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 30px 80px rgba(0,0,0,.55)}
.att-preview-bar{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:1px solid rgba(255,255,255,.08);background:rgba(255,255,255,.04);gap:10px}
.att-preview-name{font-size:13px;font-weight:600;max-width:46vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.att-preview-tools{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.att-preview-btn{padding:4px 11px;border-radius:7px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.18);color:#e2e8f0;font-size:14px;cursor:pointer;font-family:inherit}
.att-preview-btn:hover{background:rgba(255,255,255,.18)}
.att-preview-scale{font-size:12px;min-width:46px;text-align:center;color:#94a3b8}
.att-preview-stage{flex:1;display:flex;align-items:center;justify-content:center;min-height:58vh;min-width:62vw;overflow:auto;padding:14px;background:#020617}
.att-preview-stage img{max-width:100%;max-height:100%;transform-origin:center center;transition:transform .15s ease;user-select:none;-webkit-user-drag:none;cursor:zoom-in}
.att-preview-stage img.zoomed{cursor:grab}
.att-preview-meta{padding:8px 14px;font-size:12px;color:#94a3b8;border-top:1px solid rgba(255,255,255,.08);background:rgba(255,255,255,.04);display:flex;justify-content:space-between;gap:12px}
.att-preview-mask.fullscreen .att-preview{border-radius:0;max-width:100vw;max-height:100vh;width:100vw;height:100vh}
.att-preview-mask.fullscreen .att-preview-stage{min-height:calc(100vh - 88px);min-width:100vw}

@media (max-width:560px){
  .att-preview-name{max-width:30vw}
  .att-preview-tools .att-preview-btn{padding:3px 8px;font-size:12px}
  .att-preview-bar{flex-wrap:wrap}
  .att-item{padding:5px 6px}
  .att-thumb{width:42px;height:42px}
  .att-name{font-size:12.5px}
}
/* ===== v1.206 财务分析（基于项目维度 + 可调成本参数） ===== */
.fin-period-bar{display:flex;align-items:center;gap:12px;padding:8px 14px;background:var(--card,#fff);border:1px solid var(--border,#e2e8f0);border-radius:10px;margin-bottom:14px;font-size:13px}
.fin-period-bar .text-muted{color:var(--muted,#64748b)}
.fin-period-bar b{color:var(--ink,#0f172a);font-weight:600}
.fin-kpi-row{display:grid;grid-template-columns:repeat(5,1fr);gap:10px;margin-bottom:14px}
.fin-kpi{padding:14px 12px;border-radius:10px;border:1px solid var(--border,#e2e8f0);background:var(--card,#fff);position:relative}
.fin-kpi .lbl{font-size:11px;font-weight:600;color:var(--gray-700,#334155);margin-bottom:6px;letter-spacing:.5px;text-transform:uppercase}
.fin-kpi .val{font-size:22px;font-weight:700;color:var(--ink,#0f172a);line-height:1.1}
.fin-kpi .sub{font-size:11px;color:var(--muted,#64748b);margin-top:4px}
.fin-kpi.income{border-left:4px solid #16a34a;background:linear-gradient(135deg,#f0fdf4,#fff)}
.fin-kpi.cost{border-left:4px solid #dc2626;background:linear-gradient(135deg,#fef2f2,#fff)}
.fin-kpi.profit{border-left:4px solid #2563eb;background:linear-gradient(135deg,#eff6ff,#fff)}
.fin-kpi.net{border-left:4px solid #f59e0b;background:linear-gradient(135deg,#fffbeb,#fff)}
.fin-kpi.safe{border-left:4px solid #8b5cf6;background:linear-gradient(135deg,#f5f3ff,#fff)}
.fin-kpi.net .val{color:#f59e0b}.fin-kpi.safe .val{color:#8b5cf6}

.fin-config-row{display:grid;grid-template-columns:1.5fr 1fr;gap:14px;margin-bottom:14px}
.fin-config-card,.fin-cashflow-card,.fin-block{background:var(--card,#fff);border:1px solid var(--border,#e2e8f0);border-radius:12px;padding:14px 16px;box-shadow:0 2px 6px rgba(15,23,42,.04)}
.fin-config-card .card-title,.fin-cashflow-card .card-title,.fin-block .card-title{font-size:14px;font-weight:700;margin:0 0 12px;display:flex;align-items:center;gap:6px}
.fin-input-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:10px}
.fin-input-grid .field{display:flex;flex-direction:column;gap:4px}
.fin-input-grid .field label{font-size:11px;color:var(--gray-700,#334155);font-weight:600}
.fin-cust-spacer{align-self:end}
.fin-cust-list{margin-top:6px;padding:6px 0;border-top:1px dashed var(--border,#e2e8f0);border-bottom:1px dashed var(--border,#e2e8f0)}
.fin-cust-item{display:flex;align-items:center;gap:8px;padding:4px 6px;font-size:12.5px}
.fin-cust-item .name{flex:2;font-weight:600;color:var(--ink,#0f172a);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fin-cust-item .amt{font-weight:600;color:#dc2626;min-width:80px;text-align:right}
.fin-cust-item .months{color:var(--muted,#64748b);min-width:40px}
.fin-cust-item .monthly{color:#16a34a;min-width:90px;text-align:right;font-weight:600}
.fin-cust-item .fin-cust-del{margin-left:auto;padding:2px 8px;background:#fee2e2;color:#dc2626;border:1px solid #fecaca;border-radius:6px;font-size:11px;cursor:pointer}
.fin-cust-add{display:grid;grid-template-columns:2fr 1fr 1fr auto;gap:8px;margin-top:10px}

.fin-cf-row{display:flex;justify-content:space-between;align-items:center;padding:6px 0;border-bottom:1px dashed var(--border,#e2e8f0);font-size:13px}
.fin-cf-row:last-child{border-bottom:none;font-weight:700;font-size:14px;padding-top:10px}
.fin-cf-row .lbl{color:var(--gray-700,#334155)}
.fin-cf-row .val{font-family:Consolas,Menlo,monospace;font-weight:600}
.fin-cf-row .val.income{color:#16a34a}
.fin-cf-row .val.cost{color:#dc2626}
.fin-cf-row .val.transfer{color:#8b5cf6}
.fin-cf-row.net .val{font-size:18px;color:#0f172a}

.fin-proj-partner-row,.fin-mode-emp-row{display:grid;grid-template-columns:1.4fr 1fr;gap:14px;margin-bottom:14px}

.fin-list{max-height:380px;overflow-y:auto}
.fin-list-item{display:flex;align-items:center;gap:8px;padding:7px 8px;border-radius:8px;font-size:12.5px;margin-bottom:4px;background:#f8fafc;border:1px solid #f1f5f9}
.fin-list-item .idx{flex:0 0 24px;text-align:center;color:var(--muted,#64748b);font-weight:600;font-size:11px}
.fin-list-item .name{flex:1;min-width:0;font-weight:600;color:var(--ink,#0f172a);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fin-list-item .dim-tag{flex:0 0 28px;text-align:center;background:#e0e7ff;color:#4338ca;border-radius:4px;font-size:10.5px;padding:1px 4px;font-weight:600}
.fin-list-item .num{flex:0 0 90px;text-align:right;font-family:Consolas,Menlo,monospace;font-size:12px;color:var(--gray-700,#334155)}
.fin-list-item .num.margin{flex:0 0 56px;color:#94a3b8}
.fin-list-item .num.profit{color:#16a34a;font-weight:600}
.fin-list-item.neg{background:#fef2f2;border-color:#fee2e2}
.fin-list-item.neg .num.profit{color:#dc2626}
.fin-list-item.mid .num.profit{color:#94a3b8}
.fin-list-item.partner .name{color:#0f172a}
.fin-list-item.emp .num.profit{color:#2563eb}

.fin-table{width:100%;border-collapse:collapse;font-size:13px}
.fin-table th{text-align:left;padding:8px 10px;background:#f1f5f9;color:var(--gray-700,#334155);font-weight:600;border-bottom:1px solid var(--border,#e2e8f0);font-size:12px}
.fin-table td{padding:8px 10px;border-bottom:1px solid #f1f5f9;color:var(--gray-700,#334155);font-family:Consolas,Menlo,monospace;font-size:12.5px}
.fin-table tr:hover td{background:#f8fafc}

/* v1.206 移动端适配 */
@media (max-width:780px){
  .fin-kpi-row{grid-template-columns:repeat(2,1fr)}
  .fin-config-row,.fin-proj-partner-row,.fin-mode-emp-row{grid-template-columns:1fr}
  .fin-input-grid{grid-template-columns:1fr 1fr}
  .fin-cust-add{grid-template-columns:1fr 1fr}
  .fin-cust-add input,.fin-cust-add button{width:100%}
  .fin-kpi .val{font-size:18px}
}
@media (max-width:480px){
  .fin-kpi-row{grid-template-columns:1fr}
  .fin-input-grid{grid-template-columns:1fr}
}

/* v1.220 财务类别多选下拉 */
.fin-multiselect{position:relative;display:inline-block;min-width:160px}
.fin-ms-trigger{display:flex;align-items:center;justify-content:space-between;gap:6px;width:100%;min-height:34px;padding:6px 10px;background:#fff;border:1px solid #cbd5e1;border-radius:6px;cursor:pointer;font-size:13px;color:#0f172a;font-family:inherit}
.fin-ms-trigger:hover{border-color:#94a3b8}
.fin-ms-trigger.fin-ms-active{border-color:#2563eb;box-shadow:0 0 0 2px rgba(37,99,235,.15)}
.fin-ms-arrow{font-size:10px;color:#64748b;transition:transform .15s}
.fin-ms-trigger.fin-ms-active .fin-ms-arrow{transform:rotate(180deg)}
/* v1.222 电脑端类别下拉完整一竖列出，无滚动条 */
/* v1.230 类别下拉：固定面板内滚动（不再撑高页面 body 触发整页滚动条） */
.fin-ms-panel{position:absolute;top:calc(100% + 4px);left:0;right:0;max-height:320px;overflow-y:auto;overscroll-behavior:contain;background:#fff;border:1px solid #cbd5e1;border-radius:6px;box-shadow:0 8px 24px rgba(15,23,42,.15);z-index:1000;min-width:180px}
.fin-ms-panel[hidden]{display:none}
.fin-ms-item{display:flex;align-items:center;gap:8px;padding:7px 10px;font-size:13px;cursor:pointer;color:#1e293b;user-select:none}
.fin-ms-item:hover{background:#f1f5f9}
.fin-ms-item.fin-ms-all{font-weight:600;border-bottom:1px solid #e2e8f0;background:#f8fafc}
.fin-ms-item input[type=checkbox]{width:14px;height:14px;flex-shrink:0;cursor:pointer;accent-color:#2563eb}
.fin-ms-count{background:#2563eb;color:#fff;font-size:10.5px;padding:1px 6px;border-radius:8px;margin-left:auto}
@media (max-width:560px){.fin-ms-panel{max-height:60vh;overflow-y:auto}}

/* ============================================================
   v1.247 纯 UI 视觉优化（不涉及任何业务逻辑 / 字段 / 表格数据）
   范围：①全局导航 TAB 激活态强化 ②财务分析页面层次美化 ③Toast 精致化
   ============================================================ */

/* ---------- ① 顶部全局导航 TAB ---------- */
.nav-tabs { gap: 6px; }  /* 轻微间距，避免文字拥挤 */
.nav-tabs a {
  color: var(--gray-600);                       /* 未选中：提升文字对比度（原 gray-500 过浅） */
  position: relative;                           /* 供 ::after 定位激活下划线 */
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.nav-tabs a:hover {
  background: var(--gray-100);                  /* hover 浅底反馈 */
  color: var(--gray-900);
  box-shadow: 0 1px 3px rgba(15,23,42,.06);
}
.nav-tabs a.active {
  background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);  /* 极浅渐变底，一眼识别 */
  color: var(--color-primary-deep);
  font-weight: 700;                              /* 激活文字加粗 */
  box-shadow: 0 1px 4px rgba(79,70,229,.12);
}
/* 激活项底部高亮加粗下划线（伪元素：不占布局、不影响点击） */
.nav-tabs a.active::after {
  content: "";
  position: absolute; left: 14px; right: 14px; bottom: 4px;
  height: 3px; border-radius: 99px;
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
}

/* ---------- ② 财务分析页面 ---------- */
/* 页面大标题：字重加大，副标题说明文字加深 */
#page-finance-analysis .page-title { font-weight: 800; letter-spacing: -0.02em; }
#page-finance-analysis .page-title .page-sub,
#page-finance-analysis .page-sub { color: var(--gray-600); font-weight: 500; }

/* 卡片：柔和投影 + 立体层次（作用于「固定成本录入 / 核算口径 / 损益 / 关键判断」各卡） */
#page-finance-analysis .fin-config-card {
  border-color: #e2e8f0;
  box-shadow: 0 2px 10px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.04);
}
#page-finance-analysis .fin-config-card .card-title {
  font-size: 15px; font-weight: 800; margin-bottom: 14px;
}
#page-finance-analysis .fin-config-card .card-title i { color: var(--color-primary); }

/* 固定成本录入：输入框标签加粗 + 间距拉开 + hover/focus 高亮边框 */
#page-finance-analysis .fin-input-grid .field { gap: 6px; }
#page-finance-analysis .fin-input-grid .field label {
  font-size: 12px; font-weight: 700; color: #334155; letter-spacing: .01em;
}
#page-finance-analysis .fin-input-grid .input {
  transition: border-color .15s ease, box-shadow .15s ease;
}
#page-finance-analysis .fin-input-grid .input:hover { border-color: #94a3b8; }
#page-finance-analysis .fin-input-grid .input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}
/* 「自定义开支」标题行强化 */
#page-finance-analysis .fin-cust-block h4,
#page-finance-analysis div h4:has(+ .fin-cust-list) { font-weight: 700; }

/* 自定义开支「新增」按钮：视觉加重更醒目 */
#finA_custAdd {
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(79,70,229,.28);
}
#finA_custAdd:hover {
  box-shadow: 0 4px 12px rgba(79,70,229,.40);
  filter: brightness(1.05);
}

/* 核算口径 / 损益表：表头加粗加深、隔行浅灰、金额列右对齐、来源/占比列可读性 */
#page-finance-analysis .fin-table th {
  background: #e2e8f0; color: #0f172a; font-weight: 700; font-size: 12.5px;
}
#page-finance-analysis .fin-table td { color: #334155; }
#page-finance-analysis .fin-table tbody tr:nth-child(even) td { background: #f8fafc; }
#page-finance-analysis .fin-table td:nth-child(2) {
  text-align: right; font-variant-numeric: tabular-nums;
}
#page-finance-analysis .fin-table td:nth-child(3) { color: #475569; }
#page-finance-analysis .fin-table tbody tr:hover td { background: #E0E7FF; }

/* 右上角功能区：主按钮（保存筛选）饱和度拉高；次按钮（刷新数据）hover 反馈更明显 */
#finA_saveFilter {
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(79,70,229,.25);
}
#finA_saveFilter:hover {
  box-shadow: 0 4px 12px rgba(79,70,229,.38);
  filter: brightness(1.07);
}
#finA_refresh { border-color: #cbd5e1; }
#finA_refresh:hover {
  background: #eef2f7; border-color: #94a3b8; color: #1e293b;
  box-shadow: 0 2px 6px rgba(15,23,42,.08);
  transform: translateY(-1px);
}

/* ---------- ③ Toast 弹窗精致化 ---------- */
.toast {
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15,23,42,.20), 0 3px 10px rgba(15,23,42,.12);
  padding: 11px 22px;
  font-size: 13.5px; letter-spacing: .01em; line-height: 1.5;
  max-width: min(92vw, 440px);
}

/* ============================================================
   v1.248 修复手机端费用支出/收入筛选器日期与类型窗口重叠
   根因：.fin-date-range { display:inline-flex; flex-wrap:nowrap } 强制横向排
         两个 130px 日期 input + ~ 共 264px > 手机 grid 单列宽（约 168px）
         → 溢出后挤压右侧 .fin-filter（类型 select）导致重叠
   修复：手机端（≤768px）让 .fin-date-range / .fin-amt-range 垂直堆叠
   ============================================================ */
@media (max-width: 768px) {
  /* 日期/金额范围：垂直堆叠（每个 input 占满整行） */
  .fin-date-range,
  .fin-amt-range {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  .fin-date-range .fin-date { width: 100%; flex: 0 0 auto; }
  .fin-date-range .fin-date-sep {
    text-align: center;
    padding: 0;
    color: var(--gray-400);
    font-size: 12px;
  }
  .fin-amt-range input,
  .fin-amt-range .input { width: 100% !important; flex: 0 0 auto; }
  /* 防止 grid item 因内部 min-width 撑破列宽 */
  .fin-filter { min-width: 0; }
  .fin-filter .input,
  .fin-filter select { min-width: 0; }
}

/* ============================================================
   v1.261 移动端隐藏仪表盘 KPI 卡片
   ------------------------------------------------------------
   小屏上顶部 5~6 张 KPI 卡片会把首屏占满，"本月项目总表"被挤到
   第二屏之外，实际每天要看的是项目表而不是 KPI。
   只隐藏仪表盘的 #dashKpis；资金账户页的 #accountsKpis 不受影响。
   桌面端（>768px）行为完全不变。
   ============================================================ */
@media (max-width: 768px) {
  #dashKpis { display: none !important; }
}

/* ============================================================
   v1.261 只读模式（viewer 角色）界面锁定
   ------------------------------------------------------------
   app.js 的 applyMyPermissions() 给 body 挂 .ro-mode 后生效。
   数据层（cloud.js _guardWrite）已经会拦住所有写请求，这里补的是**界面**：
   否则按钮看着能点、点下去才弹错，用户会以为"还能编辑"。
   仪表盘本身没有写控件，所以实际受影响的主要是「合作结算」页。
   ============================================================ */
body.ro-mode #btnNewSettle,
body.ro-mode [data-edit-settle],
body.ro-mode [data-del-settle],
body.ro-mode #btnSaveSettle,
body.ro-mode #btnSaveTxn,
body.ro-mode #btnNewTxn,
body.ro-mode #btnSaveProject,
body.ro-mode #btnNewProject,
body.ro-mode [data-del-project],
body.ro-mode [data-edit-project] { display: none !important; }

/* v1.263 补齐上面漏掉的写入口。
   实测发现「新增项目」在项目结算页还有第二个按钮 #btnNewProject2（不在原清单里），
   只读账号在合作结算页仍能看到、点开能填表，直到保存才被拦 ——
   正是本段注释开头说的"看着能点、点下去才报错"。
   顺手把账户/员工/合作方/类别/工资/对账/企微同步/迁移备份等**写操作入口**一并收掉；
   只读账号本来也进不到这些页面，但口径统一、避免以后给 viewer 开新页面时再漏。 */
body.ro-mode #btnNewProject2,
body.ro-mode #btnNewAccount,
body.ro-mode #btnSaveAccount,
body.ro-mode #btnSaveEmps,
body.ro-mode #btnSavePartners,
body.ro-mode #btnCatMgrAddExp,
body.ro-mode #btnCatMgrAddInc,
body.ro-mode #btnSyncLocalCats,
body.ro-mode #btnApplyAdjust,
body.ro-mode #btnReconcileCheck,
body.ro-mode #btnReconcileMark,
body.ro-mode #btnSettleAll,
body.ro-mode #btnSettleNone,
body.ro-mode #btnWecomSync,
body.ro-mode #btnWecomManual,
body.ro-mode #btnRunMigrate,
body.ro-mode #btnCreateBackup,
body.ro-mode #btnUserMgr,
body.ro-mode .row-del,
body.ro-mode [data-edit-txn],
body.ro-mode [data-del-txn],
body.ro-mode [data-edit-acc],
body.ro-mode [data-del-acc],
body.ro-mode [data-edit-cat],
body.ro-mode [data-del-emp],
body.ro-mode [data-del-partner],
body.ro-mode [data-del-user],
body.ro-mode [data-del-row],
body.ro-mode [data-set-emp-status],
body.ro-mode [data-set-role],
body.ro-mode [data-set-status],
body.ro-mode [data-set-hidekpi] { display: none !important; }

/* 只读时把写弹窗里的表单控件也灰掉（防止残留入口） */
body.ro-mode #genModal input,
body.ro-mode #genModal select,
body.ro-mode #genModal textarea,
body.ro-mode #txnModal input,
body.ro-mode #txnModal select,
body.ro-mode #txnModal textarea { pointer-events: none; opacity: .65; }

/* 只读提示条 */
body.ro-mode #roNotice { display: flex !important; }
#roNotice {
  display: none; align-items: center; gap: 8px;
  margin: 0 0 12px; padding: 8px 12px; border-radius: 8px;
  font-size: 12.5px; background: var(--gray-100, #f1f1f1); color: var(--gray-600, #666);
}

/* v1.261 账号级隐藏仪表盘 KPI 卡片（users_meta.hide_kpi = true）
   与上面那条"手机端隐藏"不同：这条不看屏幕宽度，只要该账号开了开关就隐藏。
   app.js 的 applyMyPermissions() 按 users_meta.hide_kpi 给 body 挂 .hide-kpi */
body.hide-kpi #dashKpis { display: none !important; }

/* ============ v1.268 「员工提成明细」格子双击编辑提成 ============ */
/* 触发方式：双击格子（有金额的格 / 显示「—」的空格）→ 打开「编辑员工提成」弹窗。
   单击手感完全不变（格子里的 checkbox 与标签仍走原来的「提成发放」逻辑）。 */
.comm-edit-cell { cursor: pointer; }
.comm-edit-cell .comm-num { cursor: pointer; }
/* 未参与提成的空格：hover 给一层淡底，提示"这里能双击设提成" */
.comm-edit-cell.comm-empty:hover { background: var(--color-primary-soft, #eef2ff); }
/* 只读账号：不给"可编辑"的手型暗示，弹窗内的输入与保存也一并封掉 */
body.ro-mode .comm-edit-cell, body.ro-mode .comm-edit-cell .comm-num { cursor: default; }
body.ro-mode #commEditModal input,
body.ro-mode #commEditModal select,
body.ro-mode #commEditModal textarea { pointer-events: none; opacity: .65; }
body.ro-mode #commEditModal #ce_save { display: none !important; }
/* 只读账号不展示"双击可编辑提成"的说明（配合 app.js 里 editHint 置空） */
body.ro-mode .comm-edit-hint { display: none !important; }
/* v1.270 双击「项目名」= 一次编辑本项目全部员工提成 */
.proj-comm-cell { cursor: pointer; }
.proj-comm-cell:hover { background: var(--color-primary-soft, #eef2ff); }
body.ro-mode .proj-comm-cell { cursor: default; }

/* ============ v1.271 全局线条颜色加深（表单 / 表格 / 卡片 / 分隔线） ============
   做法：只改"线条"用的设计令牌，不动尺寸/圆角/间距，风险最小、一处可调。
   已核对：--gray-200 / --gray-300 在本文件里**从未**被用作 background / color，
   全部只用于 border，所以加深它们不会把任何底色压黑。
   ⚠️ --border 此前**根本没定义**，而文件里有 13 处写的是 var(--border, #e5e7eb)，
      等于一直吃浅色兜底 —— 这里把它补上，那些规则才会跟着一起加深。 */
:root {
  --form-border:     #A9B2BE;   /* 表单控件主边框（原 --gray-300 #D1D5DB） */
  --border-default:  #C4CBD4;   /* 表格 / 卡片 / 分区分割（原 #E5E7EB） */
  --border-subtle:   #DCE1E7;   /* 次级分隔线（原 #F3F4F6） */
  --border:          #C4CBD4;   /* 补定义：兜住全部 var(--border, #e5e7eb) */
  --gray-200:        #C4CBD4;
  --gray-300:        #A9B2BE;
}
/* 表单控件：不带 !important，靠"后写覆盖先写"压过 L1298 的 .input/.field，
   同时把焦点态（.input:focus，优先级更高）和校验态（红/绿边框）原样保留。 */
.input,
.field input, .field select, .field textarea,
select.input, textarea.input,
input, select, textarea {
  border-color: var(--form-border);
}
/* 表格线一起加深，避免"表单深了、表格还是浅的"这种割裂感 */
.tbl th, .tbl td { border-color: var(--border-default); }
.tbl, .tbl-wrap { border-color: var(--border-default); }
/* 弹窗与卡片外框 */
.modal, .card, .acc-card { border-color: var(--border-default); }
hr, .divider { border-color: var(--border-subtle); }
