/* ===== 设计令牌 ===== */
:root {
  color-scheme: light;
  --surface-1: #fcfcfb;
  --page: #f9f9f7;
  --text-1: #0b0b0b;
  --text-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --series-1: #2a78d6;
  --series-1-soft: #cde2fb;
  --series-2: #eb6834;
  --ord-1: #86b6ef; --ord-2: #5598e7; --ord-3: #2a78d6; --ord-4: #1c5cab; --ord-5: #104281;
  --good: #0ca30c;
  --good-text: #006300;
  --warning: #fab219;
  --warn-text: #b06a00;
  --serious: #ec835a;
  --critical: #d03b3b;
  --shadow: 0 1px 3px rgba(11, 11, 11, 0.06), 0 4px 16px rgba(11, 11, 11, 0.05);
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --surface-1: #1a1a19;
    --page: #0d0d0d;
    --text-1: #ffffff;
    --text-2: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --baseline: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --series-1: #3987e5;
    --series-1-soft: #16324f;
    --series-2: #d95926;
    --ord-1: #b7d3f6; --ord-2: #86b6ef; --ord-3: #5598e7; --ord-4: #2a78d6; --ord-5: #184f95;
    --good-text: #0ca30c;
    --warn-text: #f0a742;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--page);
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.5;
}
#app { height: 100%; }

/* ===== 登录页 ===== */
.login-page {
  height: 100%; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 24px;
}
.login-card {
  width: 360px; background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 14px; padding: 36px 32px; box-shadow: var(--shadow);
}
.login-card h1 { font-size: 20px; margin-bottom: 4px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.login-card .field { margin-bottom: 14px; }

/* ===== 应用布局 ===== */
.layout { display: flex; height: 100%; }
.sidebar {
  position: relative;
  width: 208px; flex-shrink: 0; background: var(--surface-1);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  transition: width 0.18s ease;
}
.sidebar .brand {
  padding: 20px 20px 16px; font-size: 16px; font-weight: 700;
  display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden;
}
/* 收起 / 展开按钮 */
.sb-toggle {
  position: absolute; top: 24px; right: -11px; z-index: 5;
  width: 22px; height: 22px; border-radius: 50%; padding: 0; line-height: 1;
  border: 1px solid var(--border); background: var(--surface-1); color: var(--muted);
  cursor: pointer; font-size: 13px; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); transition: color 0.15s ease, transform 0.18s ease;
}
.sb-toggle:hover { color: var(--series-1); }
/* 收起态:只留图标 */
.layout.sb-collapsed .sidebar { width: 64px; }
.layout.sb-collapsed .sidebar .brand { padding: 20px 0 16px; justify-content: center; }
.layout.sb-collapsed .sidebar .brand .txt,
.layout.sb-collapsed .nav-item .txt,
.layout.sb-collapsed .user-box .urole,
.layout.sb-collapsed .user-box .links { display: none; }
.layout.sb-collapsed .nav { padding: 8px 10px; }
.layout.sb-collapsed .nav-item { justify-content: center; padding: 9px 0; position: relative; }
.layout.sb-collapsed .nav-item .badge-num {
  position: absolute; top: 2px; right: 4px; margin-left: 0; min-width: 16px; line-height: 16px; font-size: 10px;
}
.layout.sb-collapsed .user-box { padding: 14px 8px; text-align: center; }
.layout.sb-collapsed .user-box .uname {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px;
}
.layout.sb-collapsed .sb-toggle { transform: rotate(180deg); }
.sidebar .brand .logo {
  width: 28px; height: 28px; border-radius: 8px; background: var(--series-1);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.nav { flex: 1; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
  color: var(--text-2); cursor: pointer; user-select: none; font-size: 14px;
  border: none; background: none; text-align: left; width: 100%;
}
.nav-item:hover { background: color-mix(in srgb, var(--text-1) 5%, transparent); }
.nav-item.active { background: var(--series-1-soft); color: var(--series-1); font-weight: 600; }
.nav-item .badge-num {
  margin-left: auto; background: var(--critical); color: #fff; font-size: 11px;
  padding: 0 6px; border-radius: 999px; min-width: 18px; text-align: center; line-height: 18px;
}
.sidebar .user-box {
  border-top: 1px solid var(--border); padding: 14px 16px; font-size: 13px;
}
.sidebar .user-box .uname { font-weight: 600; }
.sidebar .user-box .urole { color: var(--muted); font-size: 12px; }
.sidebar .user-box .links { margin-top: 8px; display: flex; gap: 12px; }
.sidebar .user-box a { color: var(--muted); cursor: pointer; text-decoration: none; }
.sidebar .user-box a:hover { color: var(--series-1); }

.main { flex: 1; overflow-y: auto; padding: 24px 28px; }
/* 移动端顶栏 / 抽屉遮罩(桌面隐藏) */
.topbar { display: none; }
.nav-backdrop { display: none; }
.topbar .logo { width: 26px; height: 26px; border-radius: 7px; background: var(--series-1); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
/* 顶栏操作按钮(手机端,页面名后面)*/
.topbar .tb-actions { display: inline-flex; gap: 6px; }
.tb-act { font-size: 12px; font-weight: 500; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--grid); background: var(--surface-1); color: var(--text-1); white-space: nowrap; cursor: pointer; line-height: 1.4; }
.tb-act.tb-alert { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 40%, transparent); background: color-mix(in srgb, var(--critical) 12%, transparent); font-weight: 600; }
.tb-act.tb-alert.active { background: var(--critical); color: #fff; }
/* 客资卡片(手机端) */
.cust-cards { display: flex; flex-direction: column; gap: 10px; }
.cust-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--surface-1); cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
.cust-card.starred { background: color-mix(in srgb, #f59e0b 8%, transparent); border-color: color-mix(in srgb, #f59e0b 35%, var(--border)); }
.cust-card .cc-row1 { display: flex; align-items: center; gap: 10px; }
.cust-card .cc-name { font-weight: 600; font-size: 15px; flex: 1; }
.cust-card .cc-contact { display: flex; flex-wrap: wrap; gap: 10px 16px; font-size: 14px; }
.cust-card .cc-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cust-card .cc-amt { color: var(--good-text); font-weight: 600; }
.cust-card .cc-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--text-2); }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.page-head h2 { font-size: 19px; }
.page-head .desc { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ===== 通用组件 ===== */
.card {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card .card-title { padding: 14px 18px 0; font-size: 14px; font-weight: 600; }
.card .card-sub { padding: 0 18px; color: var(--muted); font-size: 12px; }
.card .card-body { padding: 14px 18px 18px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--surface-1);
  color: var(--text-1); cursor: pointer; font-size: 13px; font-family: inherit;
}
.btn:hover { background: color-mix(in srgb, var(--text-1) 5%, var(--surface-1)); }
.btn.primary { background: var(--series-1); border-color: var(--series-1); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 40%, transparent); }
.btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--grid); border-radius: 8px;
  background: var(--surface-1); color: var(--text-1); font-size: 14px; font-family: inherit;
}
/* 复选框 / 单选框不撑满整行 */
.field input[type=checkbox], .field input[type=radio] {
  width: auto; padding: 0; margin: 0; flex-shrink: 0;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--series-1) 40%, transparent); border-color: var(--series-1);
}
.field textarea { resize: vertical; min-height: 70px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
/* 客资管理工具栏 —— 桌面端:还原为单行横排(下拉/搜索/星级顺序不变);录入按钮在右上角页头 */
.cust-toolbar .tb-row { display: contents; }
.cust-toolbar #f-view { order: 1; }
.cust-toolbar #f-tfield { order: 2; }
.cust-toolbar #f-trange { order: 3; }
.cust-toolbar #f-tstart, .cust-toolbar #f-tend, .cust-toolbar .tb-selects span { order: 4; }
.cust-toolbar .tb-search { order: 5; width: auto; }
.cust-toolbar #f-star { order: 6; }
/* 手机端「更多选项」横向筛选条(桌面隐藏)*/
.mobile-only { display: none; }
.mfilters { display: none; gap: 8px; overflow-x: auto; padding: 6px 2px 4px; margin: -4px 0 12px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.mfilters::-webkit-scrollbar { display: none; }
.mfilters .mf-chip { flex: 0 0 auto; white-space: nowrap; }
.mfilters .mf-chip.active { border-color: var(--series-1); color: var(--series-1); background: var(--series-1-soft); }
#f-more.on { border-color: var(--series-1); color: var(--series-1); font-weight: 600; }
/* 固定工具栏:滚动时时间筛选行钉在顶部 */
.toolbar.sticky-bar {
  position: sticky; top: 0; z-index: 20;
  background: var(--page); padding: 10px 0; margin-bottom: 10px;
  box-shadow: 0 6px 8px -6px rgba(0, 0, 0, 0.12);
}
.toolbar input, .toolbar select {
  padding: 7px 10px; border: 1px solid var(--grid); border-radius: 8px;
  background: var(--surface-1); color: var(--text-1); font-size: 13px; font-family: inherit;
}
.toolbar input[type="search"] { width: 220px; }

#c-table, #pool-table { overflow-x: auto; }
/* 大列表:表格放入限高滚动区,配合 sticky 表头固定;分页条在滚动区外 */
.tbl-scroll { overflow: auto; max-height: calc(100vh - 210px); }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
/* 订单跟踪卡片内的小表格:表头不固定(仅列表/明细类大表固定)*/
table.ot-items thead th { position: static; z-index: auto; box-shadow: inset 0 -1px 0 var(--grid); }
table.data th {
  text-align: left; color: var(--muted); font-weight: 500; font-size: 12px;
  padding: 10px 12px; white-space: nowrap;
  /* 列头固定:滚动列表时表头不动 */
  position: sticky; top: 0; z-index: 5;
  background: var(--surface-1); box-shadow: inset 0 -1px 0 var(--grid);
}
table.data td { padding: 11px 12px; border-bottom: 1px solid color-mix(in srgb, var(--grid) 55%, transparent); vertical-align: middle; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: color-mix(in srgb, var(--series-1) 5%, transparent); }
/* 星级客户整行底色凸显 */
table.data tr.starred td { background: color-mix(in srgb, #f59e0b 9%, transparent); }
table.data tr.starred:hover td { background: color-mix(in srgb, #f59e0b 16%, transparent); }
table.data td .cell-sub { color: var(--muted); font-size: 12px; }
table.data .num { font-variant-numeric: tabular-nums; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; background: color-mix(in srgb, var(--text-1) 6%, transparent); color: var(--text-2);
  white-space: nowrap;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.chip.s-新客资 .dot { background: var(--series-1); }
.chip.s-已联系 .dot { background: var(--ord-2); }
.chip.s-已预约 .dot { background: var(--ord-4); }
.chip.s-已到店 .dot { background: var(--warning); }
.chip.s-已成交 { background: color-mix(in srgb, var(--good) 12%, transparent); color: var(--good-text); }
.chip.s-已成交 .dot { background: var(--good); }
.chip.s-已流失 { color: var(--muted); }
.chip.s-已流失 .dot { background: var(--baseline); }
.chip.s-待跟进 .dot { background: var(--series-1); }
.chip.s-跟进中 .dot { background: var(--ord-2); }
.chip.s-已预约 .dot { background: var(--ord-4); }
.chip.s-进店追回 .dot { background: #1baf7a; }
.chip.s-已订单 { background: color-mix(in srgb, var(--good) 12%, transparent); color: var(--good-text); }
.chip.s-已订单 .dot { background: var(--good); }
.chip.s-进店流失 { color: var(--serious); }
.chip.s-进店流失 .dot { background: var(--serious); }
.chip.s-已流失, .chip.s-无效客资 { color: var(--muted); }
.chip.s-已流失 .dot, .chip.s-无效客资 .dot { background: var(--baseline); }
.chip.l-已通过 .dot { background: var(--good); }
.chip.l-未通过 .dot { background: var(--warning); }
.chip.l-被拉黑 { background: color-mix(in srgb, var(--critical) 10%, transparent); color: var(--critical); }
.chip.l-被拉黑 .dot { background: var(--critical); }
.chip.l-被删除 { color: var(--muted); }
.chip.l-被删除 .dot { background: var(--baseline); }
.chip.i-高 { background: color-mix(in srgb, var(--critical) 10%, transparent); color: var(--critical); }
.chip.i-中 { background: color-mix(in srgb, var(--warning) 14%, transparent); color: color-mix(in srgb, var(--warning) 60%, var(--text-1)); }
.chip.i-低 { color: var(--muted); }
.chip.overdue { background: color-mix(in srgb, var(--critical) 10%, transparent); color: var(--critical); font-weight: 600; }
.chip.t-婚礼客户 { background: color-mix(in srgb, #e87ba4 14%, transparent); color: #c04a77; }
.chip.t-商务客户 { background: color-mix(in srgb, var(--series-1) 12%, transparent); color: var(--series-1); }
.chip.t-团单客户 { background: color-mix(in srgb, #4a3aa7 12%, transparent); color: #6a5acd; }
.overdue-text { color: var(--critical) !important; font-weight: 600; }
.img-zone .thumbs, .order-card .thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.img-zone .thumb { position: relative; }
.img-zone .thumb img, .order-card .thumbs img {
  width: 72px; height: 72px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--grid); cursor: zoom-in; background: #fff;
}
.img-zone .thumb .x {
  position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%;
  border: none; background: var(--critical); color: #fff; font-size: 10px; cursor: pointer; line-height: 1;
}
.order-card { border: 1px solid var(--grid); border-radius: 10px; padding: 12px 14px; margin-top: 10px; }
.oc-head { display: flex; align-items: center; gap: 10px; }
.oc-amount { color: var(--good-text); font-weight: 700; font-size: 16px; }
.oc-head .oc-del { margin-left: auto; }
.oc-content { font-size: 13px; margin-top: 6px; white-space: pre-wrap; }
.oc-label { font-size: 12px; color: var(--muted); margin-top: 8px; }
.qr-peek { cursor: pointer; border-radius: 4px; padding: 0 2px; margin: 0 -2px; }
.qr-peek:hover { background: var(--series-1-soft); color: var(--series-1); }
.qr-float {
  position: fixed; z-index: 80; display: none; padding: 6px;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow);
}
.qr-float img { width: 480px; height: 480px; max-width: calc(100vw - 40px); max-height: calc(100vh - 40px); object-fit: contain; display: block; background: #fff; border-radius: 6px; }
.qr-box {
  width: 120px; height: 120px; border: 1.5px dashed var(--grid); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  overflow: hidden; background: color-mix(in srgb, var(--text-1) 2%, transparent);
}
.qr-box:hover { border-color: var(--series-1); }
.qr-box img { width: 100%; height: 100%; object-fit: contain; }
.qr-hint { font-size: 11px; color: var(--muted); text-align: center; padding: 8px; line-height: 1.5; }
.copyable { cursor: copy; border-radius: 4px; padding: 0 2px; margin: 0 -2px; }
.copyable:hover { background: var(--series-1-soft); color: var(--series-1); }

.pagination { display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding: 12px 4px 0; font-size: 13px; color: var(--muted); }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 13px; }

/* ===== 弹窗 & 抽屉 ===== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); z-index: 50;
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: var(--surface-1); border-radius: 14px; box-shadow: var(--shadow);
  width: min(560px, calc(100vw - 40px)); max-height: calc(100vh - 80px);
  display: flex; flex-direction: column;
}
.modal .modal-head { padding: 18px 22px 0; font-size: 16px; font-weight: 700; }
.modal .modal-body { padding: 16px 22px; overflow-y: auto; }
.modal .modal-foot { padding: 0 22px 18px; display: flex; justify-content: flex-end; gap: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid .full { grid-column: 1 / -1; }

.drawer-mask { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.3); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); z-index: 45;
  background: var(--surface-1); border-left: 1px solid var(--border);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12); display: flex; flex-direction: column;
  animation: slide-in 0.18s ease;
}
@keyframes slide-in { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer .drawer-head { padding: 18px 24px 12px; border-bottom: 1px solid var(--grid); }
.drawer .drawer-body { flex: 1; overflow-y: auto; padding: 18px 24px; }
.drawer .close-btn {
  position: absolute; top: 14px; right: 16px; border: none; background: none;
  font-size: 20px; color: var(--muted); cursor: pointer; padding: 4px 8px;
}
.kv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 20px; margin: 12px 0; }
.kv-grid .kv .k { color: var(--muted); font-size: 12px; }
.kv-grid .kv .v { font-size: 13px; }

.timeline { margin-top: 8px; }
.timeline .tl-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed color-mix(in srgb, var(--grid) 70%, transparent); }
.timeline .tl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--series-1); margin-top: 6px; flex-shrink: 0; }
.timeline .tl-dot.log { background: var(--baseline); }
.timeline .tl-meta { color: var(--muted); font-size: 12px; }
.timeline .tl-content { font-size: 13px; margin-top: 2px; white-space: pre-wrap; }
.timeline .tl-imgs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.timeline .tl-imgs img { width: 68px; height: 68px; object-fit: cover; border-radius: 8px; border: 1px solid var(--grid); cursor: zoom-in; background: #fff; }
.timeline .tl-del { flex-shrink: 0; align-self: flex-start; border: none; background: none; color: var(--muted); cursor: pointer; font-size: 12px; padding: 2px 6px; border-radius: 6px; opacity: 0.5; }
.timeline .tl-item:hover .tl-del { opacity: 1; }
.timeline .tl-del:hover { color: var(--critical); background: color-mix(in srgb, var(--critical) 12%, transparent); }

/* ===== 工作台 ===== */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.board-title { font-size: 13px; font-weight: 700; color: var(--text-2); margin: 2px 0 10px; }
.tile { padding: 16px 18px; }
.tile .t-label { color: var(--muted); font-size: 12px; }
.tile .t-value { font-size: 28px; font-weight: 700; margin-top: 2px; }
.tile .t-foot { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* 🎯 月度目标进度条 */
.prog-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px 28px; }
.prog-row { display: flex; flex-direction: column; gap: 6px; }
.prog-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; gap: 8px; }
.prog-track { position: relative; height: 10px; border-radius: 999px; background: color-mix(in srgb, var(--grid) 60%, transparent); }
.prog-fill { height: 100%; border-radius: 999px; background: var(--series-1); transition: width 0.4s ease; }
.prog-fill.done, .prog-fill.ok { background: var(--good); }
.prog-fill.behind { background: var(--critical); }
/* 时间进度标记线:完成率应到达的位置 */
.prog-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 1px; background: color-mix(in srgb, var(--text-1) 50%, transparent); }
.prog-flag { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; vertical-align: 1px; }
.prog-flag.ok { color: var(--good-text); background: color-mix(in srgb, var(--good) 15%, transparent); }
.prog-flag.behind { color: #fff; background: var(--critical); }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
/* 中屏:侧栏收窄为图标轨 */
@media (min-width: 769px) and (max-width: 1000px) {
  .dash-grid { grid-template-columns: 1fr; }
}
/* ===== 手机端(≤768px):顶栏 + 抽屉导航 + 卡片式客资 ===== */
@media (max-width: 768px) {
  .layout { flex-direction: column; }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface-1); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
  .topbar .tb-menu { font-size: 22px; background: none; border: none; color: var(--text-1); cursor: pointer; padding: 2px 6px; line-height: 1; }
  .topbar .tb-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
  .topbar .badge-num { margin-left: auto; }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 258px; transform: translateX(-100%); transition: transform 0.22s ease; z-index: 60; }
  .layout.nav-open .sidebar { transform: none; box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18); }
  .nav-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 55; }
  .layout.nav-open .nav-backdrop { display: block; }
  .sb-toggle { display: none; }
  /* 移动端抽屉恒展开完整标签(忽略桌面折叠态) */
  .layout.sb-collapsed .sidebar { width: 258px; }
  .layout.sb-collapsed .sidebar .brand { padding: 20px 20px 16px; justify-content: flex-start; }
  .layout.sb-collapsed .sidebar .brand .txt,
  .layout.sb-collapsed .nav-item .txt,
  .layout.sb-collapsed .user-box .urole,
  .layout.sb-collapsed .user-box .links { display: block; }
  .layout.sb-collapsed .nav-item { justify-content: flex-start; padding: 9px 12px; }
  .layout.sb-collapsed .nav-item .badge-num { position: static; }
  .main { padding: 14px 14px 32px; overflow-x: hidden; }
  .dash-grid { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: stretch; gap: 8px; margin-bottom: 8px; }
  .page-head h2 { font-size: 18px; }
  .page-head > div:last-child, .page-head .btn { width: 100%; }
  .page-head > div:last-child { display: flex; gap: 8px; }
  .page-head > div:last-child .btn { flex: 1; }
  /* 手机端隐藏页头标题/说明(顶栏已显示页面名),仅保留操作按钮;标题独占的页头整体收起 */
  .page-head > div:first-child { display: none; }
  .page-head:not(:has(> :nth-child(2))) { margin-bottom: 0; gap: 0; }
  .toolbar { gap: 8px; }
  .mobile-only { display: inline-flex; }
  .hide-on-mobile { display: none !important; }
  .mfilters { display: flex; }
  /* 手机端:工具栏竖排四行(搜索 / 星级+录入 / 三个下拉 / 筛选条)*/
  .cust-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .cust-toolbar .tb-row { display: flex; gap: 8px; flex-wrap: wrap; }
  .cust-toolbar .tb-search { width: 100%; order: 0; }
  .cust-toolbar #f-star, .cust-toolbar #f-view, .cust-toolbar #f-tfield, .cust-toolbar #f-trange { order: 0; }
  .cust-toolbar .tb-actions .btn { flex: 1 1 0; }
  .cust-toolbar .tb-selects select { flex: 1 1 0; min-width: 110px; }
  .cust-toolbar .tb-selects input[type="date"] { flex: 1 1 40%; }
  /* 订单流程一行显示完 */
  .ot-steps { flex-wrap: nowrap; gap: 2px; margin: 10px 0; }
  .ot-steps .ot-step { padding: 4px 6px; font-size: 11px; }
  .ot-steps .ot-arrow { font-size: 10px; }
  .toolbar input, .toolbar select { flex: 1 1 44%; min-width: 130px; }
  .toolbar input[type="search"] { width: 100%; flex-basis: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { padding: 12px 14px; }
  .tile .t-value { font-size: 22px; }
  .prog-body { grid-template-columns: 1fr; }
  .kv-grid { grid-template-columns: 1fr; }
  .modal { width: calc(100vw - 24px); max-height: calc(100vh - 40px); }
  /* 次级宽表格(团队/异业/统计)允许横向滚动,页面本身不横滚 */
  .card { overflow-x: auto; }
  table.data { font-size: 13px; }
}
.remind-list { list-style: none; }
.remind-list li {
  display: flex; align-items: center; gap: 10px; padding: 9px 0;
  border-bottom: 1px dashed color-mix(in srgb, var(--grid) 70%, transparent); font-size: 13px; cursor: pointer;
}
.remind-list li:hover { color: var(--series-1); }
.remind-list .r-time { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; }
.remind-list .deliv-btn {
  margin-left: auto; font-size: 12px; padding: 4px 12px; border-radius: 7px;
  border: 1px solid var(--series-1); color: var(--series-1); background: transparent;
  cursor: pointer; white-space: nowrap; font-weight: 600; transition: background 0.15s, color 0.15s;
}
.remind-list .deliv-btn:hover { background: var(--series-1); color: #fff; }
.remind-list .deliv-btn:disabled { opacity: 0.5; cursor: default; }
.remind-list .deliv-btn.good { border-color: var(--good-text); color: var(--good-text); }
.remind-list .deliv-btn.good:hover { background: var(--good-text); color: #fff; }
.remind-list .deliv-btn.bad { border-color: var(--serious); color: var(--serious); }
.remind-list .deliv-btn.bad:hover { background: var(--serious); color: #fff; }
.remind-list .deliv-btn.mute { border-color: var(--border); color: var(--muted); }
.remind-list .deliv-btn.mute:hover { background: var(--muted); color: #fff; }
.remind-list .appt-acts { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.remind-list .appt-acts .deliv-btn { margin-left: 0; padding: 3px 9px; }

/* ===== 图表 ===== */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 1100px) { .stats-grid { grid-template-columns: 1fr; } }
.stats-grid .wide { grid-column: 1 / -1; }
.hbar-row { display: flex; align-items: center; gap: 10px; margin: 7px 0; }
.hbar-label { width: 92px; flex-shrink: 0; font-size: 12px; color: var(--text-2); text-align: right; }
.hbar-track { flex: 1; display: flex; align-items: center; gap: 8px; }
.hbar {
  height: 16px; border-radius: 0 4px 4px 0; background: var(--series-1); min-width: 2px;
  transition: width 0.3s ease;
}
.hbar-val { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.chart-wrap { position: relative; }
/* 客资画像:多维度分布并排 */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px 24px; }
.profile-col { min-width: 0; padding: 4px 0; }
.profile-h { font-weight: 600; font-size: 13px; margin-bottom: 4px; color: var(--text-1); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg .btn.active { background: var(--series-1-soft); border-color: var(--series-1); color: var(--series-1); font-weight: 600; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-2); padding-bottom: 8px; }
.legend i, .tt-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.tt-dot { width: 8px; height: 8px; }
.chart-tooltip {
  position: absolute; pointer-events: none; background: var(--surface-1);
  border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow);
  padding: 6px 10px; font-size: 12px; display: none; z-index: 5; white-space: nowrap;
}
.chart-tooltip .tt-title { color: var(--muted); }
.chart-tooltip .tt-val { font-weight: 600; }

/* ===== 时间列行内编辑 ===== */
td.t-edit { cursor: pointer; }
td.t-edit:hover { background: var(--series-1-soft); }
td.s-edit { cursor: pointer; }
td.s-edit:hover { background: var(--series-1-soft); }
span.s-edit { cursor: pointer; border-radius: 999px; }
span.s-edit:hover { outline: 2px solid color-mix(in srgb, var(--series-1) 45%, transparent); }

/* 推广人折叠选择器 */
.ppick { position: relative; }
.ppick-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border: 1px solid var(--grid); border-radius: 8px;
  background: var(--surface-1); color: var(--text-1); font-size: 14px; cursor: pointer; text-align: left;
}
.ppick-toggle:hover { border-color: var(--series-1); }
.ppick-label.ph { color: var(--muted); }
.ppick-caret { color: var(--muted); font-size: 12px; }
.ppick-panel {
  margin-top: 6px; border: 1px solid var(--grid); border-radius: 8px; background: var(--surface-1);
  max-height: 260px; overflow-y: auto; padding: 4px;
}
.ppick-group + .ppick-group { border-top: 1px solid var(--border); }
.ppick-ghead {
  width: 100%; display: flex; align-items: center; gap: 6px; padding: 8px 10px;
  background: none; border: none; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-2);
}
.ppick-gcaret { transition: transform 0.15s ease; font-size: 10px; }
.ppick-group.open .ppick-gcaret { transform: rotate(90deg); }
.ppick-gbody { display: none; padding: 2px 4px 6px; }
.ppick-group.open .ppick-gbody { display: block; }
/* 异业联盟二级(门店)分组 */
.ppick-subgroup { margin-left: 8px; border-left: 2px solid var(--border); }
.ppick-subhead {
  width: 100%; display: flex; align-items: center; gap: 6px; padding: 6px 10px;
  background: none; border: none; cursor: pointer; font-size: 12.5px; color: var(--text-2);
}
.ppick-subgroup .ppick-gcaret { transition: transform 0.15s ease; font-size: 10px; }
.ppick-subgroup.open > .ppick-subhead .ppick-gcaret { transform: rotate(90deg); }
.ppick-subbody { display: none; }
.ppick-subgroup.open > .ppick-subbody { display: block; }
.ppick-item {
  width: 100%; text-align: left; padding: 7px 12px; border: none; background: none;
  border-radius: 6px; cursor: pointer; font-size: 14px; color: var(--text-1);
}
.ppick-item:hover { background: color-mix(in srgb, var(--series-1) 8%, transparent); }
.ppick-item.sel { background: var(--series-1-soft); color: var(--series-1); font-weight: 600; }

/* 异业联盟推荐人标签 */
.ref-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; font-size: 13px;
}
.ref-chip a { cursor: pointer; color: var(--muted); text-decoration: none; font-size: 12px; }
.ref-chip a:hover { color: var(--series-1); }
.ref-chip a.al-del-ref:hover { color: var(--critical); }

/* 每日待办卡片 */
.todo-item { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--border); }
.todo-item:last-child { border-bottom: none; }
.todo-item .todo-text { flex: 1; font-size: 14px; }
.todo-item.done .todo-text { text-decoration: line-through; color: var(--muted); }
.todo-item .todo-del, .todo-item .todo-del-ph { width: 24px; flex-shrink: 0; box-sizing: border-box; text-align: center; }
.todo-item .todo-del { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 2px 0; border-radius: 6px; }
.todo-item .todo-del:hover { color: var(--critical); background: color-mix(in srgb, var(--critical) 12%, transparent); }
.todo-item input[type=checkbox] { width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; }
.todo-from { font-size: 11px; color: var(--series-1); background: var(--series-1-soft); padding: 1px 6px; border-radius: 999px; margin-left: 4px; white-space: nowrap; }
.todo-time { font-size: 11px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
/* 派发看板 */
.ab-group { padding: 8px 0; border-bottom: 1px solid var(--border); }
.ab-group:last-child { border-bottom: none; }
.ab-head { font-weight: 600; font-size: 13.5px; margin-bottom: 4px; }
.ab-item { display: flex; align-items: center; gap: 8px; padding: 4px 0 4px 8px; font-size: 13.5px; }
.ab-item .ab-status { width: 16px; text-align: center; color: var(--muted); }
.ab-item.done .ab-status { color: var(--good-text); }
.ab-item.done .ab-text { text-decoration: line-through; color: var(--muted); }
.ab-item .ab-text { flex: 1; }
.ab-item .ab-time { font-size: 11px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.ab-item .ab-time .ab-done { color: var(--good-text); }
.ab-item .ab-del { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 12px; padding: 2px 6px; border-radius: 6px; }
.ab-item .ab-del:hover { color: var(--critical); background: color-mix(in srgb, var(--critical) 12%, transparent); }

/* 部门月度目标汇总(分组行右侧) */
.dept-tg { margin-left: 14px; font-weight: 600; font-size: 12.5px; color: var(--series-1); }

/* 员工管理分组行 */
table.data tr.group-row td {
  background: color-mix(in srgb, var(--series-1) 6%, transparent);
  font-weight: 700; font-size: 12.5px; padding: 8px 14px;
  border-top: 1px solid var(--grid);
}

/* 工具栏星级客户快捷按钮 */
.btn.star-btn.on { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.btn.star-btn.on:hover { background: #d97706; }

/* ===== 星级客户标记 ===== */
td.star-cell { cursor: pointer; text-align: center; }
.star-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 7px; font-size: 15px;
  color: var(--muted); transition: transform 0.12s ease, background 0.12s ease;
}
td.star-cell:hover .star-badge { transform: scale(1.15); background: color-mix(in srgb, #f59e0b 14%, transparent); color: #f59e0b; }
.star-badge.on { background: #f59e0b; color: #fff; box-shadow: 0 1px 4px color-mix(in srgb, #f59e0b 45%, transparent); }
td.star-cell:hover .star-badge.on { background: #d97706; color: #fff; }

/* ===== 表头排序 ===== */
.th-sort { display: inline-flex; flex-direction: column; vertical-align: middle; margin-left: 3px; gap: 0; }
.th-sort .ts {
  border: none; background: none; cursor: pointer; color: var(--baseline);
  font-size: 7px; line-height: 1.1; padding: 0 2px;
}
.th-sort .ts:hover { color: var(--series-1); }
.th-sort .ts.active { color: var(--series-1); }

/* ===== 表头筛选 ===== */
.th-filter {
  border: none; background: none; cursor: pointer; color: var(--muted);
  font-size: 11px; padding: 1px 4px; margin-left: 2px; border-radius: 4px; vertical-align: 1px;
}
.th-filter:hover { background: var(--series-1-soft); color: var(--series-1); }
.th-filter.active { background: var(--series-1); color: #fff; font-weight: 700; }
.filter-pop {
  position: fixed; z-index: 70; min-width: 160px; max-width: 240px;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.16);
}
.filter-pop .fp-list { max-height: 280px; overflow-y: auto; padding: 8px 6px; }
.filter-pop .fp-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px;
  font-size: 13px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.filter-pop .fp-item:hover { background: color-mix(in srgb, var(--series-1) 6%, transparent); }
.filter-pop .fp-foot {
  display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px;
  border-top: 1px solid var(--grid);
}

/* ===== 日期区间日历选择器 ===== */
.range-pop {
  position: fixed; z-index: 72; width: 268px; padding: 10px;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}
.range-pop .rp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.range-pop .rp-title { font-weight: 600; font-size: 14px; }
.range-pop .rp-nav { width: 28px; height: 28px; border: 1px solid var(--grid); border-radius: 7px; background: var(--surface-1); color: var(--text-1); cursor: pointer; font-size: 16px; line-height: 1; }
.range-pop .rp-nav:hover { border-color: var(--series-1); color: var(--series-1); }
.range-pop .rp-wk { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; color: var(--muted); font-size: 11px; margin-bottom: 2px; }
.range-pop .rp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.range-pop .rp-cell { height: 32px; border: none; background: none; color: var(--text-1); font-size: 12.5px; cursor: pointer; border-radius: 7px; }
.range-pop .rp-cell.rp-empty { visibility: hidden; }
.range-pop .rp-cell:hover:not(.rp-empty) { background: var(--series-1-soft); }
.range-pop .rp-cell.rp-today { color: var(--series-1); font-weight: 700; }
.range-pop .rp-cell.rp-in { background: var(--series-1-soft); border-radius: 0; }
.range-pop .rp-cell.rp-start, .range-pop .rp-cell.rp-end { background: var(--series-1); color: #fff; font-weight: 600; }
.range-pop .rp-cell.rp-start { border-radius: 7px 0 0 7px; }
.range-pop .rp-cell.rp-end { border-radius: 0 7px 7px 0; }
.range-pop .rp-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--grid); }
.range-pop .rp-range { flex: 1; font-size: 12px; color: var(--muted); white-space: nowrap; }
.range-pop .rp-range b { color: var(--muted); margin: 0 2px; }

/* ===== 批量操作栏 ===== */
.batch-bar {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 45;
  display: flex; align-items: center; gap: 10px; padding: 10px 18px;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18); white-space: nowrap;
}
.batch-bar .bb-count { font-size: 13px; color: var(--text-2); }
.batch-bar .bb-count b { color: var(--series-1); }

/* ===== Toast ===== */
#toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--text-1); color: var(--page); padding: 9px 18px; border-radius: 8px;
  font-size: 13px; box-shadow: var(--shadow); animation: toast-in 0.2s ease;
}
.toast.error { background: var(--critical); color: #fff; }
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
/* 工作台卡片折叠:超过 10 行的行默认隐藏,「展开全部」显示、「收起」还原 */
.card:not(.rows-expanded) .pl-extra { display: none; }
.expand-all { display: block; width: 100%; margin-top: 8px; padding: 7px; border: 1px dashed var(--series-1); border-radius: 8px; background: transparent; color: var(--text-2); font-size: 12px; cursor: pointer; transition: background .15s, color .15s; }
.expand-all:hover { background: var(--surface-2); color: var(--text-1); }

/* ===================== 数据大屏 ===================== */
.bigscreen {
  position: fixed; inset: 0; z-index: 3000; overflow: auto;
  display: flex; flex-direction: column; gap: 14px; padding: 18px 22px 22px;
  background: radial-gradient(1200px 600px at 20% -10%, #12213f 0%, transparent 60%), radial-gradient(1000px 500px at 100% 0%, #0e2a3a 0%, transparent 55%), #060b1a;
  color: #cfe0f7; font-variant-numeric: tabular-nums;
  /* 覆盖复用图表的配色变量,使其适配深色大屏 */
  --surface-1: #0b1428; --text-1: #eaf2ff; --text-2: #a9c2e8; --muted: #6f86ad;
  --grid: rgba(90,140,220,0.14); --baseline: rgba(90,140,220,0.4);
  --series-1: #22d3ee; --series-2: #f59e0b; --good-text: #22c55e;
  --ord-1: #1e3a8a; --ord-2: #2563eb; --ord-3: #3b82f6; --ord-4: #22d3ee; --ord-5: #67e8f9;
}
.bs-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; }
.bs-title { font-size: 26px; font-weight: 800; letter-spacing: 2px; color: #eaf2ff; text-shadow: 0 0 20px rgba(34,211,238,0.4); }
.bs-meta { display: flex; align-items: center; gap: 16px; }
.bs-period { color: #7f97bd; font-size: 14px; }
.bs-clock { font-size: 20px; font-weight: 700; color: #22d3ee; letter-spacing: 1px; text-shadow: 0 0 12px rgba(34,211,238,0.5); }
.bs-close { background: rgba(90,140,220,0.14); border: 1px solid rgba(120,160,230,0.3); color: #cfe0f7; padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.bs-close:hover { background: rgba(220,90,90,0.25); border-color: rgba(240,120,120,0.5); color: #fff; }
.bs-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; flex-shrink: 0; }
.bs-kpi { background: linear-gradient(160deg, rgba(30,50,95,0.55), rgba(14,26,52,0.55)); border: 1px solid rgba(90,140,220,0.22); border-radius: 12px; padding: 14px 16px; position: relative; overflow: hidden; }
.bs-kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(#22d3ee, #3b82f6); }
.bs-kpi .k-label { font-size: 13px; color: #8ba3c9; margin-bottom: 8px; }
.bs-kpi .k-value { font-size: 30px; font-weight: 800; color: #eaf2ff; line-height: 1; }
.bs-kpi .k-value.amt { color: #22c55e; text-shadow: 0 0 14px rgba(34,197,94,0.35); }
.bs-grid {
  flex: 1; min-height: 460px; display: grid; gap: 14px;
  grid-template-columns: repeat(12, 1fr); grid-auto-rows: minmax(210px, 1fr);
  grid-template-areas:
    "funnel funnel funnel trend trend trend trend trend region region region region"
    "source source source amount amount amount amount amount ally ally ally ally";
}
.p-funnel { grid-area: funnel; } .p-trend { grid-area: trend; } .p-region { grid-area: region; }
.p-source { grid-area: source; } .p-amount { grid-area: amount; } .p-ally { grid-area: ally; }
.bs-panel { background: linear-gradient(160deg, rgba(22,38,74,0.5), rgba(11,20,40,0.55)); border: 1px solid rgba(90,140,220,0.2); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.bs-ph { font-size: 14px; font-weight: 700; color: #bcd2f2; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.bs-lgd { margin-left: auto; font-size: 11px; color: #8ba3c9; font-weight: 400; display: flex; align-items: center; gap: 4px; }
.bs-lgd i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-left: 8px; }
.bs-lgd i.d1 { background: #22d3ee; } .bs-lgd i.d2 { background: #f59e0b; }
.bs-loading, .bs-empty { color: #6f86ad; text-align: center; padding: 24px; font-size: 13px; }
/* 漏斗 */
.bs-funnel { display: flex; flex-direction: column; justify-content: center; gap: 9px; flex: 1; }
.bs-frow { display: flex; align-items: center; gap: 10px; }
.bs-flabel { width: 72px; flex-shrink: 0; font-size: 12px; color: #a9c2e8; text-align: right; }
.bs-ftrack { flex: 1; background: rgba(90,140,220,0.1); border-radius: 5px; height: 18px; }
.bs-fbar { height: 100%; border-radius: 5px; min-width: 3px; box-shadow: 0 0 12px rgba(34,211,238,0.35); transition: width .4s ease; }
.bs-fval { width: 66px; flex-shrink: 0; font-size: 13px; font-weight: 700; color: #eaf2ff; }
.bs-fval em { font-style: normal; font-size: 11px; color: #6f86ad; font-weight: 400; }
/* 来源渠道 */
.bs-src { display: flex; flex-direction: column; justify-content: center; gap: 8px; flex: 1; }
.bs-srow { display: flex; align-items: center; gap: 10px; }
.bs-slabel { width: 82px; flex-shrink: 0; font-size: 12px; color: #a9c2e8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bs-strack { flex: 1; background: rgba(90,140,220,0.1); border-radius: 5px; height: 16px; }
.bs-sbar { height: 100%; border-radius: 5px; min-width: 3px; background: linear-gradient(90deg, #2563eb, #22d3ee); }
.bs-sval { width: 90px; flex-shrink: 0; font-size: 12px; color: #eaf2ff; text-align: right; }
.bs-sval em { font-style: normal; color: #22c55e; font-size: 11px; }
/* 环形图 */
.bs-donut { display: flex; align-items: center; gap: 14px; flex: 1; }
.bs-legend { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.bs-lg { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #cfe0f7; }
.bs-lg i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.bs-lg .lg-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bs-lg b { color: #eaf2ff; } .bs-lg .lg-pct { color: #6f86ad; width: 34px; text-align: right; }
/* 联盟榜 */
.bs-list { display: flex; flex-direction: column; gap: 6px; flex: 1; overflow: auto; }
.bs-lrow { display: flex; align-items: center; gap: 9px; padding: 4px 0; border-bottom: 1px solid rgba(90,140,220,0.1); }
.bs-rank { width: 20px; height: 20px; flex-shrink: 0; border-radius: 6px; background: rgba(90,140,220,0.16); color: #a9c2e8; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.bs-rank.r1 { background: linear-gradient(#f59e0b, #d97706); color: #fff; }
.bs-rank.r2 { background: linear-gradient(#94a3b8, #64748b); color: #fff; }
.bs-rank.r3 { background: linear-gradient(#b45309, #92400e); color: #fff; }
.bs-lname { flex: 1; font-size: 13px; color: #eaf2ff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bs-lnum { font-size: 11px; color: #8ba3c9; flex-shrink: 0; }
.bs-lamt { font-size: 13px; font-weight: 700; color: #22c55e; width: 92px; text-align: right; flex-shrink: 0; }
@media (max-width: 1100px) {
  .bs-kpis { grid-template-columns: repeat(3, 1fr); }
  .bs-grid { grid-template-columns: 1fr; grid-auto-rows: minmax(240px, auto); grid-template-areas: "funnel" "trend" "region" "source" "amount" "ally"; }
}

/* ===================== 订单跟踪 ===================== */
.ot-alert { border: 1px solid color-mix(in srgb, var(--critical) 45%, transparent); background: color-mix(in srgb, var(--critical) 10%, transparent); color: var(--critical); font-weight: 600; font-size: 12px; padding: 2px 10px; border-radius: 999px; cursor: pointer; font-family: inherit; }
.ot-alert:hover { background: color-mix(in srgb, var(--critical) 18%, transparent); }
.ot-alert.active { background: var(--critical); color: #fff; border-color: var(--critical); }
.ot-list { display: flex; flex-direction: column; gap: 12px; }
.ot-card { padding: 14px 16px; }
.ot-card.ot-delivered { opacity: 0.72; }
.ot-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ot-cust { cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.ot-cust:hover .ot-name { color: var(--series-1); }
.ot-name { font-weight: 700; font-size: 15px; }
.ot-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ot-amt { color: var(--good-text); font-weight: 700; }
.ot-steps { display: flex; align-items: center; gap: 4px; margin: 12px 0; flex-wrap: wrap; }
.ot-step { border: 1px solid var(--grid); background: var(--surface-1); color: var(--muted); padding: 5px 12px; border-radius: 999px; cursor: pointer; font-size: 12.5px; }
.ot-step:hover { border-color: var(--series-1); color: var(--series-1); }
.ot-step.ot-auto { cursor: default; pointer-events: none; }
.ot-step.done { background: var(--series-1-soft); border-color: var(--series-1); color: var(--series-1); }
.ot-step.cur { background: var(--series-1); border-color: var(--series-1); color: #fff; font-weight: 600; }
.ot-arrow { color: var(--baseline); font-size: 13px; }
.ot-items { width: 100%; font-size: 13px; }
.ot-items th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 4px 8px; border-bottom: 1px solid var(--grid); }
.ot-items td { padding: 5px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ot-items tr:last-child td { border-bottom: none; }
.ot-items .ot-prod { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ot-edit { cursor: pointer; border-radius: 5px; }
.ot-edit:hover { background: var(--series-1-soft); outline: 1px dashed var(--series-1); }
.ot-overdue { color: var(--critical); font-weight: 600; }
.ot-soon { color: var(--warn-text); font-weight: 600; }
.ot-sel { padding: 3px 6px; border: 1px solid var(--grid); border-radius: 6px; background: var(--surface-1); color: var(--text-1); font-size: 12px; }
.ot-foot { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--grid); font-size: 13px; color: var(--text-2); }
.ot-foot b { font-weight: 600; }
/* 下单表单:产品明细行 */
.od-item-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; align-items: center; }
.od-item-row select, .od-item-row input { width: auto; padding: 5px 7px; border: 1px solid var(--grid); border-radius: 6px; background: var(--surface-1); color: var(--text-1); font-size: 12.5px; min-width: 0; }
.od-item-row .oi-category { flex: 0 0 78px; }
.od-item-row .oi-qty { flex: 0 0 46px; }
.od-item-row .oi-fabric_supplier, .od-item-row .oi-fabric_no, .od-item-row .oi-color, .od-item-row .oi-spec { flex: 1 1 68px; }
.od-item-row .oi-del { flex-shrink: 0; border: none; background: none; color: var(--muted); cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.od-item-row .oi-del:hover { color: var(--critical); background: color-mix(in srgb, var(--critical) 12%, transparent); }
/* 客户详情:订单产品明细 */
.oc-items { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 2px; }
.oc-item { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; padding: 4px 8px; background: color-mix(in srgb, var(--text-1) 3%, transparent); border-radius: 6px; }
.oc-item-p { font-weight: 600; }
.oc-item-g { color: var(--series-1); }

/* 角色权限:按板块分组 */
.perm-groups { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.perm-group { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
.perm-group-h { font-size: 12px; font-weight: 600; color: var(--series-1); margin-bottom: 6px; }
.perm-item { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; padding: 3px 0; }
.perm-item input[type=checkbox] { flex-shrink: 0; }

/* 图片查看器:多图滑动切换 */
.imgv { position: relative; text-align: center; user-select: none; touch-action: pan-y; }
.imgv-img { max-width: 100%; max-height: 60vh; border-radius: 8px; background: #fff; }
.imgv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: none; background: rgba(0,0,0,0.45); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.imgv-nav:hover { background: rgba(0,0,0,0.65); }
.imgv-prev { left: 6px; } .imgv-next { right: 6px; }
.imgv-count { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.5); color: #fff; font-size: 12px; padding: 2px 10px; border-radius: 999px; }

/* 品牌标志:透明底 LOGO 里裁出金色六边形标志(乔治·伯爵) */
.logo.brand-mark {
  background: transparent !important;
  background-image: url('/logo-mark.png') !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: contain !important;
  color: transparent;
  overflow: hidden;
}
