:root {
  --bg: #eef2f7;
  --surface: #ffffff;
  --ink: #1c2b3a;
  --ink-2: #5b6b7c;
  --ink-3: #93a1b0;
  --line: #e3e9f0;
  --brand: #ff6a00;
  --brand-deep: #e05a00;
  --accent: #ff7a1a;
  --accent-soft: #fff0e2;
  --red: #c0392b;
  --red-soft: #fdecea;
  --amber: #b26a00;
  --amber-soft: #fdf3e3;
  --ok: #2e7d5b;
  --ok-soft: #e6f4ec;
  --shadow: 0 1px 2px rgba(28, 43, 58, .05), 0 4px 14px rgba(28, 43, 58, .06);
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(1100px 320px at 85% -60px, rgba(255, 106, 0, .10), transparent 60%),
    radial-gradient(900px 300px at -10% 0, rgba(255, 138, 40, .08), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

/* ---------- topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff; font-size: 19px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(255, 106, 0, .3);
  overflow: hidden;
}
.brand-mark.has-img { background: #fff; box-shadow: none; }
.brand-mark.has-img img { width: 100%; height: 100%; object-fit: contain; }
.brand-name { font-size: 16px; font-weight: 600; letter-spacing: .3px; }
.brand-sub { font-size: 12px; color: var(--ink-2); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.today-chip {
  font-size: 12px; color: var(--ink-2); background: var(--bg);
  border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px;
}

/* ---------- buttons / inputs ---------- */
.btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 7px 15px; border-radius: 9px; font-size: 13.5px; cursor: pointer;
  transition: all .15s ease; font-family: inherit;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn-primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 3px 8px rgba(255, 106, 0, .25);
}
.btn-primary:hover { background: var(--brand-deep); color: #fff; }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.tabs {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 28px 0;
  max-width: 1240px; margin: 0 auto; width: 100%;
}
.tab {
  border: none; background: transparent; padding: 10px 20px; font-size: 14px;
  color: var(--ink-2); cursor: pointer; border-radius: 10px 10px 0 0;
  font-family: inherit; border-bottom: 2px solid transparent;
  transition: background .12s ease, color .12s ease;
}
.tab:hover { color: var(--brand); background: rgba(255, 106, 0, .10); }
.tab.active { color: var(--brand-deep); font-weight: 600; background: #ffe7d1; border-bottom-color: var(--brand); }

/* ---------- 顶部导航下拉子菜单（2026-09-12 管理员「财务看板」分组） ---------- */
.tab-group { position: relative; }
.tab-parent { display: inline-flex; align-items: center; gap: 5px; }
.tab-parent .caret { font-size: 9px; line-height: 1; opacity: .7; }
.tab-group:hover .tab-parent,
.tab-group:focus-within .tab-parent { color: var(--brand); background: rgba(255, 106, 0, .10); }
.tab-menu {
  position: absolute; top: calc(100% - 2px); left: 0; z-index: 80;
  display: none; flex-direction: column; gap: 2px; min-width: 168px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(28, 43, 58, .14);
}
.tab-group:hover .tab-menu,
.tab-group:focus-within .tab-menu { display: flex; }
.tab-menu-item {
  border: none; background: transparent; text-align: left; padding: 8px 12px;
  font-size: 13.5px; font-family: inherit; color: var(--ink-2); cursor: pointer;
  border-radius: 8px; white-space: nowrap;
}
.tab-menu-item:hover { background: rgba(255, 106, 0, .10); color: var(--brand); }
.tab-menu-item.active { background: #ffe7d1; color: var(--brand-deep); font-weight: 600; }

/* ---------- 页内子页签（管理员总览看板：经营总览 / AI 经营报告） ---------- */
.subtabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.subtab {
  border: 1px solid var(--line); background: var(--surface); padding: 7px 16px;
  font-size: 13.5px; font-family: inherit; color: var(--ink-2); cursor: pointer;
  border-radius: 999px; transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.subtab:hover { color: var(--brand); border-color: rgba(255, 106, 0, .45); }
.subtab.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

.content { max-width: 1240px; margin: 0 auto; padding: 18px 28px 60px; width: 100%; }
.view { display: none; }
.view.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

/* ---------- stat cards ---------- */
.stat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 6px;
}
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.stat .num { font-size: 30px; font-weight: 700; letter-spacing: .2px; }
.stat .lbl { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.stat .sub { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.stat.alert .num { color: var(--red); }
.stat.warn .num { color: var(--amber); }
.stat.ok .num { color: var(--ok); }
.stat.accent .num { color: var(--accent); }

/* ---------- section titles ---------- */
.section-title {
  font-size: 15px; font-weight: 600; margin: 26px 2px 12px;
  display: flex; align-items: baseline; gap: 10px;
}
.section-hint { font-size: 12px; color: var(--ink-3); font-weight: 400; }

/* ---------- owner cards ---------- */
.owner-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 12px;
}
.owner-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 8px;
}
.owner-head { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; color: #fff;
}
.avatar.unassigned { background: linear-gradient(135deg, #9aa8b6, #75808c); }
.avatar.s0 { background: linear-gradient(135deg, #ff8f3d, #ff6a00); }
.avatar.s1 { background: linear-gradient(135deg, #ff8f3d, #d96a00); }
.avatar.s2 { background: linear-gradient(135deg, #b26a2a, #8c4f1b); }
.avatar.s3 { background: linear-gradient(135deg, #7a5bb0, #5c4290); }
.avatar.s4 { background: linear-gradient(135deg, #b5453a, #8c3228); }
.owner-name { font-weight: 600; font-size: 14.5px; }
.owner-meta { margin-left: auto; text-align: right; font-size: 11.5px; color: var(--ink-3); line-height: 1.35; }
.owner-stats { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: var(--bg); color: var(--ink-2); border: 1px solid var(--line);
}
.chip.red { background: var(--red-soft); color: var(--red); border-color: #f3c4bd; font-weight: 600; }
.chip.amber { background: var(--amber-soft); color: var(--amber); border-color: #ecd2a4; font-weight: 600; }
.chip.green { background: var(--ok-soft); color: var(--ok); border-color: #bcdccc; }
.chip.teal { background: var(--accent-soft); color: var(--accent); border-color: #ffcfa8; }
.chip.blue { background: #fff0e0; color: var(--brand); border-color: #ffd5ae; }
.chip.gray { background: #eef1f4; color: #5f6f80; border-color: #dde3ea; }

/* 公海列表：状态列加宽、禁止徽章文字换行（2026-09-08） */
#view-public .tbl th:nth-child(5),
#view-public .tbl td:nth-child(5) { min-width: 108px; white-space: nowrap; }

/* ---------- table ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; min-width: 780px; }
.tbl th {
  text-align: left; font-size: 12px; font-weight: 500; color: var(--ink-3);
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: #f7f9fc; white-space: nowrap;
}
.tbl td {
  padding: 11px 14px; border-bottom: 1px solid #eef2f6; font-size: 13.5px;
  vertical-align: middle;
}
.tbl tbody tr { cursor: pointer; transition: background .12s ease; }
.tbl tbody tr:hover { background: #f4f8fc; }
.tbl tr.overdue { background: var(--red-soft); box-shadow: inset 3px 0 0 var(--red); }
.tbl tr.overdue:hover { background: #fbe4e1; }
.tbl tr.todayDue { background: var(--amber-soft); box-shadow: inset 3px 0 0 var(--amber); }
.tbl tr.todayDue:hover { background: #fbeed5; }
.tbl .empty td { text-align: center; color: var(--ink-3); padding: 34px 0; cursor: default; }

.cust { display: flex; flex-direction: column; }
.cust .nm { font-weight: 600; }
.cust .ct { font-size: 12px; color: var(--ink-3); }
.owner-tag { font-size: 12px; }
.sabc-badge {
  display: inline-flex; width: 24px; height: 24px; border-radius: 7px;
  align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700;
}
.sabc-S { background: #fbf3dd; color: #9a7410; border: 1px solid #e8d49a; }
.sabc-A { background: #fff0e0; color: var(--brand); border: 1px solid #ffd5ae; }
.sabc-B { background: var(--ok-soft); color: var(--ok); border: 1px solid #bcdccc; }
.sabc-C { background: #eef1f4; color: #5f6f80; border: 1px solid #dde3ea; }
.status-tag { font-size: 12px; }
.due { white-space: nowrap; font-size: 12.5px; font-weight: 500; }
.due.late { color: var(--red); }
.due.today { color: var(--amber); }
.due.future { color: var(--ink-2); }
.due.none { color: var(--ink-3); }
.next { max-width: 300px; color: var(--ink-2); }
.next .more { color: var(--ink-3); }

/* ---------- filters ---------- */
.filters {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 12px;
}
.filters label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
select, input[type="text"], input[type="date"], input:not([type]), textarea {
  font-family: inherit; font-size: 13.5px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px;
  background: var(--surface); outline: none;
}
select:focus, input:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 106, 0, .12); }
.chk { cursor: pointer; user-select: none; }
.chk input { accent-color: var(--brand); }
.count-chip { margin-left: auto; font-size: 12.5px; color: var(--ink-3); }

/* ---------- forms / modal ---------- */
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.form input, .form select, .form textarea { width: 100%; }
.form textarea { resize: vertical; }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.f2 label.full { grid-column: 1 / -1; }
.overlay {
  position: fixed; inset: 0; background: rgba(22, 34, 48, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 50; overflow-y: auto;
  backdrop-filter: blur(2px);
}
.overlay[hidden] { display: none; }
.modal {
  background: var(--surface); border-radius: 16px; width: 100%; max-width: 560px;
  max-height: calc(100vh - 40px); overflow-y: auto;
  box-shadow: 0 18px 50px rgba(15, 30, 45, .25);
  padding: 20px 22px; animation: pop .18s ease;
}
.modal-wide { max-width: 980px; }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(8px); } to { opacity: 1; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-head h3 { margin: 0; font-size: 16.5px; }
.modal-close {
  border: none; background: var(--bg); color: var(--ink-2); width: 30px; height: 30px;
  border-radius: 50%; font-size: 17px; cursor: pointer; line-height: 1;
}
.modal-close:hover { background: var(--red-soft); color: var(--red); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

/* ---------- detail ---------- */
.detail-grid {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 20px;
}
.detail-info, .detail-timeline { min-width: 0; }
.detail-timeline h4 { margin: 4px 0 10px; font-size: 13.5px; color: var(--ink-2); }
.detail-timeline h4:first-child { margin-top: 0; }
.info-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.timeline { display: flex; flex-direction: column; gap: 10px; max-height: 430px; overflow-y: auto; padding-right: 4px; }
.tl-item {
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 9px; padding: 10px 13px; background: #fbfdfd;
}
.tl-item .tl-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin-bottom: 5px; }
.tl-item .tl-who { color: var(--accent); font-weight: 600; }
.tl-item .tl-body { font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.tl-empty { color: var(--ink-3); text-align: center; padding: 22px 0; font-size: 13px; }

/* ---------- guide ---------- */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.card.guide { padding: 18px 20px; }
.card.guide h3 { margin: 0 0 10px; font-size: 15px; }
.card.guide p { margin: 8px 0; color: var(--ink-2); font-size: 13.5px; }
.card.guide pre {
  background: #f4f6f9; border: 1px solid var(--line); border-radius: 9px;
  padding: 12px; font-size: 12.5px; line-height: 1.6; overflow-x: auto;
  color: #2c4a66; font-family: "SFMono-Regular", Consolas, "Courier New", monospace;
}

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--brand-deep); color: #fff; padding: 10px 22px; border-radius: 999px;
  font-size: 13.5px; box-shadow: 0 8px 24px rgba(15, 30, 45, .3); z-index: 99;
  animation: fade .2s ease;
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
  .content { padding: 14px 14px 50px; }
  .tabs { padding: 10px 14px 0; }
  .top-actions { margin-left: auto; }
}
@media (max-width: 520px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .f2 { grid-template-columns: 1fr; }
  .brand-sub { display: none; }
  .btn { padding: 6px 11px; }
}

/* ================= v2 additions ================= */
.btn-sm { padding: 4px 10px; font-size: 12.5px; border-radius: 7px; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #a93226; color: #fff; }
.btn-ghost.btn-danger { background: transparent; color: var(--red); border-color: #e8b4ae; }
.btn-ghost.btn-danger:hover { background: var(--red-soft); }
.me-chip {
  font-size: 12.5px; padding: 5px 12px; border-radius: 999px;
  background: var(--brand); color: #fff; font-weight: 500;
}
.tag-chip {
  display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 6px;
  background: #eef1f4; color: #5f6f80; border: 1px solid #dde3ea; margin: 1px 2px 1px 0;
  white-space: nowrap;
}
.tag-chip.tint { background: #fff0e0; color: var(--brand); border-color: #ffd5ae; }
.more { color: var(--ink-3); font-size: 12px; font-weight: 400; }
.hint { font-size: 12px; color: var(--ink-3); font-weight: 400; }
select[multiple] { height: auto; min-height: 66px; }
select[multiple] option { padding: 4px 6px; border-radius: 4px; }
select[multiple] option:checked { background: var(--brand); color: #fff; }
.note-band {
  padding: 12px 16px; margin-bottom: 12px; font-size: 13px; color: var(--ink-2);
  background: #f4f8fc; border-left: 4px solid var(--brand);
}
.note-band b { color: var(--ink); }
.role-sel { padding: 4px 6px; font-size: 12.5px; border-radius: 7px; margin-right: 6px; }
.mini-orders { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.mini-order {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px;
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: #fbfdfd;
  flex-wrap: wrap;
}
.mini-order b { margin-right: auto; }
.empty td { text-align: center; color: var(--ink-3); padding: 34px 0; cursor: default; }

/* ================= v3 additions (dashboard metrics / todos) ================= */
.badge {
  display: inline-flex; min-width: 17px; height: 17px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 600;
  align-items: center; justify-content: center; padding: 0 4px;
  margin-left: 5px; vertical-align: 1px;
}
.badge.hot { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.alert-band {
  border: 1px solid #f3c4bd; background: linear-gradient(90deg, var(--red-soft), #fff);
  border-radius: 12px; padding: 12px 16px; margin-top: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.alert-title { font-weight: 600; color: var(--red); font-size: 13.5px; }
.alert-row { font-size: 13px; color: var(--ink-2); display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }

.rank-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 12px; }
.rank-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 13px 15px;
}
.rank-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.rank-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; border-bottom: 1px dashed #eef2f6; }
.rank-row:last-child { border-bottom: none; }
.rank-no {
  width: 20px; height: 20px; border-radius: 6px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700; background: #eef1f4; color: #5f6f80;
}
.rank-no.top { background: var(--brand); color: #fff; }
.rank-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-val { font-weight: 600; color: var(--ink); white-space: nowrap; }
.rank-empty { color: var(--ink-3); font-size: 12.5px; padding: 14px 0; text-align: center; }

.todo-grid { display: grid; grid-template-columns: 320px 1fr; gap: 20px; }
.todo-new h4, .todo-list h4 { margin: 0 0 12px; font-size: 14px; }
.todo-list { min-width: 0; }
#todoList { display: flex; flex-direction: column; gap: 8px; max-height: 480px; overflow-y: auto; padding-right: 4px; }
.todo-item {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fbfdfd;
}
.todo-item.ov { background: var(--red-soft); border-color: #f3c4bd; }
.todo-item.due { background: var(--amber-soft); border-color: #ecd2a4; }
.todo-check {
  width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--ink-3);
  background: #fff; cursor: pointer; flex: none; margin-top: 1px;
  font-size: 12px; color: var(--ok); display: flex; align-items: center; justify-content: center;
}
.todo-check:hover { border-color: var(--ok); background: var(--ok-soft); }
.todo-body { flex: 1; min-width: 0; }
.todo-title { font-size: 13.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.todo-date { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.todo-date.late { color: var(--red); font-weight: 600; }
.todo-date.today { color: var(--amber); font-weight: 600; }
@media (max-width: 760px) {
  .todo-grid { grid-template-columns: 1fr; }
  .rank-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}

/* ================= v4 additions (rating / dd / advice) ================= */
.rating-badge {
  display: inline-block; color: #fff; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap; cursor: help;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
}
.sub-card {
  margin-top: 14px; padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--line); box-shadow: none;
}
.sub-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.sub-head b { font-size: 13.5px; }
.sub-reason { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.reason-item {
  font-size: 12px; background: #f2f5f9; color: #4b5a69;
  border-radius: 6px; padding: 3px 8px;
}
.sub-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.score-pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; color: #fff; }
.score-pill.c5 { background: #0f6b32; } .score-pill.c4 { background: #2e8b57; }
.score-pill.c3 { background: #55a868; } .score-pill.c2 { background: #8cc093; }
.score-pill.c1 { background: #cde7d3; color: #1c2b3a; }
.score-pill.r5 { background: #a50f1a; } .score-pill.r4 { background: #cf3a34; }
.score-pill.r3 { background: #e67e22; } .score-pill.r2 { background: #f2b577; color: #1c2b3a; }
.score-pill.r1 { background: #f8dcb8; color: #1c2b3a; }
.dd-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 18px; font-size: 13px; }
.dd-grid .span2 { grid-column: span 2; }
.dd-lbl { color: var(--ink-3); font-size: 11.5px; display: block; }
.dd-form { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 4px; }
.advice-item { margin-bottom: 10px; }
.advice-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--brand-deep); margin-bottom: 4px;
}
.advice-title .btn { margin-left: auto; }
.advice-body {
  margin: 0; padding: 9px 12px; font-size: 12.5px; line-height: 1.7;
  background: #f7f9fb; border: 1px solid var(--line); border-radius: 8px;
  white-space: pre-wrap; font-family: inherit; color: var(--ink-2);
}

/* ---------- knowledge base ---------- */
.kb-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.kb-filters { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kb-cat { border: 1px solid var(--line); }
.kb-cat.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-top: 12px; }
.kb-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.kb-card .kb-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.kb-card .kb-head b { font-size: 14.5px; }
.kb-meta { font-size: 12px; }
.kb-actions { display: flex; gap: 6px; margin-top: auto; flex-wrap: wrap; }
.kb-empty { padding: 30px; text-align: center; color: var(--ink-3); grid-column: 1 / -1; }
.kb-vmeta { margin-bottom: 10px; font-size: 12.5px; }
.kb-content {
  margin: 0; padding: 12px 14px; font-size: 13px; line-height: 1.8;
  background: #f7f9fb; border: 1px solid var(--line); border-radius: 8px;
  white-space: pre-wrap; font-family: inherit; color: var(--ink);
}
.kb-view-body { max-height: 62vh; overflow: auto; }

/* clickable stat cards & drill-down */
.stat.clickable { cursor: pointer; transition: transform .1s ease, box-shadow .15s ease; }
.stat.clickable:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(255, 106, 0, .12); }
.biz-row.linkable { cursor: pointer; border-radius: 8px; transition: background .12s ease; }
.biz-row.linkable:hover { background: #fff1e3; }
.lnk { color: var(--brand); cursor: pointer; text-decoration: underline; }
.lnk:hover { color: #c24f00; }

/* ---------- work board (dashboard top) ---------- */
.work-board { padding: 16px 18px; margin-bottom: 14px; border-left: 4px solid var(--brand); }
.work-head { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.work-title { font-size: 16px; }
.work-counts { display: flex; gap: 6px; align-items: center; }
.quick-add { display: flex; gap: 8px; margin: 12px 0 4px; }
.quick-add input { flex: 1; }
.wb-list { margin-top: 8px; }
.wb-item { display: flex; gap: 10px; align-items: flex-start; padding: 7px 8px; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 6px; background: #fbfcfe; }
.wb-item.ov { border-color: #e0b3b3; background: #fdf5f5; }
.wb-item.due { border-color: #e6cf9a; background: #fffaf0; }
.todo-check { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--brand); background: #fff; color: transparent; font-size: 12px; cursor: pointer; flex: none; margin-top: 2px; }
.todo-check:hover { background: var(--brand); color: #fff; }
.wb-done { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.done-chip { background: #eef7f0; color: #2e7d4f; border: 1px solid #cde7d3; padding: 2px 9px; border-radius: 20px; font-size: 12px; }
.wb-empty { color: var(--ink-3); padding: 10px 0; }

/* ---------- biz boards ---------- */
.biz-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-bottom: 4px; }
.biz-card { padding: 14px 16px; }
.biz-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.biz-head b { font-size: 14.5px; }
.biz-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.biz-row:last-child { border-bottom: none; }
.biz-rank { width: 20px; height: 20px; border-radius: 50%; background: #eef1f5; color: var(--ink-2); font-size: 11px; display: flex; align-items: center; justify-content: center; flex: none; }
.biz-rank.top { background: var(--brand); color: #fff; }
.biz-name { flex: 1; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.biz-val { font-weight: 700; font-size: 13px; text-align: right; display: flex; flex-direction: column; line-height: 1.35; }
.ch-row { margin-bottom: 9px; }
.ch-lbl { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 3px; }
.ch-bar { height: 8px; background: #eef1f5; border-radius: 10px; overflow: hidden; }
.ch-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #ff9e45); border-radius: 10px; }

/* ---------- member worklog ---------- */
.wl-head { padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.wl-head label { display: flex; align-items: center; gap: 8px; }
.wl-empty { padding: 22px; text-align: center; color: var(--ink-3); display: flex; gap: 10px; align-items: center; justify-content: center; }
.wl-member summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; cursor: pointer; list-style: none; border-bottom: 1px solid var(--line); }
.wl-member summary::-webkit-details-marker { display: none; }
.wl-member summary:hover { background: #f7f9fc; }
.wl-name { font-weight: 700; min-width: 90px; }
.wl-detail { padding: 6px 14px 12px 26px; background: #fbfcfe; }
.wl-item { padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13px; line-height: 1.6; }
.wl-item:last-child { border-bottom: none; }
.wl-open { color: #b23c3c; }


/* ---------- new customer as standalone view ---------- */.view-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }.view-head h2 { margin: 0; font-size: 18px; }.ncv-card { max-width: 780px; margin: 0 auto; padding: 22px 26px; }

/* ---------- list owner / chat / coach ---------- */.col-owner { min-width: 108px; white-space: nowrap; }.assign-chip { cursor: pointer; border: 1px dashed #b7c4d2; }.assign-chip:hover { background: #ffecdb; border-color: var(--brand); }.chat-btn { cursor: pointer; border: none; background: #fff1e3; color: var(--brand); border-radius: 20px; padding: 3px 10px; font-size: 12.5px; }.chat-btn:hover { background: #ffe0c7; }.coach-item { border-top: 1px dashed var(--line); padding: 8px 2px; }.coach-item p { margin: 4px 0 0; color: var(--ink-2); font-size: 13px; line-height: 1.6; }.coach-add { margin: 10px 0; }.coach-add textarea { width: 100%; }.chat-notes pre { max-height: 34vh; }.chat-fu { margin-top: 10px; }.fl-item { padding: 6px 2px; border-bottom: 1px dashed var(--line); }

/* ---------- resizable fixed table + multi select ---------- */
.tbl-fixed { table-layout: fixed; }
.tbl-fixed th { position: relative; overflow: hidden; }
.tbl-fixed td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl-fixed td.next { white-space: pre-line; }
.col-sel { width: 34px; padding-right: 2px !important; }
.filters label.grow { flex: 1 1 220px; }
.filters input[type=search] { width: 100%; }
.sel-bar { display: flex; gap: 10px; align-items: center; padding: 8px 14px; margin: 8px 0; border: 1px solid #cfe0f2; background: #f3f8fe; }
.sel-bar[hidden] { display: none; }
.tbl-fixed th .rz { position: absolute; top: 0; right: -3px; width: 7px; height: 100%; cursor: col-resize; z-index: 2; }

/* ---------- daily must-do push admin ---------- */
.push-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 8px; padding: 12px 16px; }
.push-card.off { opacity: .72; }
.push-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.push-main { flex: 1; min-width: 0; }
.push-meta { margin-top: 4px; line-height: 1.5; }
.push-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.push-empty { padding: 22px; color: #6b7280; }
.push-undone-row td { background: #fdf0ef; }
.push-undone-title { color: #c0392b; font-weight: 600; }
.push-mode-tabs { display: inline-flex; gap: 16px; padding-left: 6px; }
.push-mode-opt { display: inline-flex; align-items: center; gap: 5px; margin: 0; font-weight: 400; }
.push-targets { display: flex; flex-wrap: wrap; gap: 4px 16px; padding-top: 4px; }
.push-target { display: inline-flex; align-items: center; gap: 5px; margin: 0; font-weight: 400; }
.cal-head { display: flex; align-items: center; gap: 12px; margin: 6px 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; max-width: 560px; }
.cal-grid > span { min-height: 12px; }
.cal-day { border: 1px solid #e2e8f0; background: #fff; border-radius: 6px; padding: 6px 2px; cursor: pointer; font-size: 13px; }
.cal-day:hover { border-color: #3b82f6; }
.cal-day.we { color: #b0b7c3; }
.cal-day.on { background: #2563eb; color: #fff; border-color: #2563eb; font-weight: 600; }
.cal-day.on.we { color: #fff; }
.wb-item.push.ov, .todo-item.push.ov { border-left: 4px solid #c0392b; background: #fdecea; }
.wb-item.push.ov .todo-title, .todo-item.push.ov .todo-title { font-weight: 700; color: #a93226; }
.loc-time { color: #0b7285; font-size: 11px; margin-left: 4px; white-space: nowrap; }
#detailLocTime.loc-time { font-size: 12px; margin-left: 6px; }

/* ---------- knowledge base panels & learning exams ---------- */
.kb-panel.active { background: #2563eb; color: #fff; border-color: #2563eb; }
#kbDocsTools[hidden], #kbExamsTools[hidden], #kbDocsPanel[hidden], #kbExamsPanel[hidden] { display: none !important; }
.kb-link { color: #2563eb; cursor: pointer; text-decoration: underline; }
.modal-tall .modal { max-height: 86vh; }
.modal-tall { display: flex; }
.modal-tall .modal { display: flex; flex-direction: column; }
.exam-scroll { overflow-y: auto; padding: 6px 2px; }
#examTakeArea, #examResultArea { flex: 1; min-height: 0; }
.exam-q-item { border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: #fff; }
.exam-q-text { font-weight: 600; margin-bottom: 8px; line-height: 1.5; }
.exam-q-options { display: flex; flex-direction: column; gap: 6px; }
.exam-opt { display: flex; gap: 8px; align-items: flex-start; border: 1px solid #eef2f7; border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.exam-opt:hover { border-color: #2563eb; background: #f8fafc; }
.exam-opt-key { color: #64748b; font-weight: 700; }
.exam-big-score { font-size: 52px; font-weight: 800; text-align: center; padding: 18px 0 2px; }
.exam-big-score.ok { color: #16a34a; }
.exam-big-score.bad { color: #dc2626; }
.exam-score-unit { font-size: 20px; margin-left: 4px; }
.exam-score-line { text-align: center; font-size: 15px; padding-bottom: 12px; }
.exam-d-head { margin: 10px 0 6px; }
.exam-d-item { border: 1px solid #e2e8f0; border-left-width: 4px; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.exam-d-item.ok { border-left-color: #16a34a; }
.exam-d-item.bad { border-left-color: #dc2626; background: #fef2f2; }
.exam-d-ans { margin-top: 4px; }
.exam-q-list { display: flex; flex-direction: column; gap: 10px; max-height: 44vh; overflow-y: auto; padding: 2px; }
.exam-q-row { border: 1px solid #dbe3ee; border-radius: 10px; padding: 10px 12px; background: #fafcff; }
.exam-q-row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.exam-q-text-in { width: 100%; box-sizing: border-box; padding: 7px 10px; border: 1px solid #d7e0ea; border-radius: 6px; margin-bottom: 6px; }
.exam-q-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.exam-opt-in { display: flex; align-items: center; gap: 6px; }
.exam-opt-in > span { width: 18px; text-align: center; font-weight: 700; color: #64748b; }
.exam-opt-in input { flex: 1; }
.exam-q-ans { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.exam-q-head { display: flex; justify-content: space-between; align-items: center; margin: 8px 0 6px; }
.exam-opt input[type=radio] { margin: 0; }
#examAnswerState { padding-right: 10px; }

/* ---------- manual rating score / timeline comments / AI analysis ---------- */
.score-pill.sc-hi { background: #16a34a; }
.score-pill.sc-mid { background: #2563eb; }
.score-pill.sc-low { background: #d97706; }
.score-unit { font-size: 10px; opacity: .85; margin-left: 1px; }
.tl-comment { border-left: 2px solid #ffc99e; background: #f5f9ff; border-radius: 0 8px 8px 0; padding: 6px 10px; margin: 6px 0 2px; }
.tl-comment-head { display: flex; gap: 8px; font-size: 12px; }
.tl-comment p { margin: 3px 0 0; font-size: 12.5px; color: #334155; white-space: pre-wrap; word-break: break-word; }
.tl-cmt-tool { margin-top: 4px; }
.tl-cmt-form { display: flex; gap: 6px; margin-top: 4px; }
.tl-cmt-form textarea { flex: 1; padding: 6px 9px; border: 1px solid #d7e0ea; border-radius: 6px; font-size: 12.5px; }
.tl-legacy { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; }
.ai-sec { margin-top: 8px; }
.ai-sec-t { font-weight: 700; font-size: 12.5px; color: #1e3a5f; margin-bottom: 3px; }
.ai-txt { font-size: 13px; color: #1f2937; white-space: pre-wrap; word-break: break-word; line-height: 1.65; }
.ai-script { border: 1px dashed #ffc99e; background: #fff4ea; border-radius: 6px; padding: 8px 10px; margin-bottom: 6px; font-size: 12.5px; }
#aiCard .sub-tools, #aiCard .hint { margin-top: 8px; }
.btn-xs { padding: 2px 8px; font-size: 12px; }

/* ---------- round 6: work summary / order items / logistics zone ---------- */
#kbLogiTools[hidden], #kbLogiPanel[hidden] { display: none !important; }
.wb-summary { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.wb-sum-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid #e5eaf1; border-radius: 8px; background: #fff; cursor: pointer; }
.wb-sum-row:hover { border-color: #ffc99e; background: #f8fafc; }
.wb-sum-name { width: 110px; font-weight: 700; flex-shrink: 0; }
.wb-sum-bar { flex: 1; background: #eef2f7; border-radius: 6px; height: 14px; position: relative; overflow: hidden; }
.wb-bar { height: 100%; border-radius: 6px; }
.wb-bar.green { background: #16a34a; }
.wb-bar.amber { background: #d97706; }
.wb-bar.red { background: #dc2626; }
.wb-bar.gray { background: #cbd5e1; }
.wb-bar-txt { position: absolute; right: 6px; top: -1px; font-size: 11px; color: #475569; }
.wb-sum-chip { min-width: 150px; text-align: right; }
.wb-sum-detail { border: 1px dashed #d7e0ea; border-radius: 8px; padding: 6px 10px; margin-bottom: 4px; }
.oi-head { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 6px; }
.oi-list { display: flex; flex-direction: column; gap: 6px; }
.oi-row { display: grid; grid-template-columns: 2.2fr 0.7fr 0.9fr 0.8fr 30px; gap: 6px; align-items: center; }
.oi-row input, .oi-row select { width: 100%; box-sizing: border-box; padding: 6px 8px; border: 1px solid #d7e0ea; border-radius: 6px; }
.oi-prodbox { position: relative; min-width: 0; }
.oi-prodbox .oi-prod { padding-right: 26px; }
.oi-prodbox .oi-prod.picked { border-color: #ff6a00; background: #fff3e8; color: #e05a00; }
.oi-prodbox .oi-prod.denied { border-color: #dc2626; background: #fff5f5; }
.oi-prodlist { position: absolute; top: calc(100% + 2px); left: 0; right: 0; z-index: 40; margin: 0; padding: 4px; list-style: none; background: #fff; border: 1px solid #d7e0ea; border-radius: 8px; box-shadow: 0 8px 20px rgba(15, 40, 80, .16); max-height: 230px; overflow: auto; }
.oi-prodlist li { padding: 6px 9px; border-radius: 6px; cursor: pointer; font-size: 13px; line-height: 1.4; color: var(--ink); }
.oi-prodlist li:hover { background: #ffefe2; color: #ff6a00; }
.oi-prodlist li .m { color: #93a1b0; font-size: 12px; }
.oi-prodbox .oi-clear { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); border: none; background: #eef2f7; color: #5b6b7c; border-radius: 50%; width: 18px; height: 18px; font-size: 12px; line-height: 1; cursor: pointer; padding: 0; }
.oi-sub { font-weight: 600; text-align: right; color: #1e40af; }
.oi-sec { background: #f1f5f9; padding: 4px 8px; border-radius: 6px; margin: 8px 0 6px; }
.row-received td { background: #f0fdf4; }
tr.row-received:hover td { background: #e8f9ed !important; }
#oiTkForm input, #oiEvForm input { padding: 6px 9px; border: 1px solid #d7e0ea; border-radius: 6px; }

/* ---------- round 7: overview stats / stale follow-up / admin settings ---------- */
#custStatsGrid .stat, #orderStatsGrid .stat { padding: 13px 16px; }
#custStatsGrid .stat .num, #orderStatsGrid .stat .num { font-size: 24px; }
#orderStatsGrid .stat .lbl, #custStatsGrid .stat .lbl { font-size: 12.5px; }
.cust .nm.stale { color: #c0392b; font-weight: 700; }
.cust .nm.stale::after { content: ' ⚠'; font-size: 11px; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:has(.row-sel-o) { cursor: default; }
.row-sel-o { width: 16px; height: 16px; cursor: pointer; margin: 0; vertical-align: middle; }
#orderTbl .col-sel { width: 34px; padding-right: 2px !important; }
#fuMemberCard .tbl { min-width: 720px; }
.fu-edit-goal { white-space: nowrap; }
.auto-drop-inp { width: 90px; padding: 6px 9px; border: 1px solid #d7e0ea; border-radius: 6px; }
#rankPeriod { cursor: pointer; }
.wb-set-row { padding: 4px 0; }
#staleBody .stale-item { display: flex; align-items: baseline; gap: 10px; padding: 8px 10px; border-bottom: 1px dashed #e3e9f0; }
#staleBody .stale-item b { color: #c0392b; }
#flSumArea .stat .num.ok { color: #16a34a; }
#flSumArea .stat .num.bad { color: #dc2626; }
#fuMemberCard td b.ok { color: #16a34a; }
#fuMemberCard td b.bad { color: #dc2626; }
#custStatsGrid .stat.clickable, #orderStatsGrid .stat.clickable { cursor: default; }
/* ---------- AI 经营报告 (r9) ---------- */
.md-body { line-height: 1.75; color: #233; }
.md-body h2 { font-size: 19px; margin: 18px 0 6px; color: #ff6a00; border-left: 4px solid #ff6a00; padding-left: 8px; }
.md-body h3 { font-size: 16px; margin: 14px 0 4px; color: #7c4d1e; }
.md-body h4 { font-size: 14px; margin: 10px 0 2px; }
.md-body p { margin: 6px 0; }
.md-body ul { margin: 6px 0; padding-left: 22px; }
.md-body li { margin: 3px 0; list-style: disc; }
.md-body code { background: #eef3f9; padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
#aiReportList .stale-item:hover { background: #f3f7fb; }
#aiReportList .stale-item { border-bottom: 1px solid #eef2f6; }
/* ---------- r10 快递轨迹 ---------- */
.trk-list { margin: 6px 0 4px; }
.trk-item { position: relative; padding: 5px 0 5px 16px; border-left: 2px solid #dde7f2; margin-left: 4px; }
.trk-item .trk-dot { position: absolute; left: -5px; top: 10px; width: 8px; height: 8px; border-radius: 50%; background: #e8b088; }
.trk-item.last .trk-dot { background: #ff6a00; box-shadow: 0 0 0 3px rgba(255,106,0,.15); }
.trk-item .trk-time { font-size: 12px; color: #6b7b8c; }
.trk-item.last .trk-time { color: #ff6a00; font-weight: 600; }


/* r31: follow-up suggestion box, followup form head, pagers */
.fup-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 600; margin-bottom: 6px; }
.ai-sug { margin: 8px 0 12px; padding: 10px 12px; border: 1px solid #ffdcbe; border-radius: 10px; background: #fff7ee; }
.ai-sug .ai-sug-txt { white-space: pre-wrap; font-size: 13px; line-height: 1.7; color: #234; }
/* r-next: follow-up content head - AI-suggest button right after the label, no clipping */
.fup-head.head-left { justify-content: flex-start; flex-wrap: wrap; row-gap: 6px; }
.fup-head b { flex: none; white-space: nowrap; }
.fup-head .req-star { color: var(--red); font-style: normal; margin-left: 2px; }
.fup-head .fup-ai-tip { font-weight: 400; margin-left: 8px; }
/* overdue red reminder under the next-follow-up-time picker of the follow-up form */
.due-warn { display: block; margin-top: 5px; color: var(--red); font-weight: 600; font-size: 12px; line-height: 1.4; }
.due-warn[hidden] { display: none; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 8px 2px; font-size: 13px; color: #567; }
.pager select { padding: 3px 6px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; }

/* hidden forms must not be overridden by .form display rules (manager read-only detail) */
.form[hidden] { display: none !important; }


/* v36: pay overlay above order-detail overlay */
#overlayPay { z-index: 60; }

/* v37: segment control hidden guard (inline flex overrides [hidden]) */
#pcModeSeg[hidden] { display: none !important; }
