/* 出纳工作台 - 公共样式（精致极简版 v19）
 * 功能类名与布局结构完全不变，仅升级视觉质感
 * 设计方向：专业财税工具的克制现代感 —— 深蓝品牌色 + 柔和阴影 + 舒适留白
 */
:root {
  --brand: #185fa5;
  --brand-deep: #123c6b;
  --brand-hover: #0f4f8d;
  --ink: #1f2a3d;
  --ink-2: #5a6b85;
  --ink-3: #8b9bb3;
  --line: #e4e9f0;
  --line-2: #cfd8e3;
  --bg: #eef1f6;
  --panel: #ffffff;
  --green: #10B981;   /* v53.18 规范色：跌/支出/下降（原 #0f6e56） */
  --red: #EF4444;     /* v53.18 规范色：涨/收入/上升（原 #c0392b） */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 40, 75, .06), 0 2px 8px rgba(15, 40, 75, .05);
  --shadow-md: 0 4px 12px rgba(15, 40, 75, .08), 0 12px 32px rgba(15, 40, 75, .10);
  --topbar-grad: linear-gradient(120deg, #16314f 0%, #1f466f 55%, #215080 100%);
  /* v53.17e 语义色板：板块主题/状态色统一入口，模板与 JS 一律引用，禁止散落硬编码 */
  --accent-purple: #8B5CF6;   /* v53.18 对齐色盘紫罗兰（原 #8e44ad） */
  --purple-deep: #6b3fa0;     /* 特殊收款强调 */
  --purple-line: #d9c8ee;     /* 特殊收款面板边框 */
  --purple-soft: #f0e9fa;     /* 特殊收款浅底 */
  --accent-orange: #F59E0B;   /* v53.18 对齐色盘琥珀（原 #b9770e） */
  --accent-brown: #8a6d3b;    /* 注销类型 / 顾问流失 */
  --soft-bg: #fafbfc;         /* 看板浅灰底（区别于白面板） */
  --hover-bg: #f2f5fa;        /* 表头底 / 悬停浅蓝灰 */
  --ok-bg: #e5f3ee;           /* 成功 / 在岗浅绿底 */
  --ok-line: #b9dfd0;
  --danger-bg: #fdf0ef;       /* 危险操作浅红底 */
  --danger-line: #ecc9c4;
  --error: #d33;              /* 输入校验错误 */
  --error-bg: #fdf3f3;
  --warn-bg: #fff3cd;         /* 只读横幅警示黄 */
  --warn-line: #e0b04d;
  --warn-ink: #7a5b00;
  /* v53.18 看板色彩去噪规范：
   * ① 图表系列色仅限 5 色循环（JS 端 PALETTE 同源，opacity 0.8）；
   * ② 涨跌语义色独立（涨=红 / 跌=绿），浅底用于同比增减标签 */
  --chart-1: #3B82F6;  /* 蓝 */
  --chart-2: #10B981;  /* 翠绿 */
  --chart-3: #F59E0B;  /* 琥珀 */
  --chart-4: #8B5CF6;  /* 紫罗兰 */
  --chart-5: #F43F5E;  /* 玫红 */
  --up: #EF4444;  --up-bg: #FEF2F2;      /* 涨/正增长：主色 + 浅底 */
  --down: #10B981;  --down-bg: #ECFDF5;  /* 跌/负增长：主色 + 浅底 */
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  background-image: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(24, 95, 165, .07), transparent 60%);
  background-attachment: fixed;
}
a { color: var(--brand); text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

/* ---------- 顶部栏 ---------- */
.topbar {
  background: var(--topbar-grad);
  color: #fff;
  padding: 11px 28px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 12px rgba(15, 40, 75, .22);
  position: sticky; top: 0; z-index: 60;
}
.topbar .brand { display: flex; align-items: center; gap: 12px; }
.topbar .logo { height: 32px; width: auto; display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,.18)); }
.topbar h1 {
  font-size: 17px; font-weight: 600; letter-spacing: .3px;
  display: flex; align-items: baseline; gap: 10px;
}
.topbar h1 .brand-sub {
  font-size: 13px; font-weight: 400; color: rgba(255,255,255,.72);
  letter-spacing: .8px;
  padding-left: 10px; border-left: 1px solid rgba(255,255,255,.22);
}
.topbar .nav { display: flex; gap: 4px; }
.topbar .nav a {
  color: #b8c8dd; margin-left: 4px; padding: 6px 14px;
  border-radius: 8px; font-size: 14.5px;
  transition: background .15s, color .15s;
}
.topbar .nav a.active {
  background: rgba(255, 255, 255, .14);
  color: #fff; font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.topbar .nav a:hover { background: rgba(255, 255, 255, .10); color: #fff; }
.topbar .nav .nav-sep { width: 1px; height: 20px; background: rgba(255, 255, 255, .18); margin: 7px 10px; flex-shrink: 0; }

/* ---------- 表格列宽拖拽（v51）：表头右缘悬停显示手柄，拖动调宽，双击重置 ---------- */
table th { position: relative; }
table th::after {
  content: ""; position: absolute; top: 15%; right: -1px; width: 5px; height: 70%;
  cursor: col-resize; opacity: 0; border-right: 2px solid transparent;
  transition: opacity .12s, border-color .12s;
}
table th:hover::after { opacity: 1; border-right-color: #8aa3c0; }

/* ---------- 容器 ---------- */
.container { padding: 22px 28px 48px; max-width: 1600px; margin: 0 auto; }

/* ---------- 面板 ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: transform .25s ease, box-shadow .25s ease;
}
/* v53.18 悬停统一：上移 -4px + 深阴影，0.25s ease。
 * 面板内含卡片（.card/.chart-box）时自身不动，避免嵌套位移叠加（:has 降级为整体位移）。
 * v53.21b：直接包裹卡片组（> .cards / > .chart-grid）的"底层"面板完全无悬停——两层结构只让内层卡动 */
/* v1.4.26.3（向一反馈）：悬停位移只保留在 数据看板/老板看板/员工看板（body.hover-lift），
 * 其余台账板块全部取消——台账录入场景悬停浮起干扰操作 */
body.hover-lift .panel:hover { transform: translateY(-4px); box-shadow: 0 8px 25px rgba(0,0,0,0.08); }
body.hover-lift .panel:has(.card:hover), body.hover-lift .panel:has(.chart-box:hover) { transform: none; }
body.hover-lift .panel:has(> .cards):hover, body.hover-lift .panel:has(> .chart-grid):hover { transform: none; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.panel h2 {
  font-size: 16px; font-weight: 600; color: var(--ink);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.panel h2::before {
  content: ""; width: 4px; height: 16px; border-radius: 2px;
  background: linear-gradient(180deg, var(--brand), var(--brand-deep));
}

/* ---------- 筛选行（select/input/ms-btn 三件套统一外观） ---------- */
.filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filter-row .fr-group { display: inline-flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.filter-row label { font-size: 13.5px; color: var(--ink-2); }
.filter-row select, .filter-row input {
  height: 36px; padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  font-size: 14px; background: #fff; color: var(--ink);
  min-width: 90px;
  transition: border-color .15s, box-shadow .15s;
}
/* select：去掉浏览器原生箭头，用统一 SVG 三角，与 ms-btn 一致 */
.filter-row select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding: 0 32px 0 10px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1 3l4 4 4-4z' fill='%238b9bb3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px 10px;
}
.filter-row select:hover,
.filter-row select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(24, 95, 165, .12);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1 3l4 4 4-4z' fill='%23185fa5'/%3E%3C/svg%3E");
  outline: none;
}
.filter-row input:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(24, 95, 165, .12);
}
.filter-row input::placeholder { color: var(--ink-3); }
.filter-row input[type="date"] { min-width: 130px; }

/* ---------- 按钮 ---------- */
.btn {
  height: 36px; padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: #fff; font-size: 14px; color: var(--ink);
  transition: all .15s;
}
.btn:hover { border-color: var(--brand); color: var(--brand); box-shadow: 0 2px 6px rgba(24, 95, 165, .12); }
.btn-primary {
  background: linear-gradient(135deg, #1f6feb, var(--brand));
  border-color: transparent; color: #fff;
  box-shadow: 0 2px 8px rgba(24, 95, 165, .28);
}
.btn-primary:hover { background: linear-gradient(135deg, #1a63d3, var(--brand-hover)); color: #fff; box-shadow: 0 4px 12px rgba(24, 95, 165, .35); }
.btn-danger { background: #fff; border-color: #e2b6b0; color: var(--red); }
.btn-danger:hover { background: #fdf3f2; color: var(--red); }
/* 软危险按钮（浅红底）：批量删除等破坏性操作 */
.btn-danger-soft { background: var(--danger-bg); border-color: var(--danger-line); color: var(--red); }
.btn-danger-soft:hover { background: #fde5e2; border-color: var(--red); color: var(--red); }
/* 软品牌按钮（浅蓝底）：自动关联等次要操作 */
.btn-brand-soft { background: #eef4fd; border-color: #c9dbf0; color: var(--brand); }
.btn-brand-soft:hover { background: #e0edfb; border-color: var(--brand); color: var(--brand); }
.btn-sm { height: 28px; padding: 0 12px; font-size: 12.5px; border-radius: 7px; }

/* ---------- 分段控件（segmented，v53.17e 组件化：替换看板内联重复样式） ---------- */
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: var(--hover-bg); }
.seg .mode-btn { border: none; background: transparent; padding: 7px 18px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; transition: all .15s; font-family: inherit; }
.seg .mode-btn.active { background: var(--brand); color: #fff; font-weight: 600; }
.seg .mode-btn:not(.active):hover { background: rgba(24, 95, 165, .08); color: var(--brand); }

/* ---------- 收入/支出类型多选 ---------- */
.ms-wrap { position: relative; display: inline-block; }
.ms-btn { white-space: nowrap; }
/* 筛选行里的多选下拉按钮：与 select 同尺寸（36px 高 / 14px 字），视觉统一 */
.filter-row .ms-btn {
  height: 36px; min-width: 112px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); font-size: 14px;
  display: inline-flex; align-items: center; justify-content: space-between; gap: 8px;
  transition: border-color .15s, box-shadow .15s;
}
/* 多选下拉箭头：SVG 三角（与 select 箭头一致；颜色通过 background-color 控制） */
.filter-row .ms-btn::after {
  content: ""; width: 10px; height: 10px; flex-shrink: 0;
  -webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1 3l4 4 4-4z'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1 3l4 4 4-4z'/%3E%3C/svg%3E") no-repeat center / contain;
  background-color: #8b9bb3;
  transition: background-color .15s;
}
.filter-row .ms-btn:hover::after,
.filter-row .ms-btn:focus::after { background-color: var(--brand); }
.filter-row .ms-btn:hover { border-color: var(--brand); color: var(--brand); }
.filter-row .ms-btn:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(24, 95, 165, .12); }
.ms-panel {
  position: absolute; top: 32px; left: 0; z-index: 50;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 12px; min-width: 200px;
  animation: popIn .16s ease-out;
}
@keyframes popIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ms-opts { max-height: 264px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; min-width: 216px; }
.ms-opt {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--ink);
  padding: 5px 8px; border-radius: 6px;
  cursor: pointer; transition: background .12s;
}
.ms-opt:hover { background: #f2f6fc; }
.ms-opt input[type="checkbox"] {
  width: 15px; height: 15px; min-width: auto; min-height: auto;
  padding: 0; margin: 0; border: initial; background: initial;
  font-size: initial; flex-shrink: 0; cursor: pointer; accent-color: var(--brand);
}
.ms-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

/* ---------- 流失登记：chips 多选（保留样式，已改用下拉多选） ---------- */
.chip-group { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 30px; padding: 0 12px; border-radius: 15px;
  border: 1px solid #cfd8e3; background: #fff; color: var(--ink-2);
  font-size: 13px; cursor: pointer; transition: all .12s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active {
  background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500;
}

/* 档案详情（人事档案） */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.profile-item { display: flex; flex-direction: column; }
.profile-item.full { grid-column: 1 / -1; }
.profile-item .k { font-size: 12px; color: var(--ink-3); margin-bottom: 3px; }
.profile-item .v { font-size: 14px; color: var(--ink); word-break: break-all; line-height: 1.5; }
.profile-item .v.big { font-size: 15.5px; font-weight: 600; letter-spacing: .5px; }

/* 状态徽章（人事档案） */
.badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge.on { background: var(--ok-bg); color: var(--green); }
.badge.off { background: var(--bg); color: var(--ink-3); }

/* 回访记录多行输入框（结果 / 下一步） */
.visit-textarea {
  width: 100%; min-height: 68px; padding: 8px 10px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; color: var(--ink);
  resize: vertical; box-sizing: border-box; line-height: 1.55;
  transition: border-color .15s, box-shadow .15s;
  display: block;
}
.visit-textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(24, 95, 165, .12);
}
.visit-textarea::placeholder { color: var(--ink-3); }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 10px 10px; text-align: left; border-bottom: 1px solid #edf0f5; white-space: nowrap; }
th {
  background: #f2f5fa; color: var(--ink-2);
  font-weight: 600; font-size: 12.5px; letter-spacing: .3px;
}
tbody tr { transition: background .12s; }
tbody tr:hover { background: #f4f8fd; }
/* v53.17e 收支方向色铁律：涨红跌绿（与老板看板同比口径一致）。
 * 收入/进账/上升 = 红（--red）；支出/出账/下降 = 绿（--green）。 */
.amount-in { color: var(--red); font-weight: 600; font-variant-numeric: tabular-nums; }
.amount-out { color: var(--green); font-weight: 600; font-variant-numeric: tabular-nums; }
td.op a { color: var(--brand); margin-right: 10px; cursor: pointer; font-size: 13px; }
td.op a:hover { text-decoration: underline; }
td.op a.del { color: var(--red); }
.empty-tip { text-align: center; color: var(--ink-3); padding: 34px 0; }

/* 紧凑表格：固定布局 + 单元格换行，无需左右滚动 */
.table-wrap { overflow-x: hidden; }
table.compact { table-layout: fixed; font-size: 13px; }
table.compact th, table.compact td {
  padding: 8px 8px; white-space: normal; word-break: break-word; line-height: 1.45;
}
table.compact td { vertical-align: middle; }
table.compact td.edit-cell { cursor: pointer; }
table.compact td.edit-cell:hover { background: #eef5ff; }
table.compact .w-period { width: 7%; }
table.compact .w-date { width: 9%; }
table.compact .w-party { width: 11%; }
table.compact .w-summary { width: 17%; }
table.compact .w-type { width: 11%; }
table.compact .w-bank { width: 12%; }
table.compact .w-amount { width: 9%; text-align: center; font-variant-numeric: tabular-nums; }
table.compact .w-invoice { width: 4%; text-align: center; }
table.compact .w-invoice input[type="checkbox"] { margin: 0; accent-color: var(--brand); }
table.compact .w-remark { width: 9%; }
table.compact .w-op { width: 5%; text-align: center; }
table.compact td.op { text-align: center; }
table.compact td.op a { margin-right: 6px; }

/* 列对齐规则（全站统一）：短枚举/数字/操作列居中，长文本/变长文本靠左 */
table.compact th.tc, table.compact td.tc { text-align: center; }
table.compact td.tc .inline-input { text-align: center; }

/* 行内编辑控件 */
.inline-input {
  border: 1px solid var(--brand);
  border-radius: 6px;
  padding: 4px 8px; font: inherit; font-size: 13.5px;
  box-sizing: border-box; background: #fff; color: var(--ink);
  box-shadow: 0 0 0 3px rgba(24, 95, 165, .12);
}
.inline-input:focus { outline: none; }
.inline-area { resize: none; overflow-y: auto; line-height: 1.45; min-height: 26px; display: block; }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; color: var(--ink-2); }
.pager button { height: 30px; padding: 0 14px; }
.pager .info { flex: 1; font-weight: 500; color: var(--ink); }
#page-cur { background: #eef3fa; padding: 3px 10px; border-radius: 14px; font-size: 12.5px; color: var(--brand); }

/* ---------- 弹窗 ----------
 * v53.15：位置统一调低——由顶部 120px 改为距顶 24vh（约屏幕 1/4 处），
 * 避免弹窗过高偏上（用户多次反馈"弹窗位置太高"）。新增弹窗一律沿用 .mask/.dialog。 */
.mask {
  display: none; position: fixed; inset: 0;
  background: rgba(15, 32, 58, .45);
  backdrop-filter: blur(3px);
  z-index: 100; align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: 24vh 16px 48px;
}
.mask.show { display: flex; }
/* v53.12：流水关联业绩详情弹窗需盖在触发它的弹窗之上
   （perf-links-mask 在 DOM 中位于 link-mask/auto-link-mask 之前，同级 z-index 会被后者盖住） */
#perf-links-mask { z-index: 130; }
.dialog {
  max-height: 90vh; overflow-y: auto;
  background: #fff;
  border-radius: 14px; width: 640px; max-width: 100%;
  padding: 24px 26px;
  box-shadow: 0 24px 64px rgba(15, 40, 75, .25);
  animation: dialogUp .2s ease-out;
}
@keyframes dialogUp { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.dialog h3 { font-size: 17px; font-weight: 600; margin-bottom: 18px; color: var(--ink); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-item { display: flex; flex-direction: column; }
.form-item.full { grid-column: 1 / -1; }
.form-item label { font-size: 12.5px; color: var(--ink-2); margin-bottom: 5px; }
.form-item input:not([type="radio"]):not([type="checkbox"]), .form-item select {
  width: 100%; box-sizing: border-box; min-width: 0; /* v1.4.26.10：窄弹窗（记一笔）栅格列被输入框固有宽度撑破；v1.4.27.2 排除 radio/checkbox（否则单选圆圈被拉满宽） */
  height: 36px; padding: 0 10px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  font-size: 13.5px; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.form-item input[type="radio"] {
  width: 15px; height: 15px; min-width: 15px; margin: 0;
  accent-color: var(--brand); cursor: pointer; flex-shrink: 0;
}
.form-item textarea {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  font-size: 13.5px; font-family: inherit; color: var(--ink);
  resize: vertical; line-height: 1.55; box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(24, 95, 165, .12);
}
/* v1.5.4.4：按钮行垂直居中（关闭/编辑/发布、下载/关闭上下错位修复——
   span 内的内联按钮与 a.btn 走基线对齐导致偏移；span 统一 inline-flex 垂直居中） */
.dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 20px; }
.dialog-actions > span { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.dialog-actions a.btn { display: inline-flex; align-items: center; justify-content: center; }
.field-error { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(192, 57, 43, .10) !important; }
.msg { font-size: 13.5px; margin-top: 8px; }
.msg.err { color: var(--red); }
.msg.ok { color: var(--green); }

/* 导入报告 */
.report-box { margin-top: 12px; font-size: 13px; max-height: 260px; overflow-y: auto; }
.report-box .err { color: var(--red); }
.report-box .warn { color: #a9790f; }
.report-box .ok { color: var(--green); font-weight: 600; }
.report-box ul { margin-left: 18px; }
.report-box li { margin: 2px 0; }

/* 看板口径切换按钮 */
.mode-btn {
  border: none; background: transparent;
  padding: 7px 18px; font-size: 13.5px; color: var(--ink-2);
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.mode-btn.active {
  background: var(--brand); color: #fff; font-weight: 600;
}
.mode-btn:not(.active):hover { background: rgba(24, 95, 165, .08); color: var(--brand); }

/* ---------- 看板卡片 ----------
 * v53.18 规范：卡片纯白底（数字可着色，卡片本身不着色）；悬停统一 translateY(-4px)+阴影加深 */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 8px 25px rgba(0,0,0,0.08); }
.card .num { font-size: 32px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.card .num.small { font-size: 15px; }
.card .lbl { font-size: 13px; color: var(--ink-2); }
.card .num.in { color: var(--red); }   /* v53.17e 涨红跌绿：收入卡=红 */
.card .num.out { color: var(--green); } /* 支出卡=绿 */
.card .sub { font-size: 12px; color: var(--ink-3); margin-top: 6px; word-break: break-all; line-height: 1.5; }
.bar { height: 7px; background: #e8edf4; border-radius: 4px; margin-top: 8px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--chart-1); border-radius: 4px; transition: width .3s; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-box {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: transform .25s ease, box-shadow .25s ease;
}
.chart-box:hover { transform: translateY(-4px); box-shadow: 0 8px 25px rgba(0,0,0,0.08); }
.chart-box h3 { font-size: 14px; font-weight: 600; margin-bottom: 10px; color: var(--ink); }
.chart { width: 100%; height: 300px; }

/* v53.18 涨跌标签 pill：涨=红底红字、跌=绿底绿字（规范主色+浅底，趋势箭头 ↑↓ 同规则） */
.trend-pill { display: inline-block; padding: 1px 9px; border-radius: 10px; font-size: 12px; font-weight: 600; line-height: 1.65; white-space: nowrap; }
.trend-up { background: var(--up-bg); color: var(--up); }
.trend-down { background: var(--down-bg); color: var(--down); }
.lock-box { text-align: center; padding: 56px 24px 36px; }
.lock-box .logo-big { height: 72px; width: auto; margin: 0 auto 14px; display: block; filter: drop-shadow(0 2px 6px rgba(192, 57, 43, .15)); }
.lock-box .lock-title { font-size: 18px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.lock-box .lock-sub { font-size: 13px; color: var(--ink-2); margin-bottom: 18px; }
.lock-box input {
  height: 38px; width: 250px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  font-size: 14px;
}
.lock-box input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(24, 95, 165, .12); }
.lock-box .btn { height: 38px; margin-left: 8px; }

/* 只读横幅 */
#readonly-banner, .lock-box .msg { border-radius: var(--radius-sm); }

/* 滚动条美化 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c6cfdd; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #aab6c9; }

/* 数字字体 */
.dim { color: var(--ink-3); }

@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

/* 自定义紧凑 checkbox（14×14，代替浏览器原生不可控尺寸） */
input[type="checkbox"].cbx {
  appearance: none !important; -webkit-appearance: none !important; -moz-appearance: none !important; -webkit-appearance: none; -moz-appearance: none;
  width: 14px; height: 14px; margin: 0; vertical-align: middle;
  min-width: 14px; max-width: 14px;  /* v53.16h：防止 .filter-row input 的 min-width:90px 撑成长矩形 */
  border: 1.5px solid #b6c2d4; border-radius: 2px;
  background: #fff; cursor: pointer; position: relative;
  transition: border-color .15s, background-color .15s;
  flex-shrink: 0;
}
input[type="checkbox"].cbx:hover { border-color: #185fa5; }
input[type="checkbox"].cbx:checked { background: #185fa5; border-color: #185fa5; }
input[type="checkbox"].cbx:checked::after {
  content: ""; position: absolute; left: 3px; top: 0px;
  width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
table.compact td.sel-cell, table.compact th.sel-cell { width: 32px; padding: 6px 0 !important; text-align: center; }

/* ══════════════════════════════════════════════════════════════
 * v53.17：侧边栏布局（替换原顶部 tab 导航）
 * 展开 240px / 收起 56px 图标栏；父级可展开子级；出纳身份隐藏老板看板
 * ══════════════════════════════════════════════════════════════ */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px; min-width: 240px;
  background: var(--topbar-grad);
  color: #fff;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  transition: width .18s ease, min-width .18s ease;
  z-index: 70;
}
.sidebar.collapsed { width: 56px; min-width: 56px; }

.side-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 14px 10px;
  overflow: hidden; white-space: nowrap;
}
.side-logo { height: 34px; width: auto; flex-shrink: 0; filter: drop-shadow(0 1px 2px rgba(0,0,0,.2)); }
.side-title { font-size: 15px; font-weight: 600; letter-spacing: .3px; }
.sidebar.collapsed .side-title { display: none; }

/* 折叠态：logo 居中并缩放至 56px 内完整显示（避免横版 logo 被裁切） */
.sidebar.collapsed .side-brand { justify-content: center; padding: 14px 0 10px; }
.sidebar.collapsed .side-logo { height: auto; width: 34px; }
/* 折叠态：纯图标栏，隐藏文字 / 箭头 / 子级 */
.sidebar.collapsed .side-link { justify-content: center; padding-left: 0; padding-right: 0; }
.sidebar.collapsed .side-text { display: none; }
.sidebar.collapsed .side-arrow { display: none; }
.sidebar.collapsed .side-sub { display: none !important; }

/* 折叠/展开按钮 */
.side-toggle {
  margin: 2px 12px 8px; height: 32px; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.18); border-radius: 8px;
  background: rgba(255,255,255,.08); color: #fff;
  font-size: 15px; cursor: pointer;
  transition: background .15s;
}
.side-toggle:hover { background: rgba(255,255,255,.16); }
.sidebar.collapsed .side-toggle { margin-left: 10px; margin-right: 10px; }

/* 菜单 */
.side-nav { flex: 1; overflow-y: auto; overflow-x: hidden; }
.side-menu { list-style: none; padding: 0 8px; }
.side-item { margin: 2px 0; }
.side-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px;
  color: #c2d2e6; font-size: 14px;
  text-decoration: none; white-space: nowrap;
  transition: background .15s, color .15s;
  cursor: pointer; user-select: none;
}
.side-link:hover { background: rgba(255,255,255,.10); color: #fff; }
.side-item.active > .side-link {
  background: rgba(255,255,255,.16); color: #fff; font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}
.side-ico { width: 22px; height: 22px; text-align: center; flex-shrink: 0; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; }
.side-ico img { width: 18px; height: 18px; display: block; }
.side-sub-item .side-ico-sm { width: 15px; height: 15px; margin-right: 8px; vertical-align: -2px; }
.side-arrow {
  margin-left: auto; font-size: 11px; color: rgba(255,255,255,.55);
  transition: transform .18s;
}
.side-item.open > .side-link .side-arrow { transform: rotate(180deg); }

/* 子级 */
.side-sub { list-style: none; padding: 2px 0 4px 26px; display: none; }
.side-item.open .side-sub { display: block; }
.side-sub-item a {
  display: block; padding: 7px 10px; border-radius: 7px;
  color: #b0c3da; font-size: 13px; text-decoration: none;
  transition: background .15s, color .15s;
}
.side-sub-item a:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-sub-item.active a { background: rgba(255,255,255,.14); color: #fff; font-weight: 600; }

/* 底部：当前身份 + 退出 */
.side-footer {
  padding: 10px 12px 14px; border-top: 1px solid rgba(255,255,255,.12);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.side-user { font-size: 12px; color: rgba(255,255,255,.75); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-logout {
  height: 30px; padding: 0 12px; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.22); border-radius: 7px;
  background: transparent; color: #fff; font-size: 12.5px; cursor: pointer;
  transition: background .15s;
}
.side-logout:hover { background: rgba(255,255,255,.14); }
.sidebar.collapsed .side-user, .sidebar.collapsed .side-logout { display: none; }

/* 主内容区：随侧边栏宽度自动伸展 */
.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main-area .container { flex: 1; width: 100%; }

/* ══════════════════════════════════════════════════════════════
 * v53.17：登录页（左右分屏 —— 左品牌 / 右无卡片表单）
 * ══════════════════════════════════════════════════════════════ */
.login-body { height: 100vh; overflow: hidden; background: #f4f6fa; }
.login-wrap { display: flex; height: 100vh; }
.login-brand {
  position: relative;
  flex: 1 1 55%; max-width: 55%;
  background: linear-gradient(135deg, #122c48 0%, #1b3f66 52%, #204d7e 100%);
  color: #fff; display: flex; align-items: center; justify-content: center;
  padding: 56px 48px; overflow: hidden;
}

/* 背景装饰层（光晕/网格/圆环） */
.brand-deco { position: absolute; inset: 0; pointer-events: none; }
.brand-deco .grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 45%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 45%, #000 30%, transparent 75%);
}
.brand-deco .glow { position: absolute; border-radius: 50%; filter: blur(2px); }
.brand-deco .glow-a {
  width: 620px; height: 620px; top: -260px; left: -180px;
  background: radial-gradient(circle, rgba(64,145,220,.28) 0%, transparent 65%);
}
.brand-deco .glow-b {
  width: 560px; height: 560px; bottom: -260px; right: -160px;
  background: radial-gradient(circle, rgba(255,184,77,.16) 0%, transparent 62%);
}
.brand-deco .ring { position: absolute; border-radius: 50%; border: 1.5px solid rgba(255,184,77,.16); }
.brand-deco .ring-a { width: 340px; height: 340px; top: -150px; right: -90px; }
.brand-deco .ring-b { width: 560px; height: 560px; bottom: -260px; left: -180px; border-color: rgba(255,255,255,.07); }
.brand-deco .ring-c { width: 190px; height: 190px; bottom: 60px; right: -70px; border-color: rgba(255,184,77,.12); }

.brand-inner { position: relative; width: 100%; max-width: 500px; }
.brand-logo { height: 72px; width: auto; margin-bottom: 30px; filter: drop-shadow(0 4px 14px rgba(0,0,0,.3)); }
.brand-inner h1 {
  font-size: 30px; font-weight: 700; letter-spacing: 1.5px;
  margin-bottom: 10px; text-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.brand-slogan { font-size: 15px; letter-spacing: 2px; color: rgba(255,255,255,.72); margin-bottom: 40px; }

/* 业务范围区块标题 */
.biz-head {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 20px;
}
.biz-head .kicker { font-size: 15px; font-weight: 700; letter-spacing: 6px; color: #ffcf7d; }
.biz-head .kicker-en {
  font-size: 11px; letter-spacing: 3px; color: rgba(255,255,255,.4);
  text-transform: uppercase; font-family: Georgia, "Times New Roman", serif;
}
.biz-head::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(255,184,77,.4), transparent); }

/* 业务卡片 2×2 */
.biz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.biz-card {
  position: relative;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 14px; padding: 18px 18px 16px;
  transition: background .2s, border-color .2s, transform .2s;
}
.biz-card:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,184,77,.45);
  transform: translateY(-3px);
}
.biz-card .num {
  position: absolute; top: 14px; right: 16px;
  font-family: Georgia, "Times New Roman", serif; font-style: italic;
  font-size: 22px; font-weight: 600; color: rgba(255,184,77,.8);
}
.biz-ico {
  width: 44px; height: 44px; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(255,184,77,.26), rgba(232,150,46,.14));
  border: 1px solid rgba(255,184,77,.4);
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.biz-ico svg { width: 23px; height: 23px; }
.biz-name { font-size: 16.5px; font-weight: 700; color: #fff; margin-bottom: 5px; letter-spacing: .5px; }
.biz-desc { font-size: 12.8px; line-height: 1.6; color: rgba(255,255,255,.62); }

/* 底部背书：TSC5 */
.brand-foot { margin-top: 32px; }
.tsc5 {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-radius: 12px;
  background: rgba(255,184,77,.09);
  border: 1px solid rgba(255,184,77,.35);
}
.tsc5 .star { flex: 0 0 auto; width: 34px; height: 34px; }
.tsc5 .t-main { font-size: 13.5px; font-weight: 700; color: #ffd98a; letter-spacing: 1px; }
.tsc5 .t-sub { font-size: 11.5px; color: rgba(255,255,255,.55); margin-top: 3px; letter-spacing: .5px; }

/* 入场动效 */
@media (prefers-reduced-motion: no-preference) {
  .brand-inner > * { opacity: 0; transform: translateY(16px); animation: fadeUp .6s cubic-bezier(.22,.61,.36,1) forwards; }
  .brand-inner .brand-logo { animation-delay: .05s; }
  .brand-inner h1 { animation-delay: .13s; }
  .brand-inner .brand-slogan { animation-delay: .21s; }
  .brand-inner .biz-head { animation-delay: .3s; }
  .biz-card:nth-child(1) { animation-delay: .38s; }
  .biz-card:nth-child(2) { animation-delay: .46s; }
  .biz-card:nth-child(3) { animation-delay: .54s; }
  .biz-card:nth-child(4) { animation-delay: .62s; }
  .brand-inner .brand-foot { animation-delay: .72s; }
}
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

.login-panel {
  flex: 1 1 45%; max-width: 45%;
  background: #fff; display: flex; align-items: center; justify-content: center;
  padding: 40px;
}
.login-form { width: 100%; max-width: 340px; }
.login-form h2 { font-size: 24px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
/* v1.4.1.2：登录视图已删除副标题，标题下直接跟表单，补偿间距 */
#view-login h2 { margin-bottom: 26px; }
.login-sub { font-size: 13.5px; color: var(--ink-3); margin-bottom: 26px; }

/* 身份 tab（下划线式） */
.login-tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.ltab {
  background: none; border: none; padding: 0 2px 11px; font-size: 15px;
  color: var(--ink-3); cursor: pointer; position: relative; font-family: inherit;
  transition: color .15s;
}
.ltab.active { color: var(--brand); font-weight: 600; }
.ltab.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2.5px;
  background: var(--brand); border-radius: 2px;
}
.ltab:disabled { color: #c3ccd8; cursor: not-allowed; }

.login-form .field { margin-bottom: 18px; }
.login-form .field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 7px; }
.login-form .field input {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: 10px;
  font-size: 15px; color: var(--ink); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.login-form .field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(24, 95, 165, .12); }
.login-form .field input::placeholder { color: var(--ink-3); }
.login-btn { width: 100%; height: 44px; font-size: 15px; border-radius: 10px; margin-top: 4px; }
.login-link {
  margin-top: 16px; text-align: center; font-size: 13px;
  color: var(--brand); cursor: pointer; user-select: none;
  transition: color .15s;
}
.login-link:hover { color: var(--brand-deep); text-decoration: underline; }

@media (max-width: 820px) {
  .login-brand { display: none; }
  .login-panel { flex: 1 1 100%; max-width: 100%; }
}
