/* ==========================================================================
   LeadGen · 客户开发系统  设计系统
   色彩：靛蓝品牌色 + 中性灰阶 + 语义色（成功/警告/危险/信息）
   排版：14px 基准，数字表格化（tabular-nums），标题收紧字距
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ---- 画布与层级 ---- */
  --bg: #f4f6fb;
  --panel: #ffffff;
  --panel-soft: #fafbfe;
  --panel-sink: #f7f9fc;
  --line: #e9edf5;
  --line-strong: #dde4ef;

  /* ---- 文字 ---- */
  --text: #0f172a;
  --text-2: #475467;
  --muted: #94a3b8;
  --muted-2: #cbd5e1;

  /* ---- 品牌（靛蓝 → 紫罗兰） ---- */
  --brand: #4f46e5;
  --brand-600: #4338ca;
  --brand-700: #3730a3;
  --brand-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --brand-soft: #eef2ff;
  --brand-line: #c7d2fe;
  --brand-ink: #312e81;

  /* ---- 语义色 ---- */
  --ok: #10b981;      --ok-soft: #ecfdf5;   --ok-line: #a7f3d0;   --ok-ink: #065f46;
  --warn: #f59e0b;    --warn-soft: #fffbeb; --warn-line: #fde68a; --warn-ink: #92400e;
  --danger: #ef4444;  --danger-soft: #fef2f2; --danger-line: #fecaca; --danger-ink: #991b1b;
  --info: #0ea5e9;    --info-soft: #f0f9ff; --info-line: #bae6fd; --info-ink: #075985;
  --violet: #8b5cf6;  --violet-soft: #f5f3ff;

  /* ---- 侧栏 ---- */
  --side-1: #0b1120;
  --side-2: #131e36;
  --side-3: #1c2b4a;
  --side-text: #93a4c0;
  --side-line: rgba(148, 163, 184, .14);

  /* ---- 形状与阴影 ---- */
  --r-xs: 5px;  --r-sm: 7px;  --r: 10px;  --r-lg: 14px;  --r-xl: 18px;
  --sh-1: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.05);
  --sh-2: 0 4px 14px -4px rgba(16,24,40,.10), 0 2px 6px -3px rgba(16,24,40,.06);
  --sh-3: 0 16px 40px -12px rgba(16,24,40,.18);
  --sh-brand: 0 6px 16px -6px rgba(79,70,229,.55);
  --sh-side: 4px 0 24px -8px rgba(11,17,32,.35);

  --ease: cubic-bezier(.4, 0, .2, 1);
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 100% -8%, rgba(99,102,241,.10), transparent 62%),
    radial-gradient(820px 460px at -8% 2%, rgba(14,165,233,.08), transparent 58%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: rgba(99,102,241,.18); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d5dced; border-radius: 20px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b9c4da; background-clip: content-box; border: 3px solid transparent; }

/* ========================== 布局骨架 ========================== */
#app { display: flex; min-height: 100vh; }

/* ========================== 侧边栏 ========================== */
#sidebar {
  width: 234px; flex-shrink: 0;
  background: linear-gradient(178deg, var(--side-2) 0%, var(--side-1) 62%);
  color: var(--side-text);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  box-shadow: var(--sh-side);
  border-right: 1px solid rgba(0,0,0,.4);
  z-index: 20;
}
#sidebar .brand {
  display: flex; align-items: center; gap: 11px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid var(--side-line);
  color: #fff; font-size: 15px; font-weight: 650; letter-spacing: -.01em;
}
#sidebar .brand .mark {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--brand-grad);
  box-shadow: 0 6px 16px -6px rgba(99,102,241,.9), inset 0 1px 0 rgba(255,255,255,.28);
}
#sidebar .brand .mark svg { width: 20px; height: 20px; }
#sidebar .brand small {
  display: block; font-size: 10.5px; color: #64748b; font-weight: 500;
  letter-spacing: .10em; text-transform: uppercase; margin-top: 2px;
}

#sidebar nav { padding: 12px 12px 8px; flex: 1; overflow-y: auto; }
#sidebar nav::-webkit-scrollbar { width: 6px; }
#sidebar nav a {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin-bottom: 2px;
  color: var(--side-text); text-decoration: none; cursor: pointer;
  border-radius: var(--r);
  font-size: 13.5px; font-weight: 500;
  transition: background .16s var(--ease), color .16s var(--ease), transform .16s var(--ease);
}
#sidebar nav a .ic {
  width: 18px; height: 18px; flex-shrink: 0;
  opacity: .78; transition: opacity .16s var(--ease);
}
#sidebar nav a .ic svg { width: 18px; height: 18px; display: block; }
#sidebar nav a:hover { background: rgba(255,255,255,.055); color: #e2e8f5; }
#sidebar nav a:hover .ic { opacity: 1; }
#sidebar nav a.active {
  background: linear-gradient(90deg, rgba(99,102,241,.24), rgba(139,92,246,.10));
  color: #fff; font-weight: 600;
}
#sidebar nav a.active::before {
  content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0;
  background: var(--brand-grad); box-shadow: 0 0 12px rgba(99,102,241,.9);
}
#sidebar nav a.active .ic { opacity: 1; color: #a5b4fc; }

#sidebar .nav-sep {
  margin: 10px 12px 8px; padding-top: 10px;
  border-top: 1px solid var(--side-line);
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #4c5c7a;
}

#sidebar .foot {
  padding: 14px; border-top: 1px solid var(--side-line);
  font-size: 12px;
}
#sidebar .user-chip {
  display: flex; align-items: center; gap: 9px; margin-bottom: 10px;
}
#sidebar .user-chip .avatar {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #334155, #1e293b);
  border: 1px solid rgba(148,163,184,.25);
  color: #cbd5e1; font-size: 12px; font-weight: 700;
}
#sidebar .user-chip .meta { min-width: 0; }
#sidebar .user-chip .meta b { display: block; color: #e2e8f5; font-size: 12.5px; font-weight: 600; }
#sidebar .user-chip .meta span { color: #64748b; font-size: 11px; }
#sidebar .foot button {
  width: 100%; background: rgba(255,255,255,.04);
  border: 1px solid rgba(148,163,184,.22); color: #b6c3d9;
  padding: 7px 10px; border-radius: var(--r-sm); cursor: pointer;
  font-size: 12.5px; font-family: inherit;
  transition: all .16s var(--ease);
}
#sidebar .foot button:hover { background: rgba(239,68,68,.14); border-color: rgba(239,68,68,.4); color: #fca5a5; }

/* ========================== 主区 ========================== */
#main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

header.top {
  position: sticky; top: 0; z-index: 15;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 13px 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
header.top .crumb { font-size: 11px; color: var(--muted); letter-spacing: .04em; margin-bottom: 1px; }
header.top h1 { font-size: 19px; font-weight: 650; letter-spacing: -.02em; line-height: 1.25; }
header.top .top-actions { display: flex; align-items: center; gap: 12px; }
header.top .user {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-2);
  background: var(--panel); border: 1px solid var(--line);
  padding: 5px 11px 5px 5px; border-radius: 99px; box-shadow: var(--sh-1);
}
header.top .user .avatar {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-grad); color: #fff; font-size: 11px; font-weight: 700;
}
.status-dot {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 99px;
  background: var(--ok-soft); color: var(--ok-ink); border: 1px solid var(--ok-line);
}
.status-dot.off { background: var(--danger-soft); color: var(--danger-ink); border-color: var(--danger-line); }
.status-dot i {
  width: 7px; height: 7px; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 0 0 currentColor; animation: pulse 2.2s var(--ease) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(16,185,129,.5); }
  70%  { box-shadow: 0 0 0 7px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

#content { padding: 24px 26px 48px; overflow: auto; flex: 1; }
#content > * { animation: fadeUp .32s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ========================== 面板 ========================== */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: var(--sh-1);
}
.panel h3 {
  font-size: 14.5px; font-weight: 650; letter-spacing: -.01em;
  margin-bottom: 14px; padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.panel h3::before {
  content: ''; width: 3px; height: 14px; border-radius: 2px;
  background: var(--brand-grad); flex-shrink: 0;
}
.panel h3 .h3-sub { font-size: 12px; font-weight: 400; color: var(--muted); }
.panel.no-head { padding-top: 0; }

/* ========================== 统计卡（KPI） ========================== */
.cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 13px; margin-bottom: 20px;
}
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 15px 16px;
  box-shadow: var(--sh-1);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
  overflow: hidden;
}
.card::after {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--brand-grad); opacity: 0; transition: opacity .18s var(--ease);
}
.card[onclick] { cursor: pointer; }
.card[onclick]:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--brand-line); }
.card[onclick]:hover::after { opacity: 1; }
.card .n {
  font-size: 27px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.card .l { color: var(--muted); font-size: 12.5px; margin-top: 3px; font-weight: 500; }
.card .kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.card .kpi-ic {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); flex-shrink: 0;
}
.card .kpi-ic svg { width: 17px; height: 17px; }
.card .kpi-unit { font-size: 13px; font-weight: 600; color: var(--muted-2); margin-left: 2px; letter-spacing: 0; }
.card.good .n { color: var(--ok); }
.card.good .kpi-ic { background: var(--ok-soft); color: var(--ok-ink); }
.card.warn .n { color: var(--warn); }
.card.warn .kpi-ic { background: var(--warn-soft); color: var(--warn-ink); }
.card.bad  .n { color: var(--danger); }
.card.bad  .kpi-ic { background: var(--danger-soft); color: var(--danger-ink); }
.card.info .n { color: var(--info); }
.card.info .kpi-ic { background: var(--info-soft); color: var(--info-ink); }
.card.violet .n { color: var(--violet); }
.card.violet .kpi-ic { background: var(--violet-soft); color: #6d28d9; }
.card.good::after { background: linear-gradient(180deg, #34d399, #10b981); }
.card.warn::after { background: linear-gradient(180deg, #fbbf24, #f59e0b); }
.card.bad::after  { background: linear-gradient(180deg, #f87171, #ef4444); }

/* ========================== 漏斗图 ========================== */
.funnel { display: flex; flex-direction: column; gap: 9px; }
.funnel-row { display: grid; grid-template-columns: 108px 1fr 72px; align-items: center; gap: 12px; }
.funnel-row .fname { font-size: 12.5px; color: var(--text-2); font-weight: 500; text-align: right; }
.funnel-row .ftrack { height: 26px; background: var(--panel-sink); border-radius: var(--r-sm); overflow: hidden; position: relative; }
.funnel-row .fbar {
  height: 100%; border-radius: var(--r-sm); min-width: 3px;
  transition: width .7s var(--ease);
  background: var(--brand-grad);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}
.funnel-row .fbar.c-ok   { background: linear-gradient(90deg, #34d399, #10b981); }
.funnel-row .fbar.c-warn { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.funnel-row .fbar.c-bad  { background: linear-gradient(90deg, #f87171, #ef4444); }
.funnel-row .fbar.c-info { background: linear-gradient(90deg, #38bdf8, #0ea5e9); }
.funnel-row .fbar.c-mute { background: linear-gradient(90deg, #cbd5e1, #94a3b8); }
.funnel-row .fval {
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--text); text-align: right;
}
.funnel-row .fval small { font-weight: 500; color: var(--muted); font-size: 11px; margin-left: 4px; }

/* 环形图 */
.ring-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.ring { position: relative; width: 132px; height: 132px; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); }
.ring .ring-center {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
}
.ring .ring-center b { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ring .ring-center span { display: block; font-size: 10.5px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.legend { display: flex; flex-direction: column; gap: 8px; min-width: 150px; }
.legend .lg { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.legend .lg i { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.legend .lg b { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; }
.legend .lg span { color: var(--text-2); }

/* 小标签组 */
.chipbar { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; padding-top: 13px; border-top: 1px dashed var(--line-strong); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; padding: 4px 10px;
  border-radius: 99px; background: var(--panel-sink);
  border: 1px solid var(--line); color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.chip b { font-weight: 700; color: var(--text); }
.chip.ok   { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok-ink); }
.chip.ok b { color: var(--ok-ink); }
.chip.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-ink); }
.chip.warn b { color: var(--warn-ink); }
.chip.bad  { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger-ink); }
.chip.bad b { color: var(--danger-ink); }
.chip.info { background: var(--info-soft); border-color: var(--info-line); color: var(--info-ink); }
.chip.info b { color: var(--info-ink); }
.chip[onclick] { cursor: pointer; transition: all .16s var(--ease); }
.chip[onclick]:hover { transform: translateY(-1px); box-shadow: var(--sh-2); }

/* ========================== 表单 ========================== */
label {
  display: block; font-size: 11.5px; color: var(--muted);
  margin: 12px 0 5px; font-weight: 600; letter-spacing: .01em;
}
input, select, textarea {
  width: 100%; padding: 8px 11px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  font-size: 13.5px; font-family: inherit; color: var(--text);
  background: #fff;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:hover, select:hover, textarea:hover { border-color: #c8d2e2; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3.5px rgba(99,102,241,.14);
  background: #fff;
}
select {
  appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
select[multiple] { padding-right: 11px; background-image: none; cursor: default; }
textarea { resize: vertical; min-height: 84px; line-height: 1.6; }
input[type="checkbox"] {
  width: 16px; height: 16px; min-width: 16px; padding: 0; cursor: pointer;
  accent-color: var(--brand); border-radius: 4px; vertical-align: -2px;
}
input[type="file"] { padding: 7px; font-size: 12.5px; }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 160px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.checkbox-row {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 8px 11px; border-radius: var(--r-sm);
  transition: background .16s var(--ease);
}
.checkbox-row:hover { background: var(--panel-sink); }
.checkbox-row label { margin: 0; font-size: 13px; color: var(--text-2); font-weight: 500; line-height: 1.5; }
.checkbox-row input { margin-top: 2px; }

/* ========================== 按钮 ========================== */
button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--brand); color: #fff; border: 1px solid transparent;
  padding: 8px 15px; border-radius: var(--r-sm);
  cursor: pointer; font-size: 13.5px; font-weight: 600; font-family: inherit;
  box-shadow: var(--sh-brand);
  transition: all .16s var(--ease);
  white-space: nowrap;
}
button.btn:hover { background: var(--brand-600); transform: translateY(-1px); box-shadow: 0 8px 20px -6px rgba(79,70,229,.6); }
button.btn:active { transform: translateY(0); box-shadow: var(--sh-1); }
button.btn:focus-visible { outline: none; box-shadow: 0 0 0 3.5px rgba(99,102,241,.25); }
button.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
button.btn.ghost {
  background: #fff; color: var(--text-2); border-color: var(--line-strong);
  box-shadow: var(--sh-1); font-weight: 500;
}
button.btn.ghost:hover { background: var(--panel-soft); color: var(--brand-ink); border-color: var(--brand-line); box-shadow: var(--sh-2); }
button.btn.green { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 6px 16px -6px rgba(16,185,129,.6); }
button.btn.green:hover { background: linear-gradient(135deg, #059669, #047857); }
button.btn.red { background: var(--danger); box-shadow: 0 6px 16px -6px rgba(239,68,68,.55); }
button.btn.red:hover { background: #dc2626; }
button.btn.amber { background: var(--warn); box-shadow: 0 6px 16px -6px rgba(245,158,11,.55); }
button.btn.amber:hover { background: #d97706; }
button.btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: var(--r-xs); box-shadow: none; font-weight: 550; }
button.btn.sm:hover { transform: none; }
button.btn.block { width: 100%; }

/* ========================== 表格 ========================== */
.table-wrap { overflow-x: auto; border-radius: var(--r); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
thead th {
  position: sticky; top: 0; z-index: 2;
  text-align: left; padding: 10px 12px;
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); background: var(--panel-sink);
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
thead th:first-child { border-radius: var(--r-sm) 0 0 0; }
thead th:last-child { border-radius: 0 var(--r-sm) 0 0; }
tbody td {
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  vertical-align: middle; color: var(--text-2);
}
tbody td b, tbody td strong { color: var(--text); }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .14s var(--ease); }
tbody tr:hover td { background: var(--panel-soft); }
tr.exp td { background: var(--brand-soft) !important; border-bottom-color: var(--brand-line); }
tr.detail td { background: var(--panel-sink) !important; padding: 0 12px; }

/* 宽表：紧凑模式 + 单元格截断，避免右侧操作列被挤掉 */
table.compact { font-size: 12.5px; }
table.compact thead th { padding: 9px 9px; letter-spacing: .03em; }
table.compact tbody td { padding: 9px 9px; }
td.nw, th.nw { white-space: nowrap; }
.ellip { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.email-txt { display: inline-block; max-width: 226px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; color: var(--text); }
table.compact .relbar { width: 54px; margin-right: 6px; }
table.compact .stage { padding: 2px 7px; font-size: 11px; }
td.nw > .stage + .stage { margin-left: 2px; }
.detail-box {
  padding: 16px 18px; font-size: 13px; line-height: 1.9;
  border-left: 3px solid var(--brand); border-radius: 0 var(--r) var(--r) 0;
  background: #fff; margin: 10px 0;
  box-shadow: var(--sh-1);
}
.detail-box a { color: var(--brand); word-break: break-all; text-decoration: none; }
.detail-box a:hover { text-decoration: underline; }
.detail-box b { color: var(--muted); font-weight: 600; font-size: 11.5px; letter-spacing: .03em; text-transform: uppercase; }
.detail-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 4px 22px; }
.detail-kv > div { min-width: 0; }

/* ========================== 标签 / 状态 ========================== */
.tag {
  display: inline-block; background: var(--brand-soft); color: var(--brand-ink);
  border: 1px solid var(--brand-line);
  border-radius: 99px; padding: 2px 9px; font-size: 11px; margin: 1px 2px; font-weight: 500;
}
.stage {
  display: inline-block; padding: 2.5px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; background: var(--panel-sink);
  border: 1px solid transparent; white-space: nowrap;
}
.stage.good { background: var(--ok-soft); color: var(--ok-ink); border-color: var(--ok-line); }
.stage.warn { background: var(--warn-soft); color: var(--warn-ink); border-color: var(--warn-line); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 600; border: 1px solid transparent; }
.pill.sent { background: var(--ok-soft); color: var(--ok-ink); border-color: var(--ok-line); }
.pill.opened { background: var(--info-soft); color: var(--info-ink); border-color: var(--info-line); }
.pill.failed { background: var(--danger-soft); color: var(--danger-ink); border-color: var(--danger-line); }

/* ========================== 即时联系方式（WhatsApp / 微信 / Telegram） ========================== */
.stage.bad { background: var(--danger-soft); color: var(--danger-ink); border-color: var(--danger-line); }
.im-cell { max-width: 186px; }
.im-pill {
  display: inline-flex; align-items: center; gap: 4px; line-height: 1.5;
  padding: 2px 8px 2px 7px; margin: 1.5px 3px 1.5px 0; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; white-space: nowrap; font-variant-numeric: tabular-nums;
  transition: background .16s var(--ease), color .16s var(--ease), transform .16s var(--ease), box-shadow .16s var(--ease);
}
.im-pill svg { width: 12px; height: 12px; flex: none; }
.im-pill.wa { background: #e8faef; color: #067a3d; border-color: #b6eccb; }
.im-pill.wa:hover { background: #25D366; color: #fff; border-color: #25D366; box-shadow: 0 2px 8px rgba(37, 211, 102, .34); transform: translateY(-1px); }
.im-pill.wx { background: #e9fbf0; color: #04703a; border-color: #bdf0d1; }
.im-pill.wx:hover { background: #07C160; color: #fff; border-color: #07C160; box-shadow: 0 2px 8px rgba(7, 193, 96, .32); transform: translateY(-1px); }
.im-pill.tg { background: #eaf6fe; color: #0b6da8; border-color: #bde0f8; }
.im-pill.tg:hover { background: #229ED9; color: #fff; border-color: #229ED9; box-shadow: 0 2px 8px rgba(34, 158, 217, .34); transform: translateY(-1px); }

/* 评分条 */
.relbar {
  width: 60px; height: 6px; background: #eef1f7; border-radius: 99px;
  overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 7px;
}
.relbar span { display: block; height: 100%; border-radius: 99px; transition: width .5s var(--ease); }
.relbar + small {
  font-size: 12px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums; vertical-align: middle;
}
.score-cell { display: flex; align-items: center; gap: 0; white-space: nowrap; }

/* ========================== 工具条 ========================== */
.toolbar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px;
}
.toolbar .field { min-width: 142px; }
.toolbar label { margin: 0 0 4px; }
.toolbar .btn { align-self: flex-end; }

/* ========================== 其它元素 ========================== */
.muted { color: var(--muted); }
.hint {
  font-size: 12px; color: var(--muted); margin-top: 7px; line-height: 1.65;
  padding-left: 10px; border-left: 2px solid var(--line-strong);
}
.hidden { display: none !important; }
.mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

/* 空状态 */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 44px 20px; color: var(--muted); text-align: center;
}
.empty svg { width: 42px; height: 42px; opacity: .38; }
.empty p { font-size: 13px; }

/* Toast */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translate(-50%, 14px);
  background: #101828; color: #fff; padding: 11px 20px; border-radius: var(--r);
  font-size: 13.5px; font-weight: 500;
  box-shadow: var(--sh-3); opacity: 0; transition: all .26s var(--ease);
  pointer-events: none; z-index: 999; max-width: 80vw;
  border: 1px solid rgba(255,255,255,.08);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ========================== 登录页 ========================== */
.login-wrap {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 82% 12%, rgba(99,102,241,.30), transparent 60%),
    radial-gradient(700px 420px at 12% 88%, rgba(14,165,233,.22), transparent 60%),
    linear-gradient(150deg, #0b1120 0%, #131e36 55%, #0b1120 100%);
  position: relative; overflow: hidden;
}
.login-wrap::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(148,163,184,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,.055) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 78%);
}
.login-box {
  position: relative; z-index: 1;
  background: rgba(255,255,255,.985);
  padding: 34px 32px 30px; border-radius: var(--r-xl);
  width: 366px; box-shadow: 0 28px 70px -18px rgba(2,6,23,.7);
  border: 1px solid rgba(255,255,255,.7);
  animation: fadeUp .45s var(--ease) both;
}
.login-box .lmark {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: var(--brand-grad); margin-bottom: 16px;
  box-shadow: 0 10px 24px -8px rgba(99,102,241,.9), inset 0 1px 0 rgba(255,255,255,.3);
}
.login-box .lmark svg { width: 26px; height: 26px; }
.login-box h2 { font-size: 21px; font-weight: 700; letter-spacing: -.025em; margin-bottom: 4px; }
.login-box .sub { font-size: 12.5px; color: var(--muted); margin-bottom: 22px; }
.login-box .err { color: var(--danger); font-size: 12.5px; margin-top: 10px; min-height: 17px; font-weight: 500; }
.login-box .foot-note {
  margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--muted); text-align: center;
}

/* ========================== 响应式 ========================== */
@media (max-width: 1080px) {
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  #sidebar { width: 68px; }
  #sidebar .brand { justify-content: center; padding: 16px 8px; }
  #sidebar .brand .txt, #sidebar .nav-sep, #sidebar .user-chip .meta { display: none; }
  #sidebar nav { padding: 10px 8px; }
  #sidebar nav a { justify-content: center; padding: 11px 0; }
  #sidebar nav a .lbl { display: none; }
  #sidebar nav a.active::before { left: -8px; }
  #sidebar .user-chip { justify-content: center; }
  #content { padding: 16px; }
  header.top { padding: 12px 16px; }
  .funnel-row { grid-template-columns: 76px 1fr 58px; gap: 8px; }
  .funnel-row .fname { font-size: 11.5px; }
}
