:root {
  --primary: #4f7afd;
  --primary-dark: #3b60d8;
  --primary-soft: #eef3ff;
  --green: #16a34a;
  --green-soft: #e9f9ef;
  --orange: #f59e0b;
  --orange-soft: #fff7e8;
  --red: #ef4444;
  --red-soft: #fdeeee;
  --purple: #8b5cf6;
  --purple-soft: #f2edff;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --faint: #9aa3b2;
  --line: #edf0f7;
  --line-2: #e3e8f2;
  --radius: 12px;
  --shadow: 0 6px 24px rgba(31, 45, 80, .06);
  --shadow-lg: 0 18px 50px rgba(31, 45, 80, .16);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }
a { color: var(--primary); text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.flex { display: flex; align-items: center; }
.between { display: flex; align-items: center; justify-content: space-between; }
.gap8 { gap: 8px; }
.gap12 { gap: 12px; }
.grow { flex: 1; }

/* ---------- buttons ---------- */
.btn {
  height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2);
  background: #fff; color: var(--text); font-size: 13px; display: inline-flex; align-items: center;
  justify-content: center; gap: 6px; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: #c9d4ee; color: var(--primary); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--primary-soft); color: var(--primary); }
.btn.danger { color: var(--red); border-color: #f6cccc; }
.btn.danger:hover { background: var(--red-soft); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn.lg { height: 42px; padding: 0 22px; font-size: 15px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- inputs ---------- */
.input, .select, .textarea {
  height: 34px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 10px;
  background: #fff; outline: none; transition: .15s; width: 100%;
}
.textarea { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 122, 253, .12); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--faint); margin-top: 6px; }

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #0d1526;
}
.login-hero {
  position: relative; overflow: hidden; padding: 64px 72px; color: #fff;
  background: radial-gradient(1000px 620px at 12% 8%, #26406f 0%, #131c33 46%, #0b1120 100%);
  display: flex; flex-direction: column; justify-content: space-between;
}
.login-hero::after {
  content: ""; position: absolute; width: 640px; height: 640px; right: -220px; bottom: -260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 122, 253, .5), transparent 62%); filter: blur(10px);
}
.hero-brand { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 600; letter-spacing: .5px; }
.hero-logo {
  width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(140deg, #6d92ff, #3a5fe0);
  display: grid; place-items: center; box-shadow: 0 8px 22px rgba(79, 122, 253, .45);
}
.hero-title { font-size: 42px; line-height: 1.25; font-weight: 700; margin: 0 0 18px; letter-spacing: 1px; }
.hero-title span { color: #8fb0ff; }
.hero-sub { color: #9fb0cd; font-size: 15px; line-height: 1.9; max-width: 460px; }
.hero-points { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 38px; max-width: 520px; }
.hero-point {
  border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .04);
  border-radius: 12px; padding: 14px 16px; backdrop-filter: blur(6px);
}
.hero-point b { display: block; font-size: 14px; margin-bottom: 6px; color: #e8eeff; }
.hero-point span { font-size: 12px; color: #8fa0bd; line-height: 1.6; }
.hero-foot { color: #5f6f8d; font-size: 12px; }
.login-side { background: #fff; display: grid; place-items: center; padding: 40px; }
.login-card { width: 360px; }
.login-card h2 { margin: 0 0 6px; font-size: 24px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 28px; }
.login-card .input { height: 42px; border-radius: 10px; }
.login-card .btn.lg { width: 100%; margin-top: 8px; }
.login-err { color: var(--red); font-size: 13px; min-height: 20px; margin-top: 10px; }
.quick-login { margin-top: 26px; border-top: 1px dashed var(--line-2); padding-top: 18px; }
.quick-login .t { font-size: 12px; color: var(--faint); margin-bottom: 10px; }
.quick-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line-2); background: #fbfcff; border-radius: 20px; padding: 6px 12px;
  font-size: 12px; color: var(--muted); transition: .15s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 216px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { height: 60px; display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.brand-logo {
  width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(140deg, #6d92ff, #3a5fe0);
  display: grid; place-items: center; color: #fff;
}
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: .3px; }
.brand-tag { font-size: 10px; color: var(--faint); margin-top: 1px; letter-spacing: .4px; }
.nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 9px;
  color: #4b5563; font-size: 13.5px; margin-bottom: 2px; transition: .14s; position: relative;
}
.nav-item svg { width: 17px; height: 17px; opacity: .65; }
.nav-item:hover { background: #f7f9ff; color: var(--primary); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-item.active svg { opacity: 1; }
.nav-item.active::before { content: ""; position: absolute; left: -10px; top: 9px; width: 3px; height: 22px; border-radius: 0 3px 3px 0; background: var(--primary); }
.nav-sep { height: 1px; background: var(--line); margin: 10px 8px; }
.nav-title { font-size: 11px; color: var(--faint); padding: 6px 12px; letter-spacing: .6px; }
.sidebar-foot { border-top: 1px solid var(--line); padding: 12px 14px; font-size: 11px; color: var(--faint); line-height: 1.7; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center;
  padding: 0 22px; gap: 14px; position: sticky; top: 0; z-index: 20;
}
.crumbs { font-size: 13px; color: var(--faint); display: flex; align-items: center; gap: 8px; }
.crumbs b { color: var(--text); font-weight: 600; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.status-pill {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: 20px;
  padding: 5px 12px 5px 10px; font-size: 12.5px; background: #fbfcff;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(22, 163, 74, .14); }
.dot.busy { background: var(--red); box-shadow: 0 0 0 3px rgba(239, 68, 68, .14); }
.dot.break { background: var(--orange); box-shadow: 0 0 0 3px rgba(245, 158, 11, .16); }
.dot.offline { background: var(--faint); box-shadow: 0 0 0 3px rgba(154, 163, 178, .16); }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid transparent; background: transparent;
  display: grid; place-items: center; color: var(--muted); position: relative;
}
.icon-btn:hover { background: var(--bg); color: var(--primary); }
.badge-dot {
  position: absolute; top: 3px; right: 4px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px;
  background: var(--red); color: #fff; font-size: 10px; display: grid; place-items: center;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(140deg, #6d92ff, #3a5fe0);
  color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 600; cursor: pointer;
}
.user-menu {
  position: absolute; right: 18px; top: 54px; background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow-lg); border-radius: 10px; width: 190px; padding: 6px; z-index: 50;
}
.user-menu .um-head { padding: 10px 10px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.user-menu .um-head b { display: block; font-size: 13px; }
.user-menu .um-head span { font-size: 11.5px; color: var(--faint); }
.user-menu button { width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 10px; border-radius: 7px; font-size: 13px; color: var(--text); }
.user-menu button:hover { background: var(--bg); color: var(--primary); }

.content { padding: 20px 22px 40px; flex: 1; min-width: 0; }

/* ---------- cards / panels ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); gap: 10px; }
.panel-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.panel-body { padding: 16px; }
.page-title { font-size: 20px; font-weight: 650; margin: 0 0 4px; }
.page-sub { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.section-gap { margin-bottom: 16px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi .label { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 26px; font-weight: 700; margin-top: 8px; letter-spacing: .5px; }
.kpi .value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.kpi .delta { font-size: 12px; margin-top: 6px; color: var(--muted); }
.kpi .delta.up { color: var(--green); }
.kpi .delta.down { color: var(--red); }
.kpi .kpi-ico { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
table.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tb th {
  text-align: left; font-weight: 500; color: var(--faint); background: #fafbff; padding: 10px 14px;
  border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 12.5px;
}
table.tb td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tb tbody tr:hover { background: #fbfcff; }
table.tb tbody tr:last-child td { border-bottom: 0; }
.cell-main { font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--faint); margin-top: 3px; }
.empty { padding: 56px 0; text-align: center; color: var(--faint); font-size: 13px; }
.empty svg { opacity: .55; margin-bottom: 12px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.toolbar .input, .toolbar .select { width: auto; min-width: 132px; }
.toolbar .grow { flex: 1; }
.tabs { display: flex; gap: 4px; background: #f4f6fb; padding: 3px; border-radius: 9px; }
.tabs button { border: 0; background: transparent; padding: 6px 14px; border-radius: 7px; font-size: 12.5px; color: var(--muted); }
.tabs button.on { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 4px rgba(31, 45, 80, .08); }

.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; background: #f2f4f9; color: var(--muted); white-space: nowrap; }
.tag.blue { background: var(--primary-soft); color: var(--primary); }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.orange { background: var(--orange-soft); color: #b45309; }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.purple { background: var(--purple-soft); color: var(--purple); }
.tag.gray { background: #f2f4f9; color: #6b7280; }
.level { width: 24px; height: 24px; border-radius: 7px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; }
.level.A { background: var(--green-soft); color: var(--green); }
.level.B { background: var(--primary-soft); color: var(--primary); }
.level.C { background: var(--orange-soft); color: #b45309; }
.level.D { background: #f2f4f9; color: #6b7280; }
.level.E { background: var(--purple-soft); color: var(--purple); }
.level-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.level-chip { display: inline-flex; align-items: center; gap: 6px; background: #f7f9ff; border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px 3px 4px; font-size: 12.5px; }
.level-chip b { font-weight: 600; }
.pill-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.pill-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.pill-status.running i { background: var(--green); }
.pill-status.paused i { background: var(--orange); }
.pill-status.done i { background: var(--faint); }

.progress { height: 6px; border-radius: 4px; background: #eef1f8; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #6d92ff, #4f7afd); }

/* ---------- workbench ---------- */
.wb { display: grid; grid-template-columns: 300px minmax(420px, 1fr) 320px; gap: 14px; align-items: start; }
.wb-left, .wb-right { position: static; }
.cust-list { height: clamp(380px, calc(100vh - 620px), 500px); overflow-y: auto; }
.cust-list::-webkit-scrollbar { width: 6px; }
.cust-list::-webkit-scrollbar-thumb { background: #d7ddea; border-radius: 3px; }
.cust-list::-webkit-scrollbar-track { background: transparent; }
.wb-left-col, .wb-mid { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.cust-item { padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; transition: .12s; }
.cust-item:hover { background: #fbfcff; }
.cust-item.on { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.cust-item .row1 { display: flex; align-items: center; gap: 8px; }
.cust-item .nm { font-weight: 600; font-size: 13.5px; }
.cust-item .ph { font-size: 12.5px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.cust-item .co { font-size: 12px; color: var(--faint); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cust-item .meta { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.list-foot { padding: 10px 14px; font-size: 12px; color: var(--faint); border-top: 1px solid var(--line); display: flex; justify-content: space-between; }
.node-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.node-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; color: var(--muted); background: #fafbff; }
.node-chip b { width: 18px; height: 18px; border-radius: 5px; background: #eef1f8; color: #6b7280; display: grid; place-items: center; font-size: 11px; }
.node-chip em { font-style: normal; font-size: 10.5px; color: var(--faint); }
.node-chip.speak b { background: var(--primary-soft); color: var(--primary); }
.node-chip.choice b { background: var(--purple-soft); color: var(--purple); }
.node-chip.form b { background: var(--orange-soft); color: #b45309; }
.node-chip.end b { background: var(--green-soft); color: var(--green); }
.notice-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line-2); font-size: 12.5px; }
.notice-item:last-child { border-bottom: 0; }
.notice-item i { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); margin-top: 6px; flex-shrink: 0; }
.notice-item .nt { font-weight: 600; font-size: 12.5px; }
.notice-item .nd { color: var(--faint); font-size: 11.5px; margin-top: 3px; line-height: 1.5; }
.notice-item > span { margin-left: auto; color: var(--faint); font-size: 11px; white-space: nowrap; }

.dialer { padding: 18px; }
.dial-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.dial-head .nm { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.dial-head .co { color: var(--muted); font-size: 13px; margin-top: 6px; }
.dial-head .tags { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.dial-body { display: grid; grid-template-columns: 1fr 220px; gap: 20px; padding-top: 18px; }
.call-state {
  border-radius: 14px; padding: 22px; text-align: center; border: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfcff, #f4f7ff); position: relative; overflow: hidden;
}
.call-state.active { border-color: #cfdcff; background: linear-gradient(180deg, #f1f6ff, #e8efff); }
.call-state.ringing { border-color: #ffe0b2; background: linear-gradient(180deg, #fffaf1, #fff3e0); }
.call-state .num { font-size: 30px; font-weight: 700; letter-spacing: 2px; font-variant-numeric: tabular-nums; }
.call-state .st { margin-top: 10px; font-size: 13px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 8px; }
.call-state .timer { font-size: 22px; font-weight: 600; color: var(--primary); margin-top: 8px; font-variant-numeric: tabular-nums; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--orange); position: relative; }
.pulse::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid rgba(245, 158, 11, .5); animation: pulse 1.4s infinite; }
.call-state.active .pulse { background: var(--green); }
.call-state.active .pulse::after { border-color: rgba(22, 163, 74, .5); }
@keyframes pulse { 0% { transform: scale(.7); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }
.call-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }
.btn-call { background: var(--green); border-color: var(--green); color: #fff; height: 44px; padding: 0 30px; border-radius: 22px; font-size: 15px; }
.btn-call:hover { background: #128a3e; border-color: #128a3e; color: #fff; }
.btn-hang { background: var(--red); border-color: var(--red); color: #fff; height: 44px; padding: 0 30px; border-radius: 22px; font-size: 15px; }
.btn-hang:hover { background: #dc2626; border-color: #dc2626; color: #fff; }
.call-tools { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }
.tool-btn { border: 1px solid var(--line-2); background: #fff; border-radius: 9px; padding: 7px 12px; font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.tool-btn.on { background: var(--primary-soft); border-color: #cfdcff; color: var(--primary); }
.tool-btn.disabled, .tool-btn:disabled { opacity: .45; cursor: not-allowed; }
.call-flag { font-size: 11px; border-radius: 8px; padding: 1px 8px; margin-left: 8px; font-weight: 400; }
.call-flag.mute { background: var(--orange-soft); color: #b45309; }
.call-flag.hold { background: var(--purple-soft); color: var(--purple); }
.call-flag.transfer { background: var(--primary-soft); color: var(--primary); }
.end-close { margin-top: 12px; padding: 10px 14px; background: var(--green-soft); border: 1px dashed #b7ebc6; border-radius: 9px; font-size: 13px; color: #15803d; }
.end-close b { font-size: 14px; }
.tb td.best { color: var(--green); font-weight: 600; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 6px; animation: livePulse 1.4s infinite; }
@keyframes livePulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.monitor-hd { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.call-flag-bar { margin-top: 10px; font-size: 12px; color: var(--muted); background: #f7f9ff; border: 1px dashed var(--line-2); border-radius: 8px; padding: 7px 12px; text-align: center; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button {
  height: 52px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; font-size: 18px;
  font-weight: 600; color: #374151; transition: .1s;
}
.keypad button:hover { border-color: var(--primary); color: var(--primary); background: #f8faff; }
.keypad button small { display: block; font-size: 9px; color: var(--faint); font-weight: 400; letter-spacing: 1px; }
.keypad .kp-del { grid-column: 1 / -1; height: 38px; font-size: 14px; color: var(--muted); }
.keypad .kp-del:hover { color: var(--red); border-color: var(--red); background: var(--red-soft); }
.kp-num { font-variant-numeric: tabular-nums; }
.mini-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mini-stat { background: #fafbff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.mini-stat .v { font-size: 20px; font-weight: 700; margin-top: 4px; }
.mini-stat .l { font-size: 12px; color: var(--muted); }
.recent-call { padding: 11px 0; border-bottom: 1px dashed var(--line-2); font-size: 12.5px; }
.recent-call:last-child { border-bottom: 0; }
.recent-call .top { display: flex; justify-content: space-between; gap: 8px; }
.recent-call .bot { color: var(--faint); font-size: 11.5px; margin-top: 4px; display: flex; justify-content: space-between; }

/* customer detail rows */
.kv { display: grid; grid-template-columns: 72px 1fr; gap: 8px 12px; font-size: 13px; }
.kv .k { color: var(--faint); }
.kv .v { color: var(--text); word-break: break-all; }

/* ---------- 统计看板 ---------- */
.gauge-wrap { display: flex; align-items: center; gap: 22px; padding: 6px 0 2px; flex-wrap: wrap; }
.gauge { width: 200px; height: 200px; flex-shrink: 0; }
.gauge-foot { display: grid; gap: 10px; font-size: 12.5px; color: var(--muted); }
.gauge-foot b { color: var(--text); font-size: 16px; }
.intent-cols { display: flex; gap: 10px; align-items: flex-end; padding: 18px 4px 0; height: 236px; }
.intent-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.col-val { font-size: 12.5px; font-weight: 600; color: var(--text); }
.col-pct { font-size: 11px; color: var(--faint); margin-top: 2px; }
.col-bar { width: 60%; max-width: 38px; height: 118px; display: flex; align-items: flex-end; margin: 6px 0; background: #f4f6fb; border-radius: 6px; overflow: hidden; }
.col-bar > i { width: 100%; border-radius: 6px 6px 0 0; display: block; }
.col-name { font-size: 11px; color: var(--faint); text-align: center; line-height: 1.35; }
.result-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; padding: 6px 8px 14px; }
.result-card { display: flex; align-items: center; gap: 10px; padding: 14px 12px; border-bottom: 1px dashed var(--line-2); }
.result-card:nth-last-child(-n+4) { border-bottom: 0; }
.rc-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.rc-label { font-size: 12.5px; color: var(--muted); flex: 1; }
.rc-val { font-size: 20px; font-weight: 700; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0 4px; }
.cloud-tag { display: inline-flex; align-items: center; gap: 8px; border-radius: 8px; padding: 7px 12px; font-size: 12.5px; background: #f4f6fb; color: #4b5563; }
.cloud-tag b { font-size: 12px; font-weight: 600; background: #fff; border-radius: 10px; padding: 1px 8px; color: var(--text); }
.cloud-tag.blue { background: var(--primary-soft); color: var(--primary); }
.cloud-tag.green { background: var(--green-soft); color: var(--green); }
.cloud-tag.orange { background: var(--orange-soft); color: #b45309; }
.cloud-tag.purple { background: var(--purple-soft); color: var(--purple); }
.cloud-tag.gray { background: #f2f4f9; color: #6b7280; }
.dur-bars { display: flex; align-items: flex-end; gap: 4px; height: 170px; padding: 12px 4px 0; }
.dur-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.dur-bar { width: 100%; max-width: 22px; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, #6d92ff, #4f7afd); min-height: 2px; }
.dur-x { font-size: 10px; color: var(--faint); height: 14px; }
.dist-legend { display: grid; gap: 8px; font-size: 12.5px; color: var(--muted); }
.dist-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 8px; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-grid a { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; font-size: 12.5px; color: var(--muted); }
.quick-grid a:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* ---------- 话术流程 ---------- */
.script-top { display: flex; flex-direction: column; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.script-top-row1 { display: flex; align-items: center; gap: 10px; min-width: 0; }
.script-live { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--green); font-weight: 600; flex-shrink: 0; }
.script-live b { font-variant-numeric: tabular-nums; color: var(--text); font-size: 14px; display: inline-block; min-width: 46px; text-align: left; }
.script-name { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; min-width: 0; }
.script-tools { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.script-tools .tool-btn { padding: 6px 8px; font-size: 12px; white-space: nowrap; }
.script-tools .tool-btn svg { width: 13px; height: 13px; }
.script-tools .btn-hang { margin-left: auto; }
.script-cust { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #fbfcff; border-bottom: 1px solid var(--line); font-size: 13px; flex-wrap: wrap; }
.script-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.step { font-size: 11.5px; color: var(--muted); background: #f4f6fb; border-radius: 6px; padding: 3px 8px; }
.step.done { background: var(--green-soft); color: #15803d; }
.step.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.step em { font-style: normal; opacity: .7; margin-left: 4px; }
.step-count { margin-left: auto; font-size: 11.5px; color: var(--faint); }
.script-card { padding: 20px; }
.node-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.node-title { font-size: 15px; font-weight: 650; margin-bottom: 12px; }
.node-script { font-size: 19px; line-height: 1.9; color: #111827; background: linear-gradient(180deg, #fbfcff, #f5f8ff); border: 1px solid #e6ecff; border-radius: 12px; padding: 20px 22px; }
.node-hint { font-size: 12px; color: var(--faint); margin: 12px 0 10px; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 12px; }
.opt-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line-2); background: #fff; border-radius: 10px; padding: 14px 16px; font-size: 14px; color: var(--text); transition: .14s; text-align: left; }
.opt-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); transform: translateY(-1px); }
.script-form { margin-top: 6px; }
.script-form .field { margin-bottom: 12px; }
.script-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
.end-wrap { text-align: center; padding: 14px 0 4px; }
.end-anim { width: 64px; height: 64px; border-radius: 50%; background: var(--green-soft); display: grid; place-items: center; margin: 0 auto 14px; animation: pop .3s ease-out; }
.end-title { font-size: 17px; font-weight: 650; }
.end-text { color: var(--muted); font-size: 13px; margin-top: 8px; line-height: 1.8; }
.end-form { margin-top: 16px; text-align: left; background: #fafbff; border: 1px dashed var(--line-2); border-radius: 10px; padding: 12px 14px; display: grid; gap: 6px; }
.flow { display: grid; gap: 10px; }
.flow-node { display: flex; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fff; }
.flow-idx { width: 24px; height: 24px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; }
.flow-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.flow-text { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.7; }
.flow-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.flow-opt { font-size: 11.5px; background: #f4f6fb; color: var(--muted); border-radius: 6px; padding: 3px 8px; }

/* ---------- charts ---------- */
.charts { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; margin-bottom: 14px; }
.chart-box { padding: 16px; }
.chart-box h3 { margin: 0 0 4px; font-size: 14px; }
.chart-box .sub { font-size: 12px; color: var(--faint); margin-bottom: 12px; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }
svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
.bar-row { display: grid; grid-template-columns: 70px 1fr 46px; align-items: center; gap: 10px; font-size: 12.5px; margin-bottom: 10px; }
.bar-row .track { height: 8px; border-radius: 4px; background: #f1f4fa; overflow: hidden; }
.bar-row .track > i { display: block; height: 100%; border-radius: 4px; background: var(--primary); }
.bar-row .val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- modal ---------- */
.mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .42); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal { background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); width: 520px; max-width: 100%; max-height: calc(100vh - 40px); overflow: auto; animation: pop .16s ease-out; }
.modal.wide { width: 760px; }
@keyframes pop { from { transform: translateY(8px) scale(.99); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fcfdff; border-radius: 0 0 14px 14px; }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-row label { border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 12px; font-size: 12.5px; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.radio-row input { accent-color: var(--primary); }
.radio-row label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.quick-notes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.quick-notes button { border: 1px dashed var(--line-2); background: #fff; color: var(--muted); border-radius: 6px; padding: 4px 8px; font-size: 11.5px; }
.quick-notes button:hover { border-color: var(--primary); color: var(--primary); }
.ai-box { background: linear-gradient(180deg, #f7f9ff, #f2f6ff); border: 1px solid #e2eaff; border-radius: 10px; padding: 12px 14px; font-size: 12.5px; line-height: 1.75; color: #3b4a6b; }
.ai-box b { color: var(--primary); }

/* ---------- toast ---------- */
.toast-root { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #1f2937; color: #fff; border-radius: 9px; padding: 10px 16px; font-size: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18); animation: toastIn .18s ease-out; max-width: 70vw;
}
.toast.ok { background: #14833b; }
.toast.err { background: #b91c1c; }
.toast.warn { background: #b45309; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- misc ---------- */
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.agent-card { padding: 18px; }
.agent-card .top { display: flex; align-items: center; gap: 12px; }
.agent-ava { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 16px; background: linear-gradient(140deg, #6d92ff, #3a5fe0); }
.agent-card .grow { min-width: 0; }
.agent-card .nm { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-card .ac { font-size: 12px; color: var(--faint); margin-top: 3px; }
.agent-card .stats { display: flex; gap: 18px; margin: 16px 0 14px; }
.agent-card .stats div span { display: block; font-size: 11.5px; color: var(--faint); }
.agent-card .stats div b { font-size: 17px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.switch input { display: none; }
.switch i { width: 38px; height: 22px; border-radius: 11px; background: #dfe4ef; position: relative; transition: .18s; flex-shrink: 0; }
.switch i::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: .18s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { transform: translateX(16px); }
.checkline { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px dashed var(--line-2); }
.checkline:last-child { border-bottom: 0; }
.checkline .t { font-size: 13.5px; }
.checkline .d { font-size: 12px; color: var(--faint); margin-top: 3px; }
.import-area { width: 100%; height: 180px; font-family: Consolas, monospace; font-size: 12.5px; }
.note-line { font-size: 12.5px; color: var(--muted); line-height: 1.8; }
.toolbar .spacer { flex: 1; }
.badge-count { font-size: 11px; background: #eef1f8; color: var(--muted); border-radius: 10px; padding: 1px 7px; margin-left: 6px; }

@media (max-width: 1400px) {
  .wb { grid-template-columns: 270px minmax(380px, 1fr) 300px; }
  .dial-body { grid-template-columns: 1fr 200px; }
}
@media (max-width: 1180px) {
  .result-grid { grid-template-columns: repeat(2, 1fr); }
  .result-card:nth-last-child(-n+4) { border-bottom: 1px dashed var(--line-2); }
  .result-card:nth-last-child(-n+2) { border-bottom: 0; }
  .intent-cols { height: 200px; }
  .wb { grid-template-columns: 1fr; }
  .wb-left, .wb-right { position: static; }
  .charts { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { display: none; }
}
@media (max-width: 760px) {
  #menuToggle { display: grid !important; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: .2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .content { padding: 14px; }
  .topbar { padding: 0 14px; }
  .dial-body { grid-template-columns: 1fr; }
}

/* ---------- 话术节点可视化编辑器 ---------- */
.node-editor { display: flex; flex-direction: column; gap: 10px; max-height: 58vh; overflow-y: auto; padding-right: 4px; }
.ne-node { border: 1px solid var(--line-2); border-radius: 10px; background: #fbfcff; }
.ne-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #f5f8ff; border-radius: 10px 10px 0 0; }
.ne-seq { width: 22px; height: 22px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.ne-head .ne-title { flex: 1; height: 30px; min-width: 0; }
.ne-head .ne-type { width: 130px; height: 30px; flex-shrink: 0; }
.ne-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.ne-body .field { margin-bottom: 0; }
.ne-body label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 5px; }
.ne-opts, .ne-fields { display: flex; flex-direction: column; gap: 6px; }
.ne-opt { display: flex; align-items: center; gap: 8px; }
.ne-opt .ne-opt-label { flex: 1; height: 30px; min-width: 0; }
.ne-opt .ne-opt-next { width: 190px; height: 30px; flex-shrink: 0; }
.ne-field { display: grid; grid-template-columns: 1fr 92px 62px 30px; gap: 8px; align-items: center; }
.ne-field .ne-f-label { height: 30px; }
.ne-field .ne-f-type { height: 30px; }
.ne-field .ne-f-opts { grid-column: 1 / -1; height: 30px; }
.ne-f-req { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); margin: 0; }
.ne-issue { padding: 8px 12px; border-left: 3px solid var(--orange); background: var(--orange-soft); border-radius: 6px; font-size: 12.5px; margin-bottom: 6px; }
.flow-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line-2); }
.flow-row:last-child { border-bottom: 0; }
.flow-no { width: 24px; height: 24px; border-radius: 7px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.flow-main { width: 210px; flex-shrink: 0; }
.flow-title { font-size: 13px; font-weight: 600; }
.flow-sub { font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.flow-to { flex: 1; font-size: 12.5px; color: var(--muted); line-height: 1.9; }
.flow-arrow { display: inline-block; background: #f2f4f9; border-radius: 5px; padding: 1px 7px; margin-right: 4px; color: var(--text); font-size: 12px; }
.flow-bad { color: var(--red); }
