/* Teduh Khairat — Konsol Pentadbiran */
@font-face { font-family: 'Playfair Display'; src: url('fonts/PlayfairDisplay.ttf') format('truetype'); font-weight: 400 900; font-display: swap; }

:root {
  --emerald-900: #0b2e23;
  --emerald-800: #0f3d2e;
  --emerald-700: #14523d;
  --emerald-600: #1b6a4f;
  --chart: #16865f;
  --gold: #b8975a;
  --gold-soft: #e9dcc0;
  --ivory: #f7f4ee;
  --surface: #ffffff;
  --line: #e6e1d6;
  --line-strong: #d4ccbb;
  --text: #1c2320;
  --text-2: #56605b;
  --text-3: #8a918c;
  --ok: #1e7b4f;   --ok-bg: #e5f2ea;
  --warn: #9a6400; --warn-bg: #fbf0d9;
  --risk: #b4461f; --risk-bg: #fbe7de;
  --crit: #b3261e; --crit-bg: #f9e1df;
  --info: #2b5c8a; --info-bg: #e3edf6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 61, 46, .06), 0 4px 16px rgba(15, 61, 46, .05);
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); font-size: 14px; color: var(--text); background: var(--ivory); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--emerald-600); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 登录 ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { position: relative; background: var(--emerald-800); color: #f3ecdc; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.login-art::before { content: ''; position: absolute; inset: 0; background-image: url('pattern.svg'); background-size: 120px; opacity: .08; }
.login-art > * { position: relative; }
.login-art h1 { font-family: var(--serif); font-weight: 500; font-size: 40px; line-height: 1.2; margin: 0 0 16px; letter-spacing: .2px; }
.login-art p { color: #cfc6b1; max-width: 440px; line-height: 1.7; margin: 0; }
.login-art .verse { border-left: 2px solid var(--gold); padding-left: 16px; font-family: var(--serif); font-style: italic; color: #e2d6bb; font-size: 16px; line-height: 1.7; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 40px; height: 40px; }
.brand b { font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: .5px; }
.brand small { display: block; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--gold); }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-family: var(--serif); font-weight: 500; font-size: 28px; margin: 0 0 6px; }
.login-card .sub { color: var(--text-2); margin: 0 0 28px; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; letter-spacing: .3px; }
.input, select.input, textarea.input { width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.input:focus { outline: none; border-color: var(--emerald-600); box-shadow: 0 0 0 3px rgba(27, 106, 79, .12); }
textarea.input { resize: vertical; min-height: 72px; }
.error { background: var(--crit-bg); color: var(--crit); padding: 10px 12px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.muted { color: var(--text-3); font-size: 12px; }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line-strong); background: #fff; cursor: pointer; font-weight: 600; font-size: 13px; transition: background .15s, border-color .15s; white-space: nowrap; }
.btn:hover { background: var(--ivory); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--emerald-700); border-color: var(--emerald-700); color: #fff; }
.btn-primary:hover { background: var(--emerald-800); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn-gold:hover { background: #a3834a; }
.btn-danger { color: var(--crit); border-color: #e7c3c0; }
.btn-danger:hover { background: var(--crit-bg); }
.btn-block { width: 100%; padding: 12px; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-ghost { border-color: transparent; background: transparent; }

/* ---------- 布局 ---------- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--emerald-800); color: #d9d1bf; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side .brand { padding: 22px 20px; border-bottom: 1px solid rgba(233, 220, 192, .12); color: #f3ecdc; }
.nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.nav-group { font-size: 10px; letter-spacing: 1.6px; text-transform: uppercase; color: #8fa89c; padding: 14px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: #d9d1bf; text-decoration: none; font-size: 13.5px; }
.nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav a.active { background: rgba(184, 151, 90, .16); color: #fff; box-shadow: inset 2px 0 0 var(--gold); }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav .count { margin-left: auto; background: var(--gold); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 10px; }
.side-foot { padding: 14px 20px; border-top: 1px solid rgba(233, 220, 192, .12); font-size: 12px; }
.side-foot b { color: #f3ecdc; display: block; font-size: 13px; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 18px 32px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar h1 { font-family: var(--serif); font-weight: 500; font-size: 22px; margin: 0; }
.topbar .crumb { color: var(--text-3); font-size: 12px; }
.topbar .spacer { flex: 1; }
.clock { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 12px; text-align: right; }
.lang { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.lang button { border: 0; background: #fff; padding: 6px 10px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--text-2); }
.lang button.on { background: var(--emerald-700); color: #fff; }
.content { padding: 28px 32px 48px; max-width: 1440px; }

/* ---------- 卡片与 KPI ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-h h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-h .muted { margin-left: auto; }
.card-b { padding: 20px; }
.grid { display: grid; gap: 20px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-21 { grid-template-columns: 2fr 1fr; }
.kpi { padding: 18px 20px; }
.kpi .label { font-size: 12px; color: var(--text-2); font-weight: 600; letter-spacing: .2px; }
.kpi .value { font-size: 30px; font-weight: 700; margin: 8px 0 4px; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.kpi .foot { font-size: 12px; color: var(--text-3); }
.kpi.hero { background: var(--emerald-800); border-color: var(--emerald-800); color: #f3ecdc; position: relative; overflow: hidden; }
.kpi.hero::after { content: ''; position: absolute; right: -30px; top: -30px; width: 140px; height: 140px; background: url('pattern.svg'); background-size: 70px; opacity: .1; }
.kpi.hero .label { color: var(--gold-soft); }
.kpi.hero .value { font-size: 48px; color: #fff; }
.kpi.hero .foot { color: #b9c7bf; }

/* ---------- 表格 ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .input { width: auto; min-width: 260px; }
.toolbar .spacer { flex: 1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-strong); background: #fff; padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--text-2); }
.chip.on { background: var(--emerald-700); border-color: var(--emerald-700); color: #fff; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-3); font-weight: 600; background: #fbfaf7; position: sticky; top: 0; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #faf8f3; }
tbody tr:last-child td { border-bottom: 0; }
td .sub { display: block; color: var(--text-3); font-size: 12px; margin-top: 2px; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 12.5px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { text-align: center; color: var(--text-3); padding: 40px; }

/* ---------- 状态标签（颜色 + 图标 + 文字）---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: #eef0ee; color: var(--text-2); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-risk { background: var(--risk-bg); color: var(--risk); }
.b-crit { background: var(--crit-bg); color: var(--crit); }
.b-info { background: var(--info-bg); color: var(--info); }
.b-gold { background: #f5eddc; color: #87672d; }

/* ---------- SLA 计时 ---------- */
.sla { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.sla-bar { flex: 1; height: 6px; background: #eeebe3; border-radius: 3px; overflow: hidden; }
.sla-bar i { display: block; height: 100%; border-radius: 3px; background: var(--ok); }
.sla.risk .sla-bar i { background: var(--warn); }
.sla.breach .sla-bar i { background: var(--crit); }
.sla-t { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; min-width: 64px; }
.sla.risk .sla-t { color: var(--warn); }
.sla.breach .sla-t { color: var(--crit); }
.sla-list .row { display: grid; grid-template-columns: 1fr 190px; gap: 16px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); cursor: pointer; }
.sla-list .row:hover { background: #faf8f3; }
.sla-list .row:last-child { border-bottom: 0; }

/* ---------- 图表 ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: #eeebe3; stroke-width: 1; }
.chart .axis-t { fill: var(--text-3); font-size: 11px; }
.chart .bar { fill: var(--chart); }
.chart .bar-hit { fill: transparent; cursor: default; }
.chart .bar-hit:hover + .bar, .chart .bar.hl { fill: #0f6b4b; }
.chart .val-t { fill: var(--text-2); font-size: 11px; font-weight: 600; }
.tip { position: absolute; pointer-events: none; background: #1c2320; color: #fff; padding: 8px 10px; border-radius: 6px; font-size: 12px; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .1s; z-index: 3; }
.tip b { display: block; font-size: 14px; }
.hbar { display: grid; grid-template-columns: 150px 1fr 40px; gap: 12px; align-items: center; margin-bottom: 12px; font-size: 13px; }
.hbar .track { height: 10px; background: #f1eee7; border-radius: 0 4px 4px 0; }
.hbar .track i { display: block; height: 100%; background: var(--chart); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar .n { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.link-btn { background: none; border: 0; color: var(--emerald-600); cursor: pointer; font-size: 12px; font-weight: 600; padding: 0; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- 抽屉（详情）---------- */
.drawer-bg { position: fixed; inset: 0; background: rgba(11, 46, 35, .35); z-index: 20; animation: fade .15s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(880px, 96vw); background: var(--ivory); z-index: 21; display: flex; flex-direction: column; box-shadow: -8px 0 32px rgba(0, 0, 0, .15); animation: slide .2s ease-out; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer-h { background: var(--surface); padding: 20px 28px; border-bottom: 1px solid var(--line); display: flex; gap: 16px; align-items: flex-start; }
.drawer-h h2 { font-family: var(--serif); font-weight: 500; font-size: 22px; margin: 4px 0 6px; }
.drawer-h .close { margin-left: auto; }
.drawer-b { padding: 24px 28px; overflow-y: auto; flex: 1; }
.drawer-f { background: var(--surface); border-top: 1px solid var(--line); padding: 14px 28px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; margin: 0; font-size: 13px; }
.dl dt { color: var(--text-3); }
.dl dd { margin: 0; font-weight: 500; }
.section-t { font-size: 11px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--text-3); font-weight: 700; margin: 0 0 12px; }

/* 流程步骤 */
.steps { display: flex; margin: 4px 0 24px; }
.step { flex: 1; text-align: center; position: relative; font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.step::before { content: ''; position: absolute; top: 11px; left: -50%; right: 50%; height: 2px; background: var(--line-strong); }
.step:first-child::before { display: none; }
.step .dot { position: relative; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 2px solid var(--line-strong); margin: 0 auto 8px; display: grid; place-items: center; font-size: 11px; }
.step.done { color: var(--emerald-700); }
.step.done::before, .step.cur::before { background: var(--emerald-600); }
.step.done .dot { background: var(--emerald-600); border-color: var(--emerald-600); color: #fff; }
.step.cur { color: var(--text); }
.step.cur .dot { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(184, 151, 90, .2); }

/* 时间线 */
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { position: relative; padding: 0 0 18px 24px; font-size: 13px; }
.tl li::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: -6px; width: 1px; background: var(--line-strong); }
.tl li:last-child::before { display: none; }
.tl li::after { content: ''; position: absolute; left: 0; top: 4px; width: 11px; height: 11px; border-radius: 50%; background: #fff; border: 2px solid var(--emerald-600); }
.tl li.internal::after { border-color: var(--gold); }
.tl .when { color: var(--text-3); font-size: 12px; }
.tl .note { color: var(--text-2); margin-top: 2px; }

/* 文件 */
.doc { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.doc:last-child { border-bottom: 0; }
.doc .ico { width: 34px; height: 34px; border-radius: 8px; background: var(--ivory); display: grid; place-items: center; flex: none; color: var(--emerald-600); }
.doc .name { flex: 1; }
.doc .req { color: var(--crit); font-size: 11px; font-weight: 700; margin-left: 4px; }

/* 模态 */
.modal-bg { position: fixed; inset: 0; background: rgba(11, 46, 35, .4); z-index: 30; display: grid; place-items: center; animation: fade .15s; }
.modal { background: #fff; border-radius: 12px; width: min(460px, 92vw); box-shadow: 0 20px 60px rgba(0, 0, 0, .2); }
.modal-h { padding: 20px 24px 0; }
.modal-h h3 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 20px; }
.modal-b { padding: 16px 24px; }
.modal-f { padding: 0 24px 20px; display: flex; justify-content: flex-end; gap: 10px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--emerald-900); color: #fff; padding: 12px 20px; border-radius: 8px; z-index: 40; font-size: 13px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); animation: fade .2s; }
.toast.err { background: var(--crit); }
.banner { background: #fbf5e7; border: 1px solid var(--gold-soft); color: #6f5523; border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 20px; display: flex; gap: 10px; align-items: center; }

@media (max-width: 1100px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-21, .g-3 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .nav { display: flex; overflow-x: auto; padding: 8px; }
  .nav-group, .side-foot { display: none; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
  .g-2 { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ===== 在线客服 ===== */
.chat { display: grid; grid-template-columns: 340px 1fr; gap: 18px; height: calc(100vh - 170px); min-height: 520px; }
.chat .card { display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.chat-list-h { padding: 14px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.chat-list-h .chips { flex-wrap: wrap; }
.chat-items { overflow-y: auto; flex: 1; }
.chat-item { width: 100%; display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 0; border-bottom: 1px solid var(--line); background: #fff; text-align: left; cursor: pointer; font: inherit; color: inherit; position: relative; }
.chat-item:hover { background: #faf8f3; }
.chat-item.on { background: #f1f6f3; box-shadow: inset 3px 0 0 var(--emerald-700, #14523d); }
.chat-item .av, .room-h .av { width: 40px; height: 40px; border-radius: 50%; background: #e7f0ec; color: #14523d; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 14px; }
.ci-m { flex: 1; min-width: 0; display: grid; gap: 3px; }
.ci-top { display: flex; justify-content: space-between; gap: 8px; }
.ci-top b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-top small { color: #8a918c; font-size: 11.5px; white-space: nowrap; }
.ci-prev { font-size: 13px; color: #55605b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-tags { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.chat-item .count { position: absolute; right: 12px; bottom: 14px; }
.chat-room { min-width: 0; }
.chat-empty { align-items: center; justify-content: center; text-align: center; background: #fbfaf6; }
.chat-empty b { font-size: 20px; color: #0f3d2e; }
.room-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.room-h b { font-size: 17px; color: #0f3d2e; }
.room-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 250px; }
.msgs { overflow-y: auto; padding: 18px; background: #f7f4ee; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; flex-direction: column; max-width: 74%; }
.msg.in { align-self: flex-start; }
.msg.out { align-self: flex-end; align-items: flex-end; }
.bubble { padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.55; word-break: break-word; }
.msg.in .bubble { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.out .bubble { background: #14523d; color: #fff; border-bottom-right-radius: 4px; }
.msg.note .bubble { background: #fbf3dc; color: #6b5220; border: 1px dashed #b8975a; }
.note-l { display: block; font-size: 11px; font-weight: 700; margin-bottom: 3px; }
.msg .meta { font-size: 11px; color: #8a918c; margin-top: 4px; padding: 0 4px; }
.msg-sys { align-self: center; font-size: 12px; color: #8a918c; background: #eeebe3; padding: 4px 12px; border-radius: 999px; text-align: center; max-width: 86%; }
.msg-img { color: inherit; text-decoration: underline; }
.room-side { border-left: 1px solid var(--line); padding: 14px; overflow-y: auto; background: #fff; }
.room-side .dl { margin: 0 0 12px; }
.side-link { display: flex; flex-direction: column; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; text-decoration: none; color: inherit; font-size: 13px; }
.side-link:hover { border-color: #b8975a; }
.side-link small { color: #8a918c; }
.composer { border-top: 1px solid var(--line); padding: 12px 16px; background: #fff; }
.composer.is-note { background: #fffaf0; }
.composer .chips { flex-wrap: wrap; }
.comp-row { display: flex; gap: 10px; align-items: flex-end; }
.comp-row textarea { flex: 1; resize: vertical; min-height: 64px; height: auto; padding: 10px 12px; font: inherit; }
.comp-btns { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.note-tg { font-size: 12.5px; color: #55605b; display: flex; gap: 6px; align-items: center; white-space: nowrap; cursor: pointer; }
.composer > small { display: block; margin-top: 6px; font-size: 11.5px; }
@media (max-width: 1100px) { .room-body { grid-template-columns: 1fr; } .room-side { display: none; } }
@media (max-width: 820px) {
  .chat { grid-template-columns: 1fr; height: auto; }
  .chat-list { max-height: 45vh; }
  .chat-room { height: 75vh; }
  .msg { max-width: 88%; }
}

/* ===== 平台扩展：机构标识、背书、漏斗、模块 ===== */
.tenant-chip { margin: 0 16px 10px; padding: 8px 12px; border-radius: 10px; background: rgba(255,255,255,.06); border: 1px solid rgba(233,220,192,.18); display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: #e9dcc0; }
.tenant-chip i { width: 10px; height: 10px; border-radius: 3px; background: var(--tc); flex-shrink: 0; box-shadow: 0 0 0 2px rgba(255,255,255,.15); }
.tenant-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.powered { font-size: 11px; letter-spacing: .3px; color: rgba(233,220,192,.55); margin-top: 8px; }
.funnel { display: grid; gap: 8px; }
.funnel .fs { display: grid; grid-template-columns: 110px 1fr 48px; gap: 12px; align-items: center; font-size: 13px; }
.funnel .fs .bar { height: 30px; border-radius: 8px; background: var(--emerald-700); display: flex; align-items: center; padding-left: 10px; color: #fff; font-weight: 600; font-size: 12px; min-width: 34px; transition: width .3s; }
.funnel .fs.lost .bar { background: #c9c3b6; color: #56605b; }
.funnel .fs .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }
.tree { list-style: none; margin: 0; padding: 0; }
.tree ul { list-style: none; margin: 0; padding-left: 22px; border-left: 1px dashed var(--line-strong); margin-left: 9px; }
.tree li { padding: 5px 0; }
.tree .node { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 13px; }
.tree .node .lv { font-size: 10.5px; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: .4px; }
.tree .node .ct { color: var(--text-3); font-size: 12px; }
.lvl-path { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; }
.lvl-path span { padding: 3px 9px; border-radius: 999px; background: #f4ecdb; color: #8a6d35; font-weight: 600; }
.lvl-path i { color: var(--text-3); font-style: normal; }
.tenant-card { border-top: 4px solid var(--tc, var(--emerald-700)); }
.tenant-head { display: flex; gap: 12px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.tenant-logo { width: 42px; height: 42px; border-radius: 12px; background: var(--tc); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.mini-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.mini-kpis > div { background: #fff; padding: 12px 14px; }
.mini-kpis b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.mini-kpis small { color: var(--text-3); font-size: 11.5px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.sd-ok { background: #2e9e6a; } .sd-warn { background: #d4a017; } .sd-off { background: #b7b1a5; } .sd-crit { background: #c0392b; }
.code-pill { font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 12px; background: #f3f1ec; padding: 2px 7px; border-radius: 6px; }
.split-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: #fbf6ea; border: 1px dashed var(--gold); color: #6b5220; font-size: 13px; margin-bottom: 20px; }
.mt20 { margin-top: 20px; } .mb20 { margin-bottom: 20px; }
@media (max-width: 900px) { .mini-kpis { grid-template-columns: repeat(2, 1fr); } .funnel .fs { grid-template-columns: 90px 1fr 36px; } }

/* 表格内的紧凑下拉框（阶段、分配客服等） */
select.input-sm {
  width: auto; min-width: 128px; height: 34px; padding: 0 32px 0 12px; line-height: 32px;
  font-size: 13px; font-weight: 600; color: var(--text); background-color: #fff;
  border: 1px solid var(--line-strong); border-radius: 8px; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2356605b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
select.input-sm:hover { border-color: var(--emerald-600); }
select.input-sm:focus { outline: none; border-color: var(--emerald-600); box-shadow: 0 0 0 3px rgba(27, 106, 79, .12); }
select.input-sm option { color: #1c2320; font-weight: 500; }
select.input-sm.st-LEAD { background-color: #eef4fa; color: #2f5f8a; border-color: #c9dbec; }
select.input-sm.st-ENGAGED { background-color: #f7f0e1; color: #7a5e2a; border-color: #e6d4ae; }
select.input-sm.st-REGISTERED { background-color: #fdf3e0; color: #8a5a0f; border-color: #edd3a0; }
select.input-sm.st-PAID, select.input-sm.st-ACTIVE { background-color: #e7f4ec; color: #1f6e46; border-color: #bfe0cc; }
select.input-sm.st-LOST { background-color: #efede8; color: #56605b; }
