/* :root = warm 暖米文艺(和主站/手机版一致:选 warm 时不设 data-theme、落回这里)。
   无存储的新用户默认 gemini,由 <head> 脚本设置 data-theme。 */
:root {
  --bg: #f6f3ed;
  --panel: #fffdf9;
  --panel-soft: #f6f1e7;   /* 表头/浅色内衬 */
  --hover: #f4efe4;        /* 行悬浮 */
  --ink: #1e2329;
  --ink-soft: #6b6459;
  --line: #e7dccd;
  --brand: #1d6f8f;
  --brand-dark: #0f4d64;
  --brand-ink: #ffffff;    /* 品牌底上的文字色(深色主题反转) */
  --ok: #1f9d6b;
  --warn: #e08a1e;
  --danger: #d8503a;
  --chip: #e3edf1;
  --radius: 10px;
  --shadow: 0 2px 6px rgba(90, 70, 40, 0.05), 0 10px 28px rgba(90, 70, 40, 0.08);
  --shadow-pop: 0 8px 30px rgba(20, 32, 60, 0.16);
  /* ★别名:财务板块前端从一开始就在用 --bg2 / --muted 这两个名字(app.js 里 38 处),
     但这里从来没定义过 —— 结果原文预览区一直是透明底、「无原件」这类提示也没变灰。
     custom property 是用时替换,所以别名只写在 :root 也能跟着下面各主题的 --panel-soft/--ink-soft 走。 */
  --bg2: var(--panel-soft);
  --muted: var(--ink-soft);
  font-family: "Noto Sans CJK SC", "PingFang SC", -apple-system, "Segoe UI", system-ui, sans-serif;
}

/* 跟随网页版「个人中心」主题（与主站同域，共享 localStorage 的 app-theme，
   <head> 脚本读取并设 html[data-theme]）。 */
html[data-theme="gemini"] {
  --bg: #f6f8fc; --panel: #ffffff; --panel-soft: #f4f7fd; --hover: #f6f9ff;
  --ink: #1f1f24; --ink-soft: #5f6368;
  --line: #e6ebf3; --brand: #4285f4; --brand-dark: #1a73e8; --chip: #e8f0fe;
}
html[data-theme="claude"] {
  --bg: #ece8e0; --panel: #faf8f4; --panel-soft: #f3efe7; --hover: #f5f1e9;
  --ink: #2a2724; --ink-soft: #6f6a60;
  --line: #e4ddce; --brand: #c96442; --brand-dark: #b5573a; --chip: #f4e3da;
  --shadow: 0 2px 6px rgba(80, 60, 30, 0.05), 0 10px 28px rgba(80, 60, 30, 0.08);
}
html[data-theme="openai"] {
  --bg: #ffffff; --panel: #f7f7f8; --panel-soft: #f0f0f3; --hover: #f2f2f5;
  --ink: #0d0d0d; --ink-soft: #6e6e80;
  --line: #e6e6eb; --brand: #0d0d0d; --brand-dark: #000000; --chip: #ececf1;
}
/* 玫瑰粉软拟态:粉灰底 + 蕾丝玫瑰,卡片软浮雕(阴影变量带双向柔光) */
html[data-theme="rose"] {
  --bg: #f2eaec; --panel: #fbf6f7; --panel-soft: #f3e9ec; --hover: #f6eef1;
  --ink: #3d2e34; --ink-soft: #8d7680;
  --line: #e8d8dd; --brand: #c1798f; --brand-dark: #a95f78; --chip: #f0dde3;
  --radius: 14px;
  --shadow: 4px 4px 10px rgba(178, 142, 154, 0.26), -3px -3px 8px rgba(255, 255, 255, 0.9);
  --shadow-pop: 6px 6px 18px rgba(150, 110, 124, 0.32), -4px -4px 10px rgba(255, 255, 255, 0.85);
}
/* 鼠尾草绿软拟态:灰调绿底,卡片软浮雕(阴影变量带双向柔光) */
html[data-theme="sage"] {
  --bg: #e8ece4; --panel: #f4f7f1; --panel-soft: #eef2ea; --hover: #f0f4ec;
  --ink: #2f3b2c; --ink-soft: #7c8874;
  --line: #dbe2d5; --brand: #6b8f5c; --brand-dark: #557548; --chip: #dde6d6;
  --radius: 14px;
  --shadow: 4px 4px 10px rgba(120, 138, 108, 0.24), -3px -3px 8px rgba(255, 255, 255, 0.9);
  --shadow-pop: 6px 6px 18px rgba(100, 118, 90, 0.3), -4px -4px 10px rgba(255, 255, 255, 0.85);
}
/* 深夜球场风:藏青黑底 + 柠檬绿主色 + 蓝调线;品牌底上用深字保证对比 */
html[data-theme="xai"] {
  --bg: #06080c; --panel: #0d131d; --panel-soft: #121a28; --hover: #16202f;
  --ink: #e9eff8; --ink-soft: #8da3bf;
  --line: #1e2a3d; --brand: #b6f24a; --brand-dark: #9ad82f; --brand-ink: #11210a;
  --chip: #16202b;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.42), 0 12px 32px rgba(0, 0, 0, 0.52);
  --shadow-pop: 0 10px 34px rgba(0, 0, 0, 0.66);
}
/* 黑金奢华:曜石黑底 + 香槟金主色;品牌底上用深字保证对比 */
html[data-theme="gold"] {
  --bg: #0b0b0d; --panel: #141417; --panel-soft: #17171b; --hover: #1c1c21;
  --ink: #ece9e0; --ink-soft: #9b968a;
  --line: #2a2a30; --brand: #d4af37; --brand-dark: #e6c860; --brand-ink: #1a1503;
  --chip: #1d1c17;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.42), 0 12px 32px rgba(0, 0, 0, 0.52);
  --shadow-pop: 0 10px 34px rgba(0, 0, 0, 0.66);
}

* { box-sizing: border-box; }
/* hidden 属性必须压过下面给 .login-view/.app-view 等设的 display，否则两个视图会叠在一起 */
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; -webkit-font-smoothing: antialiased; }
.ledger-page-shell { width: 100%; min-width: 0; }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; font-size: 14px; }
input, select, textarea { background: var(--panel); color: var(--ink); }
a { color: var(--brand); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 1px;
}

/* ══ 全站控件基线 ══
   台账里有 180+ 处裸 <input>/<select>/<textarea>(没带 class)，以前靠 .toolbar input / .form-grid input /
   .modal-body > label > input 这类"按容器打补丁"兜着，各处 padding/圆角还不一致(7/8/9px 混用)，
   漏网的(筛选栏日期框、抽屉内联输入、直播/统计页的选择器)就是浏览器原生样式。
   这里给所有文本类控件一个统一体面的基线；有类名的(.input/.form-grid 等)在下面按需微调即可。
   排除 checkbox/radio/file/range/color 这些"非文本框"，它们吃了 padding 会走形。 */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]),
select, textarea {
  padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; box-sizing: border-box;
  font-family: inherit; font-size: 14px; line-height: 1.3; color: var(--ink); background: var(--panel);
  transition: border-color .15s, box-shadow .15s;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):hover, select:hover, textarea:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):focus, select:focus, textarea:focus {
  border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
input:disabled, select:disabled, textarea:disabled { background: var(--panel-soft); color: var(--ink-soft); cursor: not-allowed; }
/* select：去掉原生箭头，用 currentColor 画一个(深色主题也对)；multiple 的列表框不画 */
select:not([multiple]) {
  padding-right: 30px; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
select:disabled { color: var(--ink-soft); }
textarea { resize: vertical; min-height: 60px; line-height: 1.5; }
input[type="number"] { font-variant-numeric: tabular-nums; }
input[type="date"], input[type="month"], input[type="time"], input[type="datetime-local"] { min-height: 36px; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; vertical-align: -3px; margin: 0 4px 0 0; }
input[type="file"] { font-size: 13px; color: var(--ink-soft); }
input[type="file"]::file-selector-button { padding: 6px 12px; margin-right: 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--ink); font-family: inherit; font-size: 13px; cursor: pointer; }
input[type="file"]::file-selector-button:hover { border-color: var(--brand); color: var(--brand); }
/* 裸 <button>(没带任何 btn 类)兜底：别再是灰疙瘩。带类名的各走各的定义 */
button:not([class]) { padding: 7px 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font-size: 14px; line-height: 1.2; transition: border-color .15s, color .15s; }
button:not([class]):hover { border-color: var(--brand); color: var(--brand); }
button:disabled { opacity: .55; cursor: not-allowed; }
::placeholder { color: color-mix(in srgb, var(--ink-soft) 70%, transparent); }
/* 细滚动条(整站统一) */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--ink-soft) 32%, transparent); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--ink-soft) 52%, transparent); border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ── 启动占位 ── */
.loading-view { min-height: 100vh; display: grid; place-items: center; background: var(--bg); }
.loading-dot { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: ld-spin .7s linear infinite; }
@keyframes ld-spin { to { transform: rotate(360deg); } }

/* ── 登录 ── */
.login-view { min-height: 100vh; display: grid; place-items: center; background: var(--bg); }
.login-card { width: 360px; background: var(--panel); border-radius: 16px; padding: 36px 32px; box-shadow: var(--shadow); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.login-card h1 { margin: 0; font-size: 24px; }
.login-sub { margin: 0 0 8px; color: var(--ink-soft); font-size: 13px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-soft); }
.login-card input { padding: 10px 12px; }
.login-error { color: var(--danger); font-size: 13px; min-height: 18px; }
.login-hint { color: var(--ink-soft); font-size: 12px; line-height: 1.5; opacity: .8; }

.btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--brand); color: var(--brand-ink); border: 1px solid var(--brand); padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; line-height: 1.2; white-space: nowrap; transition: background .15s, transform .1s; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:active, .btn-ghost:active, .btn-sm:active, .btn-danger:active { transform: scale(.98); }
.btn-primary:disabled, .btn-ghost:disabled, .btn-sm:disabled, .btn-danger:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: transparent; border: 1px solid var(--line); color: var(--ink-soft); padding: 8px 14px; border-radius: 8px; font-size: 14px; line-height: 1.2; white-space: nowrap; transition: border-color .15s, color .15s, background .15s; }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); background: color-mix(in srgb, var(--brand) 5%, transparent); }
.btn-sm { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 5px 11px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 13px; line-height: 1.2; white-space: nowrap; transition: border-color .15s, color .15s; }
.btn-sm:hover { border-color: var(--brand); color: var(--brand); }
.btn-ok { display: inline-flex; align-items: center; background: var(--ok); color: #fff; border: 1px solid var(--ok); padding: 5px 12px; border-radius: 7px; font-size: 13px; line-height: 1.2; white-space: nowrap; }
.btn-ok:hover { filter: brightness(1.06); }
.btn-danger { display: inline-flex; align-items: center; background: var(--panel); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 38%, transparent); padding: 5px 12px; border-radius: 7px; font-size: 13px; line-height: 1.2; white-space: nowrap; transition: background .15s; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 8%, var(--panel)); }

/* 财务页(.fin-view)里的 .panel 默认带内边距 —— 全局 .panel 是给贴边表格用的(无 padding)，
   财务这边大量 panel 装的是文字/表单，贴边很难看。表格类 panel 让表格反向抵消回贴边。 */
.fin-view .panel { padding: 12px 14px; }
.fin-view .panel > .tbl { width: calc(100% + 28px); margin: -12px -14px; }
.fin-view .panel > .tbl + .mini { margin-top: 18px; }
.fin-view .panel.fin-metric-banner, .fin-view .fin-person-card, .fin-view .fin-rule-card, .fin-view .stat-card { padding: 14px 16px; }
.fin-view .cards { margin-bottom: 14px; }
.fin-view .panel .panel { padding: 10px 12px; } /* 嵌套 panel(告警条等)略紧 */
.fin-v2-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.fin-v2-domain { display:inline-flex; padding:3px; border:1px solid var(--line); border-radius:8px; background:var(--panel-soft); }
.fin-v2-domain button { border:0; border-radius:6px; padding:7px 14px; background:transparent; color:var(--ink-soft); font-weight:600; }
.fin-v2-domain button.on { background:var(--panel); color:var(--ink); box-shadow:0 1px 4px rgba(0,0,0,.08); }
.fin-v2-toolbar-actions { display:flex; align-items:center; gap:8px; }
.fin-v2-notice { display:flex; gap:10px; align-items:center; padding:11px 14px; margin-bottom:12px; border:1px solid color-mix(in srgb,var(--warn) 30%,var(--line)); border-left:3px solid var(--warn); border-radius:8px; background:color-mix(in srgb,var(--warn) 6%,var(--panel)); color:var(--ink-soft); }
.fin-v2-notice strong { color:var(--ink); white-space:nowrap; }
.fin-v2-empty { min-height:220px; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:8px; border:1px dashed var(--line); border-radius:8px; color:var(--ink-soft); background:var(--panel); }
.fin-v2-empty strong { color:var(--ink); font-size:16px; }
.fin-v2-history-row { display:flex; justify-content:space-between; align-items:end; gap:16px; margin-bottom:12px; }
.fin-v2-history { width:min(460px,75vw); margin-top:4px; }
.fin-v2-summary { display:grid; grid-template-columns:repeat(5,minmax(130px,1fr)); gap:9px; margin-bottom:12px; }
.fin-v2-kpi { min-width:0; padding:13px 14px; border:1px solid var(--line); border-radius:8px; background:var(--panel); }
.fin-v2-kpi > span { display:block; color:var(--ink-soft); font-size:12px; margin-bottom:6px; }
.fin-v2-kpi > strong { display:block; font-size:19px; font-variant-numeric:tabular-nums; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.fin-v2-kpi.has-diff { border-left:3px solid var(--warn); }
.fin-v2-kpi.has-diff > strong { color:var(--warn); }
.fin-v2-kpi.matched { border-left:3px solid var(--ok); }
.fin-v2-blockers,.fin-v2-diffs,.fin-v2-review { margin-bottom:12px; border:1px solid var(--line); border-radius:8px; background:var(--panel); overflow:hidden; }
.fin-v2-section-head { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:11px 13px; border-bottom:1px solid var(--line); background:var(--panel-soft); }
.fin-v2-section-head > div { display:flex; align-items:center; gap:8px; }
.fin-v2-blocker { display:grid; grid-template-columns:auto 1fr auto; gap:10px; align-items:center; padding:10px 13px; border-bottom:1px solid var(--line); }
.fin-v2-blocker:last-child { border-bottom:0; }
.fin-v2-table-wrap { overflow:auto; }
.fin-v2-table { min-width:820px; }
.fin-v2-table th:nth-child(3),.fin-v2-table th:nth-child(4),.fin-v2-table th:nth-child(5) { text-align:right; }
.fin-v2-diff { color:var(--warn); font-weight:700; }
.fin-v2-link { border:0; padding:0; background:transparent; color:var(--brand); font:inherit; font-weight:600; }
.fin-v2-review { padding-bottom:12px; }
.fin-v2-review textarea { width:calc(100% - 26px); margin:12px 13px 0; min-height:76px; }
.fin-v2-review > .row { padding:0 13px; }
@media (max-width: 980px) { .fin-v2-summary { grid-template-columns:repeat(3,1fr); } }
@media (max-width: 640px) {
  .fin-v2-toolbar,.fin-v2-history-row { align-items:stretch; flex-direction:column; }
  .fin-v2-toolbar-actions { justify-content:space-between; }
  .fin-v2-history { width:100%; }
  .fin-v2-summary { grid-template-columns:repeat(2,1fr); }
  .fin-v2-blocker { grid-template-columns:auto 1fr; }
  .fin-v2-blocker .btn { grid-column:2; justify-self:start; }
  .fin-v2-notice { align-items:flex-start; flex-direction:column; }
}
/* .row：横向排布的通用容器(财务页 66 处在用，之前没定义 → 全竖着堆)。具体 gap/对齐由行内 style 覆盖 */
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* ── 财务板块通用控件：.btn / .input / .tag ──
   财务这块(总览/月度办事/制度设置/代理佣金)一直用 .btn/.input/.tag 这套类名，
   但样式表里从来没定义过 → 全是浏览器默认样式(白底黑框、灰疙瘩按钮)。
   这里补齐，视觉与上面的 .btn-primary/.btn-sm/.form-grid 同一套语言。 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font-size: 14px; line-height: 1.2; white-space: nowrap; transition: border-color .15s, color .15s, background .15s, transform .1s; }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: var(--brand-ink); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 8%, var(--panel)); border-color: var(--danger); }
.btn.mini { padding: 4px 10px; font-size: 12.5px; border-radius: 6px; }
.btn.mini.primary { font-weight: 600; }
/* 提醒态按钮：比 primary 弱、比普通按钮显眼。给「⚠️ 补原件」这类「该做但不紧急」的动作用，
   免得一行里两个深色 primary 互相抢注意力（用户 20260817 报「按钮排版很乱」）。 */
.btn.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 8%, var(--panel)); }
.btn.warn:hover { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 15%, var(--panel)); color: var(--warn); }
.input { padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font-size: 14px; line-height: 1.3; box-sizing: border-box; transition: border-color .15s, box-shadow .15s; }
.input:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.input:focus, .input:focus-visible { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.input:disabled { background: var(--panel-soft); color: var(--ink-soft); cursor: not-allowed; }
/* 下拉箭头用 mask 画，颜色跟 currentColor 走 —— 深色主题(xai/gold)也对 */
select.input { padding-right: 30px; appearance: none; -webkit-appearance: none; position: relative; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
select.input:disabled { color: var(--ink-soft); }
textarea.input { resize: vertical; min-height: 60px; line-height: 1.5; }
.input[type="number"] { font-variant-numeric: tabular-nums; }
.input[type="date"], .input[type="month"] { min-height: 36px; }
/* 状态小标签(草稿/待初审/已封账/奖/罚…) */
.tag { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; line-height: 1.6; background: color-mix(in srgb, var(--ink-soft) 12%, transparent); color: var(--ink-soft); white-space: nowrap; }
.tag.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.tag.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.tag.danger { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
/* 财务页里表单标签行距统一：label 下的 .mini 是字段名 */
.modal-body .fin-fld > .mini, .modal-body label > .mini:first-child { font-size: 12.5px; color: var(--ink-soft); }
/* 财务表格：表头浅底、行悬浮、数字列右对齐等宽 */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--ink-soft); background: var(--panel-soft); padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: normal; }
.tbl th { position: static; } /* 财务表格不需要吸顶(在 panel 里滚)，全局 th 的 sticky 会在横向滚动时错位 */
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover td { background: var(--hover); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .btn.mini + .btn.mini { margin-left: 4px; }
/* 制度文件列表的操作列。原来按钮是一个个 margin-left:4px 堆进 td 里，列一窄就各自乱换行、
   每行宽度还参差不齐。改成 flex：统一间距、要换行就整齐换行、按钮不被压变形。
   ★.fin-doc-acts 里要把上面那条相邻间距归零，否则 gap + margin 双份间距。 */
/* min-width 按最常见那组按钮实测算：核对公式(86)+补原件(80)+删除(47)+两个 5px 间距 = 223 →
   给 232 让它们稳稳一行。有原件的行是 5 个按钮，会整齐折成两行，那是正常的。 */
.fin-doc-acts { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; justify-content: flex-end; min-width: 232px; }
.fin-doc-acts > * { flex: 0 0 auto; margin-left: 0 !important; }

/* ── 顶栏 ── */
.topbar { height: 56px; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 18px; gap: 16px; }
.brand { font-weight: 700; font-size: 17px; color: var(--brand); letter-spacing: .2px; }
.topbar-mid { flex: 1; }
.project-select { min-width: 220px; font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-badge { font-size: 13px; color: var(--ink-soft); }
.role-tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; background: var(--chip); color: var(--brand); margin-left: 6px; }

/* ── 布局 ── */
.layout { display: flex; height: calc(100vh - 56px); }
.sidebar { width: 176px; background: var(--panel); border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 4px; }
.nav-item { padding: 10px 14px; border-radius: 8px; color: var(--ink-soft); cursor: pointer; font-size: 14px; display: flex; align-items: center; gap: 8px; transition: background .15s, color .15s; }
.nav-item:hover { background: var(--chip); color: var(--ink); }
.nav-item.active { background: var(--brand); color: var(--brand-ink); }
.content { flex: 1; overflow: auto; padding: 22px 26px; }

/* ── 通用 ── */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.page-head h2 { margin: 0; font-size: 20px; letter-spacing: .2px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input, .toolbar select { min-height: 36px; }
.search-input { min-width: 200px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
/* 操作按钮列：按钮多时(入账/红冲/修改/删除)允许换行。
   抽屉宽 560px，全局 td 是 nowrap，原来靠 margin-left 排的按钮会溢出被裁掉，最右边那个点不到。 */
.actions-cell { white-space: normal; }
.actions-cell .cell-actions { display: flex; flex-wrap: wrap; gap: 6px; }
/* 只给需要的表格加横向滚动，不用全局 .panel —— 列头筛选菜单是绝对定位的，overflow 会把它裁掉 */
.table-scroll { overflow-x: auto; }
th { background: var(--panel-soft); color: var(--ink-soft); font-weight: 600; position: sticky; top: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--hover); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.row-link { cursor: pointer; }
.empty { padding: 40px; text-align: center; color: var(--ink-soft); opacity: .8; }

/* 台账批量处理 */
.sel-col { width: 34px; text-align: center; }
.sel-col input { cursor: pointer; width: 15px; height: 15px; }
.deal-batch-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin-bottom: 8px; background: var(--brand); color: var(--brand-ink); border-radius: var(--radius); box-shadow: var(--shadow); }
.deal-batch-bar .deal-batch-count { font-weight: 600; margin-right: 4px; }
.deal-batch-bar .btn-sm { background: color-mix(in srgb, var(--brand-ink) 14%, transparent); color: var(--brand-ink); border-color: color-mix(in srgb, var(--brand-ink) 40%, transparent); }
.deal-batch-bar .btn-sm:hover { background: var(--brand-ink); color: var(--brand); border-color: var(--brand-ink); }
.deal-batch-bar .btn-danger { background: color-mix(in srgb, var(--brand-ink) 14%, transparent); color: var(--brand-ink); border-color: color-mix(in srgb, var(--brand-ink) 50%, transparent); }
.deal-batch-bar .btn-danger:hover { background: var(--brand-ink); color: var(--danger); }
.deal-batch-bar .btn-ghost { color: var(--brand-ink); opacity: .85; }

.recycle-sub { margin: 14px 0 8px; font-size: 15px; color: var(--ink); }

/* 项目删除危险区 */
.project-danger-zone { margin-top: 16px; padding: 12px; border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); border-radius: var(--radius); background: color-mix(in srgb, var(--danger) 6%, var(--panel)); display: flex; flex-direction: column; gap: 8px; }
.project-danger-zone .btn-danger { align-self: flex-start; }
.danger-note { font-weight: 600; color: var(--danger); margin-bottom: 6px; }

.status-pill { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; }
.s-待售 { background: #eef7ef; color: #2f8f4a; }
.s-下定 { background: #fdf3df; color: #a8730f; }
.s-已签约 { background: #e7f0ff; color: #2356c8; }
.s-首付齐 { background: #fff3e0; color: #b9751a; }
.s-款清 { background: #e4f7ee; color: #178a5d; }
.s-已交房 { background: #e3f1fd; color: #1f7fb0; }
.s-退房 { background: #fdecea; color: #c0432c; }
.pay-pending { color: var(--warn); }
.pay-confirmed { color: var(--ok); }
.pay-voided { color: var(--ink-soft); text-decoration: line-through; opacity: .75; }

/* progress */
.progress { height: 6px; background: color-mix(in srgb, var(--ink-soft) 14%, transparent); border-radius: 6px; overflow: hidden; min-width: 60px; }
.progress > span { display: block; height: 100%; background: var(--ok); border-radius: 6px; }

/* ── 抽屉/弹窗 ── */
.drawer-overlay, .modal-overlay { position: fixed; inset: 0; background: rgba(15, 22, 36, 0.42); backdrop-filter: blur(2px); display: flex; z-index: 200; }
.drawer-overlay { justify-content: flex-end; }
.drawer { width: 560px; max-width: 92vw; background: var(--bg); height: 100%; overflow: auto; box-shadow: var(--shadow-pop); animation: slideIn .18s ease; }
@keyframes slideIn { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-overlay { justify-content: center; align-items: center; }
.modal { width: 540px; max-width: 94vw; max-height: 90vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-pop); animation: modalIn .16s ease-out; }
@keyframes modalIn { from { transform: translateY(10px) scale(.985); opacity: .5; } to { transform: none; opacity: 1; } }

.drawer-head, .modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 1; }
.drawer-head h3, .modal-head h3 { margin: 0; font-size: 17px; }
.close-x { border: none; background: transparent; font-size: 22px; color: var(--ink-soft); cursor: pointer; line-height: 1; border-radius: 6px; transition: color .15s; }
.close-x:hover { color: var(--ink); }
.drawer-body, .modal-body { padding: 18px 20px; }

.kv-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin-bottom: 18px; }
.kv-grid .k { color: var(--ink-soft); }
.kv-grid .v { font-weight: 500; }

.section-title { font-weight: 700; margin: 16px 0 10px; font-size: 15px; display: flex; justify-content: space-between; align-items: center; }

/* forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid label, .form-row label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-soft); }
.form-grid label.full { grid-column: 1 / -1; }
.form-grid input:not([type="checkbox"]):not([type="radio"]), .form-grid select, .form-grid textarea, .form-row input:not([type="checkbox"]):not([type="radio"]), .form-row select { width: 100%; }
.form-grid input:hover, .form-grid select:hover, .form-row input:hover, .form-row select:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.confirm-msg { font-size: 14px; line-height: 1.7; color: var(--ink); white-space: pre-wrap; margin-bottom: 14px; }

.voucher-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.voucher-thumb { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); }

/* z-index 要压过弹窗(200)和全屏核对屏/原稿查看器(400)：toast 是操作结果反馈，
   被遮住等于没提示 —— 原来是 100，弹窗里保存成功的提示一直是看不见的。 */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 11px 20px; border-radius: 10px; z-index: 600; box-shadow: var(--shadow-pop); font-size: 14px; }
.toast.err { background: var(--danger); color: #fff; }

.muted { color: var(--ink-soft); }
.right { text-align: right; }
.mini { font-size: 12px; color: var(--ink-soft); }

/* ── Excel 式列头筛选 ── */
th .col-filter { display: inline-flex; align-items: center; justify-content: center; width: 19px; height: 19px; margin-left: 5px; vertical-align: middle; border-radius: 5px; cursor: pointer; opacity: .75; font-size: 12px; line-height: 1; color: var(--ink-soft); background: var(--chip); user-select: none; transition: .15s; }
th .col-filter:hover { opacity: 1; color: var(--brand); background: color-mix(in srgb, var(--brand) 16%, var(--chip)); }
th .col-filter.on { opacity: 1; color: var(--brand-ink); background: var(--brand); }
.col-filter-menu { position: fixed; z-index: 1200; width: 224px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.col-filter-menu .cf-search { width: 100%; padding: 7px 9px; border-radius: 7px; }
.col-filter-menu .cf-bar { display: flex; gap: 14px; font-size: 12px; padding: 0 2px; }
.col-filter-menu .cf-bar a { cursor: pointer; color: var(--brand); }
.col-filter-menu .cf-list { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.col-filter-menu .cf-item { display: flex; align-items: center; gap: 8px; padding: 5px 7px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--ink); }
.col-filter-menu .cf-item:hover { background: var(--chip); }
.col-filter-menu .cf-item input { width: 15px; height: 15px; flex: none; margin: 0; }
.col-filter-menu .cf-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.col-filter-menu .cf-actions button { padding: 6px 15px; font-size: 13px; border-radius: 7px; }

/* ───── 我的团队 ───── */
.team-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.team-row:last-child { border-bottom: none; }
.team-name { font-weight: 600; min-width: 84px; }
.team-chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.team-chip { padding: 4px 12px; border-radius: 999px; font-size: 13px; cursor: pointer; user-select: none; border: 1px solid var(--line); transition: all .12s; }
.team-chip-plain { cursor: default; background: var(--panel-soft); }
.team-chip-on { background: var(--chip); border-color: var(--brand); color: var(--brand); }
.team-chip-off { background: var(--panel); color: var(--ink-soft); }
.team-chip-off:hover { border-color: var(--brand); color: var(--brand); }
.team-chip-on:hover { background: color-mix(in srgb, var(--brand) 16%, var(--chip)); }
.team-add-row { display: flex; gap: 10px; align-items: center; }
.team-select { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; min-width: 200px; }
.panel h3 { margin: 0 0 12px; font-size: 15px; }

/* 客户成交状态徽标 + 历史编辑记录 */
.cust-stage-badge { display:inline-block; padding:2px 9px; border-radius:999px; font-size:12px; background:var(--chip); color:var(--brand); }
.history-item { padding:12px 4px; border-bottom:1px solid var(--line); }
.history-item:last-child { border-bottom:none; }
.history-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
.history-line { font-size:13px; color:var(--ink); line-height:1.7; }
.history-line.mini { color:var(--ink-soft); }

/* ───── 桌面客户详情滑出面板 ───── */
.cust-panel-mask { position: fixed; inset: 0; background: rgba(0,0,0,.32); backdrop-filter: blur(2px); z-index: 90; }
.cust-panel { position: fixed; top: 0; right: 0; bottom: 0; width: 460px; max-width: 92vw; background: var(--panel); z-index: 91;
  box-shadow: var(--shadow-pop); display: flex; flex-direction: column; animation: panelIn .18s ease-out; }
@keyframes panelIn { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.cust-panel-head { flex: 0 0 auto; padding: 16px 18px; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: var(--brand-ink); position: relative; }
.cust-panel-close { position: absolute; top: 12px; right: 14px; background: transparent; color: var(--brand-ink); font-size: 18px; cursor: pointer; }
/* 一个客户可能挂多张成交单（1 套房 + 多个车位），房号块要能换行，否则超出面板宽度被裁掉。
   之前单成交单不换行也够用，车位导入后必现溢出。 */
.cust-panel-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 12px; }
.cust-panel-title strong { font-size: 21px; }
.cust-panel-stage { padding: 3px 11px; background: color-mix(in srgb, var(--brand-ink) 22%, transparent); border-radius: 999px; font-size: 13px; cursor: pointer; }
/* 车位入口:与客户状态并排但配色区分开 —— 车位成交状态是独立的一套 */
/* ══ 产品配色:同一业态 = 同一图标 + 同一底色(见 app.js 的 PRODUCT_STYLE) ══
   按钮(＋房源 / 🅿️车位)和状态标签共用这几个 class，配色只在这里改一处。
   手机端 mobile.css 里有一份同样的定义，两边要一起改。 */
/* 顺序要紧:.cust-panel-room 是形状底样式，.prod-* 是配色修饰，修饰必须写在后面才盖得住
   —— 反了的话所有房号徽标都会是这里的绿色，业态配色白写。 */
.cust-panel-park, .cust-panel-addunit { cursor: pointer; }
.cust-panel-room { padding: 3px 10px; background: rgba(46,200,120,.35); border-radius: 999px; font-size: 13px; white-space: nowrap; }
.cust-panel-room-link { transition: filter .15s; }
.cust-panel-room-link:hover { filter: brightness(.94) saturate(1.2); }
.prod-house { background: rgba(34, 130, 220, 0.12); color: #2069b8; }
.prod-park  { background: rgba(140, 120, 200, 0.16); color: #6b5bb0; }
.prod-shop  { background: rgba(230, 150, 40, 0.16);  color: #a86a12; }
.prod-apt   { background: rgba(20, 165, 140, 0.14);  color: #12806c; }
.prod-other { background: rgba(120, 130, 145, 0.14); color: #5d6875; }
/* 顶部操作条：6 个按钮(改派顾问/提醒跟进/编辑/历史/丢公海/删除)挤在一行时会把「改派顾问」劈成两行，
   同样改为不断行 + 放不下就换行 */
.cust-panel-act { display: flex; flex-wrap: wrap; gap: 8px; }
.cust-panel-act button { white-space: nowrap; }
.cust-panel-act .btn-sm, .cust-panel-act .btn-danger { background: color-mix(in srgb, var(--brand-ink) 18%, transparent); color: var(--brand-ink); border: none; }
.cust-panel-act .btn-danger { background: rgba(255,90,90,.5); }
.cust-panel-body { flex: 1; overflow-y: auto; padding: 14px 16px; background: var(--bg); }
.cust-panel-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; margin-bottom: 12px;
  background: color-mix(in srgb, var(--warn) 10%, var(--panel)); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); border-radius: 10px; font-size: 13px; color: var(--warn); }
.cust-panel-banner button { padding: 7px 14px; background: var(--warn); color: #fff; border: none; border-radius: 999px; font-size: 13px; cursor: pointer; }
.cust-panel-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.cust-panel-card h4 { margin: 0 0 10px; font-size: 14px; color: var(--ink); }
.cust-panel-kv { display: flex; gap: 12px; padding: 5px 0; font-size: 13px; }
.cust-panel-kv span { color: var(--ink-soft); min-width: 76px; }
.cust-panel-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.cust-panel-tag { padding: 5px 12px; background: var(--chip); color: var(--brand); border-radius: 999px; font-size: 12.5px; }
.cust-panel-tabs { display: flex; gap: 18px; padding: 4px 2px 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.cust-panel-tabs button { background: transparent; border: none; font-size: 15px; color: var(--ink-soft); cursor: pointer; padding-bottom: 6px; }
.cust-panel-tabs button.active { color: var(--brand); font-weight: 600; border-bottom: 2px solid var(--brand); }
.cust-panel-feed-item { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.cust-panel-feed-item .feed-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.cust-panel-feed-item .feed-body { font-size: 13.5px; line-height: 1.7; color: var(--ink); white-space: pre-wrap; }
.cust-panel-feed-item .feed-foot { display: flex; justify-content: flex-end; margin-top: 8px; }
/* 底部操作条：原来 button{flex:1} 强制五等分，面板一窄就把「＋ 跟进记录」断成两行。
   改成按内容宽度、不断行，放不下时整行换行——宁可多一行，也不要把词劈开。 */
.cust-panel-foot { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.cust-panel-foot button { flex: 1 1 auto; white-space: nowrap; padding: 11px 14px; font-size: 14px; }
.stage-opts { display: flex; flex-direction: column; gap: 8px; max-height: 56vh; overflow-y: auto; }
.stage-opt { text-align: left; padding: 11px 14px; background: var(--panel-soft); border: 1px solid var(--line); border-radius: 9px; font-size: 14px; color: var(--ink); cursor: pointer; transition: border-color .12s, background .12s; }
.stage-opt:hover { border-color: var(--brand); background: var(--chip); }
@media (max-width: 560px) { .cust-panel { width: 100vw; } }

/* ───── 统一分页条 ───── */
.cust-pager { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 6px 6px; font-size: 13px; color: var(--ink-soft); }
.cust-pager-total { color: var(--ink-soft); opacity: .85; }
.cust-pager select { padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; }
.cust-pager-pages { display: flex; align-items: center; gap: 5px; margin-left: auto; }
.cust-page-btn { min-width: 32px; height: 30px; padding: 0 9px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 7px; cursor: pointer; font-size: 13px; transition: border-color .12s, color .12s; }
.cust-page-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.cust-page-btn.active { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.cust-page-btn:disabled { opacity: .4; cursor: default; }
.cust-page-gap { color: var(--ink-soft); opacity: .6; padding: 0 2px; }
.cust-pager-jump { width: 54px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; }

/* ───── 批量操作 + 自定义列 ───── */
.batch-op-wrap { position: relative; display: inline-block; }
.batch-op-menu { display: none; position: absolute; top: 110%; left: 0; z-index: 30; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-pop); min-width: 160px; padding: 6px; }
.batch-op-menu.show { display: block; }
.batch-op-menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; background: transparent; border: none; border-radius: 6px; font-size: 13px; color: var(--ink); cursor: pointer; }
.batch-op-menu button:hover { background: var(--chip); }
.batch-op-custom { display: flex; gap: 6px; padding: 6px 4px 2px; border-top: 1px solid var(--line); margin-top: 4px; }
.batch-op-custom input { width: 90px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; }
.cust-batch-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin: 0 0 4px; background: var(--chip); border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); border-radius: 8px; }
.cust-batch-count { font-weight: 600; color: var(--brand); }
.col-config-list { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow-y: auto; padding: 2px; }
/* 注意：本文件的主题变量叫 --panel-soft / --ink-soft，没有 --soft / --muted。
   之前这里写成 var(--soft, #f7f7fa) 会一路走兜底值 → 深色主题下白底配浅色字，条目文字看不见。 */
.col-config-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; cursor: pointer; background: var(--panel-soft); color: var(--ink); user-select: none; }
.col-config-item .col-drag { cursor: grab; color: var(--ink-soft); font-size: 14px; line-height: 1; flex-shrink: 0; }
.col-config-item .col-drag:active { cursor: grabbing; }
.col-config-item.dragging { opacity: .45; }
.col-config-item.drag-over { border-color: var(--brand); border-style: dashed; }
.table .ell, td.ell { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 客户查重 */
.dedup-extra { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.dedup-cond { display: flex; gap: 8px; align-items: center; }
.dedup-cond select, .dedup-cond input { padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; }
.dedup-cond input { flex: 1; }
.dedup-add { display: inline-block; margin: 4px 0 8px; color: var(--brand); font-size: 13px; }
.dedup-result { max-height: 40vh; overflow-y: auto; }

/* 桌面客户筛选条 */
.cust-filter-bar .cust-filter-sel { padding: 6px 28px 6px 9px; border-radius: 7px; font-size: 13px; }
.cust-filter-bar { align-items: center; }
/* 业态切换条(全部/住宅/车位/商业)：看板、统计分析、项目管理概览共用 */
.cat-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
/* 筛选统计：四个页面（客户/公海/房源/台账）共用。有筛选条件时高亮，一眼看出当前是筛过的数 */
.cust-filter-bar .filter-count { margin-left: auto; font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.cust-filter-bar .filter-count.on { color: var(--brand-dark); font-weight: 600; }
/* 清除筛选/自定义筛选贴着统计右侧，不被上面的 margin-left:auto 推开 */
.cust-filter-bar .filter-count ~ .btn-sm { margin-left: 8px; }

/* 成交大脑 C1:AI 话术/跟进 */
.btn-ai { background: linear-gradient(90deg, var(--brand), var(--brand-dark)); color: var(--brand-ink); border:none; border-radius:8px; padding:7px 12px; font-size:13px; cursor:pointer; font-weight:600; }
.btn-ai:hover { filter:brightness(1.08); }
.coach-out { white-space:pre-wrap; line-height:1.65; margin-top:10px; min-height:60px; max-height:52vh; overflow-y:auto; background:var(--panel-soft); border:1px solid var(--line); border-radius:8px; padding:12px 14px; font-size:13.5px; color:var(--ink); }

/* 🧠 成交大脑 */
.brain-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:12px; }
.brain-card { border:1px solid var(--line); border-radius:10px; padding:12px 14px; background:var(--panel); display:flex; flex-direction:column; gap:8px; transition: box-shadow .18s, transform .18s; }
.brain-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.brain-card-top { display:flex; align-items:center; justify-content:space-between; }
.brain-cat { background:var(--chip); color:var(--brand); font-size:12px; font-weight:600; padding:3px 10px; border-radius:20px; }
.brain-weight { font-size:12px; color:var(--warn); font-weight:700; }
.brain-scenario { font-size:12.5px; color:var(--ink-soft); }
.brain-technique { font-size:13.5px; line-height:1.6; color:var(--ink); white-space:pre-wrap; }
.brain-card-foot { display:flex; align-items:center; gap:8px; margin-top:2px; }
.brain-tag { font-size:11px; color:var(--ink-soft); background:var(--panel-soft); padding:2px 8px; border-radius:6px; }

/* 看板·客户转化漏斗 */
.dash-section-title { margin: 26px 0 12px; font-size: 16px; }
.dash-sub { margin: 18px 0 8px; font-size: 13px; color: var(--ink-soft); }
.funnel { display: flex; flex-direction: column; gap: 7px; max-width: 720px; }
.funnel-row { display: flex; align-items: center; gap: 10px; }
.funnel-label { width: 92px; font-size: 13px; color: var(--ink); flex-shrink: 0; text-align: right; }
.funnel-bar-wrap { flex: 1; background: var(--panel-soft); border-radius: 6px; overflow: hidden; height: 22px; }
.funnel-bar { height: 100%; border-radius: 6px; min-width: 2px; }
.funnel-val { width: 116px; font-size: 12.5px; color: var(--ink-soft); flex-shrink: 0; }
.dash-table { max-width: 560px; margin-top: 4px; }
.dash-table .num { text-align: right; }
.dash-source { display: flex; gap: 18px; margin: 16px 0; font-size: 13px; color: var(--ink-soft); flex-wrap: wrap; }
.dash-source span { background: var(--panel-soft); padding: 6px 14px; border-radius: 8px; }

/* 跨项目客户:项目标签 */
.proj-chip { display:inline-block; background:var(--chip); color:var(--brand); font-size:12px; padding:2px 9px; border-radius:6px; white-space:nowrap; }

/* 交款单识别确认 */
.pay-match { margin-bottom: 12px; }
.pay-match-ok { background:color-mix(in srgb, var(--ok) 10%, var(--panel)); color:var(--ok); padding:9px 12px; border-radius:8px; font-size:13px; }
.pay-match-no { background:color-mix(in srgb, var(--warn) 10%, var(--panel)); color:var(--warn); padding:9px 12px; border-radius:8px; font-size:13px; }
.pay-deal-list { max-height:160px; overflow-y:auto; margin-top:6px; display:flex; flex-direction:column; gap:4px; }
.pay-deal-opt { text-align:left; padding:8px 10px; border:1px solid var(--line); border-radius:7px; background:var(--panel); color:var(--ink); font-size:13px; cursor:pointer; }
.pay-deal-opt:hover { background:var(--chip); }
.pay-ref { margin:10px 0; padding:8px 10px; background:var(--panel-soft); border-radius:7px; color:var(--ink-soft); line-height:1.6; }

/* ───── 看板美化 + 经营统计 ───── */
.dash-section-head { display:flex; align-items:center; justify-content:space-between; margin:26px 0 12px; flex-wrap:wrap; gap:10px; }
.dash-section-head .dash-section-title { margin:0; }
.dash-section-title { font-size:16px; font-weight:700; color:var(--ink); display:flex; align-items:center; gap:6px; }
.cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(158px,1fr)); gap:12px; margin-bottom: 22px; }
.stat-card { background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:15px 18px; transition:box-shadow .2s, transform .2s; position:relative; overflow:hidden; }
.stat-card:hover { box-shadow:var(--shadow); transform:translateY(-1px); }
.stat-card .label { font-size:13px; color:var(--ink-soft); margin-bottom:8px; }
.stat-card .value { font-size:25px; font-weight:700; color:var(--ink); line-height:1.1; }
.stat-card .value.small { font-size:21px; }
.stat-card .value .unit { font-size:13px; font-weight:400; color:var(--ink-soft); margin-left:3px; }
.stat-card::before { content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--brand); }
.stat-card.sc-deal::before { background:var(--ok); }
.stat-card.sc-pay::before { background:var(--warn); }
.period-seg { display:inline-flex; background:var(--panel-soft); border-radius:9px; padding:3px; gap:2px; }
.period-btn { border:none; background:transparent; padding:6px 16px; border-radius:7px; font-size:13px; color:var(--ink-soft); cursor:pointer; }
.period-btn.active { background:var(--panel); color:var(--brand); font-weight:600; box-shadow:0 1px 3px rgba(0,0,0,.1); }
.dashboard-period-scope { display:flex; align-items:center; justify-content:space-between; gap:14px; margin:2px 0 14px; padding:10px 12px; border-left:3px solid var(--brand); border-radius:0 6px 6px 0; background:var(--panel-soft); }
.dashboard-period-scope strong { color:var(--ink); font-size:12px; font-variant-numeric:tabular-nums; }
.dashboard-period-scope span { color:var(--ink-soft); font-size:10.5px; line-height:1.5; text-align:right; }
.dashboard-kpis { margin-top:0; }
.analytics-kpis.dashboard-result-kpis { grid-template-columns:repeat(7,minmax(120px,1fr)); }
.stat-card.sc-customer::before { background:#547896; }
/* ── 财务设置：左侧小目录 + 单块渲染 ── */
.fin-setup-layout { display:flex; gap:14px; align-items:flex-start; }
.fin-setup-nav { display:flex; flex-direction:column; gap:4px; min-width:150px; position:sticky; top:10px; }
.fin-setup-navbtn { text-align:left; padding:9px 13px; border:1px solid transparent; border-radius:9px; background:transparent; color:var(--ink-soft); cursor:pointer; font-size:14px; }
.fin-setup-navbtn:hover { background:var(--panel); }
.fin-setup-navbtn.on { background:var(--panel); border-color:var(--line); color:var(--ink); font-weight:600; box-shadow:var(--shadow-sm, 0 1px 3px rgba(0,0,0,.06)); }
.fin-setup-body { flex:1; min-width:0; }
.fin-rule-card { background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:14px 16px; }

/* ── 月度办事：五步流程条 ── */
.fin-flow-steps { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
.fin-flow-step { flex:1 1 150px; min-width:148px; text-align:left; background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:10px 13px; cursor:pointer; color:var(--ink-soft); transition:box-shadow .15s; }
.fin-flow-step:hover { box-shadow:var(--shadow-sm, 0 1px 3px rgba(0,0,0,.06)); }
.fin-flow-step.on { border-color:var(--brand); box-shadow:0 0 0 1px var(--brand) inset; }
.fin-flow-step-head { display:flex; gap:7px; align-items:center; font-size:14px; font-weight:600; color:var(--ink); }
.fin-flow-note { margin-top:3px; color:var(--ink-soft); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.fin-flow-light { display:inline-flex; width:20px; height:20px; border-radius:50%; align-items:center; justify-content:center; font-size:12px; border:1.5px solid var(--line); color:var(--ink-soft); flex:none; }
.fin-flow-step.done .fin-flow-light { background:color-mix(in srgb, var(--ok) 15%, transparent); border-color:var(--ok); color:var(--ok); }
.fin-flow-step.doing .fin-flow-light { background:color-mix(in srgb, var(--warn) 18%, transparent); border-color:var(--warn); color:var(--warn); }
.fin-metric-banner { border-left:3px solid var(--brand); margin-bottom:10px; }

/* ── 总览·人员抽屉：明细行/暂扣池统一网格（房号｜说明｜金额） ── */
.fin-line { display:grid; grid-template-columns:96px 1fr auto; gap:4px 12px; align-items:center; padding:8px 0; border-bottom:1px dashed var(--line); }
.fin-line:last-child { border-bottom:none; }
.fin-line-room { font-weight:600; color:var(--ink); font-variant-numeric:tabular-nums; min-width:0; }
.fin-line-sub { font-weight:400; color:var(--ink-soft); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.fin-line-body { min-width:0; display:flex; flex-direction:column; gap:4px; align-items:flex-start; }
.fin-line-why { color:var(--ink-soft); line-height:1.4; }
.fin-line-amt { font-weight:700; font-size:15px; font-variant-numeric:tabular-nums; text-align:right; white-space:nowrap; min-width:72px; }
.fin-line-amt.neg { color:var(--warn); }
.fin-line-pill { display:inline-block; font-size:12px; line-height:1; padding:3px 8px; border-radius:999px; background:color-mix(in srgb, var(--ink-soft) 12%, transparent); color:var(--ink-soft); white-space:nowrap; }
.fin-line-pill.ok { background:color-mix(in srgb, var(--ok) 14%, transparent); color:var(--ok); }
.fin-line-pill.warn { background:color-mix(in srgb, var(--warn) 16%, transparent); color:var(--warn); }
.fin-line-pool { padding:6px 0 6px 10px; }
.fin-pool-month { margin-bottom:2px; }
.fin-pool-sum { display:grid; grid-template-columns:auto auto 1fr auto; gap:10px; align-items:center; cursor:pointer; padding:7px 0; list-style:none; }
.fin-pool-sum::-webkit-details-marker { display:none; }
.fin-pool-sum::before { content:"▸"; color:var(--ink-soft); font-size:12px; margin-right:-4px; }
.fin-pool-month[open] > .fin-pool-sum::before { content:"▾"; }
.fin-pool-sum-m { font-weight:600; }
.fin-pool-sum .fin-line-amt { font-size:14px; }
.fin-pay-grid { display:grid; grid-template-columns:repeat(4, 1fr); gap:8px; }
.fin-pay-kv { background:var(--bg2, var(--panel)); border:1px solid var(--line); border-radius:8px; padding:8px 10px; }
.fin-pay-v { font-weight:700; font-size:15px; font-variant-numeric:tabular-nums; margin-top:2px; }
.fin-pay-v.ok { color:var(--ok); }
.fin-pay-v.warn { color:var(--warn); }
@media (max-width: 480px) { .fin-line { grid-template-columns:78px 1fr auto; gap:4px 8px; } .fin-pay-grid { grid-template-columns:repeat(2, 1fr); } }

/* ── 提成规则编辑弹窗：两列网格 + 档位列对齐 ── */
.fin-fld { display:block; margin-bottom:8px; min-width:0; }
.fin-rule-form { display:grid; grid-template-columns:1fr 1fr; gap:10px 14px; }
.fin-rule-form .fin-fld { margin-bottom:0; }
.fin-rule-form .span2, .fin-rule-form .fin-fld-tri { grid-column:1 / -1; }
.fin-fld-tri { display:grid; grid-template-columns:1fr 1fr 1fr; gap:10px 14px; }
.fin-tier-row { display:flex; gap:6px; align-items:center; margin-bottom:5px; }
.fin-tier-row > div { flex:1 1 0; min-width:0; }
.fin-tier-row .input { flex:1 1 0; width:auto; min-width:0; }
.fin-tier-head { margin-bottom:2px; }
.fin-tier-row .fin-tier-del { flex:0 0 32px; width:32px; padding-left:0; padding-right:0; text-align:center; }
@media (max-width: 560px) { .fin-rule-form { grid-template-columns:1fr; } .fin-fld-tri { grid-template-columns:1fr 1fr; } }

/* ── 财务总览：大数字 + 人员卡片墙 ── */
.stat-card .big { font-size:24px; font-weight:700; color:var(--ink); line-height:1.15; margin:2px 0; }
.fin-cardwall { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:12px; }
.fin-person-card { background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:14px 16px; cursor:pointer; transition:box-shadow .15s, transform .15s; }
.fin-person-card:hover { box-shadow:var(--shadow); transform:translateY(-1px); }
.fin-card-money { font-size:22px; font-weight:700; margin-top:6px; }
.status-pill.ok { background:color-mix(in srgb, var(--ok) 15%, transparent); color:var(--ok); }
.status-pill.warn { background:color-mix(in srgb, var(--warn) 15%, transparent); color:var(--warn); }

.dashboard-chart-grid { align-items:stretch; margin-bottom:10px; }
.dashboard-chart-grid .analytics-chart-panel { height:100%; }
.dashboard-cohort-title { margin-top:22px; }
.dashboard-quality-stack { margin:10px 0 14px; }
.dashboard-current-head { margin-top:30px; }
.leaderboard { margin-top:18px; }
.lb-tabs { display:flex; gap:6px; border-bottom:1px solid var(--line); margin-bottom:8px; flex-wrap:wrap; }
.lb-tab { border:none; background:transparent; padding:8px 14px; font-size:13px; color:var(--ink-soft); cursor:pointer; border-bottom:2px solid transparent; }
.lb-tab.active { color:var(--brand); font-weight:600; border-bottom-color:var(--brand); }
.lb-body { max-width:560px; }
.lb-row { display:flex; align-items:center; gap:12px; padding:10px 12px; border-radius:8px; }
.lb-row:nth-child(odd) { background:var(--panel-soft); }
.lb-rank { width:28px; text-align:center; font-size:15px; font-weight:700; color:var(--ink-soft); opacity:.7; }
.lb-rank.r1, .lb-rank.r2, .lb-rank.r3 { font-size:18px; opacity:1; }
.lb-name { flex:1; font-size:14px; color:var(--ink); }
.lb-val { font-weight:700; color:var(--brand); font-size:15px; }

/* 统计分析：与直播复盘共用克制、紧凑的数据产品语言 */
.analytics-page-head { align-items: flex-end; margin-bottom: 14px; }
.analytics-page-head h2 { margin-bottom: 3px; }
.analytics-filterbar { position: sticky; top: 8px; z-index: 12; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 16px; box-shadow: 0 5px 20px color-mix(in srgb, var(--ink) 6%, transparent); }
.analytics-filterbar button { min-height: 32px; padding: 6px 11px; font-size: 12px; }
.analytics-filterbar input, .analytics-filterbar select { min-height: 32px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
.analytics-section-title { display: flex; align-items: baseline; gap: 9px; margin: 20px 0 10px; }
.analytics-section-title small { color: var(--ink-soft); font-size: 10px; font-weight: 400; }
.analytics-kpis { grid-template-columns: repeat(4, minmax(138px, 1fr)); gap: 8px; margin-bottom: 10px; }
.analytics-kpis .stat-card { min-height: 92px; padding: 13px 14px; border-radius: 8px; box-shadow: none; }
.analytics-kpis .stat-card::before { width: 3px; }
.analytics-kpis .stat-card .label { margin-bottom: 6px; font-size: 11px; }
.analytics-kpis .stat-card .value { overflow: hidden; font-size: 21px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.analytics-kpis .stat-card .value .unit { font-size: 11px; }
.analytics-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 10px 0; }
.analytics-chart-grid-main { grid-template-columns: minmax(0, 1.45fr) minmax(310px, .8fr); }
.analytics-chart-panel { min-width: 0; overflow: hidden; padding: 14px 15px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.analytics-chart-wide { margin: 10px 0; }
.analytics-chart-head { min-height: 39px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.analytics-chart-head h3 { margin: 0 0 3px; color: var(--ink); font-size: 14px; }
.analytics-chart-head p { margin: 0; color: var(--ink-soft); font-size: 10.5px; line-height: 1.45; }
.analytics-chart { width: 100%; height: var(--chart-height, 270px); min-height: 180px; }
.analytics-chart-empty, .analytics-chart-error { display: grid; place-items: center; color: var(--ink-soft); font-size: 12px; text-align: center; }
.analytics-chart-error { color: var(--danger); }
.analytics-mini-tabs { display: inline-flex; gap: 2px; padding: 2px; margin-bottom: 2px; border-radius: 6px; background: var(--panel-soft); }
.analytics-mini-tab { padding: 4px 10px; border: 0; border-radius: 5px; background: transparent; color: var(--ink-soft); font-size: 11px; }
.analytics-mini-tab.active { background: var(--panel); color: var(--brand); font-weight: 700; box-shadow: 0 1px 3px color-mix(in srgb, var(--ink) 10%, transparent); }
.analytics-quality-note { display: flex; align-items: flex-start; gap: 8px; margin: -2px 0 10px; padding: 9px 11px; border-left: 3px solid var(--warn); border-radius: 0 6px 6px 0; background: color-mix(in srgb, var(--warn) 8%, var(--panel)); color: var(--ink-soft); font-size: 11px; line-height: 1.55; }
.analytics-quality-note strong { flex: 0 0 auto; color: var(--warn); font-size: 11px; }

/* 公海设置 */
.pool-cfg-divider { margin:14px 0 6px; padding-top:12px; border-top:1px solid var(--line); font-weight:600; color:var(--ink-soft); font-size:13px; }

/* AI 多方案可选卡片 */
.coach-opt { border:1px solid var(--line); border-radius:10px; padding:10px 12px; margin-bottom:8px; cursor:pointer; transition:border-color .15s, background .15s; }
.coach-opt:hover { border-color:color-mix(in srgb, var(--brand) 45%, var(--line)); }
.coach-opt.sel { border-color:var(--brand); background:var(--chip); }
.coach-opt-head { display:flex; align-items:center; gap:8px; margin-bottom:5px; }
.coach-opt-radio { color:var(--brand); font-size:15px; }
.coach-opt-body { white-space:pre-wrap; line-height:1.6; font-size:13.5px; color:var(--ink); }
.coach-tip { font-size:12px; color:var(--ink-soft); margin-bottom:8px; }

/* 修复:小号主按钮(白字白底→品牌底白字) */
.btn-sm.btn-primary { background: var(--brand); color: var(--brand-ink); border: 1px solid var(--brand); padding: 5px 12px; font-size: 13px; font-weight: 600; }
.btn-sm.btn-primary:hover { background: var(--brand-dark); color: var(--brand-ink); border: none; }
/* 修复:弹窗内直接子级 label 的排版(公海设置/批量编辑/话术等) */
.modal-body > label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-soft); margin-bottom: 13px; }
.modal-body > label > select, .modal-body > label > input:not([type="checkbox"]):not([type="radio"]), .modal-body > label > textarea { width: 100%; }
.modal-body > label > input[type="number"] { width: 140px; }
.modal-body > label > input[type="checkbox"] { width: 18px; height: 18px; }

/* 深色主题下的浅色状态胶囊微调:半透明底保持可读 */
html[data-theme="xai"] .s-待售 { background: rgba(63,174,90,.16); color: #57c877; }
html[data-theme="xai"] .s-下定 { background: rgba(232,160,32,.16); color: #ecb455; }
html[data-theme="xai"] .s-已签约 { background: rgba(66,133,244,.18); color: #7aa8ff; }
html[data-theme="xai"] .s-首付齐 { background: rgba(240,151,43,.16); color: #efb066; }
html[data-theme="xai"] .s-款清 { background: rgba(31,157,107,.18); color: #4ecb96; }
html[data-theme="xai"] .s-已交房 { background: rgba(31,127,176,.2); color: #62b1dc; }
html[data-theme="xai"] .s-退房 { background: rgba(216,80,58,.18); color: #ec8873; }
html[data-theme="xai"] .cust-panel-room { background: rgba(46,200,120,.26); }
html[data-theme="gold"] .s-待售 { background: rgba(63,174,90,.16); color: #57c877; }
html[data-theme="gold"] .s-下定 { background: rgba(232,160,32,.16); color: #ecb455; }
html[data-theme="gold"] .s-已签约 { background: rgba(66,133,244,.18); color: #7aa8ff; }
html[data-theme="gold"] .s-首付齐 { background: rgba(240,151,43,.16); color: #efb066; }
html[data-theme="gold"] .s-款清 { background: rgba(31,157,107,.18); color: #4ecb96; }
html[data-theme="gold"] .s-已交房 { background: rgba(31,127,176,.2); color: #62b1dc; }
html[data-theme="gold"] .s-退房 { background: rgba(216,80,58,.18); color: #ec8873; }
html[data-theme="gold"] .cust-panel-room { background: rgba(46,200,120,.26); }

/* 设置模板 */
.tpl-list { display: flex; flex-direction: column; gap: 10px; }
.tpl-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.tpl-card .tpl-main { flex: 1; min-width: 0; }
.tpl-card .tpl-name { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.tpl-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

/* ── 第三档：统一加载 spinner + 列头筛选提示 ── */
.loading-row { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 40px; color: var(--ink-soft); font-size: 13px; }
.loading-row.mini { padding: 14px; font-size: 12px; }
.loading-row .loading-dot { width: 16px; height: 16px; border-width: 2px; }
.cf-tip { font-size: 12px; color: var(--warn); padding: 2px 2px 6px; }

/* ── 直播复盘 · 数据图表 ── */
.live-insight-page-head { margin-bottom: 10px; }
.live-insight-page-head > div:first-child { min-width: 0; }
.live-insight-page-head h2 { margin-bottom: 4px; }
.live-insight-page-head p { margin: 0; color: var(--ink-soft); font-size: 13px; }
.live-head-actions { display: flex; align-items: center; gap: 8px; }

.live-subnav { display: flex; align-items: stretch; gap: 4px; margin: 0 0 16px; padding: 0 0 9px; border-bottom: 1px solid var(--line); }
.live-subnav-item { min-width: 150px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 13px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink-soft); text-align: left; }
.live-subnav-item strong { font-size: 14px; color: inherit; }
.live-subnav-item span { font-size: 11px; opacity: .78; }
.live-subnav-item:hover { color: var(--ink); background: var(--panel-soft); }
.live-subnav-item.active { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 28%, var(--line)); background: color-mix(in srgb, var(--brand) 8%, var(--panel)); }
.live-daily-filter { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 10px 12px; margin-bottom: 10px; }
.live-daily-check { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.live-daily-wrap { overflow-x: auto; background: #fff; border: 1px solid #c5ced9; }
.live-daily-sheet { width: max-content; min-width: 100%; border-collapse: collapse; font-size: 12px; color: #1a1a1a; }
.live-daily-sheet caption { caption-side: top; text-align: center; font-weight: 700; font-size: 16px; padding: 12px 8px 8px; color: #111; background: #fff; }
.live-daily-sheet th, .live-daily-sheet td { border: 1px solid #c5ced9; padding: 6px 8px; text-align: center; vertical-align: middle; white-space: nowrap; background: #fff; position: static; top: auto; }
.live-daily-sheet thead th { background: #1f4e9a; color: #fff; font-weight: 600; }
.live-daily-sheet td.live-daily-name { font-weight: 600; }
.live-daily-sheet td.num { font-variant-numeric: tabular-nums; }

.live-insight-filter { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 13px 15px 11px; margin-bottom: 10px; box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 4%, transparent); }
.live-filter-quick { display: flex; align-items: center; gap: 3px; padding-bottom: 11px; margin-bottom: 11px; border-bottom: 1px solid var(--line); }
.live-filter-quick > span { margin-right: 8px; color: var(--ink-soft); font-size: 12px; font-weight: 600; white-space: nowrap; }
.live-filter-quick button { padding: 5px 11px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-soft); font-size: 12px; white-space: nowrap; }
.live-filter-quick button:hover { color: var(--brand); background: var(--panel-soft); }
.live-filter-quick button.active { color: var(--brand-ink); background: var(--brand); font-weight: 600; }
.live-filter-fields { display: grid; grid-template-columns: repeat(6, minmax(116px, 1fr)); gap: 9px; }
.live-filter-field { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.live-filter-field.wide { grid-column: span 2; }
.live-filter-field > span { color: var(--ink-soft); font-size: 11px; }
.live-filter-field input, .live-filter-field select { width: 100%; min-width: 0; height: 34px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); font-size: 12px; }
.live-filter-field input:hover, .live-filter-field select:hover { border-color: color-mix(in srgb, var(--brand) 55%, var(--line)); }
.live-filter-foot { display: flex; align-items: center; gap: 12px; padding-top: 11px; margin-top: 11px; border-top: 1px solid var(--line); }
.live-dedupe-toggle { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.live-dedupe-toggle input { width: 15px; height: 15px; accent-color: var(--brand); }
.live-filter-result { color: var(--ink-soft); font-size: 12px; }
.live-filter-foot > button { margin-left: auto; }

.live-quality-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 8px; margin-bottom: 13px; }
.live-quality-note { min-height: 52px; display: flex; align-items: center; gap: 12px; padding: 9px 11px; border: 1px solid var(--line); border-left-width: 3px; border-radius: 7px; background: var(--panel); }
.live-quality-note > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.live-quality-note strong { color: var(--ink); font-size: 12px; }
.live-quality-note span { color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
.live-quality-note button { margin-left: auto; flex: 0 0 auto; }
.live-quality-note.warn { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn) 5%, var(--panel)); }
.live-quality-note.info { border-left-color: var(--brand); background: color-mix(in srgb, var(--brand) 5%, var(--panel)); }
.live-quality-note.ok { border-left-color: var(--ok); background: color-mix(in srgb, var(--ok) 5%, var(--panel)); }

.live-category-nav { display: flex; gap: 2px; margin: 5px 0 14px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.live-category-nav::-webkit-scrollbar { display: none; }
.live-category-nav button { position: relative; flex: 0 0 auto; padding: 9px 15px 10px; border: 0; background: transparent; color: var(--ink-soft); font-size: 13px; }
.live-category-nav button:hover { color: var(--ink); }
.live-category-nav button.active { color: var(--brand); font-weight: 700; }
.live-category-nav button.active::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand); }
.live-category-section { animation: live-section-in .16s ease-out; }
.live-category-content { min-width: 0; }
@keyframes live-section-in { from { opacity: .55; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.live-insight-empty { border: 1px dashed var(--line); border-radius: 8px; background: var(--panel); }

.live-kpi-grid { display: grid; grid-template-columns: repeat(8, minmax(118px, 1fr)); gap: 8px; margin-bottom: 10px; }
.live-kpi { position: relative; min-width: 0; min-height: 104px; display: flex; flex-direction: column; justify-content: space-between; padding: 12px 12px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); overflow: hidden; }
.live-kpi::before { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 3px; background: var(--brand); }
.live-kpi.tone-blue::before { background: #3478c9; }
.live-kpi.tone-cyan::before { background: #168da3; }
.live-kpi.tone-green::before { background: var(--ok); }
.live-kpi.tone-orange::before { background: var(--warn); }
.live-kpi > span { color: var(--ink-soft); font-size: 11px; }
.live-kpi > strong { overflow: hidden; color: var(--ink); font-size: clamp(19px, 1.45vw, 25px); line-height: 1.05; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.live-kpi > small { overflow: hidden; color: var(--ink-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.live-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.live-chart-grid.live-chart-main { grid-template-columns: minmax(0, 1.65fr) minmax(320px, .85fr); }
.live-chart-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.live-chart-panel { min-width: 0; padding: 14px 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.live-chart-panel .live-echart { width: 100%; min-height: 230px; }
.live-efficiency-panel { margin-bottom: 10px; }
.live-chart-head { min-height: 38px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.live-chart-head h3 { margin: 0 0 3px; color: var(--ink); font-size: 14px; }
.live-chart-head p { margin: 0; color: var(--ink-soft); font-size: 10.5px; line-height: 1.45; }
.live-chart-legend { display: flex; align-items: center; gap: 12px; color: var(--ink-soft); font-size: 10px; white-space: nowrap; }
.live-chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.live-chart-legend span::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: color-mix(in srgb, var(--brand) 28%, transparent); }
.live-chart-legend .viewers::before { width: 12px; height: 2px; border-radius: 2px; background: var(--warn); }
.live-chart-empty { min-height: 150px; display: grid; place-items: center; color: var(--ink-soft); font-size: 12px; text-align: center; }
.live-svg-wrap { width: 100%; overflow: hidden; }
.live-trend-svg { display: block; width: 100%; height: 260px; overflow: visible; }
.live-grid-line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.live-axis-label { fill: var(--ink-soft); font-size: 10px; font-family: inherit; }
.live-bar-exposure { fill: color-mix(in srgb, var(--brand) 29%, transparent); }
.live-bar-exposure:hover { fill: color-mix(in srgb, var(--brand) 48%, transparent); }
.live-line-viewers { stroke: var(--warn); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.live-dot-viewers { fill: var(--panel); stroke: var(--warn); stroke-width: 2; }

.live-funnel { display: flex; flex-direction: column; gap: 12px; padding: 4px 0 3px; }
.live-funnel-row { display: grid; grid-template-columns: 112px minmax(80px, 1fr) 60px; align-items: center; gap: 10px; }
.live-funnel-meta { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.live-funnel-meta strong { color: var(--ink); font-size: 12px; }
.live-funnel-meta span { overflow: hidden; color: var(--ink-soft); font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.live-funnel-track { height: 16px; overflow: hidden; border-radius: 4px; background: var(--panel-soft); }
.live-funnel-track span { display: block; height: 100%; border-radius: 4px; background: color-mix(in srgb, var(--brand) 78%, var(--panel)); }
.live-funnel-row:nth-child(2) .live-funnel-track span { background: color-mix(in srgb, var(--brand) 60%, var(--ok)); }
.live-funnel-row:nth-child(3) .live-funnel-track span { background: color-mix(in srgb, var(--brand) 45%, var(--warn)); }
.live-funnel-row:nth-child(4) .live-funnel-track span { background: var(--warn); }
.live-funnel-row:nth-child(5) .live-funnel-track span { background: var(--ok); }
.live-funnel-row > b { color: var(--ink); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.live-funnel-row.data-gap .live-funnel-meta span { color: var(--warn); }

.live-source-bar { height: 24px; display: flex; overflow: hidden; margin: 17px 0 14px; border-radius: 5px; background: var(--panel-soft); }
.live-source-bar span { height: 100%; }
.live-source-bar .natural { background: var(--ok); }
.live-source-bar .paid { background: var(--brand); }
.live-source-legend, .live-gender-legend { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.live-source-legend > div, .live-gender-legend > div { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 6px; padding: 8px; border-radius: 6px; background: var(--panel-soft); }
.live-source-legend b, .live-gender-legend b { color: var(--ink); font-size: 13px; }
.live-source-legend small, .live-gender-legend small { color: var(--ink-soft); font-size: 10px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.dot.natural { background: var(--ok); }
.dot.paid { background: var(--brand); }
.dot.male { background: var(--brand); }
.dot.female { background: var(--warn); }
.dot.unknown { background: var(--ink-soft); }
.live-cost-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.live-cost-grid > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 9px; border-top: 1px solid var(--line); }
.live-cost-grid span { color: var(--ink-soft); font-size: 10px; }
.live-cost-grid strong { overflow: hidden; color: var(--ink); font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }

.live-interaction-list { display: flex; flex-direction: column; gap: 10px; padding-top: 3px; }
.live-interaction-row { display: grid; grid-template-columns: 74px minmax(70px, 1fr) 58px 94px; align-items: center; gap: 8px; }
.live-interaction-row .name { color: var(--ink); font-size: 11px; }
.live-interaction-row .bar { height: 9px; overflow: hidden; border-radius: 3px; background: var(--panel-soft); }
.live-interaction-row .bar i { display: block; height: 100%; border-radius: 3px; background: var(--brand); }
.live-interaction-row .bar i.tone-1 { background: var(--ok); }
.live-interaction-row .bar i.tone-2 { background: var(--warn); }
.live-interaction-row .bar i.tone-3 { background: color-mix(in srgb, var(--brand) 55%, var(--warn)); }
.live-interaction-row strong { color: var(--ink); font-size: 11px; text-align: right; }
.live-interaction-row small { color: var(--ink-soft); font-size: 9.5px; text-align: right; }

.live-gender-bar { height: 32px; display: flex; overflow: hidden; margin: 30px 0 15px; border-radius: 5px; background: var(--panel-soft); }
.live-gender-bar .male { background: var(--brand); }
.live-gender-bar .female { background: var(--warn); }
.live-gender-bar .unknown { background: var(--ink-soft); }
.live-gender-legend { grid-template-columns: repeat(3, 1fr); }
.live-gender-legend > div { grid-template-columns: auto 1fr; }
.live-gender-legend small { grid-column: 2; }
.live-dist-list { display: flex; flex-direction: column; gap: 8px; }
.live-dist-list > div { display: grid; grid-template-columns: 68px minmax(50px, 1fr) 48px; align-items: center; gap: 8px; }
.live-dist-list span { overflow: hidden; color: var(--ink-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.live-dist-list i { height: 8px; overflow: hidden; border-radius: 3px; background: var(--panel-soft); }
.live-dist-list i b { display: block; height: 100%; border-radius: 3px; background: var(--brand); }
.live-city-list i b { background: var(--ok); }
.live-dist-list strong { color: var(--ink); font-size: 10px; text-align: right; }
.live-coverage-strip { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-soft); }
.live-coverage-strip strong { color: var(--brand); font-size: 12px; }
.live-coverage-strip span { color: var(--ink-soft); font-size: 10.5px; }

.live-anchor-layout { display: grid; grid-template-columns: minmax(320px, .8fr) minmax(0, 1.35fr); gap: 10px; margin-bottom: 10px; }
.live-anchor-bars { display: flex; flex-direction: column; gap: 9px; }
.live-anchor-bar-row { display: grid; grid-template-columns: 24px minmax(118px, .8fr) minmax(80px, 1fr) 58px; align-items: center; gap: 8px; }
.live-anchor-bar-row .rank { color: var(--ink-soft); font-size: 10px; font-variant-numeric: tabular-nums; }
.live-anchor-bar-row .person { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.live-anchor-bar-row .person strong { overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.live-anchor-bar-row .bar { height: 10px; overflow: hidden; border-radius: 3px; background: var(--panel-soft); }
.live-anchor-bar-row .bar i { display: block; height: 100%; border-radius: 3px; background: var(--brand); }
.live-anchor-bar-row > b { color: var(--ink); font-size: 11px; text-align: right; }
.live-role-badge { width: max-content; max-width: 100%; padding: 1px 5px; border-radius: 4px; background: color-mix(in srgb, var(--brand) 10%, var(--panel)); color: var(--brand); font-size: 9px; font-weight: 500; white-space: nowrap; }
.live-role-badge.consultant { background: color-mix(in srgb, var(--ok) 11%, var(--panel)); color: var(--ok); }
.live-role-badge.live-session-role { background: color-mix(in srgb, var(--ink) 7%, var(--panel)); color: var(--ink-soft); }
.live-role-badge.live-session-role.assistant { background: color-mix(in srgb, var(--warn) 9%, var(--panel)); color: var(--warn); }
/* 角色选「全部」时同一人合并成一行，主播/助播场次两个徽标并排(徽标本身是 max-content，不包一层会各占一行) */
.live-role-mix { display: flex; flex-wrap: wrap; gap: 3px; }
.live-table-person { min-width: 108px; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.live-table-person strong { font-size: 12px; }

.live-table-panel { padding-left: 0; padding-right: 0; padding-bottom: 0; overflow: hidden; }
.live-table-panel > .live-chart-head { padding: 0 15px; }
.live-table-scroll { width: 100%; overflow-x: auto; }
.live-table-panel table { min-width: 760px; }
.live-table-panel th, .live-table-panel td { padding: 9px 11px; font-size: 11px; }
.live-table-panel th { top: 0; }
.live-session-detail { margin-bottom: 10px; }
.live-session-detail table { min-width: 1260px; }
.live-cell-sub { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 9px; }
.live-risk-count { display: inline-grid; min-width: 20px; height: 20px; place-items: center; border-radius: 5px; background: color-mix(in srgb, var(--danger) 11%, var(--panel)); color: var(--danger); font-weight: 700; }
.live-duplicate-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.live-duplicate-list > div { display: grid; grid-template-columns: 1fr; gap: 3px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-soft); }
.live-duplicate-list strong { color: var(--ink); font-size: 13px; }
.live-duplicate-list span { color: var(--ink-soft); font-size: 11px; }

@media (max-width: 1280px) {
  .analytics-kpis { grid-template-columns: repeat(4, minmax(125px, 1fr)); }
  .analytics-kpis.dashboard-result-kpis { grid-template-columns:repeat(4,minmax(125px,1fr)); }
  .live-filter-fields { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
  .live-kpi-grid { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
  .live-kpi { min-height: 96px; }
  .live-kpi > strong { font-size: 22px; }
  .live-chart-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live-chart-grid-3 > :last-child { grid-column: 1 / -1; }
}

@media (max-width: 980px) {
  .analytics-chart-grid, .analytics-chart-grid-main { grid-template-columns: 1fr; }
  .live-filter-fields { grid-template-columns: repeat(3, minmax(115px, 1fr)); }
  .live-chart-grid, .live-chart-grid.live-chart-main, .live-anchor-layout { grid-template-columns: 1fr; }
  .live-chart-grid-3 { grid-template-columns: 1fr; }
  .live-chart-grid-3 > :last-child { grid-column: auto; }
}

@media (max-width: 760px) {
  .topbar { height: 54px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; padding: 7px 9px; }
  .brand { font-size: 15px; white-space: nowrap; }
  .topbar-mid { min-width: 0; }
  .project-select { width: 100%; min-width: 0; padding: 7px 8px; font-size: 12px; }
  .topbar-right { gap: 4px; }
  .topbar-right .user-badge { display: none; }
  .topbar-right .btn-ghost { max-width: 66px; padding: 6px 8px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
  .layout { height: calc(100vh - 54px); flex-direction: column; }
  .sidebar { width: 100%; flex: 0 0 auto; flex-direction: row; gap: 3px; padding: 6px 8px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .sidebar::-webkit-scrollbar { display: none; }
  .nav-item { flex: 0 0 auto; padding: 7px 10px; font-size: 12px; white-space: nowrap; }
  .sidebar > .mini { display: none; }
  .content { width: 100%; padding: 14px 12px 24px; }
  .page-head { flex-wrap: wrap; }
  .analytics-page-head { align-items: flex-start; }
  .analytics-filterbar { position: static; gap: 6px; padding: 9px; overflow: hidden; }
  .analytics-filterbar input { width: 126px; }
  .analytics-filterbar select { max-width: 150px; }
  .analytics-filterbar button[style*="margin-left:auto"] { margin-left: 0 !important; }
  .analytics-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-kpis.dashboard-result-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .analytics-kpis .stat-card { min-height: 82px; padding: 11px 12px; }
  .analytics-kpis .stat-card .value { font-size: 18px; }
  .analytics-chart-panel { padding: 12px 10px 8px; }
  .analytics-chart { --chart-height: 250px; min-height: 220px; }
  .analytics-chart-head { min-height: auto; }
  .analytics-quality-note { flex-direction: column; gap: 2px; }
  .dashboard-period-scope { align-items:flex-start; flex-direction:column; gap:4px; }
  .dashboard-period-scope span { text-align:left; }
  .dashboard-current-head { align-items:flex-start; }
  .live-insight-page-head { align-items: flex-start; gap: 10px; }
  .live-subnav { overflow-x: auto; }
  .live-subnav-item { min-width: 142px; }
  .live-filter-quick { overflow-x: auto; padding-bottom: 9px; }
  .live-filter-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live-filter-field.wide { grid-column: 1 / -1; }
  .live-filter-foot { align-items: flex-start; flex-wrap: wrap; }
  .live-filter-result { width: calc(100% - 120px); line-height: 1.45; }
  .live-filter-foot > button { margin-left: 0; }
  .live-quality-row { grid-template-columns: 1fr; }
  .live-quality-note { align-items: flex-start; }
  .live-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live-kpi { min-height: 90px; }
  .live-trend-svg { height: 225px; }
  .live-chart-head { flex-wrap: wrap; }
  .live-funnel-row { grid-template-columns: 94px minmax(60px, 1fr) 50px; gap: 7px; }
  .live-interaction-row { grid-template-columns: 54px minmax(60px, 1fr) 52px; }
  .live-interaction-row small { grid-column: 2 / -1; margin-top: -5px; }
  .live-anchor-bar-row { grid-template-columns: 20px minmax(100px, .8fr) minmax(60px, 1fr) 48px; gap: 6px; }
  .live-coverage-strip { align-items: flex-start; flex-direction: column; gap: 3px; }
}

/* ═══════════ 项目日报(看板子栏目):三段式 + div 柱状图 + 长图导出 ═══════════ */
.dr-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.dr-head-ops { display: flex; align-items: center; gap: 10px; }
.dr-date { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font-size: 13.5px; }
.dr-sec { margin: 12px 0; padding: 16px 18px; }
.dr-cap { margin: 0 0 10px; font-size: 12px; letter-spacing: 3px; color: var(--ink-soft); font-weight: 700; }
.dr-cap.accent { color: var(--brand); }
.dr-brow { display: flex; align-items: center; gap: 10px; margin: 10px 0 8px; }
.dr-badge { font-size: 12px; padding: 3px 12px; border-radius: 99px; background: var(--panel-soft); color: var(--ink-soft); font-weight: 600; }
.dr-badge.main { background: color-mix(in srgb, var(--brand) 14%, var(--panel)); color: var(--brand); }
.dr-kgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.dr-kpi { background: var(--panel-soft); border-radius: 10px; padding: 10px 12px; }
.dr-today .dr-kpi { background: var(--panel); }
.dr-kl { margin: 0; font-size: 11.5px; color: var(--ink-soft); }
.dr-kv { margin: 2px 0 0; font-size: 21px; font-weight: 700; color: var(--ink); }
.dr-kv i, .dr-n i { font-style: normal; font-size: 12px; color: var(--ink-soft); font-weight: 400; margin-left: 2px; }
.dr-ks { margin: 1px 0 0; font-size: 11px; color: var(--ink-soft); }
.dr-today { margin: 12px 0; padding: 14px 16px 16px; border-radius: 14px; background: color-mix(in srgb, var(--brand) 9%, var(--bg)); border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent); }
.dr-strip { background: var(--panel); border-radius: 10px; padding: 10px 14px; margin-top: 8px; }
.dr-strip.hl { border-left: 3px solid var(--brand); border-radius: 0 10px 10px 0; }
.dr-strip-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.dr-n { font-size: 21px; font-weight: 700; color: var(--ink); }
.dr-d { font-size: 12.5px; color: var(--ink); }
.dr-dm { font-size: 12.5px; color: var(--ink-soft); }
.dr-detail { margin: 4px 0 0; font-size: 11.5px; color: var(--ink-soft); line-height: 1.7; }
.dr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dr-chip { font-size: 12px; background: var(--panel-soft); border-radius: 99px; padding: 4px 12px; color: var(--ink); }
.dr-chip.muted { color: var(--ink-soft); }
.dr-mrow { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--ink-soft); margin: 0 0 8px; align-items: baseline; }
.dr-mrow b { font-size: 16px; color: var(--ink); margin: 0 2px; }
.dr-mrow.live { background: var(--panel-soft); border-radius: 10px; padding: 8px 14px; }
.dr-legend { display: flex; gap: 16px; font-size: 11.5px; color: var(--ink-soft); margin: 10px 0 6px; }
.dr-legend span { display: flex; align-items: center; gap: 5px; }
.dr-legend i, .dr-bars i { display: inline-block; border-radius: 2px; }
.dr-legend i { width: 10px; height: 10px; }
.dr-chart .b1, .dr-legend .b1 { background: #4a7bb5; }
.dr-chart .b2, .dr-legend .b2 { background: #4f9e7e; }
.dr-chart .b3, .dr-legend .b3 { background: #c86a3a; }
.dr-chart { display: flex; align-items: flex-end; gap: 2px; height: 140px; padding-bottom: 4px; overflow-x: auto; }
.dr-bar-g { flex: 1; min-width: 14px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.dr-bar-g.today .dr-bl { color: var(--brand); font-weight: 700; }
.dr-bars { display: flex; align-items: flex-end; gap: 1px; height: 114px; }
.dr-bars i { width: 5px; border-radius: 2px 2px 0 0; }
.dr-bl { font-size: 10px; color: var(--ink-soft); }
.dr-note-row { display: flex; gap: 8px; }
.dr-note-row input { flex: 1; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font-size: 13px; }
@media (max-width: 720px) {
  .dr-kgrid { grid-template-columns: 1fr 1fr; }
  .dr-bar-g { min-width: 10px; }
}

/* 看板子栏目切换(总览/日报) + 日报工具条 */
.dash-subtabs { display: flex; gap: 8px; margin: 0 0 12px; }
.dash-subtab { padding: 7px 18px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-soft); font-size: 13px; cursor: pointer; transition: 0.18s; }
.dash-subtab:hover { color: var(--ink); border-color: var(--ink-soft); }
.dash-subtab.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 700; }
.dr-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 0 4px; }

/* 看板总览·项目盘面:业态切换 + 分产品KPI卡 */
.board-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.board-tab { padding: 6px 16px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-soft); font-size: 13px; cursor: pointer; transition: 0.18s; }
.board-tab:hover { color: var(--ink); border-color: var(--ink-soft); }
.board-tab.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 700; }
.board-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.board-card .board-sub { font-size: 11px; color: var(--ink-soft); margin-top: 3px; }
@media (max-width: 720px) { .board-cards { grid-template-columns: 1fr 1fr; } }

/* 看板总览分块标题(项目销售情况 / 当日情况) */
.dash-block-title { margin-top: 14px; }
.dash-block-title:first-child { margin-top: 0; }

/* 日报·手机版预览(iframe 手机框) */
.dr-mobile-stage { display: flex; justify-content: center; padding: 20px 0 6px; }
.dr-mobile-frame { width: 400px; max-width: 100%; height: 1180px; border: none; border-radius: 26px; background: #f4f0e9; box-shadow: 0 10px 40px rgba(60,45,30,0.18); }
@media (max-width: 460px) { .dr-mobile-frame { width: 100%; } }
/* 恒业定制版:横向 820px 的表格页,预览区可横向滚动 */
.dr-sheet-stage { display: flex; justify-content: center; padding: 16px 0 6px; overflow-x: auto; }
.dr-sheet-frame { width: 820px; flex: none; height: 1120px; border: none; border-radius: 8px; background: #fff; box-shadow: 0 8px 30px rgba(60,45,30,0.16); }

/* 日报统计口径说明:默认收起的小面板,规则不写出来没人猜得到 */
.dr-rule { margin: 0 0 12px; }
.dr-rule-toggle { font-size: 12.5px; padding: 5px 11px; }
.dr-rule-list { margin: 8px 0 0; padding: 12px 16px 12px 30px; background: var(--panel-soft); border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 4px 10px 10px 4px; font-size: 13px; line-height: 1.85; color: var(--ink-soft); }
.dr-rule-list li { margin: 0 0 6px; }
.dr-rule-list li:last-child { margin-bottom: 0; }
.dr-rule-list b { color: var(--ink); font-weight: 600; }

/* 成交大脑:分类筛选 */
.brain-cats { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.brain-cat-chip { background: var(--panel); border: 1px solid var(--line); color: var(--ink-soft); padding: 5px 12px; border-radius: 99px; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; transition: border-color .15s, color .15s, background .15s; }
.brain-cat-chip:hover { border-color: var(--brand); color: var(--brand); }
.brain-cat-chip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.brain-cat-chip i { font-style: normal; font-size: 11.5px; opacity: .7; font-variant-numeric: tabular-nums; }
.brain-cat { cursor: pointer; }
.brain-cat:hover { text-decoration: underline; }

/* 员工离职审批与客户交接 */
.offboarding-todo { border-left: 3px solid var(--brand); }
.offboarding-todo-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 2px; border-top: 1px solid var(--line); }
.offboarding-todo-info { flex: 1; min-width: 0; }
.offboarding-todo-actions, .member-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.offboarding-status { display: inline-flex; align-items: center; margin-left: 9px; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.offboarding-status.pending { color: #8a5a10; background: #fff1cc; }
.offboarding-status.approved { color: #185f49; background: #dcefe8; }
.offboarding-status.rejected { color: #7b3b3b; background: #f4e2e2; }
.offboarding-admin-list { padding: 4px 14px; }
.handover-summary { padding: 12px 14px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--line)); background: color-mix(in srgb, var(--brand) 7%, var(--panel)); line-height: 1.7; }
.offboarding-impact-note { padding: 12px 14px; border-radius: 8px; background: var(--panel-soft); color: var(--ink-soft); }
.offboarding-impact-note b { color: var(--ink); }
.offboarding-impact-note ol { margin: 8px 0 0; padding-left: 20px; line-height: 1.8; }
.offboarding-recipient { display: grid; gap: 6px; }
.offboarding-customer-list { max-height: min(46vh, 440px); overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.offboarding-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.offboarding-list-head label { display: flex; align-items: center; gap: 4px; font-weight: 700; }
.offboarding-customer-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.offboarding-customer-row:last-child { border-bottom: none; }
.offboarding-customer-row:hover { background: var(--panel-soft); }
.offboarding-customer-main { display: flex; flex-direction: column; min-width: 0; }
.offboarding-history-list { display: grid; gap: 9px; max-height: min(55vh, 520px); overflow: auto; }
.offboarding-history-row { padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.offboarding-history-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.offboarding-history-flow { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin: 8px 0 4px; font-size: 13px; color: var(--ink); }
.handover-arrow { color: var(--brand); font-weight: 700; }
@media (max-width: 720px) {
  .offboarding-todo-row { align-items: flex-start; flex-direction: column; gap: 9px; }
  .offboarding-todo-actions, .member-actions { justify-content: flex-start; }
  .offboarding-customer-row { grid-template-columns: auto minmax(0, 1fr); }
  .offboarding-customer-row > .mini:last-child { grid-column: 2; }
  .offboarding-list-head { align-items: flex-start; flex-direction: column; gap: 4px; }
}
.offboarding-impact-live { padding: 10px 14px; border-radius: 8px; background: var(--panel-soft); color: var(--ink-soft); line-height: 1.7; }
.offboarding-impact-live.warn { background: color-mix(in srgb, #c0392b 8%, var(--panel)); border: 1px solid color-mix(in srgb, #c0392b 30%, var(--line)); color: var(--ink); }
.offboarding-impact-warn { margin-top: 6px; line-height: 1.75; }
.offboarding-impact-warn b { display: block; margin-bottom: 4px; color: #a5341f; }
/* 离职交接:还有成交单没接手人 —— 卡住不让完成,点开看是哪些单 */
.offboarding-orphan { cursor: pointer; border: 1px solid #d98b3a; background: #fdf3e6; color: #9a5b17; }
.offboarding-orphan:hover { background: #f9e6cd; }
