/* 品特策划 · 内部管理平台 */
:root {
  --brand: #2e6cf6;
  --brand-light: #e8effe;
  --green: #16a34a;
  --green-bg: #e7f7ee;
  --red: #dc2626;
  --red-bg: #fdecec;
  --orange: #ea8a1f;
  --orange-bg: #fdf3e3;
  --purple: #7c3aed;
  --purple-bg: #f1eafd;
  --cyan: #0891b2;
  --cyan-bg: #e3f5fa;
  --text: #1e2433;
  --muted: #8a93a6;
  --border: #e8ebf2;
  --bg: #f4f6fb;
  --card: #ffffff;
  --radius: 14px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); outline: none; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1d3f8f 0%, #2e6cf6 55%, #5b8cff 100%); }
.login-card { width: 380px; background: #fff; border-radius: 20px; padding: 40px 36px; box-shadow: 0 24px 60px rgba(10, 30, 80, .35); }
.login-logo { width: 52px; height: 52px; border-radius: 14px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; margin-bottom: 16px; }
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-card .sub { color: var(--muted); margin-bottom: 26px; }
.login-err { background: var(--red-bg); color: var(--red); border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 12px; display: none; }

/* ---------- 布局 ---------- */
.app { display: flex; height: 100vh; }
.sidebar { width: 216px; background: #fff; border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; }
.brand .name { font-weight: 700; font-size: 15px; }
.brand .name small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.nav { padding: 6px 10px; flex: 1; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: #4a5568; cursor: pointer; margin-bottom: 4px; user-select: none; }
.nav-item:hover { background: #f2f5fb; }
.nav-item.active { background: var(--brand); color: #fff; font-weight: 600; box-shadow: 0 6px 14px rgba(46, 108, 246, .35); }
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-item .badge { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; border-radius: 8px; padding: 1px 7px; }
.nav-item.active .badge { background: rgba(255,255,255,.28); }
.side-foot { padding: 14px 16px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.side-foot .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-light); color: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.side-foot .who { flex: 1; min-width: 0; }
.side-foot .who b { font-size: 13px; display: block; }
.side-foot .who span { font-size: 11px; color: var(--muted); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.header { height: 58px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 20px; gap: 14px; flex-shrink: 0; }
.header h2 { font-size: 16px; }
.header .spacer { flex: 1; }
.search-box { display: flex; align-items: center; background: #f2f5fb; border-radius: 20px; padding: 7px 14px; width: 280px; gap: 8px; }
.search-box input { border: none; background: transparent; width: 100%; }
.search-box svg { width: 15px; height: 15px; color: var(--muted); flex-shrink: 0; }
.btn { border: none; border-radius: 9px; padding: 8px 16px; font-size: 13px; background: #f2f5fb; color: var(--text); }
.btn:hover { filter: brightness(.97); }
.btn-primary { background: var(--brand); color: #fff; font-weight: 600; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-danger-ghost { background: var(--red-bg); color: var(--red); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }

.content { flex: 1; overflow-y: auto; padding: 20px 22px 40px; }

/* ---------- 通用卡片 ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 18px 20px; box-shadow: 0 1px 3px rgba(20, 40, 90, .05); }
.card h3 { font-size: 14px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card h3 svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: 1fr 1fr; } .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* KPI */
.kpi { display: flex; align-items: center; gap: 14px; }
.kpi .ic { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.kpi .ic svg { width: 22px; height: 22px; }
.kpi .ic.ic-blue { background: var(--brand-light); color: var(--brand); }
.kpi .ic.ic-green { background: var(--green-bg); color: var(--green); }
.kpi .ic.ic-grey { background: #f1f3f7; color: #98a2b8; }
.kpi .num { font-size: 24px; font-weight: 800; line-height: 1.1; }
.kpi .num.money { font-size: 19px; white-space: nowrap; }
.kpi .lbl { color: var(--muted); font-size: 12px; margin-top: 2px; }
/* 可点击的统计卡（销售机会列表页）：整卡可点，点即筛选 */
.kpi-click { cursor: pointer; border: 1px solid transparent; transition: box-shadow .15s, transform .15s, border-color .15s, background .15s; }
.kpi-click:hover { box-shadow: 0 6px 18px rgba(46, 108, 246, .13); transform: translateY(-1px); }
.kpi-click:hover .num { text-decoration: underline; text-decoration-color: var(--brand); text-underline-offset: 3px; }
.kpi-click.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
.kpi-click.on .num { color: var(--brand); }
.kpi-go { margin-left: auto; font-size: 11.5px; color: var(--muted); opacity: 0; transition: opacity .15s, color .15s; white-space: nowrap; flex-shrink: 0; }
.kpi-click:hover .kpi-go, .kpi-click.on .kpi-go { opacity: 1; }
.kpi-click.on .kpi-go { color: var(--brand); font-weight: 700; }

/* 看板里的小节标题（把机会口径与合同口径分开） */
.sec-h { display: flex; align-items: baseline; gap: 10px; font-size: 13.5px; font-weight: 800; color: #2b3a55; margin: 2px 0 10px; }
.sec-h::before { content: ''; width: 3px; height: 14px; border-radius: 2px; background: var(--brand); align-self: center; }
.sec-note { font-weight: 400; font-size: 11.5px; color: var(--muted); }

/* 条形图 */
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-label { width: 88px; font-size: 12.5px; color: #4a5568; text-align: right; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; height: 18px; background: #f2f5fb; border-radius: 9px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 9px; min-width: 2px; transition: width .4s; }
.bar-val { width: 34px; font-size: 12.5px; font-weight: 700; flex-shrink: 0; }

/* 赢单输单 */
.wl-bar { display: flex; height: 26px; border-radius: 13px; overflow: hidden; font-size: 12px; color: #fff; margin: 6px 0 14px; }
.wl-win { background: var(--green); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.wl-lose { background: #98a2b8; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.wl-none { background: #f2f5fb; color: var(--muted); display: flex; align-items: center; justify-content: center; width: 100%; }
.wl-stats { display: flex; gap: 22px; }
.wl-stats .item b { font-size: 20px; display: block; }
.wl-stats .item span { color: var(--muted); font-size: 12px; }
/* 看板上的回款进度条：文字比赢单/输单长，需要更宽的段与裁剪 */
.wl-bar.money-bar { height: 30px; font-size: 11.5px; }
.wl-bar.money-bar > div { overflow: hidden; white-space: nowrap; padding: 0 8px; }

/* 漏斗 */
.funnel-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.funnel-row:last-child { margin-bottom: 0; }
.funnel-label { width: 70px; font-size: 12.5px; color: #4a5568; text-align: right; flex-shrink: 0; }
.funnel-track { flex: 1; height: 22px; display: flex; }
.funnel-fill { height: 100%; border-radius: 6px; min-width: 3px; display: flex; align-items: center; color: #fff; font-size: 11px; font-weight: 700; padding-left: 8px; transition: width .4s; }

/* pill */
.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }

/* ---------- 表格 ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar select { background: #fff; border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; }
.toolbar select.active { border-color: var(--brand); background: var(--brand-light); color: var(--brand); font-weight: 600; }
.btn-clear { color: var(--brand); background: var(--brand-light); border: 1px solid #c3d7fd; padding: 5px 10px; font-size: 12px; border-radius: 7px; font-weight: 600; white-space: nowrap; }
.btn-clear:hover { background: #dbe7fe; }
.filter-count { color: var(--muted); font-size: 12px; margin-right: 6px; white-space: nowrap; }
.filter-count b { color: var(--brand); }
.table-wrap { background: #fff; border-radius: var(--radius); box-shadow: 0 1px 3px rgba(20, 40, 90, .05); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 980px; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid #f1f3f8; font-size: 13px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8faff; }
td .co { font-weight: 700; }
td .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.empty { text-align: center; color: var(--muted); padding: 50px 0; }
.actions { display: flex; gap: 6px; }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 25, 50, .45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { background: #fff; border-radius: 16px; width: 720px; max-width: 100%; max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; }
.modal.narrow { width: 420px; }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.modal-h b { font-size: 15px; }
.modal-x { border: none; background: none; font-size: 20px; color: var(--muted); line-height: 1; }
.modal-b { padding: 20px 22px; overflow-y: auto; }
.modal-f { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12.5px; color: #4a5568; margin-bottom: 5px; }
.field label .req { color: var(--red); margin-left: 2px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; background: #fbfcfe; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); background: #fff; }
.field textarea { resize: vertical; min-height: 60px; }

/* 新建销售机会：客户/联系人＝下拉选库内 + 右侧「＋ 新建」（见 app.js openOppModal） */
.pick-row { display: flex; gap: 8px; align-items: stretch; }
.pick-row select { flex: 1 1 auto; min-width: 0; }
.pick-add { flex: 0 0 auto; white-space: nowrap; padding: 0 10px; }
.pick-tip { grid-column: 1 / -1; color: var(--muted); font-size: 11.5px; line-height: 1.6; margin-top: -4px; }

/* 设置页 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--brand-light); color: var(--brand); border-radius: 18px; padding: 6px 8px 6px 14px; font-size: 13px; font-weight: 600; }
.chip button { border: none; background: rgba(46, 108, 246, .15); color: var(--brand); width: 18px; height: 18px; border-radius: 50%; font-size: 11px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.chip.gray { background: #eef1f6; color: #4a5568; }
.chip.gray button { background: rgba(0,0,0,.08); color: #4a5568; }
/* 可点选 chip（供应商服务类型多选）：点一下切换选中态 */
.chip.pick { cursor: pointer; background: #f2f5fb; color: #4a5568; padding: 6px 14px; user-select: none; }
.chip.pick:hover { background: var(--brand-light); color: var(--brand); }
.chip.pick.sel { background: var(--brand); color: #fff; }
.add-row { display: flex; gap: 10px; margin-top: 14px; }
.add-row input { flex: 1; border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; background: #fbfcfe; }

/* ---------- 详情抽屉 ---------- */
tr.row-click { cursor: pointer; }
tr.row-click .co { color: var(--brand); }
/* ---------- 详情整页视图 ----------
 * 点列表任意一行 → 在主内容区整页打开（原来是从右侧滑出的抽屉，华哥要求改成整页打开）
 * 宽度铺满内容区（不能加 max-width，否则又变成"中间一块"） */
.detail-page { width: 100%; animation: dpin .18s ease-out; }
@keyframes dpin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dp-bar { display: flex; align-items: center; gap: 14px; background: #fff; border-radius: var(--radius); padding: 13px 18px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(20, 40, 90, .05); }
.dp-back { display: inline-flex; align-items: center; gap: 6px; border: none; background: #f2f5fb; color: #4a5568; border-radius: 9px; padding: 8px 13px; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.dp-back:hover { background: var(--brand-light); color: var(--brand); }
.dp-back svg { width: 15px; height: 15px; }
.dp-head { min-width: 0; }
.dp-title { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.dp-sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.dp-body { background: #fff; border-radius: var(--radius); padding: 20px 24px; box-shadow: 0 1px 3px rgba(20, 40, 90, .05); }
.dt-sec { margin-bottom: 20px; }
.dt-sec-h { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .5px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.dt-tip { font-weight: 400; color: #b3bacb; font-size: 11px; }
.dt-row { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px dashed #f1f3f8; min-width: 0; }
.dt-row:last-child { border-bottom: none; }
.dt-lbl { width: 72px; color: var(--muted); font-size: 12.5px; flex-shrink: 0; }
.dt-val { flex: 1; font-size: 13.5px; word-break: break-all; min-width: 0; }
/* 详情页备注：保留换行，长文本可读 */
.dt-note { font-size: 13.5px; line-height: 1.85; color: #2f3646; white-space: pre-wrap; word-break: break-word; background: #f7f9fe; border: 1px solid #e9eefb; border-radius: 10px; padding: 11px 13px; }
.dt-note-empty { font-size: 13px; color: #b3bacb; }
.dt-meta { color: #b3bacb; font-size: 11.5px; padding-top: 6px; }
.stage-box { display: flex; flex-wrap: wrap; gap: 8px; }
.stage-btn { border: 1px solid transparent; border-radius: 20px; padding: 6px 14px; font-size: 12.5px; font-weight: 600; }
.stage-btn:hover { filter: brightness(.96); }
/* 当前所在阶段：红底白字 + 淡红投影，比原来的蓝色梯度更醒目（华哥 2026-09-11 要求） */
.stage-btn.on { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 2px 8px rgba(220, 38, 38, .28); }

/* 撑满宽度后，字段不能一条条横着拉满（label 到 value 隔半个屏幕）
 * → 每个信息分区内部改成自适应多列栅格，字段自动填满整行
 * 分区里除 .dt-row 以外的内容（备注、阶段按钮、金额概览、支出卡片、联系人列表…）一律通栏 */
.dp-body .dt-sec { display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: 0 30px; align-content: start; }
.dp-body .dt-sec > *:not(.dt-row) { grid-column: 1 / -1; }
/* 多列后每个字段各自带一条虚线下划线，统一保留（含最后一个），视觉才齐 */
.dp-body .dt-sec .dt-row,
.dp-body .dt-sec .dt-row:last-child { border-bottom: 1px dashed #f1f3f8; }
@media (max-width: 900px) { .dp-body .dt-sec { grid-template-columns: 1fr; } }

/* 联系人条目（客户详情 / 联系人页复用） */
.ct-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.ct-item:hover { background: #f7f9fe; border-color: var(--border); }
.ct-av { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-light); color: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.ct-av-lg { width: 42px; height: 42px; font-size: 17px; }
.ct-name { font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ct-item .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
/* 联系人卡片：姓名/性别/年龄 与 电话/邮箱 同一行（电话邮箱跟在姓名后面，不再是下面一行小字） */
.ct-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.ct-lk { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--brand); white-space: nowrap; }
.ct-lk svg { width: 14px; height: 14px; opacity: .8; flex-shrink: 0; }
.ct-lk:hover { text-decoration: underline; }
.ct-edit { color: var(--muted); font-size: 12px; white-space: nowrap; }
/* 表格里的电话/邮箱：同一行、可点击拨号与发信 */
.c-links { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 14px; }
.lk { color: var(--brand); font-size: 13px; }
.tag-sm { background: #eef1f6; color: #4a5568; border-radius: 6px; padding: 1px 6px; font-size: 11px; font-weight: 600; }

/* 提示 */
.toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); background: #1e2433; color: #fff; padding: 10px 20px; border-radius: 10px; font-size: 13px; z-index: 200; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: fadein .2s; }
@keyframes fadein { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- 系统设置：账号管理 ---------- */
table.mini { min-width: 0; }
table.mini th { padding: 10px 12px; }
table.mini td { padding: 11px 12px; }
.role-tip { margin-top: 16px; border-top: 1px dashed var(--border); padding-top: 14px; display: grid; gap: 8px; }
.role-row { display: flex; gap: 10px; font-size: 12.5px; line-height: 1.7; }
.role-row b { width: 76px; flex-shrink: 0; color: var(--brand); font-weight: 700; }
.role-row span { color: var(--muted); flex: 1; }
.role-hint { background: var(--brand-light); color: var(--brand); border-radius: 9px; padding: 9px 12px; font-size: 12.5px; line-height: 1.6; }
.readonly-box { border: 1px dashed var(--border); border-radius: 9px; padding: 9px 11px; background: #f7f9fe; color: #4a5568; font-size: 13px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.readonly-box .dt-tip { margin-left: auto; }

/* ---------- 销售合同 ---------- */
/* 列表上方的一行合计（合同额 / 已收 / 未收 / 支出 / 利润） */
.sum-strip { display: flex; flex-wrap: wrap; gap: 20px; background: #fff; border-radius: 10px; padding: 10px 16px; margin-bottom: 14px; font-size: 12.5px; color: var(--muted); box-shadow: 0 1px 3px rgba(20, 40, 90, .05); }
.sum-strip b { color: var(--text); font-weight: 700; }

/* 合同详情的金额概览（整页详情够宽，四格排一行；窄屏退回两格） */
.money-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 10px; }
@media (max-width: 900px) { .money-grid { grid-template-columns: 1fr 1fr; } }
.money-cell { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: #fbfcfe; }
.money-cell .k { color: var(--muted); font-size: 11.5px; margin-bottom: 3px; }
.money-cell .v { font-size: 15px; font-weight: 800; }
.money-cell.hero { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 10px; background: var(--brand-light); border-color: #c3d7fd; }
.money-cell.hero .k { margin: 0; }
.money-cell.hero .v { font-size: 20px; }
.money-hint { font-size: 11.5px; color: var(--muted); line-height: 1.7; }

/* 填合同时的实时预览 */
.money-preview { border: 1px dashed var(--border); border-radius: 10px; padding: 10px 12px; background: #f7f9fe; }
.money-preview-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12.5px; color: #4a5568; padding: 3px 0; }
.money-preview-row b { color: var(--text); font-weight: 800; }
.money-warn { margin-top: 6px; background: var(--red-bg); color: var(--red); border-radius: 8px; padding: 7px 10px; font-size: 12px; line-height: 1.6; }

/* 项目支出卡片（独立成卡，放在合同信息卡下面） */
.exp-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 12px 6px; background: #fbfcfe; }
.exp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.exp-head .t { font-size: 12.5px; font-weight: 700; color: #4a5568; display: flex; align-items: center; gap: 6px; }
.exp-head .t svg { width: 15px; height: 15px; color: var(--muted); }
.exp-sub { display: flex; flex-wrap: wrap; gap: 16px; font-size: 11.5px; color: var(--muted); padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
.exp-sub b { color: var(--text); font-weight: 700; }

/* ---------- 详情页下方的独立卡片（项目支出 / 备注） ---------- */
.panel-card { background: #fff; border-radius: var(--radius); padding: 18px 24px; margin-top: 14px; box-shadow: 0 1px 3px rgba(20, 40, 90, .05); }
.pc-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pc-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; }
.pc-title svg { width: 17px; height: 17px; color: var(--brand); }
.pc-title .pc-count { background: var(--brand-light); color: var(--brand); font-size: 11.5px; font-weight: 700; border-radius: 20px; padding: 2px 9px; }
.pc-acts { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pc-acts .btn svg { width: 14px; height: 14px; }
.pc-body { padding-top: 2px; }
.exp-sum { display: flex; flex-wrap: wrap; gap: 20px; font-size: 12.5px; color: var(--muted); padding: 10px 12px; background: #f7f9fe; border: 1px solid #e9eefb; border-radius: 10px; }
.exp-sum b { color: var(--text); font-weight: 800; }

/* 面板卡里的紧凑表格（客户详情「关联合同」用）。
 * 不能直接复用 .table-wrap：那里 table 有 min-width:980px，塞进卡片会横向溢出。 */
.card-table-wrap { margin-top: 12px; border: 1px solid var(--border); border-radius: 10px; overflow-x: auto; }
.card-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.card-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--border); background: #fbfcfe; white-space: nowrap; }
.card-table td { padding: 11px 14px; border-bottom: 1px solid #f1f3f8; font-size: 13px; vertical-align: middle; }
.card-table tr:last-child td { border-bottom: none; }
.card-table tbody tr:hover td { background: #f8faff; }

/* 按费用类型的分类小计 */
.cat-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cat-chip { display: inline-flex; align-items: baseline; gap: 7px; background: #fbfcfe; border: 1px solid var(--border); border-radius: 20px; padding: 5px 12px; font-size: 12px; }
.cat-chip i { font-style: normal; color: #4a5568; }
.cat-chip b { font-weight: 800; }
.cat-chip em { font-style: normal; color: #b3bacb; font-size: 11px; }

/* 表格拖入区 */
.dropzone { display: flex; align-items: center; gap: 14px; margin: 12px 0 4px; padding: 14px 18px; border: 2px dashed #cdd8ee; border-radius: 12px; background: #fafcff; transition: .15s; }
.dropzone .dz-ic { width: 38px; height: 38px; border-radius: 10px; background: var(--brand-light); color: var(--brand); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dropzone .dz-ic svg { width: 20px; height: 20px; }
.dropzone .dz-tx { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--muted); }
.dropzone .dz-tx b { color: var(--text); font-size: 13px; font-weight: 700; }
.dropzone .dz-tx a { color: var(--brand); font-weight: 600; }
.dropzone.over { border-color: var(--brand); background: var(--brand-light); }

.exp-list { padding-top: 2px; }
.exp-item { padding: 9px 2px; border-bottom: 1px solid #eef1f8; }
.exp-item:last-child { border-bottom: none; }
.exp-top { display: flex; align-items: baseline; gap: 10px; }
.exp-title { flex: 1; min-width: 0; font-weight: 700; font-size: 13px; word-break: break-all; }
.exp-money { font-weight: 800; font-size: 13.5px; white-space: nowrap; }
.exp-bot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 5px; }
.exp-bot .d { color: var(--muted); font-size: 11.5px; }
.exp-bot .s { color: #4a5568; font-size: 11.5px; }
/* 费用类型标签 */
.exp-type { display: inline-block; background: #eef4ff; color: #2e6cf6; border-radius: 20px; padding: 2px 9px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }

/* 跟进记录（机会详情页底部卡片）：左侧时间轴 + 右侧内容 */
.fu-list { position: relative; padding-left: 20px; }
.fu-list::before { content: ''; position: absolute; left: 4px; top: 14px; bottom: 14px; width: 2px; border-radius: 2px; background: #e9eefb; }
.fu-item { position: relative; padding: 10px 0 12px; border-bottom: 1px solid #f1f4fa; }
.fu-item:last-child { border-bottom: none; padding-bottom: 0; }
.fu-item::before { content: ''; position: absolute; left: -20px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid #c9d6f5; box-sizing: border-box; }
.fu-item:first-child::before { background: var(--brand); border-color: var(--brand); }   /* 最新一条实心 */
.fu-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.fu-date { font-weight: 800; font-size: 13px; }
.fu-ago { font-size: 11.5px; color: var(--muted); }
.fu-who { background: #f2f5fb; color: #4a5568; border-radius: 20px; padding: 2px 9px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.fu-stage { border-radius: 20px; padding: 2px 9px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.fu-text { font-size: 13.5px; line-height: 1.85; color: #2f3646; white-space: pre-wrap; word-break: break-word; }

/* 导入预览 */
.imp-tip { background: #f7f9fe; border: 1px solid #e9eefb; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: #4a5568; line-height: 1.75; margin-bottom: 12px; }
.imp-wrap { max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.imp-table { width: 100%; box-shadow: none; }
.imp-table th { position: sticky; top: 0; z-index: 1; }
.imp-table .r { text-align: right; }
.imp-table td:nth-child(2) { white-space: nowrap; }   /* 日期别折成两行 */
.imp-table td:nth-child(6) { white-space: nowrap; }
.imp-table td .exp-type { font-size: 11px; }
.imp-table .pill { display: inline-block; }

/* 已支付 / 未支付：点一下就能切换 */
.pay-pill { cursor: pointer; user-select: none; background: #f1f3f7; color: #8a93a6; }
.pay-pill.on { background: var(--green-bg); color: var(--green); }
.pay-pill:hover { filter: brightness(.95); }
