:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --line: #e5e7eb;
  --text: #1f2329;
  --text-2: #646a73;
  --text-3: #8f959e;
  --brand: #1f6feb;
  --brand-3: #2b8cf0;
  --brand-2: #eaf2ff;
  --ok: #12805c;
  --ok-bg: #e7f5ef;
  --warn: #b25e09;
  --warn-bg: #fdf1e4;
  --danger: #c02a2a;
  --danger-bg: #fdecec;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 12px rgba(16, 24, 40, 0.04);
}
* { 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(1200px 600px at 20% 0%, #e8f0fb 0%, #f5f6f8 55%);
}
.login-card {
  width: 380px;
  background: var(--panel);
  border-radius: 16px;
  padding: 32px 30px 24px;
  box-shadow: 0 10px 40px rgba(16, 24, 40, 0.08);
  border: 1px solid var(--line);
}
.logo-mark {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600; letter-spacing: 1px;
  margin-bottom: 14px;
}
.login-card h1 { font-size: 22px; margin: 0 0 4px; }
.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);
}
/* 多选组（供应商类型等）：用 .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; }

/* ---------------- 按钮 ---------------- */
.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: #1a63d6; }
.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 { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; flex: 0 0 220px; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px; border-bottom: 1px solid var(--line); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600;
}
.brand-text { font-weight: 600; font-size: 15px; }
#nav { flex: 1; overflow-y: auto; padding: 10px 8px; }
.nav-group-title {
  font-size: 11px; font-weight: 600; color: #a3a9b2; letter-spacing: .06em;
  padding: 13px 12px 5px; user-select: none;
}
.nav-group-title:first-child { padding-top: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px;
  color: var(--text-2); cursor: pointer; font-size: 13.5px; margin-bottom: 2px; user-select: none;
  position: relative;
}
.nav-item:hover { background: #f5f6f8; 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: .8; font-size: 13px; }
.nav-badge {
  margin-left: auto; background: var(--danger); 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; }
.me-role { font-size: 12px; color: var(--text-3); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.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;
}
.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; 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; }
.view { padding: 20px 24px 40px; }

/* ---------------- 卡片 / 统计 ---------------- */
.grid { display: grid; gap: 14px; }
.grid.cols-4 { grid-template-columns: repeat(4, 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: 1180px) { .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .sidebar { display: none; }
  .grid.cols-4, .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; }
.card-body { padding: 16px; }
.stat { padding: 16px; }
.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; }
.stat .sub { color: var(--text-3); font-size: 12px; margin-top: 4px; }
.value.pos { color: var(--danger); }
.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: #eef0f3; padding: 3px; border-radius: 8px; }
.tab { padding: 6px 14px; border-radius: 6px; font-size: 13px; cursor: pointer; color: var(--text-2); }
.tab.active { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.06); font-weight: 500; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; color: var(--text-3); font-weight: 500; font-size: 12px;
  padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap;
}
td { padding: 11px 12px; border-bottom: 1px solid #f0f1f3; vertical-align: middle; }
tbody tr:hover { background: #fafcff; }
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); }
.actions { display: flex; gap: 6px; }

.tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border-radius: 4px; font-size: 12px; background: #f0f1f3; color: var(--text-2); white-space: nowrap;
}
.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); }

/* ---------------- 弹窗 ---------------- */
.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;
}
.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: #eef0f3; 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-name { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: #f1f3f5; 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 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; }
.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); }
