:root {
  /* 底色 / 边界 / 文字 */
  --bg: #f2f5fb;
  --panel: #ffffff;
  --line: #e3e8f2;
  --line-soft: #eef1f8;
  --text: #16233d;
  --text-2: #55617a;
  --text-3: #8b95ab;
  /* 品牌：靛蓝结构 + 青绿强调 */
  --brand: #1e4fd8;
  --brand-3: #4a73e8;
  --brand-2: #eef3fe;
  --nav-bg: #fafbfe;
  --nav-bg-2: #f1f4fb;
  --nav-text: #55617a;
  --mint: #25e0ae;
  /* 语义色：正向 / 待办 / 风险 / 三组辅助色 */
  --ok: #0b7c3d;
  --ok-bg: #e4f6ec;
  --warn: #a9690a;
  --warn-bg: #fef1dc;
  --danger: #b32424;
  --danger-bg: #fde8e8;
  --teal: #0e9c8d;
  --teal-bg: #e4f7f4;
  --purple: #5b3ed6;
  --purple-bg: #f0edfe;
  --amber: #b8720a;
  --amber-bg: #fef5e7;
  --rose: #b32b57;
  --rose-bg: #fce9f0;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(22, 35, 61, 0.05), 0 6px 18px rgba(22, 35, 61, 0.05);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.err { color: var(--danger); min-height: 18px; font-size: 13px; margin: 6px 0; }

/* ---------------- 登录 ---------------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(820px 480px at 8% -12%, #dbe6ff 0%, rgba(219, 230, 255, 0) 62%),
    radial-gradient(700px 420px at 96% 6%, #d5f3ee 0%, rgba(213, 243, 238, 0) 58%),
    radial-gradient(620px 380px at 50% 108%, #fdeed8 0%, rgba(253, 238, 216, 0) 60%),
    #f3f6fc;
}
.login-card {
  width: 380px;
  background: var(--panel);
  border-radius: 18px;
  padding: 34px 30px 24px;
  box-shadow: 0 12px 44px rgba(22, 35, 61, 0.1), 0 2px 6px rgba(22, 35, 61, 0.04);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
/* 顶部品牌色条：让登录卡不显素 */
.login-card::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: linear-gradient(90deg, var(--brand) 0%, #3b70ff 45%, var(--mint) 100%);
}
/* 头部：logo + 系统名横向居中，公司名不再展示 */
.login-head {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-bottom: 24px;
}
.logo-mark {
  width: 52px; height: 52px; border-radius: 14px; display: block; flex: none;
  box-shadow: 0 8px 18px rgba(30, 79, 216, 0.22);
}
.login-head h1 { font-size: 21px; margin: 0; letter-spacing: .5px; }
.login-card .muted { margin: 0 0 22px; font-size: 13px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 14px; background: #fff; color: var(--text);
  outline: none; transition: border .15s, box-shadow .15s;
  font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(26, 95, 180, 0.12);
}
/* v1.80.1：动态必填高亮（收入合同选「子合同」后，上级主合同变必填） */
.field.req-focus > span { color: var(--warn); font-weight: 600; }
.field.req-focus select { border-color: var(--warn); background: var(--warn-bg); }
.field select:disabled { background: var(--line-soft); color: var(--text-3); cursor: not-allowed; }
/* 多选组（供应商类型等）：用 .field .chk 提高特异性，抵消上面 input 的 100% 宽度 */
.chk-group { display: flex; flex-wrap: wrap; gap: 10px 20px; padding: 6px 0 2px; }
.field .chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text); cursor: pointer; margin: 0; }
.field .chk input { width: 15px; height: 15px; padding: 0; margin: 0; border-radius: 3px; accent-color: var(--brand); cursor: pointer; }
.hint { font-size: 12px; color: var(--text-3); margin-top: 16px; line-height: 1.6; }

/* ---------------- 钉钉登录 ---------------- */
.ding-login { margin-bottom: 4px; }
.btn.ding-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: #1677ff; border-color: #1677ff; color: #fff;
  padding: 11px 14px; font-size: 15px; font-weight: 500;
}
.btn.ding-btn:hover { background: #0e63dd; border-color: #0e63dd; }
.btn.ding-btn:disabled { opacity: .65; cursor: default; }
.ding-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 5px; background: #fff; color: #1677ff;
  font-size: 12px; font-weight: 700; line-height: 1;
}
/* 「或使用手机号密码」：两条细线夹一行小字 */
.login-or { display: flex; align-items: center; gap: 10px; margin: 16px 0 14px; color: var(--text-3); font-size: 12px; }
.login-or::before, .login-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------------- 按钮 ---------------- */
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 13px;
  font-family: inherit; transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: #c9ccd1; background: #fafbfc; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #1740b8; }
.btn.danger { color: var(--danger); border-color: #f0c6c6; background: #fff; }
.btn.danger:hover { background: var(--danger-bg); }
.btn.ok { color: var(--ok); border-color: #bfe3d4; }
.btn.ok:hover { background: var(--ok-bg); }
.btn.block { width: 100%; padding: 11px; font-size: 15px; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------------- 框架 ---------------- */
/* 双栏独立滚动：.app 锁一屏高，左栏内部滚（#nav），右栏 .main 自己滚，互不牵动 */
.app { display: flex; height: 100vh; /* 底部留出备案页脚的高度，别让侧栏「退出」被盖住 */ padding-bottom: 34px; }
.sidebar {
  width: 224px; flex: 0 0 224px; background: var(--nav-bg); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; height: 100%;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 16px; border-bottom: 1px solid var(--line); }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; display: block; flex: none; }
.brand-lock { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.brand-text { color: var(--text); font-weight: 600; font-size: 15px; letter-spacing: .5px; }
.brand-sub { color: var(--text-3); font-size: 11px; letter-spacing: .3px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#nav { flex: 1; overflow-y: auto; padding: 10px 8px; }
.nav-group { margin-bottom: 2px; }
.nav-group-title {
  font-size: 13px; font-weight: 700; color: #3f4a63; letter-spacing: .02em;
  padding: 11px 12px 6px; user-select: none;
  display: flex; align-items: center; gap: 6px; cursor: pointer; border-radius: 6px;
  transition: color .12s ease, background .12s ease;
}
.nav-group-title:hover { color: var(--text); background: var(--nav-bg-2); }
.nav-group-title .caret {
  font-size: 10px; line-height: 1; opacity: .55; transform: rotate(90deg);
  transition: transform .15s ease;
}
.nav-group-title .gname { flex: 0 0 auto; }
.nav-group-title .gcount {
  margin-left: auto; font-size: 11px; font-weight: 600; color: #9aa5bc;
  font-variant-numeric: tabular-nums;
}
.nav-group.collapsed .nav-group-title .caret { transform: rotate(0deg); }
.nav-group.collapsed .nav-group-body { display: none; }
.nav-group:first-child .nav-group-title { padding-top: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px;
  color: var(--nav-text); cursor: pointer; font-size: 13.5px; margin-bottom: 2px; user-select: none;
  position: relative;
}
.nav-item:hover { background: var(--nav-bg-2); color: var(--text); }
.nav-item.active {
  background: var(--brand-2); color: var(--brand); font-weight: 600;
}
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px;
  border-radius: 2px; background: var(--brand);
}
.nav-item .ico { width: 16px; text-align: center; opacity: .75; font-size: 13px; }
/* v1.49.0：仓储子项升为该组二级菜单，与 .nav-item 视觉对齐（不再有缩进竖线） */
.nav-sub { margin: 0; padding-left: 0; border-left: none; display: grid; gap: 2px; }
.nav-sub-item {
  position: relative; display: flex; align-items: center;
  padding: 8px 12px 8px 38px; border-radius: 8px; color: var(--nav-text);
  cursor: pointer; font-size: 13.5px; margin-bottom: 2px; user-select: none;
}
.nav-sub-item:hover { background: var(--nav-bg-2); color: var(--text); }
.nav-sub-item.active { background: var(--brand-2); color: var(--brand); font-weight: 600; }
.nav-sub-item.active::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px;
  border-radius: 2px; background: var(--brand);
}
.nav-badge {
  margin-left: auto; background: #e0507e; color: #fff; font-size: 11px;
  min-width: 18px; height: 18px; border-radius: 9px; display: flex;
  align-items: center; justify-content: center; padding: 0 5px;
}
.sidebar-foot { border-top: 1px solid var(--line); padding: 12px; display: grid; gap: 8px; }
.me-name { font-weight: 500; font-size: 13px; color: var(--text); }
.me-role { font-size: 12px; color: var(--text-3); }
.me-dept { font-size: 11px; color: var(--text-3); margin-top: 2px; line-height: 1.4; }

/* v1.52.0 发文编辑：左侧大编辑框 + 右侧 A4 排版实时预览 */
.off-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 12px; }
.off-edit-pane, .off-preview-pane { min-width: 0; }
.off-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.off-editor-label { font-weight: 600; font-size: 13px; margin-right: 6px; }
.off-body-input {
  width: 100%; min-height: 330px; box-sizing: border-box; font-family: inherit;
  font-size: 13px; line-height: 1.9; padding: 10px;
  border: 1px solid var(--line); border-radius: 6px; resize: vertical;
}
.off-preview-head { font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.off-pages { max-height: 430px; overflow-y: auto; background: #f3f4f6; padding: 10px; border-radius: 6px; }
.off-page {
  width: 100%; aspect-ratio: 210 / 297; box-sizing: border-box; overflow: hidden;
  background: #fff; box-shadow: 0 1px 5px rgba(0, 0, 0, .14); margin-bottom: 12px;
  padding: 7% 8% 5%; font-size: 9px; line-height: 1.7; color: #1f2329;
}
.off-redhead { text-align: center; color: #c02a2a; font-size: 15px; font-weight: 700; letter-spacing: 2px; }
.off-redline { border-top: 2px solid #c02a2a; margin: 4px 0 8px; }
.off-doctype { text-align: center; font-size: 10px; color: #555; }
.off-title { text-align: center; font-size: 13px; font-weight: 700; margin: 8px 0; }
.off-to { font-size: 9px; margin-bottom: 6px; }
.off-para { text-indent: 2em; margin: 0 0 2px; }
.off-sign { text-align: right; margin-top: 10px; }
.off-foot { border-top: 1px solid #ddd; color: #888; font-size: 8px; margin-top: 8px; padding-top: 3px; }
@media (max-width: 900px) { .off-editor { grid-template-columns: 1fr; } }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; overflow-y: auto; }
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 10;
  box-shadow: 0 1px 3px rgba(22, 35, 61, 0.04);
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; overflow: hidden; }
.co { display: flex; align-items: center; gap: 10px; min-width: 0; white-space: nowrap; }
.co-name { font-size: 14px; font-weight: 600; color: var(--brand); letter-spacing: .2px; overflow: hidden; text-overflow: ellipsis; }
.co-sys { font-size: 12px; color: var(--text-3); flex: 0 0 auto; }
.co-sep { width: 1px; height: 16px; background: var(--line); flex: 0 0 auto; }
.topbar h2 { font-size: 13px; margin: 0; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.flow-btn { display: inline-flex; align-items: center; gap: 6px; }
.flow-btn .nav-badge { margin-left: 0; }
/* 顶栏登录人问候：名字加粗突出，提示语弱化 */
.greet { display: inline-flex; align-items: baseline; gap: 6px; font-size: 13px; color: #4b5563; white-space: nowrap; }
.greet b { font-size: 14px; color: #1f2937; }
.greet .greet-tip { font-size: 12px; color: #9aa1ab; }
@media (max-width: 1100px) { .greet .greet-tip { display: none; } }
.view { padding: 20px 24px 40px; }

/* ---------------- 卡片 / 统计 ---------------- */
.grid { display: grid; gap: 14px; }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1440px) { .grid.cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1180px) { .grid.cols-4, .grid.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .sidebar { display: none; }
  /* 窄屏没有双栏了：恢复整页自然滚动 */
  .app { height: auto; }
  .main { height: auto; overflow: visible; }
  .grid.cols-4, .grid.cols-5, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
}
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.card-head h3 { margin: 0; font-size: 14px; font-weight: 600; display: flex; align-items: center; }
/* 标题前的小色条：给整页一点节奏，不靠满屏上色 */
.card-head h3::before {
  content: ''; width: 3px; height: 13px; border-radius: 2px;
  background: var(--brand); margin-right: 8px; flex: none;
}
.card-body { padding: 16px; }
.stat { padding: 15px 16px 15px 17px; position: relative; }
.stat .label { color: var(--text-2); font-size: 13px; }
.stat .value { font-size: 24px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.stat .sub { color: var(--text-3); font-size: 12px; margin-top: 4px; }
/* 指标卡按语义轮转上色：左色条 + 同色数字，位置固定所以每页观感一致 */
.grid > .card.stat { border-left: 3px solid var(--tone, var(--brand)); }
.grid > .card.stat:nth-child(5n + 1) { --tone: #1e4fd8; --tone-ink: #1b47be; }
.grid > .card.stat:nth-child(5n + 2) { --tone: #f59e0b; --tone-ink: #b8720a; }
.grid > .card.stat:nth-child(5n + 3) { --tone: #12b5a4; --tone-ink: #0e9c8d; }
.grid > .card.stat:nth-child(5n + 4) { --tone: #6d4ae6; --tone-ink: #5b3ed6; }
.grid > .card.stat:nth-child(5n + 5) { --tone: #e0507e; --tone-ink: #b32b57; }
.grid > .card.stat .value { color: var(--tone-ink, var(--text)); }
.grid > .card.stat .ck-hint { color: var(--tone-ink, var(--text-3)); opacity: .65; }
/* 可点击的统计卡：资金看板大数字 → 明细弹层 */
.stat.clickable { cursor: pointer; transition: box-shadow .12s, transform .12s; }
.stat.clickable:hover { box-shadow: 0 8px 22px rgba(22, 35, 61, 0.1); transform: translateY(-2px); }
.stat .ck-hint { float: right; font-size: 11px; color: var(--text-3); font-weight: 400; }
.stat.clickable:hover .ck-hint { color: var(--primary, #2f6fed); }
/* 红涨绿跌：这两个状态色优先级高于指标卡轮转色 */
.grid > .card.stat .value.pos, .stat .value.pos { color: #c0392b; }
.grid > .card.stat .value.neg, .stat .value.neg { color: var(--ok); }

/* ---------------- 表格 ---------------- */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.toolbar input, .toolbar select {
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; background: #fff; outline: none; font-family: inherit;
}
.toolbar input:focus { border-color: var(--brand); }
.tabs { display: flex; gap: 4px; background: #eaeff8; padding: 3px; border-radius: 9px; }
.tab { padding: 6px 14px; border-radius: 7px; font-size: 13px; cursor: pointer; color: var(--text-2); }
.tab.active { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(22,35,61,.1); font-weight: 500; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; color: #7b879e; font-weight: 500; font-size: 12px; letter-spacing: .02em;
  padding: 10px 12px; border-bottom: 1px solid var(--line); background: #f7f9fd; white-space: nowrap;
}
td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:nth-child(even) { background: #fcfdff; }
tbody tr:hover { background: #f4f8ff; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.strong { font-weight: 500; }
.empty { padding: 40px; text-align: center; color: var(--text-3); }
/* 权限不足占位：比「加载失败」更明确，且给一条回到工作台的路 */
.perm-empty { padding: 72px 24px; }
.perm-empty .perm-icon { font-size: 30px; line-height: 1; opacity: .55; }
.perm-empty .perm-title {
  margin-top: 12px; font-size: 15px; font-weight: 600; color: var(--text);
}
.perm-empty .perm-sub { margin-top: 6px; font-size: 12.5px; color: var(--text-3); }
.perm-empty .btn { margin-top: 18px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.actions .btn { flex-shrink: 0; }

.tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border-radius: 6px; font-size: 12px; background: #eef1f8; color: var(--text-2); white-space: nowrap;
  font-weight: 500;
}
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.danger { background: var(--danger-bg); color: var(--danger); }
.tag.info { background: var(--brand-2); color: var(--brand); }
.tag.teal { background: var(--teal-bg); color: var(--teal); }
.tag.purple { background: var(--purple-bg); color: var(--purple); }

/* ---------------- 弹窗 ---------------- */
.mask {
  position: fixed; inset: 0; background: rgba(15, 20, 30, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal {
  background: #fff; border-radius: 14px; width: 560px; max-width: 100%;
  max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.18);
}
.modal.wide { width: 760px; }
.modal-head {
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot {
  padding: 14px 20px; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 10px;
}
/* ===== v1.91.0 A 档：录入弹窗 → 右侧抽屉（scoped，仅 openModal 容器） =====
   只加在 .form-drawer-mask / .form-drawer 上，密码门禁、项目汇总、报表钻取
   仍用裸 .mask/.modal 保持中置弹窗，互不干扰。 */
.mask.form-drawer-mask {
  padding: 0; align-items: stretch; justify-content: flex-end;
  background: rgba(15, 22, 36, 0.32);
}
.mask.form-drawer-mask .modal.form-drawer {
  position: relative;
  width: min(560px, 96vw); max-width: 96vw;
  height: 100vh; max-height: 100vh;
  border-radius: 0;
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 40px rgba(16, 24, 40, 0.16);
  animation: formDrawerIn 0.18s ease-out;
}
.mask.form-drawer-mask .modal.form-drawer.wide { width: min(760px, 96vw); }
.mask.form-drawer-mask .modal.form-drawer .modal-head,
.mask.form-drawer-mask .modal.form-drawer .modal-foot { flex-shrink: 0; }
.mask.form-drawer-mask .modal.form-drawer .modal-body { flex: 1; min-height: 0; }
@keyframes formDrawerIn {
  from { transform: translateX(28px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}
/* 左缘拖拽调宽把手 */
.form-drawer-resizer {
  position: absolute; left: -5px; top: 0; bottom: 0; width: 10px;
  cursor: col-resize; z-index: 2;
}
.form-drawer-resizer::after {
  content: ''; position: absolute; left: 4px; top: 42%; width: 2px; height: 16%;
  border-radius: 2px; background: var(--brand-3); opacity: 0.5;
}
.form-drawer-resizer:hover::after,
.form-drawer-resizer:active::after { opacity: 1; width: 3px; }
@media (max-width: 720px) {
  .mask.form-drawer-mask .modal.form-drawer,
  .mask.form-drawer-mask .modal.form-drawer.wide { width: 100vw; max-width: 100vw; }
  .form-drawer-resizer { display: none; }
}
.close { cursor: pointer; color: var(--text-3); font-size: 20px; line-height: 1; background: none; border: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
  background: #1f2329; color: #fff; padding: 10px 18px; border-radius: 8px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: all .2s; z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: #b3261e; }

.progress { height: 6px; background: #e8edf7; border-radius: 3px; overflow: hidden; min-width: 90px; }
.progress > i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.progress.warn > i { background: #e08a23; }
.progress.danger > i { background: var(--danger); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; font-size: 13px; }
.kv .k { color: var(--text-3); }

/* ================= 期次六：经营看板 + 报表中心 ================= */
.page-hint { color: var(--text-2); font-size: 13px; margin-bottom: 12px; }
.page-hint .muted { color: var(--text-3); }
/* 只读提示条（公司信息等：普通员工看得到、改不了） */
.page-hint.ro-hint {
  background: #f2f3f5; border-left: 3px solid #c9cdd4; border-radius: 0 6px 6px 0;
  padding: 10px 14px; color: var(--text-2);
}
.page-hint.ro-hint b { color: var(--text); }

.chart-svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

.bar-list { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 92px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row.clickable { cursor: pointer; border-radius: 6px; padding: 2px 4px; margin: 0 -4px; transition: background .12s; }
.bar-row.clickable:hover { background: rgba(47, 111, 237, .07); }
.bar-row .ck-hint { font-style: normal; color: var(--text-3); font-size: 11px; margin-left: 4px; }
.bar-row.clickable:hover .ck-hint { color: var(--primary, #2f6fed); }
.bar-name { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: #eaeff8; border-radius: 4px; height: 10px; overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 4px; background: var(--brand); }
.bar-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.bar-val em { color: var(--text-3); font-style: normal; font-size: 12px; }

.pie-wrap { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.pie { width: 150px; height: 150px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.04); }
.pie-legend { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.pie-item { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 8px; align-items: center; }
.pie-item.clickable { cursor: pointer; border-radius: 6px; padding: 2px 4px; margin: 0 -4px; transition: background .12s; }
.pie-item.clickable:hover { background: rgba(47, 111, 237, .07); }
.pie-item .ck-hint { width: auto; font-size: 11px; }
.pie-item.clickable:hover .ck-hint { color: var(--primary, #2f6fed); }
.pie-item i { width: 10px; height: 10px; border-radius: 2px; }
.pie-item b { font-weight: 600; font-variant-numeric: tabular-nums; }
.pie-item em { color: var(--text-3); font-style: normal; font-size: 12px; width: 46px; text-align: right; }

/* 报表中心布局 */
.rpt-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 980px) { .rpt-layout { grid-template-columns: 1fr; } }
.rpt-side { padding: 0; overflow: hidden; }
.rpt-list { max-height: calc(100vh - 220px); overflow: auto; }
.rpt-item { padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.rpt-item:hover { background: #fafbfc; }
.rpt-item.active { background: var(--brand-2); border-left: 3px solid var(--brand); padding-left: 11px; }
.rpt-name { font-weight: 500; margin-bottom: 3px; }
.rpt-meta { font-size: 12px; color: var(--text-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rpt-main { display: flex; flex-direction: column; gap: 14px; }

.rpt-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 14px 0; }
@media (max-width: 760px) { .rpt-picks { grid-template-columns: 1fr; } }
.pick-title { font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.chk-group { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.chk input { accent-color: var(--brand); }
.builder-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 12px; border-top: 1px dashed var(--line); }

/* 附件：票据 / 合同 / 项目影像 */
.attach { border-top: 1px dashed var(--line); margin-top: 14px; padding-top: 12px; }
.attach-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.attach-title { font-size: 13px; font-weight: 600; }
.attach-title em { font-weight: 400; font-style: normal; color: var(--text-3); font-size: 12px; margin-left: 8px; }
.attach-list { display: flex; flex-wrap: wrap; gap: 10px; min-height: 28px; }
.att-item { width: 104px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.att-thumb { display: block; height: 76px; background: #f6f7f8; }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att-file { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 76px; gap: 6px; padding: 0 6px; text-decoration: none; }
.att-ext { font-size: 11px; font-weight: 700; color: #fff; background: var(--brand); border-radius: 4px; padding: 2px 6px; }
.att-name { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 92px; }
.att-meta { display: flex; align-items: center; gap: 6px; padding: 6px 8px; font-size: 11px; color: var(--text-3); border-top: 1px solid var(--line); }
.att-meta .att-name { flex: 1; }
.att-del { border: 0; background: transparent; color: var(--text-3); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.att-del:hover { color: #c02a2a; }

/* 项目成员 */
.member-list { margin-bottom: 14px; max-height: 280px; overflow: auto; }
.member-add { border-top: 1px dashed var(--line); padding-top: 12px; }

/* 自定义字段动态表单 */
.dyn-form { display: flex; flex-direction: column; gap: 14px; }
.dyn-group-title { font-size: 12px; color: var(--text-2); margin-bottom: 8px; padding-left: 8px; border-left: 3px solid var(--brand); line-height: 1; }
.dyn-group { background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }

/* 审批流设计器 */
.tabs.sub { background: transparent; padding: 0; gap: 2px; margin-bottom: 10px; border-bottom: 1px solid var(--line); border-radius: 0; }
.tabs.sub .tab { border-radius: 6px 6px 0 0; border-bottom: 2px solid transparent; }
.tabs.sub .tab.active { border-bottom-color: var(--brand); background: transparent; }
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.chain-node { display: inline-flex; align-items: baseline; gap: 4px; background: #f2f4f7; border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font-size: 12px; }
.chain-node em { font-style: normal; color: var(--text-3); font-size: 11px; }
.chain-node .mode { font-style: normal; font-size: 10px; color: #fff; border-radius: 3px; padding: 0 4px; }
.chain-node .mode.hq { background: #7a5af5; }
.chain-node .mode.hx { background: #0f9d58; }
.chain-arrow { color: var(--text-3); font-size: 12px; }
.fn-title { display: flex; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 600; margin: 16px 0 8px; }
.flow-node { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; background: #fafbfc; }
.fn-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px dashed var(--line); }
.fn-seq { font-size: 12px; color: var(--brand); font-weight: 600; white-space: nowrap; }
.fn-name { flex: 1; min-width: 120px; }
.fn-head select { width: 86px; }
.fn-body { padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.fn-row { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; }
.fn-row > b { width: 64px; flex: 0 0 64px; font-weight: 500; color: var(--text-2); padding-top: 2px; }
.fn-row .chks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.fn-row select[multiple] { min-width: 200px; height: 66px; }
.fn-row .hint { margin: 0; align-self: center; }
.chk.line { display: flex; margin-bottom: 12px; }
.dot { color: #c02a2a; }

/* 统计卡（队伍工效 / 证件预警） */
.stat-row { display: flex; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.stat-row .stat { flex: 1; min-width: 180px; background: #fff; border: 1px solid var(--line); border-radius: 10px; border-left: 3px solid var(--tone, var(--brand)); }
.stat-row .stat:nth-child(4n + 1) { --tone: #1e4fd8; }
.stat-row .stat:nth-child(4n + 2) { --tone: #f59e0b; }
.stat-row .stat:nth-child(4n + 3) { --tone: #12b5a4; }
.stat-row .stat:nth-child(4n + 4) { --tone: #6d4ae6; }
.stat-row .stat span { display: block; color: var(--text-2); font-size: 13px; }
.stat-row .stat b { display: block; font-size: 24px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat-row .stat.danger b { color: #c02a2a; }
.stat-row .stat.warn b { color: #b26a00; }

/* 发票导入（P6.6） */
.ii-box { margin-bottom: 14px; }
.ii-drop {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  background: #fafbfc;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.ii-drop:hover,
.ii-drop.hot { border-color: var(--primary, #1f6feb); background: #f2f7ff; }
.ii-drop b { font-size: 14px; }
.ii-drop span { font-size: 12px; }
.ii-qr { display: flex; gap: 8px; margin-top: 8px; }
.ii-qr input { flex: 1; min-width: 0; }
.ii-msg { margin-top: 8px; font-size: 12px; color: var(--text-3); line-height: 1.5; }
.ii-msg.ok { color: #1a7f37; }
.ii-msg.warn { color: #b26a00; }
.ii-msg.err { color: #c02a2a; }

/* 发票批量导入清单 */
.ii-batch-top {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.ii-batch-top .field { margin: 0; }
.ii-batch-top .field > span { font-size: 12px; color: var(--text-2); }
@media (max-width: 720px) {
  .ii-batch-top { grid-template-columns: 1fr; }
}

/* ---------- 通用明细抽屉（所有列表点行打开） ---------- */
.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 22, 36, 0.36);
  z-index: 60;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(640px, 92vw);
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: -8px 0 24px rgba(16, 24, 40, 0.08);
  z-index: 61;
  display: flex;
  flex-direction: column;
}
.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.drawer-title { font-size: 16px; font-weight: 600; line-height: 1.4; }
.drawer-sub { margin-top: 4px; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.drawer-tools { display: flex; gap: 8px; flex-shrink: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px 32px; }
.drawer-amt {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 14px;
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 14px;
}
.drawer-amt b { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.drawer-amt span { font-size: 12px; color: var(--text-3); }
.drawer-sec { margin-bottom: 16px; }
.drawer-sec h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.drawer-kv {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
  font-size: 13px;
  border-bottom: 1px dashed #eef1f5;
}
.drawer-kv:last-child { border-bottom: none; }
.drawer-kv .k { color: var(--text-2); flex-shrink: 0; }
.drawer-kv .v { text-align: right; word-break: break-all; }
.drawer-note {
  padding: 10px 12px;
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 12px;
}
.drawer-link {
  display: inline-block;
  margin: 0 8px 8px 0;
  padding: 4px 10px;
  border: 1px solid var(--brand-2);
  background: var(--brand-2);
  color: var(--brand);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
.drawer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #f2f4f7;
  font-size: 13px;
}
.drawer-row:last-child { border-bottom: none; }
.drawer-row .r-main { flex: 1; min-width: 0; }
.drawer-row .r-sub { margin-top: 3px; font-size: 12px; color: var(--text-3); }
.drawer-row .r-amt { font-weight: 600; font-variant-numeric: tabular-nums; }
tr[data-detail-id] { cursor: pointer; }
tr[data-detail-id]:hover { background: #f7f9fc; }

/* 登录页：免登录勾选 */
.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 10px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}
.remember input { width: 15px; height: 15px; margin: 0; accent-color: var(--brand); cursor: pointer; }

/* 登录页：密码显示/隐藏 */
.pwd-wrap { position: relative; display: block; }
.pwd-wrap input { padding-right: 62px; }
.pwd-eye {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 12px;
  padding: 6px 8px;
  cursor: pointer;
  border-radius: 6px;
}
.pwd-eye:hover { color: var(--brand); background: var(--brand-2); }

/* ============================================================
 * 报表中心 P21：分组目录 / 交叉表 / 计算字段 / 下钻 / 订阅
 * ============================================================ */
.rpt-search { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.rpt-search input { width: 100%; height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font-size: 13px; }
.rpt-search input:focus { outline: none; border-color: var(--brand); }

.rpt-group { padding-top: 6px; }
.rpt-group-t {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px 6px; font-size: 11.5px; font-weight: 600;
  color: var(--text-3); letter-spacing: .04em; text-transform: none;
}
.rpt-group-t em { font-style: normal; font-weight: 500; color: var(--text-3); opacity: .8; }

.rpt-item { display: flex; align-items: center; gap: 7px; }
.rpt-item .rpt-star {
  flex: none; width: 18px; text-align: center; font-size: 14px;
  color: #c9ced6; cursor: pointer; line-height: 1;
}
.rpt-item .rpt-star:hover { color: #e0a11b; }
.rpt-item .rpt-star.on { color: #e0a11b; }
.rpt-item .rpt-name {
  flex: 1; min-width: 0; font-weight: 500; font-size: 13.5px; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rpt-item .rpt-ds {
  flex: none; font-size: 11px; color: var(--text-3);
  background: #f3f5f8; border-radius: 4px; padding: 1px 5px;
}

.rpt-meta-bar {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: center;
  padding: 8px 16px; border-bottom: 1px solid var(--line);
  font-size: 12px; color: var(--text-3); background: #fafbfc;
}

.rpt-sec { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.rpt-sec:first-of-type { margin-top: 8px; }
.rpt-sec-t {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 10px;
}
.rpt-sec-t em { font-style: normal; font-weight: 400; font-size: 12px; color: var(--text-3); }
.rpt-sec-t .btn { margin-left: auto; }
.rpt-ds-desc { margin-top: 16px; font-size: 12px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 16px;
  padding: 5px 12px; font-size: 13px; cursor: pointer;
  background: #fff; color: var(--text); user-select: none;
}
.chip:hover { border-color: var(--brand); }
.chip.on { background: var(--brand-2); border-color: var(--brand); color: var(--brand); font-weight: 500; }
.chip input { display: none; }

.ord-line { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; min-height: 26px; align-items: center; }
.ord-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--brand-2); color: var(--brand);
  border: 1px solid var(--brand); border-radius: 6px;
  padding: 3px 6px 3px 10px; font-size: 12.5px;
}
.mini {
  border: none; background: rgba(255,255,255,.7); color: var(--brand);
  border-radius: 4px; width: 18px; height: 18px; line-height: 1;
  font-size: 10px; cursor: pointer; padding: 0;
}
.mini:hover { background: #fff; }
.mini:disabled { opacity: .3; cursor: default; }
.mini.x { color: #b4518f; font-size: 13px; }

.calc-row, .filter-row {
  display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap;
}
.calc-row input, .calc-row select, .filter-row input, .filter-row select {
  height: 32px; border: 1px solid var(--line); border-radius: 7px;
  padding: 0 9px; font-size: 13px; background: #fff;
}
.calc-row .w120, .filter-row .w120 { width: 128px; }
.calc-row .grow { flex: 1; min-width: 220px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.filter-row input { width: 160px; }
.calc-row input:focus, .filter-row input:focus, .calc-row select:focus, .filter-row select:focus {
  outline: none; border-color: var(--brand);
}

/* 交叉表 */
.crosstab { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 100%; }
.crosstab th, .crosstab td { border-bottom: 1px solid var(--line); padding: 7px 10px; white-space: nowrap; }
.crosstab thead th { background: #f7f9fb; font-weight: 600; font-size: 12.5px; color: var(--text-2); }
.crosstab thead .ct-mh { text-align: center; border-left: 2px solid #e6eaf0; background: #eef2f7; color: var(--text); }
.crosstab thead .ct-sum-h { background: #e8edf4; }
.crosstab .ct-fix {
  position: sticky; left: 0; background: #fbfcfd; z-index: 2;
  text-align: left; font-weight: 500; color: var(--text);
  border-right: 1px solid var(--line);
}
.crosstab tbody tr:hover .ct-cell { background: #f5f9ff; }
.crosstab tbody tr:hover .ct-fix { background: #f0f5fc; }
.crosstab .ct-cell { cursor: pointer; }
.crosstab .ct-sum { background: #f7f9fb; font-weight: 600; border-left: 2px solid #e6eaf0; }
.crosstab .ct-total th, .crosstab .ct-total td {
  background: #eef2f7; font-weight: 700; border-top: 2px solid #dde3ec;
}
.rpt-table tbody tr.rpt-row { cursor: pointer; }
.rpt-table tbody tr.rpt-row:hover { background: #f5f9ff; }

/* 订阅 */
.sub-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.sub-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; margin-bottom: 6px; }
.sub-line:last-child { margin-bottom: 0; }
.sub-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.sub-form .field.wide { grid-column: 1 / -1; }
.sub-form .field span { font-size: 12px; color: var(--text-2); margin-bottom: 5px; display: block; }
.sub-form select[multiple] { height: auto; min-height: 110px; padding: 6px; }
@media (max-width: 760px) { .sub-form { grid-template-columns: 1fr; } }

/* 主子项目（P21.5）：项目范围 / 含下级 */
.rpt-scope { display: inline-flex; align-items: center; gap: 6px; }
.rpt-scope select { height: 26px; padding: 0 6px; font-size: 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; max-width: 240px; }
.rpt-inline { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.rpt-inline input[type='checkbox'] { margin: 0; }
.rpt-meta-bar select:disabled { opacity: 0.55; }

/* 钉钉同步（D3） */
.dt-pill { font-size: 12px; padding: 2px 10px; border-radius: 10px; border: 1px solid var(--line); }
.dt-ok { color: #0a7d3a; background: #eaf7ef; border-color: #bfe6cd; }
.dt-warn { color: #9a6a00; background: #fff8e6; border-color: #f0dda8; }
.dt-muted { color: var(--text-2); background: #f4f6f9; }
.dt-unit { font-size: 13px; font-weight: 400; color: var(--text-3); margin-left: 4px; }
.dt-small { font-size: 15px !important; }
.dt-alert { margin-top: 10px; padding: 8px 12px; border-radius: 6px; background: #fff8e6; border: 1px solid #f0dda8; color: #7a5600; font-size: 13px; }
.dt-tip { margin: 10px 0 0; padding: 10px 12px; border-radius: 6px; background: #f7f9fc; color: var(--text-2); font-size: 12px; line-height: 1.8; }
.dt-warn-list { margin: 8px 0 0; padding-left: 18px; color: #8a5a00; font-size: 12px; line-height: 1.9; }
.dt-fold { margin: 10px 0; border: 1px solid var(--line); border-radius: 8px; }
.dt-fold > summary { cursor: pointer; padding: 9px 12px; font-size: 13px; font-weight: 600; user-select: none; }
.dt-fold > summary::marker { color: var(--text-3); }
.dt-fold .table-wrap { border-top: 1px solid var(--line); }
.dt-fold table th, .dt-fold table td { padding: 7px 10px; }
.dt-tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 9px; }
.dt-act-create { color: #0a7d3a; background: #eaf7ef; }
.dt-act-update { color: #1657b8; background: #eaf1fb; }
.dt-act-same { color: var(--text-3); background: #f2f4f7; }
.dt-act-skip { color: #9a6a00; background: #fff8e6; }
.dt-env { font-size: 11px; font-weight: 400; color: var(--text-3); }
.dt-hint { display: block; margin-top: 4px; font-size: 11px; color: var(--text-3); font-style: normal; }

/* ==================== 单据详情（整页） ==================== */
.rec-page { display: flex; flex-direction: column; gap: 12px; padding-bottom: 8px; }
.rec-page.has-bar { padding-bottom: 76px; }

.rec-head {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.rec-back { flex: none; }
.rec-id { flex: 1; min-width: 0; }
.rec-title { font-size: 17px; font-weight: 650; line-height: 1.35; word-break: break-all; }
.rec-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 5px; font-size: 12.5px; color: var(--text-2); }
.rec-label { padding: 1px 8px; border-radius: 9px; background: var(--brand-2); color: #1657b8; }
.rec-no { font-family: ui-monospace, Menlo, Consolas, monospace; }
.rec-amt { flex: none; text-align: right; }
.rec-amt b { display: block; font-size: 21px; font-weight: 700; letter-spacing: -0.2px; }
.rec-amt span { font-size: 12px; color: var(--text-3); }

.rec-note {
  padding: 9px 13px; border-radius: 8px; font-size: 13px;
  background: var(--warn-bg); color: var(--warn); border: 1px solid #f3ddbe;
}

.rec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
@media (max-width: 1100px) { .rec-grid { grid-template-columns: 1fr; } }

.rec-sec { padding: 0; overflow: hidden; }
.rec-sec .card-head { padding: 12px 14px 10px; }
.rec-sec .card-head h3 { font-size: 14px; }
.rec-kvs { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--line); }
@media (max-width: 760px) { .rec-kvs { grid-template-columns: 1fr; } }
.rec-kv { padding: 9px 14px; border-bottom: 1px solid #f2f4f7; font-size: 13px; min-width: 0; }
.rec-kv.full { grid-column: 1 / -1; }
.rec-kv span { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 3px; }
.rec-kv b { font-weight: 500; word-break: break-all; }
.rec-sec .table-wrap { border-top: 1px solid var(--line); }
.rec-sec .empty { padding: 16px 14px; }
.rec-totals { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 10px 14px; border-top: 1px solid var(--line); background: #fafbfd; font-size: 13px; }
.rec-total em { font-style: normal; color: var(--text-3); margin-right: 6px; }
.rec-total b { font-weight: 650; }
.rec-links { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; }

/* 审批情况时间轴 */
.ft-list { list-style: none; margin: 0; padding: 12px 14px 4px; border-top: 1px solid var(--line); }
.ft-item { position: relative; padding: 0 0 14px 20px; }
.ft-item::before {
  content: ''; position: absolute; left: 4px; top: 12px; bottom: -2px; width: 1px; background: var(--line);
}
.ft-item:last-child::before { display: none; }
.ft-dot {
  position: absolute; left: 0; top: 5px; width: 9px; height: 9px; border-radius: 50%;
  background: #c3c9d2; box-shadow: 0 0 0 3px #fff;
}
.ft-dot.ok { background: var(--ok); }
.ft-dot.danger { background: var(--danger); }
.ft-dot.warn { background: var(--warn); }
.ft-dot.info { background: var(--brand); }
.ft-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 13px; }
.ft-top b { font-weight: 600; }
.ft-act { font-size: 11.5px; padding: 1px 7px; border-radius: 8px; background: #f1f3f6; color: var(--text-2); }
.ft-act.ok { background: var(--ok-bg); color: var(--ok); }
.ft-act.danger { background: var(--danger-bg); color: var(--danger); }
.ft-act.warn { background: var(--warn-bg); color: var(--warn); }
.ft-act.info { background: var(--brand-2); color: #1657b8; }
.ft-time { margin-left: auto; font-size: 11.5px; color: var(--text-3); }
.ft-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.ft-op {
  margin-top: 5px; padding: 7px 10px; border-radius: 7px; font-size: 12.5px;
  background: #f7f9fc; color: var(--text); border-left: 2px solid var(--line);
}
.ft-cur {
  display: flex; gap: 9px; align-items: flex-start; margin: 0 14px 14px;
  padding: 10px 12px; border-radius: 8px; background: var(--brand-2); font-size: 13px;
}
.ft-cur.done { color: var(--text-2); background: #f4f6f9; }
.ft-cur-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-top: 6px; flex: none; }
.ft-empty { padding: 18px 14px; color: var(--text-3); font-size: 13px; }
.ft-empty-li { color: var(--text-3); font-size: 13px; }

/* 底部操作条：返回 / 转交 / 拒绝 / 同意 */
.rec-bar {
  position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; margin-top: 4px;
  background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 -2px 12px rgba(16, 24, 40, 0.06);
}
.rec-bar .spacer { flex: 1; }
.rec-bar-hint { font-size: 12px; color: var(--text-3); margin-right: 4px; }
.rec-ask { display: flex; flex-direction: column; gap: 10px; }
.rec-ask-doc { font-size: 12.5px; color: var(--text-2); background: #f7f9fc; border-radius: 7px; padding: 7px 10px; }
.rec-ask textarea { width: 100%; }
@media (max-width: 760px) {
  .rec-head { flex-wrap: wrap; }
  .rec-amt { text-align: left; }
  .rec-bar { position: fixed; left: 0; right: 0; bottom: 0; border-radius: 0; margin: 0; }
  .rec-bar-hint { display: none; }
}

/* ============ 变更记录（P0 单据锁定与变更管理） ============ */
.cl-diffs { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 4px; }
.cl-diff { font-size: 12.5px; color: var(--tx2, #555); background: rgba(0, 0, 0, 0.035); border-radius: 6px; padding: 3px 8px; }
.cl-diff em { font-style: normal; color: var(--tx3, #888); margin-right: 4px; }
.cl-diff b { color: var(--tx, #222); }
.ft-dot.danger { background: #e54d42; }
.ft-dot.warn { background: #f0a020; }
.ft-dot.info { background: #3b82d6; }

/* ============ 变更单（L2） ============ */
.badge { display: inline-block; font-size: 11.5px; line-height: 18px; padding: 0 7px; border-radius: 9px; margin-left: 6px; vertical-align: middle; }
.badge.warn { background: #fdf1dc; color: #a96a00; }
.co-table-wrap { overflow-x: auto; }
.co-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.co-table th { text-align: left; font-weight: 600; color: var(--tx3, #888); padding: 6px 8px; border-bottom: 1px solid rgba(0, 0, 0, 0.07); white-space: nowrap; }
.co-table td { padding: 6px 8px; border-bottom: 1px solid rgba(0, 0, 0, 0.05); vertical-align: middle; }
.co-table tr:last-child td { border-bottom: 0; }
.co-table .input { width: 100%; box-sizing: border-box; }
.co-list { display: flex; flex-direction: column; gap: 6px; }
.co-row { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 7px; background: rgba(0, 0, 0, 0.025); }
.co-no { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--tx2, #555); }
.co-sum { flex: 1; font-size: 12.5px; color: var(--tx2, #555); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- 底部备案号 ---- */
.icp-footer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; text-align: center; padding: 6px 0 8px; font-size: 12px; color: var(--tx2, #8a8f99); pointer-events: auto; }
.icp-footer a { color: inherit; text-decoration: none; }
.icp-footer a:hover { color: var(--tx, #333); }
.icp-footer .beian-sep { margin: 0 10px; opacity: .6; }
.icp-footer a img { vertical-align: -2px; margin-right: 3px; }

/* ============ 产值单 ============ */
.neg { color: var(--danger, #c02a2a); }
.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin: 4px 0 10px; }
.kv-grid > div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed rgba(0,0,0,.06); padding: 5px 0; font-size: 13px; }
.kv-grid span { color: var(--tx3, #888); white-space: nowrap; }
.kv-grid b { text-align: right; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .kv-grid { grid-template-columns: 1fr; } }

/* ---------------- v1.90.8 UI 试点增强（体检第三步，纯样式 / 零功能改动） ----------------
 * 三页试点：产值单列表 / 审批待办 / 仓库出入库（共用 .table-wrap + .toolbar 组件）。
 * 均为正向增强，窄屏才可见，桌面端观感不变；不改任何金额 / 状态 / 交互逻辑。
 * 1) 长列表粘滞表头：纵向滚动时列名常驻；2) 触摸惯性滚动 + 细滚动条；
 * 3) 窄屏筛选控件自适应占宽，不再挤出屏幕。
 * ------------------------------------------------------------------------------ */
.table-wrap { -webkit-overflow-scrolling: touch; }
.table-wrap table thead th { position: sticky; top: 0; z-index: 2; }
.table-wrap::-webkit-scrollbar { height: 8px; width: 8px; }
.table-wrap::-webkit-scrollbar-thumb { background: #c9d2e0; border-radius: 4px; }
.table-wrap::-webkit-scrollbar-track { background: transparent; }
@media (max-width: 640px) {
  .toolbar { gap: 8px; }
  .toolbar > select, .toolbar > input {
    flex: 1 1 130px; min-width: 120px; max-width: none !important; width: auto;
  }
  .table-wrap table { font-size: 12px; }
  .table-wrap th { padding: 9px 10px; }
  .table-wrap td { padding: 10px; }
  .page-head { flex-wrap: wrap; gap: 8px; }
}

/* v1.98.0 甲供材料 AI 识别草稿：未匹配红框 / 低置信度高亮 */
.inv-invalid { border-color: var(--danger, #d93025) !important; box-shadow: 0 0 0 2px rgba(217,48,37,.12); }
.inv-lowconf { background: rgba(230,162,60,.12) !important; }

/* ===== v2.0.0 列表页统一版式组件 ===== */
/* 统计卡扩展：支持 5/6 张一行更紧凑，.card.stat 与 .stat 两结构统一配色 */
.stat-row.tight .stat { min-width: 150px; padding: 12px 14px; }
.stat-row .stat .sub { display: block; color: var(--text-3); font-size: 12px; margin-top: 4px; }
.stat-row .stat:nth-child(5n + 1) { --tone: #1e4fd8; }
.stat-row .stat:nth-child(5n + 2) { --tone: #f59e0b; }
.stat-row .stat:nth-child(5n + 3) { --tone: #12b5a4; }
.stat-row .stat:nth-child(5n + 4) { --tone: #6d4ae6; }
.stat-row .stat:nth-child(5n + 5) { --tone: #e0507e; }
/* 按钮行：统计置顶后，操作按钮统一沉到筛选行同一层 */
.action-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.action-bar .spacer { flex: 1; }
.action-bar .pick-count { font-size: 13px; color: var(--text-2); }
.action-bar .btn.primary { padding: 9px 18px; font-size: 14px; }
/* 分页栏 + 每页条数 */
.pager-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding: 10px 0; font-size: 13px; color: var(--text-2); }
.pager-bar .spacer { flex: 1; }
.pager-bar select { max-width: 90px; }
.pager-bar .pg-btn { min-width: 34px; }
.pager-bar .pg-btn:disabled { opacity: .45; cursor: not-allowed; }
/* 底部分计行 */
.table-wrap table tfoot td { background: #f7f9fc; font-weight: 600; border-top: 2px solid var(--line); }
.table-wrap table tfoot td.num { font-variant-numeric: tabular-nums; }


/* ===== v2.1.0 角色权限三档矩阵 ===== */
.perm-matrix { max-height: 52vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; margin-top: 8px; }
.perm-matrix .pgrp { font-size: 12px; font-weight: 600; color: #5a6b82; padding: 12px 0 6px; border-bottom: 1px dashed var(--line); margin-bottom: 4px; }
.perm-matrix .prow { display: flex; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px solid rgba(0,0,0,.04); }
.perm-matrix .prow:last-child { border-bottom: 0; }
.perm-matrix .plab { flex: 1; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.perm-matrix .pkey { color: #98a3b3; font-size: 11px; font-family: monospace; margin-left: auto; }
.perm-matrix .pills { display: inline-flex; gap: 4px; }
.pill-radio { display: inline-block; min-width: 46px; text-align: center; padding: 4px 8px; font-size: 12px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; color: #6b7688; user-select: none; }
.pill-radio:hover { border-color: #409eff; color: #409eff; }
.pill-radio.on { background: #409eff; border-color: #409eff; color: #fff; }
.form-grid label.ck { display: flex; align-items: center; gap: 6px; }

/* ==================== 系统内帮助文档 v2.1.2 ==================== */
.help-toc { background:#fff; border:1px solid var(--line,#e3e8ef); border-radius:10px; padding:14px 18px; margin-bottom:16px; }
.help-toc-t { font-weight:600; font-size:14px; margin-bottom:10px; color:#303d51; }
.help-toc-links { display:flex; flex-wrap:wrap; gap:8px; }
.help-toc-links a { display:inline-block; padding:6px 12px; background:#f4f7fb; border:1px solid #e3e8ef; border-radius:16px; color:#2b5cad; font-size:13px; cursor:pointer; text-decoration:none; }
.help-toc-links a:hover { background:#2b5cad; color:#fff; }
.help-doc { background:#fff; border:1px solid var(--line,#e3e8ef); border-radius:10px; padding:22px 28px 40px; max-width:960px; line-height:1.85; font-size:14px; color:#2b3442; }
.help-doc h2 { font-size:20px; margin:30px 0 14px; padding:8px 12px; border-left:4px solid #2b5cad; background:#f4f7fb; border-radius:4px; scroll-margin-top:12px; }
.help-doc h2:first-child { margin-top:4px; }
.help-doc h3 { font-size:16px; margin:22px 0 8px; color:#1f2d40; }
.help-doc p { margin:8px 0; }
.help-doc ul,.help-doc ol { margin:8px 0 8px 24px; }
.help-doc li { margin:5px 0; }
.help-doc strong { color:#1f2d40; }
.help-doc code { background:#f2f5f9; padding:1px 6px; border-radius:4px; font-family:Consolas,Monaco,monospace; font-size:13px; color:#b3306a; }
.help-doc pre { background:#1f2733; color:#e6edf5; padding:14px 16px; border-radius:8px; overflow:auto; font-size:13px; line-height:1.7; margin:12px 0; }
.help-doc pre code { background:none; color:inherit; padding:0; }
.help-doc table { border-collapse:collapse; width:100%; margin:12px 0; font-size:13px; }
.help-doc th,.help-doc td { border:1px solid #dfe5ee; padding:8px 10px; text-align:left; vertical-align:top; }
.help-doc th { background:#f4f7fb; color:#1f2d40; }
.help-doc tr:nth-child(even) td { background:#fafbfd; }
.help-doc figure { margin:14px 0; text-align:center; }
.help-doc figure img { max-width:100%; border:1px solid #e3e8ef; border-radius:6px; }
.help-doc figcaption { font-size:12px; color:#8a94a3; margin-top:6px; }
.help-note { background:#fff8e8; border-left:4px solid #e6a23c; padding:10px 14px; border-radius:4px; margin:12px 0; color:#6b5426; }
