/* ===== 销售作战工作台 · 浅色主题 ===== */
:root {
  --primary: #3b6ef6;
  --primary-deep: #2f5de0;
  --primary-soft: #eef2fe;
  --up: #e5484d;          /* 涨 → 红（中文惯例） */
  --up-soft: #fdecec;
  --down: #12a150;        /* 跌 → 绿 */
  --down-soft: #e9f7ef;
  --gold: #f5a623;
  --text: #1f2733;
  --text-2: #667085;
  --text-3: #98a2b3;
  --border: #e6e9f0;
  --bg: #f5f7fb;
  --card: #ffffff;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(31, 39, 51, 0.06);
  --font: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button { font-family: var(--font); cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: var(--font); }

.layout { display: flex; height: 100vh; overflow: hidden; }

/* ===== 侧边栏 ===== */
.sidebar {
  width: 216px;
  flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; border-bottom: 1px solid var(--border); }
.brand-logo {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, #3b6ef6, #7a5af8);
  color: #fff; font-weight: 700; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 15px; }
.brand-text span { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  color: var(--text-2); font-size: 14px; text-align: left;
  transition: all .15s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: #f3f5fa; color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

.sidebar-foot { border-top: 1px solid var(--border); padding: 14px 8px 4px; }
.sync-badge {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-2);
  background: #f3f5fa; border-radius: 8px; padding: 8px 10px;
}
.sync-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex-shrink: 0; }
.sync-badge.mode-feishu .dot { background: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.sync-badge.mode-mock .dot { background: var(--gold); }
.sync-time { font-size: 11px; color: var(--text-3); margin-top: 6px; padding-left: 2px; }

/* ===== 顶栏 ===== */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 60px; flex-shrink: 0;
  background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; gap: 16px;
}
.topbar-left { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.topbar-left h1 { font-size: 17px; white-space: nowrap; }
.page-desc { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.filter-group { display: flex; gap: 10px; }
.filter { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.filter select {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 10px; font-size: 13px; color: var(--text);
  background: #fff; outline: none;
}
.filter select:focus { border-color: var(--primary); }

.btn-sync {
  display: flex; align-items: center; gap: 6px;
  background: var(--primary); color: #fff;
  border-radius: 8px; padding: 8px 14px; font-size: 13px;
  transition: background .15s;
}
.btn-sync svg { width: 15px; height: 15px; }
.btn-sync:hover { background: var(--primary-deep); }
.btn-sync:disabled { background: #a9bdfa; cursor: not-allowed; }
.btn-sync.spinning svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-primary {
  background: var(--primary); color: #fff; border-radius: 8px;
  padding: 8px 16px; font-size: 13px;
}
.btn-primary:hover { background: var(--primary-deep); }
.btn-ghost {
  border: 1px solid var(--border); background: #fff; color: var(--text-2);
  border-radius: 8px; padding: 7px 14px; font-size: 13px;
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

/* ===== 内容区 ===== */
.content { flex: 1; overflow-y: auto; padding: 24px; }
.tab-panel { display: none; animation: fadeIn .2s ease; }
.tab-panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom: 20px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.card-head h3 { font-size: 15px; }
.card-sub { font-size: 12px; color: var(--text-3); }
.card-actions { display: flex; align-items: center; gap: 10px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-2 .card { margin-bottom: 20px; }

/* ===== KPI 卡片 ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 16px; margin-bottom: 20px;
}
.kpi-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px;
}
.kpi-label { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 26px; font-weight: 700; margin-top: 8px; letter-spacing: -0.3px; }
.kpi-value .unit { font-size: 13px; font-weight: 400; color: var(--text-3); margin-left: 2px; }
.kpi-foot { margin-top: 10px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.kpi-with-ring { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.donut-text { font-size: 15px; font-weight: 700; fill: var(--text); }

.progress-track { height: 6px; background: #edf0f6; border-radius: 3px; overflow: hidden; margin-top: 10px; }
.progress-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, #3b6ef6, #7a5af8); }

/* 涨跌 chip：红涨绿跌 */
.chip {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 12px; font-weight: 600;
  border-radius: 6px; padding: 2px 7px; white-space: nowrap;
}
.chip-up { color: var(--up); background: var(--up-soft); }
.chip-down { color: var(--down); background: var(--down-soft); }
.chip-flat { color: var(--text-3); background: #f3f5fa; }

/* ===== 图表 ===== */
.chart-box { width: 100%; }
.chart-svg { width: 100%; height: auto; display: block; }
.axis-label { font-size: 11px; fill: #98a2b3; }
.bar-label { font-size: 11px; fill: #667085; font-weight: 600; }
.chart-legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); margin-top: 8px; }
.lg-bar { width: 12px; height: 8px; border-radius: 2px; background: #3b6ef6; display: inline-block; }
.lg-dash { width: 16px; height: 0; border-top: 2px dashed var(--gold); display: inline-block; margin-left: 8px; }

/* 漏斗 */
.funnel-row { display: grid; grid-template-columns: 44px 1fr 64px; align-items: center; gap: 10px; margin-bottom: 14px; }
.funnel-label { font-size: 13px; color: var(--text-2); font-weight: 600; }
.funnel-bar-wrap { position: relative; background: #f3f5fa; border-radius: 6px; height: 30px; overflow: visible; }
.funnel-bar { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #3b6ef6, #7a5af8); min-width: 40px; transition: width .5s ease; }
.funnel-val { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 700; color: var(--text); }
.funnel-conv { font-size: 12px; color: var(--text-3); text-align: right; }

/* ===== 排行榜 ===== */
.lb-row {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 12px;
  align-items: center; padding: 10px 4px;
  border-bottom: 1px solid #f2f4f8;
}
.lb-row:last-child { border-bottom: none; }
.lb-rank {
  width: 26px; height: 26px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; background: #c3cad9;
}
.lb-rank.r1 { background: linear-gradient(135deg, #f7b733, #fc4a1a); }
.lb-rank.r2 { background: linear-gradient(135deg, #bdc3c7, #8e9aab); }
.lb-rank.r3 { background: linear-gradient(135deg, #e08e45, #b5651d); }
.lb-main { min-width: 0; }
.lb-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.lb-team { font-size: 11px; color: var(--text-3); background: #f3f5fa; border-radius: 4px; padding: 1px 6px; font-weight: 400; }
.lb-bar-track { height: 5px; background: #f0f2f7; border-radius: 3px; margin-top: 7px; overflow: hidden; }
.lb-bar-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, #3b6ef6, #7a5af8); }
.lb-right { text-align: right; }
.lb-rev { font-size: 14px; font-weight: 700; }
.lb-mom { margin-top: 4px; }

/* ===== 快捷入口 ===== */
.quick-links { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quick-link {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; text-align: left; transition: all .15s; background: #fff;
}
.quick-link:hover { border-color: var(--primary); background: var(--primary-soft); }
.ql-icon {
  width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.ql-icon svg { width: 18px; height: 18px; }
.ql-text strong { display: block; font-size: 13px; }
.ql-text span { font-size: 11px; color: var(--text-3); }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
thead th {
  font-size: 12px; color: var(--text-2); font-weight: 600;
  text-align: left; padding: 10px 12px;
  background: #f8f9fc; border-bottom: 1px solid var(--border);
  cursor: pointer; user-select: none;
}
thead th:hover { color: var(--primary); }
thead th .sort-arrow { font-size: 10px; margin-left: 3px; color: var(--primary); }
thead th.no-sort { cursor: default; }
thead th.no-sort:hover { color: var(--text-2); }
tbody td { padding: 12px; border-bottom: 1px solid #f2f4f8; font-size: 13px; }
tbody tr:hover { background: #f8faff; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.rep-cell { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.rep-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.mini-progress { width: 74px; height: 5px; background: #edf0f6; border-radius: 3px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 7px; }
.mini-progress > div { height: 100%; border-radius: 3px; background: linear-gradient(90deg, #3b6ef6, #7a5af8); }

/* ===== 资料库 ===== */
.sub-tabs { display: flex; gap: 4px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 4px; margin-bottom: 16px; width: max-content; }
.sub-tab { padding: 8px 18px; border-radius: 8px; font-size: 13px; color: var(--text-2); }
.sub-tab.active { background: var(--primary); color: #fff; font-weight: 600; }

.res-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-btn {
  border: 1px solid var(--border); background: #fff; color: var(--text-2);
  border-radius: 999px; padding: 5px 14px; font-size: 12px;
}
.chip-btn:hover { border-color: var(--primary); color: var(--primary); }
.chip-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 0 12px; height: 34px; min-width: 240px;
}
.search-box svg { width: 15px; height: 15px; color: var(--text-3); flex-shrink: 0; }
.search-box input { border: none; outline: none; font-size: 13px; flex: 1; min-width: 0; background: transparent; }

.res-pane { display: none; }
.res-pane.active { display: block; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.res-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; cursor: pointer; transition: all .15s;
  display: flex; flex-direction: column; gap: 10px; text-align: left;
}
.res-card:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(59, 110, 246, 0.12); transform: translateY(-2px); }
.res-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.res-card h4 { font-size: 14.5px; line-height: 1.4; }
.res-card .summary { font-size: 12.5px; color: var(--text-2); line-height: 1.6; flex: 1; }
.res-card-foot { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--text-3); }
.res-cat { font-size: 11px; color: var(--primary); background: var(--primary-soft); border-radius: 5px; padding: 2px 8px; font-weight: 600; white-space: nowrap; }
.tag-new { font-size: 10.5px; color: #b5451b; background: #fff0e6; border-radius: 5px; padding: 2px 7px; font-weight: 700; white-space: nowrap; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.product-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; cursor: pointer; transition: all .15s; text-align: left;
}
.product-card:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(59, 110, 246, 0.12); transform: translateY(-2px); }
.product-card img { width: 100%; height: 150px; object-fit: cover; display: block; background: #f3f5fa; }
.product-body { padding: 14px 16px; }
.product-body h4 { font-size: 14.5px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.product-price { font-size: 13px; font-weight: 700; color: var(--up); white-space: nowrap; }
.product-tagline { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.product-points { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.product-points li { font-size: 12px; color: var(--text-2); list-style: none; padding-left: 15px; position: relative; line-height: 1.5; }
.product-points li::before { content: ""; position: absolute; left: 0; top: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }

/* ===== 新人清单 ===== */
.check-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f2f4f8; }
.check-item:last-child { border-bottom: none; }
.check-item input[type="checkbox"] { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
.check-item .check-text { font-size: 13px; line-height: 1.6; color: var(--text); }
.check-item .check-day { font-size: 11px; color: var(--text-3); font-weight: 700; margin-right: 4px; }
.check-item.done .check-text { color: var(--text-3); text-decoration: line-through; }

/* ===== 工具箱 ===== */
.tool-rows { display: flex; flex-direction: column; gap: 14px; }
.tool-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px;
}
.tool-row strong { font-size: 13.5px; }
.tool-row p { font-size: 12px; color: var(--text-3); margin-top: 3px; }

.status-list { display: flex; flex-direction: column; gap: 0; }
.status-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 2px; border-bottom: 1px solid #f2f4f8; font-size: 13px; }
.status-row:last-of-type { border-bottom: none; }
.status-row .k { color: var(--text-2); }
.status-row .v { font-weight: 600; text-align: right; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 11px; }
.pill-mock { color: #b5451b; background: #fff0e6; }
.pill-feishu { color: var(--primary-deep); background: var(--primary-soft); }
.pill-warn { color: #b5451b; background: #fff0e6; }
.pill-ok { color: var(--down); background: var(--down-soft); }
.pill-local { color: #1f6feb; background: #e8f1ff; }
.pill-cloud { color: #6b3fa0; background: #f1e9fb; }

#report-template {
  width: 100%; min-height: 200px; resize: vertical;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; font-size: 13px; line-height: 1.8; color: var(--text);
  background: #f8f9fc; outline: none; font-family: var(--font);
}
.guide-steps { display: flex; flex-direction: column; gap: 12px; }
.guide-step { display: flex; gap: 12px; align-items: flex-start; }
.guide-num {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary);
  font-size: 12.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.guide-step .g-text { font-size: 13px; line-height: 1.7; }
.guide-step .g-text code {
  background: #f0f2f7; border-radius: 4px; padding: 1px 6px;
  font-size: 12px; font-family: Consolas, monospace; color: #b5451b;
}
.guide-note {
  margin-top: 14px; font-size: 12px; color: #b5451b;
  background: #fff8f0; border: 1px solid #ffe3c2; border-radius: 8px; padding: 10px 14px; line-height: 1.7;
}

/* ===== 弹窗 ===== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(31, 39, 51, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 32px;
}
.modal-mask[hidden] { display: none; }
.modal {
  background: #fff; border-radius: 14px; max-width: 780px; width: 100%;
  max-height: 84vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18); animation: pop .18s ease;
}
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border); gap: 16px;
}
.modal-head h3 { font-size: 17px; line-height: 1.4; }
.modal-meta { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); font-size: 18px;
}
.modal-close:hover { background: #f3f5fa; color: var(--text); }
.modal-body { padding: 22px 26px; overflow-y: auto; }
.modal-foot { padding: 14px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* markdown 渲染 */
.md-body { font-size: 14px; line-height: 1.85; color: var(--text); }
.md-body h1 { font-size: 20px; margin: 4px 0 14px; }
.md-body h2 { font-size: 16.5px; margin: 22px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.md-body h3 { font-size: 15px; margin: 18px 0 8px; }
.md-body p { margin: 8px 0; }
.md-body ul, .md-body ol { margin: 8px 0 8px 22px; }
.md-body li { margin: 4px 0; }
.md-body blockquote {
  border-left: 3px solid var(--primary); background: var(--primary-soft);
  margin: 10px 0; padding: 10px 16px; border-radius: 0 8px 8px 0;
  color: var(--text); font-size: 13.5px;
}
.md-body blockquote p { margin: 4px 0; }
.md-body table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.md-body th, .md-body td { border: 1px solid var(--border); padding: 7px 12px; text-align: left; }
.md-body th { background: #f8f9fc; font-weight: 600; }
.md-body code { background: #f0f2f7; border-radius: 4px; padding: 1px 6px; font-size: 12.5px; font-family: Consolas, monospace; color: #b5451b; }
.md-body hr { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.md-body .md-check { list-style: none; margin-left: 4px; }
.md-body .md-check li::before { content: "☐ "; color: var(--primary); }
.md-body .md-check li.checked::before { content: "☑ "; }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%);
  background: #1f2733; color: #fff; font-size: 13px;
  border-radius: 10px; padding: 11px 20px; z-index: 200;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22); animation: toastIn .2s ease;
}
.toast[hidden] { display: none; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%); } }

/* ===== 用户菜单 ===== */
.user-chip {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 6px 4px 4px; background: #fff;
}
.user-chip[hidden] { display: none; }
.uc-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #3b6ef6, #7a5af8); color: #fff;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.uc-name { font-size: 13px; color: var(--text); max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .btn-ghost { padding: 4px 10px; font-size: 12px; }

/* ===== 登录弹窗 ===== */
.login-modal { max-width: 360px; padding: 34px 30px 26px; text-align: center; }
.login-logo {
  width: 48px; height: 48px; border-radius: 12px; margin: 0 auto 16px;
  background: linear-gradient(135deg, #3b6ef6, #7a5af8); color: #fff;
  font-weight: 700; font-size: 22px; display: flex; align-items: center; justify-content: center;
}
.login-modal h3 { font-size: 18px; }
.login-modal .hint { margin: 8px 0 18px; }
.login-modal input {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 11px 14px; font-size: 14px; outline: none; background: #fff;
}
.login-modal input:focus { border-color: var(--primary); }

/* ===== CRM 组件 ===== */
.mini-select, .mini-input {
  border: 1px solid var(--border); border-radius: 8px; height: 34px;
  padding: 0 10px; font-size: 13px; color: var(--text); background: #fff; outline: none;
}
.mini-input { min-width: 200px; }
.mini-select:focus, .mini-input:focus { border-color: var(--primary); }

.act-item { border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px; margin-bottom: 10px; background: #fff; }
.act-head { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-3); margin-bottom: 6px; flex-wrap: wrap; }
.act-head strong { font-size: 13px; color: var(--text); }
.act-type { color: var(--primary-deep); background: var(--primary-soft); border-radius: 5px; padding: 1px 8px; font-weight: 600; white-space: nowrap; }
.act-owner { color: var(--text-2); }
.act-date { margin-left: auto; }
.act-content { font-size: 13px; line-height: 1.6; color: var(--text); }

.sub-table { display: flex; flex-direction: column; gap: 8px; }
.sub-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; font-size: 13px;
}
.sub-row strong { font-size: 13px; }
.sub-row span { font-size: 12px; }

/* ===== 表单工具类（前台弹窗通用） ===== */
.inp {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 13px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.inp:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,110,246,.12); }
.inp[readonly] { background: #f6f8fc; color: var(--text-2); cursor: default; }
textarea.inp { resize: vertical; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-2); }
.full { grid-column: 1 / -1; }
.muted { color: var(--text-3); font-size: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ===== 业绩日历 ===== */
.cal-legend {
  display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
  margin-bottom: 16px; font-size: 12px; color: var(--text-2);
}
.cal-legend i.lg {
  display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  margin-right: 5px; vertical-align: middle;
}
.lg-target { background: #edf0f6; }
.lg-done { background: var(--primary); }
.lg-left { background: var(--gold); }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-dow { text-align: center; font-size: 12px; color: var(--text-3); padding: 4px 0; }
.cal-cell {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 10px; min-height: 96px; background: var(--card);
  cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s;
  display: flex; flex-direction: column;
}
.cal-cell:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.cal-cell.empty { background: transparent; border: none; cursor: default; }
.cal-cell.empty:hover { box-shadow: none; transform: none; }
.cal-cell.done { background: #f6f9ff; }
.cal-cell.done.ok { background: linear-gradient(180deg, #f1faf3, #ffffff); border-color: #cdebd4; }

.cal-day { font-weight: 700; font-size: 13px; margin-bottom: 5px; display: flex; justify-content: space-between; align-items: center; }
.cal-pin {
  font-size: 10px; font-weight: 700; line-height: 1;
  color: #b07d16; background: #fff5e0; border-radius: 5px; padding: 2px 5px;
}
.cal-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; color: var(--text-2); margin: 1px 0; }
.cal-k { color: var(--text-3); }
.cal-v { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.cal-v.strong { color: var(--primary); }
.cal-v.pos { color: var(--up); }
.cal-v.neg { color: var(--down); }
.cal-bar { height: 4px; background: #edf0f6; border-radius: 3px; overflow: hidden; margin: 5px 0 4px; }
.cal-bar > div { height: 100%; background: linear-gradient(90deg, #3b6ef6, #7a5af8); border-radius: 3px; }
.cal-note { font-size: 10px; color: var(--text-3); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 当日订单面板 */
.day-sum {
  font-size: 13px; color: var(--text-2); background: #f7f9fd;
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; margin-bottom: 12px;
}
.day-sum b { color: var(--text); font-size: 15px; }
.day-sum b.strong { color: var(--primary); }

/* 小型操作按钮（表格行内 / 弹窗内） */
.btn-sm { padding: 4px 9px; font-size: 12px; border-radius: 6px; }
.btn-danger {
  background: #fff; border: 1px solid #f0c2c2; color: var(--down);
  padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.btn-danger:hover { background: var(--down); border-color: var(--down); color: #fff; }
.btn-danger.btn-sm { padding: 4px 9px; font-size: 12px; border-radius: 6px; }
.btn-ghost.btn-sm { padding: 4px 9px; font-size: 12px; border-radius: 6px; }

@media (max-width: 760px) {
  .cal-grid { gap: 5px; }
  .cal-cell { padding: 5px 6px; min-height: 74px; border-radius: 8px; }
  .cal-row { font-size: 10px; }
  .cal-day { font-size: 12px; }
}

/* ===== 响应式 ===== */
@media (max-width: 1080px) {
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { width: 64px; padding: 20px 8px; }
  .brand-text, .nav-item span, .sync-badge span:last-child, .sync-time { display: none; }
  .nav-item { justify-content: center; }
  .brand { justify-content: center; }
  .topbar { padding: 0 14px; }
  .filter-group { display: none; }
}

/* ===== 产品多选（订单表单） ===== */
.prod-picker { display: flex; flex-direction: column; gap: 8px; }
.prod-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 24px; }
.prod-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--primary-soft); color: var(--primary); border-radius: 999px; padding: 3px 4px 3px 10px; font-size: 12px; max-width: 100%; }
.prod-chip button { border: none; background: none; color: inherit; cursor: pointer; font-size: 13px; line-height: 1; padding: 0 3px; flex: none; }
.prod-opts { max-height: 236px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; padding: 6px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px 8px; align-content: start; }
.prod-opt { display: flex; align-items: center; gap: 7px; padding: 5px 7px; border-radius: 7px; font-size: 13px; cursor: pointer; }
.prod-opt:hover { background: #f6f8fc; }
.prod-opt input { flex: none; }
.prod-opt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prod-opt.is-extra { color: var(--gold); }
.product-noimg { width: 100%; height: 150px; display: flex; align-items: center; justify-content: center; background: #f3f5fa; color: var(--text-3); font-size: 12px; }

/* ===== 日历：统计行 + 微信树 ===== */
.cal-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0 14px; }
.cstat { background: #f8fafd; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.cstat-k { font-size: 12px; color: var(--text-3); }
.cstat-v { font-size: 18px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.cstat-v.strong { color: var(--primary); }
.cstat-v.pos { color: var(--up); }
.cal-body { display: flex; gap: 14px; align-items: flex-start; }
.cal-side { width: 236px; flex: none; }
.cal-main { flex: 1; min-width: 0; }
.wx-tree { border: 1px solid var(--border); border-radius: 10px; padding: 8px; max-height: 600px; overflow: auto; background: var(--card); }
.wx-tree-title { font-size: 12px; color: var(--text-3); padding: 4px 8px 8px; font-weight: 600; }
.wx-node { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.wx-node:hover { background: #f1f5fe; }
.wx-node.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.wx-node.wx-root { font-weight: 600; border-bottom: 1px dashed var(--border); border-radius: 8px 8px 0 0; margin-bottom: 4px; }
.wx-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wx-s { font-size: 11px; color: var(--text-3); white-space: nowrap; flex: none; }
.wx-node.is-active .wx-s { color: var(--primary); }

@media (max-width: 900px) {
  .cal-body { flex-direction: column; }
  .cal-side { width: 100%; }
  .wx-tree { max-height: 220px; }
  .cal-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .prod-opts { grid-template-columns: 1fr; }
}
