/* ============ 元合A7CRM ============ */
:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --line: #e7ebf3;
  --line-2: #eef2f8;
  --text: #16233a;
  --muted: #6b7a90;
  --muted-2: #93a1b5;
  --primary: #4f6ef7;
  --primary-dark: #3c58db;
  --primary-soft: #eef2ff;
  --green: #0ea472;
  --green-soft: #e6f7f1;
  --amber: #d97706;
  --amber-soft: #fef4e6;
  --red: #e2483d;
  --red-soft: #fdeceb;
  --purple: #7c5cf0;
  --purple-soft: #f1edfe;
  --cyan: #0891b2;
  --cyan-soft: #e6f7fb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -18px rgba(15, 23, 42, .35);
  --sidebar-w: 230px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 9px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- login ---------------- */
.login-wrap {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 700px at 12% 8%, #25367a 0%, transparent 55%),
              radial-gradient(900px 600px at 92% 92%, #0b6b64 0%, transparent 50%),
              #0b1226;
  padding: 24px;
}
.login-wrap::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 72%);
}
.login-card {
  position: relative; width: 900px; max-width: 100%; min-height: 520px; display: grid;
  grid-template-columns: 1.05fr .95fr; background: #fff; border-radius: 22px; overflow: hidden;
  box-shadow: 0 40px 90px -30px rgba(2, 6, 23, .7);
}
.login-brand {
  padding: 48px 44px; color: #e8eefc; display: flex; flex-direction: column;
  background: linear-gradient(155deg, #1b2a6b 0%, #101a3f 55%, #0b1226 100%);
  position: relative; overflow: hidden;
}
.login-brand::after {
  content: ""; position: absolute; width: 380px; height: 380px; border-radius: 50%;
  right: -150px; bottom: -150px; background: radial-gradient(circle, rgba(79,110,247,.55), transparent 68%);
}
.login-logo { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 18px; letter-spacing: .5px; }
.logo-mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, #6d86ff, #3f5de6); box-shadow: 0 8px 20px -6px rgba(79,110,247,.8);
}
.login-brand h1 { font-size: 30px; line-height: 1.35; margin: 44px 0 12px; font-weight: 650; letter-spacing: .5px; }
.login-brand p { color: #9fb0d8; margin: 0 0 28px; font-size: 14px; }
.login-points { display: grid; gap: 14px; margin-top: auto; font-size: 13.5px; color: #c3d0ee; }
.login-points div { display: flex; gap: 10px; align-items: center; }
.login-points svg { color: #7f9bff; flex: none; }
.login-form { padding: 56px 48px; display: flex; flex-direction: column; justify-content: center; }
.login-form h2 { margin: 0 0 6px; font-size: 24px; }
.login-form .sub { color: var(--muted); margin: 0 0 28px; font-size: 13.5px; }
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 13px; color: #43536b; font-weight: 500; }
.input, .select, .textarea {
  width: 100%; border: 1px solid #dbe2ee; background: #fff; border-radius: 10px;
  padding: 10px 12px; outline: none; transition: .15s; font-size: 14px;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,110,247,.12); }
.textarea { min-height: 84px; resize: vertical; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #dbe2ee;
  background: #fff; color: #334155; border-radius: 10px; padding: 9px 15px; cursor: pointer;
  font-size: 13.5px; font-weight: 500; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: #b9c6dd; background: #f8fafc; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, #5b78f8, #4a63e8); border-color: transparent; color: #fff; box-shadow: 0 6px 16px -8px rgba(79,110,247,.9); }
.btn.primary:hover { background: linear-gradient(135deg, #4f6ef7, #3c58db); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--line-2); color: var(--text); }
.btn.danger { color: var(--red); border-color: #f3cbc8; background: #fff; }
.btn.danger:hover { background: var(--red-soft); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; padding: 11px; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.login-tip { margin-top: 18px; font-size: 12.5px; color: var(--muted-2); background: #f8fafc; border: 1px dashed #e2e8f0; padding: 9px 12px; border-radius: 9px; }
.login-error { color: var(--red); font-size: 13px; min-height: 18px; margin-bottom: 6px; }

/* ---------------- shell ---------------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, #121c33 0%, #0c1425 100%); color: #9fb0cc;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 30;
}
.logo { display: flex; align-items: center; gap: 10px; padding: 19px 20px 17px; color: #fff; font-weight: 700; font-size: 16.5px; letter-spacing: .4px; }
.logo small { display: block; font-size: 10px; font-weight: 400; color: #6b7fa3; letter-spacing: 1.6px; margin-top: 1px; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; flex: none; }
.nav { padding: 8px 12px; display: grid; gap: 3px; overflow-y: auto; }
.nav-group { font-size: 10.5px; letter-spacing: 1.4px; color: #5b6f92; padding: 14px 10px 6px; font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9.5px 11px; border-radius: 9px; cursor: pointer;
  color: #9fb0cc; font-size: 13.5px; transition: .14s; position: relative; border: 0; background: transparent; width: 100%; text-align: left;
}
.nav-item svg { flex: none; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.055); color: #e3eafb; }
.nav-item.active { background: linear-gradient(90deg, rgba(79,110,247,.28), rgba(79,110,247,.12)); color: #fff; font-weight: 500; }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: #7c93ff; }
.nav-item .count { margin-left: auto; font-size: 11px; background: rgba(255,255,255,.09); padding: 1px 7px; border-radius: 20px; color: #c7d4ee; }
.sidebar-foot { margin-top: auto; padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.06); }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip .meta { min-width: 0; }
.user-chip .meta b { display: block; color: #e7eefc; font-size: 13px; font-weight: 500; }
.user-chip .meta span { font-size: 11.5px; color: #7e91b3; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff;
  font-size: 12.5px; font-weight: 600; flex: none; letter-spacing: .2px;
}
.avatar.lg { width: 46px; height: 46px; font-size: 16px; }
.avatar.sm { width: 24px; height: 24px; font-size: 10.5px; }
.icon-btn { border: 0; background: transparent; color: #7e91b3; cursor: pointer; padding: 5px; border-radius: 7px; display: grid; place-items: center; }
.icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px; background: rgba(255,255,255,.86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 18px; padding: 0 26px; position: sticky; top: 0; z-index: 20;
}
.crumb { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.crumb b { color: var(--text); font-weight: 600; font-size: 15px; }
.search { margin-left: auto; position: relative; width: min(360px, 38vw); }
.search .input { padding-left: 34px; height: 36px; background: #f6f8fc; border-color: transparent; }
.search .input:focus { background: #fff; }
.search svg { position: absolute; left: 11px; top: 10px; color: var(--muted-2); }
.search-results {
  position: absolute; top: 44px; left: 0; right: 0; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 20px 45px -18px rgba(15,23,42,.35); padding: 7px; display: none; max-height: 420px; overflow: auto;
}
.search-results.show { display: block; }
.sr-group { font-size: 11px; color: var(--muted-2); padding: 7px 10px 3px; letter-spacing: .5px; }
.sr-item { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; gap: 8px; align-items: center; font-size: 13px; }
.sr-item:hover { background: #f5f7fc; }
.sr-item small { margin-left: auto; color: var(--muted-2); font-size: 11.5px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.quick-wrap { position: relative; }
.quick-menu {
  position: absolute; right: 0; top: 42px; width: 170px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 6px; box-shadow: 0 20px 45px -18px rgba(15,23,42,.35); display: none; z-index: 40;
}
.quick-menu.show { display: block; }
.quick-menu button { display: flex; width: 100%; gap: 9px; align-items: center; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.quick-menu button:hover { background: #f5f7fc; }

.view { padding: 24px 26px 48px; max-width: 1560px; width: 100%; margin: 0 auto; min-width: 0; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; margin: 0; letter-spacing: .2px; }
.page-head .sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; margin: 0 0 14px; }
.section-title .more { margin-left: auto; font-size: 12.5px; color: var(--primary); cursor: pointer; font-weight: 400; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }

/* ---------------- cards / kpi ---------------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.card { min-width: 0; }
.kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.kpi { padding: 17px 18px; display: flex; gap: 13px; align-items: flex-start; position: relative; overflow: hidden; }
.kpi .chip { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.kpi .k-label { color: var(--muted); font-size: 12.5px; }
.kpi .k-value { font-size: 24px; font-weight: 650; letter-spacing: .3px; margin: 2px 0 1px; font-variant-numeric: tabular-nums; }
.kpi .k-value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.kpi .k-foot { font-size: 11.5px; color: var(--muted-2); display: flex; gap: 5px; align-items: center; }
.trend-up { color: var(--green); }
.trend-down { color: var(--red); }
.chip.blue { background: var(--primary-soft); color: var(--primary); }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.amber { background: var(--amber-soft); color: var(--amber); }
.chip.purple { background: var(--purple-soft); color: var(--purple); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.cyan { background: var(--cyan-soft); color: var(--cyan); }

/* ---------------- tables ---------------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th {
  text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; background: #f8fafc;
  padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-size: 13px; }
table.data tbody tr { transition: background .12s; cursor: default; }
table.data tbody tr:hover { background: #fafbfe; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .name-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
table.data .name-cell b { font-weight: 550; }
table.data .name-cell .sub { font-size: 11.5px; color: var(--muted-2); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .row-actions { display: flex; gap: 2px; justify-content: flex-end; opacity: 0; transition: .12s; }
table.data tr:hover .row-actions { opacity: 1; }
table.data .link { color: var(--primary); cursor: pointer; font-weight: 500; }
.table-foot { padding: 11px 16px; border-top: 1px solid var(--line-2); color: var(--muted-2); font-size: 12px; display: flex; gap: 12px; align-items: center; }
.table-foot b { color: var(--text); font-weight: 600; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 2px 9px; border-radius: 20px;
  background: #f1f5f9; color: #475569; white-space: nowrap; font-weight: 500;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .75; }
.badge.green { background: var(--green-soft); color: #047857; }
.badge.blue { background: #eaf0ff; color: #3755d6; }
.badge.amber { background: var(--amber-soft); color: #b45309; }
.badge.red { background: var(--red-soft); color: #c2342b; }
.badge.gray { background: #f1f5f9; color: #64748b; }
.badge.purple { background: var(--purple-soft); color: #6d4ae0; }
.badge.cyan { background: var(--cyan-soft); color: #0e7490; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

.toolbar { display: flex; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.toolbar .input, .toolbar .select { height: 34px; padding: 6px 11px; width: auto; min-width: 150px; }
.toolbar .grow { flex: 1; }
.toolbar .spacer { flex: 1; }
.tabs { display: flex; gap: 4px; padding: 4px; background: #f1f4fa; border-radius: 10px; }
.tab { border: 0; background: transparent; padding: 6px 13px; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 13px; }
.tab.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(15,23,42,.1); font-weight: 500; }
.seg { display: inline-flex; background: #f1f4fa; border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; cursor: pointer; color: var(--muted); font-size: 12.5px; }
.seg button.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(15,23,42,.12); }

/* ---------------- dashboard ---------------- */
.dash-grid { display: grid; gap: 16px; grid-template-columns: 1.55fr 1fr; }
.dash-grid.three { grid-template-columns: 1fr 1fr; }
.funnel-row { display: grid; grid-template-columns: 82px 1fr 96px; gap: 12px; align-items: center; margin-bottom: 14px; }
.funnel-row:last-child { margin-bottom: 0; }
.funnel-label { font-size: 12.5px; color: #475569; }
.funnel-track { height: 26px; background: #f1f5f9; border-radius: 7px; overflow: hidden; }
.funnel-bar { height: 100%; border-radius: 7px; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; color: #fff; font-size: 11px; min-width: 28px; transition: width .5s ease; }
.funnel-val { text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.funnel-val b { font-weight: 600; }
.funnel-val span { display: block; font-size: 11px; color: var(--muted-2); }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 14px; font-size: 12px; color: var(--muted); }
.legend i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; margin-right: 6px; }
.rank-row { display: grid; grid-template-columns: 20px 30px 1fr auto; gap: 9px; align-items: center; margin-bottom: 12px; }
.rank-row:last-child { margin-bottom: 0; }
.rank-no { font-size: 12px; color: var(--muted-2); font-weight: 600; text-align: center; }
.rank-no.top { color: var(--amber); }
.rank-name { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-bar { height: 6px; border-radius: 6px; background: #f1f5f9; overflow: hidden; margin-top: 5px; }
.rank-bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #6b86fa, #4f6ef7); }
.rank-val { font-size: 12px; font-variant-numeric: tabular-nums; color: #334155; }

.task-item { display: flex; gap: 11px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.task-item:last-child { border-bottom: 0; padding-bottom: 0; }
.task-item:first-child { padding-top: 2px; }
.task-check { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid #cbd5e1; flex: none; margin-top: 2px; cursor: pointer; display: grid; place-items: center; color: transparent; background: #fff; }
.task-check:hover { border-color: var(--primary); color: var(--primary); }
.task-item .t-body { min-width: 0; flex: 1; }
.task-item .t-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-item .t-meta { font-size: 11.5px; color: var(--muted-2); display: flex; gap: 8px; align-items: center; margin-top: 2px; flex-wrap: wrap; }
.task-item .t-time { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.task-item.overdue .t-time { color: var(--red); }
.task-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; }

.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 14px 0; font-size: 12.5px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: -17px; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: #c7d2fe; border: 2px solid #fff; box-shadow: 0 0 0 1px #e2e8f0; }
.tl-item b { font-weight: 550; }
.tl-item .tl-time { color: var(--muted-2); font-size: 11px; margin-top: 2px; }

.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut { width: 132px; height: 132px; border-radius: 50%; position: relative; flex: none; }
.donut::after { content: ""; position: absolute; inset: 26px; background: #fff; border-radius: 50%; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; z-index: 2; line-height: 1.2; }
.donut-center b { display: block; font-size: 20px; font-weight: 650; }
.donut-center span { font-size: 10.5px; color: var(--muted-2); }
.donut-legend { display: grid; gap: 7px; font-size: 12px; flex: 1; min-width: 0; }
.donut-legend div { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.donut-legend i { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.donut-legend b { margin-left: auto; color: var(--text); font-weight: 550; }

/* ---------------- charts ---------------- */
.chart-box { width: 100%; }
.chart-box svg { display: block; width: 100%; height: auto; }
.axis-label { font-size: 10px; fill: #94a3b8; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); justify-content: flex-end; margin-bottom: 4px; }
.chart-legend i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; margin-right: 5px; }

.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 190px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-stack { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.bar-stack i { width: 9px; border-radius: 4px 4px 2px 2px; min-height: 2px; display: block; transition: height .5s; }
.bar-col span { font-size: 10.5px; color: var(--muted-2); white-space: nowrap; }

/* ---------------- kanban ---------------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: 268px; gap: 13px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.kcol { background: #edf1f9; border-radius: 13px; padding: 10px; min-height: 220px; border: 1px solid #e3e9f4; }
.kcol.drag-over { background: #e3eaff; box-shadow: inset 0 0 0 2px #b9c8fb; }
.kcol-head { display: flex; align-items: center; gap: 7px; padding: 2px 4px 10px; font-size: 12.5px; font-weight: 600; color: #3f4f66; }
.kcol-head .n { margin-left: auto; font-size: 11px; color: var(--muted-2); background: #fff; border-radius: 20px; padding: 0 7px; }
.kcol-head .sum { font-size: 11px; color: var(--muted); font-weight: 400; }
.kcard { background: #fff; border: 1px solid #e5eaf4; border-radius: 10px; padding: 11px 12px; margin-bottom: 9px; cursor: grab; box-shadow: 0 1px 2px rgba(15,23,42,.04); transition: .12s; }
.kcard:hover { border-color: #c3cffa; box-shadow: 0 6px 16px -10px rgba(15,23,42,.4); transform: translateY(-1px); }
.kcard.dragging { opacity: .45; }
.kcard .k-title { font-size: 12.8px; font-weight: 550; line-height: 1.45; margin-bottom: 6px; }
.kcard .k-acc { font-size: 11.5px; color: var(--muted-2); margin-bottom: 8px; display: flex; align-items: center; gap: 5px; }
.kcard .k-amt { font-size: 14px; font-weight: 650; color: #1e293b; letter-spacing: .2px; }
.kcard .k-foot { display: flex; align-items: center; gap: 6px; margin-top: 9px; padding-top: 8px; border-top: 1px dashed #eef2f8; font-size: 11px; color: var(--muted-2); }
.kcard .k-foot .ml { margin-left: auto; display: flex; align-items: center; gap: 5px; }
.kbar { height: 3px; background: #eef2f8; border-radius: 3px; margin-top: 8px; overflow: hidden; }
.kbar i { display: block; height: 100%; border-radius: 3px; }
.kcard .k-date.overdue { color: var(--red); }

/* ---------------- detail ---------------- */
.detail-hero { padding: 20px 22px; display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.detail-hero .avatar { border-radius: 14px; }
.detail-hero h1 { font-size: 20px; margin: 0 0 5px; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.detail-hero .meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; }
.detail-hero .meta span { display: inline-flex; gap: 5px; align-items: center; }
.detail-stats { display: flex; margin-left: auto; gap: 26px; flex-wrap: wrap; }
.detail-stats div { text-align: right; }
.detail-stats b { display: block; font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; }
.detail-stats span { font-size: 11.5px; color: var(--muted-2); }
.detail-tabs { display: flex; gap: 24px; padding: 0 22px; border-bottom: 1px solid var(--line); margin-top: 6px; overflow-x: auto; }
.detail-tabs button { border: 0; background: transparent; padding: 11px 2px; color: var(--muted); cursor: pointer; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.detail-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 550; }
.detail-body { padding: 20px 22px; }
.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px 26px; }
.info-grid .k { font-size: 11.5px; color: var(--muted-2); margin-bottom: 3px; }
.info-grid .v { font-size: 13px; }
.info-grid .full { grid-column: 1 / -1; }

/* ---------------- modal ---------------- */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); backdrop-filter: blur(2px); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 18px 30px; overflow-y: auto; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 16px; width: 640px; max-width: 100%; box-shadow: 0 30px 70px -20px rgba(2,6,23,.55); animation: pop .18s; }
@keyframes pop { from { transform: translateY(8px) scale(.985); opacity: 0; } }
.modal.wide { width: 820px; }
.modal-head { display: flex; align-items: center; padding: 17px 22px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-head .x { margin-left: auto; }
.modal-body { padding: 20px 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 9px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .field { margin: 0; }
.form-grid .span2 { grid-column: 1 / -1; }
.form-grid .hint { font-size: 11.5px; color: var(--muted-2); margin-top: -2px; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; padding-top: 6px; }
.check-row input { width: 16px; height: 16px; accent-color: var(--primary); }

/* ---------------- toast / empty ---------------- */
.toast-root { position: fixed; top: 18px; right: 18px; z-index: 200; display: grid; gap: 8px; }
.toast { background: #101a2e; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; box-shadow: 0 12px 30px -12px rgba(0,0,0,.5); display: flex; gap: 8px; align-items: center; animation: slide .2s; }
.toast.ok { background: #0e7a56; }
.toast.err { background: #b52f27; }
@keyframes slide { from { transform: translateY(-8px); opacity: 0; } }
.empty { text-align: center; padding: 46px 20px; color: var(--muted-2); }
.empty .big { font-size: 34px; margin-bottom: 8px; opacity: .55; }
.empty p { margin: 0; font-size: 13px; }

.loading { padding: 60px 0; text-align: center; color: var(--muted-2); }
.spinner { width: 26px; height: 26px; border: 3px solid #e2e8f0; border-top-color: var(--primary); border-radius: 50%; margin: 0 auto 10px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { background: linear-gradient(90deg, #eef2f8 25%, #f7f9fc 37%, #eef2f8 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 10px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---------------- responsive ---------------- */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dash-grid, .dash-grid.three { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 66px; }
  .logo span, .logo small, .nav-item span, .nav-item .count, .sidebar-foot .meta, .nav-group { display: none; }
  .logo { justify-content: center; padding: 16px 0; }
  .nav { padding: 8px; }
  .nav-item { justify-content: center; padding: 11px 0; }
  .nav-item.active::before { left: -8px; }
  .sidebar-foot { padding: 12px 0; display: grid; place-items: center; }
  .search { width: 200px; }
  .view { padding: 18px 16px 40px; }
  .detail-stats { margin-left: 0; gap: 18px; }
  .login-card { grid-template-columns: 1fr; min-height: 0; }
  .login-brand { display: none; }
  .login-form { padding: 40px 28px; }
}
@media (max-width: 640px) {
  .search { display: none; }
  .topbar { padding: 0 14px; gap: 10px; }
  .page-head h1 { font-size: 18px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr 1fr; }
  .detail-tabs { gap: 16px; }
  .chart-legend { display: none; }
}

/* ---------------- mobile 适配（390px） ---------------- */
@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr !important; }
  .bar-chart { overflow-x: auto; gap: 6px; padding-bottom: 2px; }
  .bar-col { min-width: 20px; }
  .bar-col span { font-size: 9px; }
  .card-pad { padding: 14px; }
}

/* ---------------- daily follow-up board ---------------- */
.daily-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.daily-head .input { height: 32px; padding: 0 8px; }
.daily-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.daily-stat { display: flex; align-items: center; justify-content: space-between; background: #f8fafc; border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; }
.daily-stat span { font-size: 12px; color: var(--muted); }
.daily-stat b { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.daily-row { cursor: pointer; }
.daily-row.active { background: #eef2ff !important; }
.daily-detail { margin-top: 14px; border-top: 1px solid var(--line-2); padding-top: 12px; }
.daily-detail .timeline { max-height: 260px; overflow-y: auto; }
@media (max-width: 760px) {
  .daily-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .daily-head .section-title { width: 100%; }
}

/* AI Token 多模型报价行 */
.token-lines { display:flex; flex-direction:column; gap:8px; }
.token-line { display:grid; grid-template-columns: 1.05fr 1.35fr .72fr .88fr .78fr 34px; gap:8px; align-items:end; padding:10px; border:1px solid #e6ecf7; background:#f8faff; border-radius:10px; }
.token-line .tl-cell { min-width:0; }
.token-line .tl-cell label { display:block; font-size:11px; line-height:1.4; color:#64748b; margin-bottom:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.token-line .select, .token-line .input { width:100%; height:38px; }
.tl-discount-wrap { position:relative; display:flex; align-items:center; }
.tl-discount-wrap input { padding-right:26px; }
.tl-discount-wrap span { position:absolute; right:10px; font-size:12px; color:#64748b; pointer-events:none; }
.tl-cost { min-height:38px; display:flex; align-items:center; padding:0 9px; border-radius:8px; background:#ecfdf5; color:#0e9f6e; font-size:12px; line-height:1.35; }
.token-lines-foot { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:8px; }
.tl-remove { margin-bottom:3px; color:#94a3b8; }
.tl-remove:hover { color:#e2483d; background:#fef2f2; }
@media (max-width:760px) {
  .token-line { grid-template-columns:1fr 1fr; padding:9px; }
  .token-line .tl-cell:nth-child(3), .token-line .tl-cell:nth-child(4), .token-line .tl-cell:nth-child(5) { grid-column:span 1; }
  .token-line .tl-remove { grid-column:2; justify-self:end; margin-bottom:0; }
}

/* ---------------- 渠道平台：渠道卡片 / 渠道详情 ---------------- */
.channel-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; padding:4px 16px 16px; }
.channel-card { position:relative; padding:15px 16px 12px; cursor:pointer; transition:border-color .15s, box-shadow .15s, transform .15s; }
.channel-card:hover { border-color:#b9c8f5; box-shadow:0 8px 24px rgba(79,110,247,.12); transform:translateY(-1px); }
.channel-card-top { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.channel-id { min-width:0; }
.channel-name { font-weight:650; font-size:14.5px; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.channel-company { font-size:11.5px; color:var(--muted-2); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.channel-best { margin-top:13px; padding:10px 12px; border-radius:10px; background:linear-gradient(135deg,#f0fdf4,#ecfdf5); border:1px solid #d1fae5; }
.channel-best-label { font-size:10.5px; letter-spacing:.4px; color:#0e9f6e; margin-bottom:3px; }
.channel-best-main { display:flex; align-items:baseline; justify-content:space-between; gap:10px; }
.channel-best-main b { font-size:13.5px; color:#065f46; font-weight:650; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.channel-best-main span { flex:none; font-size:14px; font-weight:700; color:#059669; font-variant-numeric:tabular-nums; }
.channel-best-empty { font-size:12px; color:#94a3b8; }
.channel-stats { display:flex; align-items:center; gap:13px; flex-wrap:wrap; margin-top:12px; font-size:11.5px; color:var(--muted); }
.channel-stats b { color:var(--ink); font-weight:650; }
.channel-card-foot { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:10px; padding-top:9px; border-top:1px solid var(--line-2); }
.channel-card-foot .tiny { min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.channel-open { flex:none; font-size:11.5px; color:var(--primary); }
.channel-card-actions { display:flex; justify-content:flex-end; align-items:center; gap:6px; margin-top:7px; }
.channel-detail-grid { grid-template-columns:minmax(260px,.78fr) minmax(0,1.65fr); align-items:start; }
.channel-detail-grid .card { min-width:0; }
.channel-detail-grid .section-title { margin-bottom:12px; }
.channel-detail-grid .info-grid { grid-template-columns:1fr 1fr; gap:13px 18px; }
@media (max-width:1180px) { .channel-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:760px) {
  .channel-grid { grid-template-columns:1fr; padding:4px 12px 12px; }
  .channel-detail-grid { grid-template-columns:1fr; }
}
.channel-best-sub { margin-top:4px; font-size:10.5px; color:#6b9e87; }
.radio-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.radio-pill { display:inline-flex; align-items:center; gap:6px; padding:8px 11px; border:1px solid var(--line); border-radius:9px; background:#fff; font-size:12.5px; color:#43536b; cursor:pointer; }
.radio-pill input { accent-color:var(--primary); margin:0; }
.radio-pill:has(input:checked) { border-color:#9db0f8; background:#eef3ff; color:#3755d6; font-weight:600; }
@media (max-width:640px) { .radio-pill { flex:1 1 calc(33.33% - 6px); justify-content:center; padding:8px 6px; } }
.kcard .k-convert { width:100%; margin-top:8px; justify-content:center; }
