:root {
  --bg: #f4f5f7; --card: #fff; --text: #1d2330; --muted: #6b7280; --line: #e3e6ec; --accent: #2457d6;
  --red-bg: #fde8e8; --red-fg: #b42318; --yellow-bg: #fff6d6; --yellow-fg: #8a6100; --green-bg: #e7f6ec; --green-fg: #19713a; --grey-bg: #eef0f3;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0 0 8px; }
h2 { font-size: 18px; } h3 { font-size: 16px; }
.muted { color: var(--muted); font-size: 13px; }
.error { color: var(--red-fg); min-height: 1.4em; margin: 4px 0; }

.login-view { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { background: var(--card); border-radius: 12px; padding: 24px; width: 100%; max-width: 360px; box-shadow: 0 2px 12px rgba(0,0,0,.08); display: flex; flex-direction: column; gap: 12px; }
.login-card label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }

.topbar { background: #1d2a4d; color: #fff; display: flex; align-items: center; gap: 12px; padding: 8px 16px; position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand { font-weight: 600; white-space: nowrap; }
.nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; min-width: 0; -webkit-overflow-scrolling: touch; }
.nav a { color: #cfd8f5; text-decoration: none; padding: 6px 10px; border-radius: 6px; white-space: nowrap; font-size: 14px; }
.nav a.active { background: #3a4c85; color: #fff; }
.who { font-size: 13px; white-space: nowrap; }
.who button.link { color: #cfd8f5; }
.main { padding: 16px; max-width: 1400px; margin: 0 auto; }

button { font: inherit; cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 6px; padding: 6px 12px; }
button:hover { border-color: #b9c0cf; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: var(--red-fg); border-color: #f1b8b3; }
button.link { background: none; border: none; padding: 0 4px; color: var(--accent); text-decoration: underline; }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { font: inherit; padding: 6px 8px; border: 1px solid #cfd4de; border-radius: 6px; background: #fff; color: var(--text); max-width: 100%; }
textarea { width: 100%; min-height: 90px; }
input[type=number] { width: 110px; text-align: right; }

.card { background: var(--card); border-radius: 10px; padding: 14px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }
.stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.stat { background: var(--card); border-radius: 10px; padding: 10px 16px; box-shadow: 0 1px 3px rgba(0,0,0,.05); min-width: 140px; }
.stat b { font-size: 24px; display: block; }
.stat.red b { color: var(--red-fg); } .stat.yellow b { color: var(--yellow-fg); } .stat.green b { color: var(--green-fg); }
.stat.green { max-width: 340px; }

.table-wrap { overflow-x: auto; background: var(--card); border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { background: #f8f9fb; font-weight: 600; color: #444c5e; position: sticky; top: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.row-red td { background: var(--red-bg); }
tr.row-yellow td { background: var(--yellow-bg); }
tr.row-green td { background: var(--green-bg); }
tr.row-grey td { background: var(--grey-bg); }
tr.row-inactive td:first-child { opacity: .6; }
.tag { display: inline-block; font-size: 12px; padding: 0 6px; border-radius: 10px; background: var(--grey-bg); color: var(--muted); margin-left: 4px; }
.tag.warn { background: var(--yellow-bg); color: var(--yellow-fg); }
.tag.new { background: #e5ecff; color: var(--accent); }
.status-red { color: var(--red-fg); font-weight: 600; } .status-yellow { color: var(--yellow-fg); font-weight: 600; } .status-green { color: var(--green-fg); font-weight: 600; }
.layout-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 1100px) { .layout-2 { grid-template-columns: 1fr 340px; align-items: start; } }

dialog { border: none; border-radius: 12px; padding: 20px; width: min(480px, 94vw); box-shadow: 0 8px 30px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(0,0,0,.4); }
dialog form { display: flex; flex-direction: column; gap: 10px; }
dialog label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1d2330; color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 20; max-width: 90vw; }
.toast.err { background: var(--red-fg); }
.bar { position: relative; height: 10px; background: #e6e9ef; border-radius: 5px; min-width: 120px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.bar > s { position: absolute; top: -3px; width: 2px; height: 16px; background: var(--red-fg); }
.settings-form { display: grid; gap: 12px; max-width: 520px; }
.settings-form label { display: flex; flex-direction: column; gap: 4px; }
.note { background: #f8f9fb; border-left: 3px solid var(--accent); padding: 8px 12px; margin: 8px 0; font-size: 13px; color: #444c5e; }
.tag-stage, .tag-btn { display: inline-block; font-size: 12px; padding: 0 8px; border-radius: 10px; margin-left: 4px; border: 1px solid transparent; line-height: 1.6; }
.tag-btn { cursor: pointer; text-decoration: underline; }
.tag-stage.pending, .tag-btn.pending { background: var(--yellow-bg); color: var(--yellow-fg); }
.tag-stage.following, .tag-btn.following { background: #e5ecff; color: var(--accent); }
.tag-stage.done-good, .tag-btn.done-good { background: var(--green-bg); color: var(--green-fg); }
.tag-stage.done-bad, .tag-btn.done-bad { background: var(--red-bg); color: var(--red-fg); }
.leader-head { margin: 18px 0 8px; }
.talk-card.closed { opacity: .85; }
.talk-card.focus { outline: 2px solid var(--accent); }
.talk-head { margin-bottom: 8px; }
.talk-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.talk-steps > li { padding-left: 4px; border-left: 3px solid var(--line); padding-left: 10px; }
.step-name { font-weight: 600; margin-right: 6px; }
.pre { white-space: pre-wrap; }
.followups { margin: 4px 0 0; padding-left: 18px; }
.trend.improved { color: var(--green-fg); font-weight: 600; }
.trend.worse { color: var(--red-fg); font-weight: 600; }
.trend.same { color: var(--muted); }
@media (max-width: 640px) {
  .nav { order: 3; flex-basis: 100%; } .who { margin-left: auto; }
  .report-reminder-slot { padding: 10px 10px 0; }
  .main { padding: 10px; } th, td { padding: 6px 8px; font-size: 13px; } input[type=number] { width: 90px; }
}
/* 看板：组长卡片（点了只看该组长的组员）+ 全宽表格，操作列不换行 */
.leader-cards { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.leader-card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 130px; padding: 10px 14px; border: 2px solid transparent; border-radius: 10px; background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.05); cursor: pointer; font: inherit; color: var(--text); text-align: left; }
.leader-card b { font-size: 15px; }
.leader-card span { font-size: 13px; }
.leader-card:hover { border-color: #c5cde0; }
.leader-card.active { border-color: #1d2a4d; background: #eef2fb; }
.dash-table td:last-child { white-space: nowrap; }
/* 冻结窗格（看板/日报/打款/目标/建议/员工）：容器自身滚动，表头吸顶、姓名/组别吸左；separate 避免 sticky 单元格丢边框。
   底色用低优先级的 .fz-col，让 tr.row-red td 等状态底色仍能盖过它。 */
.table-wrap.freeze { max-height: calc(100vh - 220px); overflow: auto; }
.table-wrap.freeze table { border-collapse: separate; border-spacing: 0; }
.table-wrap.freeze thead th { z-index: 2; }
.fz-col { background: var(--card); }
th.fz-col { background: #f8f9fb; }
.table-wrap.freeze .fz-col { position: sticky; z-index: 1; }
.table-wrap.freeze thead .fz-col { z-index: 3; }
.table-wrap.freeze .fz-2 { box-shadow: 1px 0 0 var(--line); }
.rec-line { margin-top: 2px; }
.rec-link { margin-right: 6px; white-space: nowrap; }
/* 生日提醒条、图片缩略图、请假页签、员工生日输入 */
.birthday-bar { display: block; margin-bottom: 12px; padding: 10px 14px; border-radius: 10px; background: var(--yellow-bg); color: var(--yellow-fg); text-decoration: none; font-weight: 600; }
.birthday-bar:hover { filter: brightness(.97); }
/* 日报未录提醒条：全站顶部，橙红醒目；全部录完是绿色 */
.report-reminder-slot { max-width: 1400px; margin: 0 auto; padding: 12px 16px 0; }
.report-reminder-slot:empty { display: none; }
.report-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 10px; font-weight: 600; }
.report-bar.due { background: #ffe4d1; color: #9a3412; border-left: 5px solid #ea580c; }
.report-bar.ok { background: var(--green-bg); color: var(--green-fg); border-left: 5px solid var(--green-fg); }
.report-bar-link { color: inherit; text-decoration: none; flex: 1 1 320px; }
.report-bar-link:hover { text-decoration: underline; }
.report-bar-notify { font-size: 12px; padding: 2px 10px; border-color: #ea580c; color: #9a3412; background: #fff; }
.report-entry-line { margin-bottom: 10px; padding: 8px 12px; border-radius: 8px; font-weight: 600; background: var(--grey-bg); color: var(--text); }
.report-entry-line.due { background: #ffe4d1; color: #9a3412; }
.report-entry-line.ok { background: var(--green-bg); color: var(--green-fg); }
.thumbs-cell { white-space: normal; min-width: 90px; }
.thumb-wrap { position: relative; display: inline-block; margin: 2px 6px 2px 0; vertical-align: top; }
.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); cursor: zoom-in; background: var(--grey-bg); display: block; }
.thumb-del { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; padding: 0; line-height: 18px; border-radius: 50%; font-size: 14px; color: var(--red-fg); border-color: #f1b8b3; }
dialog:has(.photo-big) { width: min(900px, 96vw); }
.photo-big { max-width: 100%; max-height: 75vh; object-fit: contain; margin: 0 auto; display: block; }
.up-status { min-height: 1.4em; }
.tab { border-radius: 16px; }
.tab.active { background: #1d2a4d; border-color: #1d2a4d; color: #fff; }
.field-group { display: flex; flex-direction: column; gap: 4px; }
.field-caption { font-size: 13px; color: var(--muted); }
.birth-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.birth-row input[type=number] { width: 70px; text-align: center; }
dialog label.inline-check { flex-direction: row; align-items: center; gap: 4px; color: var(--text); }
/* 粘贴图片区（照片选择框下方） */
.paste-zone { border: 1px dashed #c5cde0; border-radius: 8px; padding: 10px; color: var(--muted); font-size: 13px; background: #fafbfd; }
.paste-zone:focus { outline: 2px solid var(--accent); }
.paste-previews { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.paste-previews:empty { display: none; }
.paste-previews img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }

/* 妙记文字稿与 AI 总结 */
.tx-block { margin: 6px 0 2px; padding: 6px 10px; border-left: 3px solid var(--accent); background: #f6f8ff; border-radius: 0 6px 6px 0; font-size: 13px; }
.tx-title { font-weight: 600; margin-bottom: 2px; }
.tx-summary { margin: 2px 0 4px; }
.tx-status { margin: 2px 0; padding-left: 18px; color: var(--muted); }
.tx-actions { margin-top: 2px; }
dialog:has(.tx-view) { width: min(760px, 96vw); }
.tx-text { max-height: 40vh; overflow: auto; padding: 8px; background: var(--grey-bg); border-radius: 6px; font-size: 13px; line-height: 1.6; }

/* 面试管理：简历文件、AI 评估正文、详情表单、人才画像 */
.file-chip { display: inline-flex; align-items: center; gap: 4px; margin: 2px 6px 2px 0; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fafbfd; font-size: 13px; max-width: 100%; }
.file-chip a { overflow-wrap: anywhere; }
.chip-del { padding: 0 6px; line-height: 18px; border-radius: 50%; color: var(--red-fg); border-color: #f1b8b3; }
.resume-files { margin-bottom: 8px; }
.resume-text { margin: 8px 0; }
.resume-text summary { cursor: pointer; }
.review-text { line-height: 1.7; }
.iv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 8px; }
.iv-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.iv-form textarea { min-height: 50px; }
#ivd-root .card .tx-block { margin: 10px 0; }
#ivd-root .toolbar a { white-space: nowrap; }
.profile-card summary { cursor: pointer; }
.profile-body { margin-top: 10px; }
.profile-text { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; line-height: 1.55; min-height: 320px; }
.profile-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.md-preview { padding: 10px 14px; border: 1px solid var(--line); border-radius: 6px; background: #fafbfd; max-height: 70vh; overflow: auto; font-size: 14px; }
.md-preview h3, .md-preview h4, .md-preview h5, .md-preview h6 { margin: 12px 0 4px; }
.md-preview p { margin: 4px 0; }
.md-preview ul { margin: 4px 0; padding-left: 20px; }
.md-preview blockquote { margin: 6px 0; padding: 4px 10px; border-left: 3px solid #e0b100; background: var(--yellow-bg); color: var(--yellow-fg); }
.md-table { border-collapse: collapse; margin: 6px 0; font-size: 13px; }
.md-table th, .md-table td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; vertical-align: top; white-space: normal; }

/* 员工访谈：提纲、进度卡、列表展开详情；人才画像页的访谈提炼草稿 */
.staff-outline summary { cursor: pointer; }
.staff-outline ol { margin: 4px 0 8px; padding-left: 22px; }
.staff-outline li { margin: 2px 0; }
.staff-outline h4 { margin: 10px 0 2px; }
.staff-progress .progress-line { margin: 6px 0; }
.missing-names { margin: 2px 0 0 0; }
.missing-names .tag { margin: 2px 4px 2px 0; }
tr.detail-row td { white-space: normal; background: #fafbfd; }
.staff-detail { position: sticky; left: 8px; max-width: min(880px, 90vw); }
.profile-drafts { margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--line); }
.profile-drafts h4 { margin: 0 0 4px; }
dialog:has(.draft-view) { width: min(1180px, 96vw); }
.draft-view .draft-basis { margin-bottom: 8px; }
.draft-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.draft-compare .md-preview, .draft-view .md-preview { max-height: 60vh; }
@media (max-width: 760px) { .draft-compare { grid-template-columns: 1fr; } }
/* 绩效看板 · 本月业绩总览：总业绩大字 + 各组占比条（100% 横条，段间 2px 缝，两端圆角）+ 分组表 */
.ov-card { padding: 16px; }
.ov-hero { display: flex; flex-direction: column; gap: 4px; }
.ov-hero > b { font-size: 30px; line-height: 1.2; color: var(--text); }
.ov-bar { display: flex; gap: 2px; height: 30px; margin: 14px 0 12px; border-radius: 4px; overflow: hidden; }
.ov-seg { display: flex; align-items: center; justify-content: center; min-width: 2px; cursor: default; }
.ov-seg span { color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; text-shadow: 0 0 2px rgba(0,0,0,.35); }
.ov-seg:hover { filter: brightness(1.08); }
.ov-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: baseline; }
.ov-table td, .ov-table th { padding: 6px 10px; }

/* 目标达成徽章（实际打款 ≥ 目标）：带文字，不单靠颜色 */
.ach-badge { display: inline-block; font-size: 12px; padding: 0 8px; margin-left: 6px; border-radius: 10px; line-height: 1.6; font-weight: 600; white-space: nowrap; }
.ach-badge.ach-done { background: var(--green-bg); color: var(--green-fg); border: 1px solid var(--green-fg); }
.ach-badge.ach-expect { background: #f3faf5; color: var(--green-fg); border: 1px dashed var(--green-fg); font-weight: 400; }
td.cell-achieved { background: var(--green-bg); }

.small { font-size: 12px; }
/* 组长卡片：全组业绩一行加粗，组长本人一行小字 */
.leader-card .lc-perf { font-weight: 600; color: var(--text); margin-top: 2px; }
.leader-card .lc-line { font-size: 12px; color: var(--muted); }
.leader-card .lc-line em { font-style: normal; }
.leader-card { min-width: 170px; }
