/* ============ 羽升智能外呼系统 · Design System ============ */
:root {
  --bg: #f4f7fc;
  --bg-soft: #eef3fa;
  --panel: #ffffff;
  --panel-2: #f8fafd;
  --side: #0b1424;
  --side-2: #101d33;
  --text: #101a2f;
  --text-2: #33415c;
  --muted: #71809a;
  --muted-2: #9aa7bd;
  --line: #e6ecf5;
  --line-2: #d8e1ef;
  --primary: #3568f5;
  --primary-2: #6d5cf6;
  --primary-soft: #eef3ff;
  --green: #0fae7e;
  --green-soft: #e8f9f2;
  --amber: #e99a0b;
  --amber-soft: #fff7e6;
  --red: #e5484d;
  --red-soft: #fdeeee;
  --cyan: #0891b2;
  --violet: #7c5cf5;
  --violet-soft: #f1edff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 2px 4px rgba(16, 26, 47, .03), 0 10px 30px rgba(16, 26, 47, .055);
  --shadow-lg: 0 24px 70px rgba(9, 18, 36, .18);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: rgba(53, 104, 245, .18); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd6e6; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

.ic { flex-shrink: 0; vertical-align: -3px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-amber { color: var(--amber); }
.text-primary { color: var(--primary); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }

/* ============ Boot ============ */
.boot-screen {
  height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(1200px 700px at 50% -10%, #13284b 0%, #0b1424 55%, #070e19 100%);
  color: #e8eefc; gap: 6px;
}
.boot-logo { margin-bottom: 18px; }
.boot-title { font-size: 21px; font-weight: 700; letter-spacing: .5px; }
.boot-sub { color: #7f93b8; font-size: 13px; }
.boot-bar { width: 180px; height: 3px; background: rgba(255,255,255,.1); border-radius: 4px; overflow: hidden; margin-top: 22px; }
.boot-bar span { display: block; width: 40%; height: 100%; background: linear-gradient(90deg, #4a7dff, #8b6cff); border-radius: 4px; animation: bootSlide 1.2s ease-in-out infinite; }
@keyframes bootSlide { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }

.logo-mark {
  position: relative; display: inline-block; width: 34px; height: 34px; border-radius: 11px;
  background: linear-gradient(135deg, #4f7cff 0%, #765bf7 55%, #a35cf5 100%);
  box-shadow: 0 6px 18px rgba(83, 112, 255, .35); overflow: hidden; flex-shrink: 0;
}
.logo-mark i {
  position: absolute; left: 50%; top: 50%; display: block; border-radius: 50%;
  border: 1.6px solid rgba(255,255,255,.9); transform: translate(-50%, -50%);
}
.logo-mark i:nth-child(1) { width: 17px; height: 17px; opacity: .95; }
.logo-mark i:nth-child(2) { width: 9px; height: 9px; background: #fff; border: 0; }
.logo-mark i:nth-child(3) { width: 26px; height: 26px; opacity: .35; border-style: dashed; }

/* ============ Login ============ */
.login-page { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr); min-height: 100vh; background: #fff; }
.login-visual {
  position: relative; overflow: hidden; color: #e9efff; padding: 54px 64px 40px;
  background: radial-gradient(1000px 620px at 18% 8%, rgba(61, 106, 255, .38), transparent 60%),
              radial-gradient(800px 600px at 92% 92%, rgba(132, 82, 246, .3), transparent 62%),
              linear-gradient(145deg, #0a1528 0%, #0c1a33 48%, #0a1425 100%);
  display: flex; flex-direction: column;
}
.login-visual::before {
  content: ""; position: absolute; inset: 0; opacity: .34;
  background-image: linear-gradient(rgba(125, 160, 230, .10) 1px, transparent 1px), linear-gradient(90deg, rgba(125, 160, 230, .10) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 40% 40%, #000 20%, transparent 75%);
}
.login-visual::after {
  content: ""; position: absolute; width: 420px; height: 420px; right: -120px; top: 18%;
  background: radial-gradient(circle, rgba(105, 114, 255, .28), transparent 65%); filter: blur(10px);
}
.login-brand { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 700; letter-spacing: .4px; }
.login-brand .sub { font-size: 12px; font-weight: 400; color: #8ea4cc; margin-left: 2px; letter-spacing: 1px; }
.login-copy { position: relative; z-index: 2; margin-top: 84px; max-width: 560px; }
.login-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: rgba(112, 143, 255, .12); border: 1px solid rgba(112, 143, 255, .28);
  color: #a9c0ff; font-size: 12px; letter-spacing: .5px; margin-bottom: 22px;
}
.login-copy h1 { font-size: 46px; line-height: 1.22; font-weight: 700; letter-spacing: -.5px; }
.login-copy h1 em { font-style: normal; background: linear-gradient(100deg, #7fa4ff, #b48cff 55%, #6ee7ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-copy p { margin-top: 18px; color: #93a7ca; font-size: 15px; line-height: 1.9; max-width: 480px; }
.visual-features { position: relative; z-index: 2; display: flex; gap: 26px; margin-top: 34px; }
.visual-feature { display: flex; align-items: flex-start; gap: 10px; }
.visual-feature .vf-icon {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); color: #8fb0ff;
}
.visual-feature strong { display: block; font-size: 13px; font-weight: 600; color: #dbe5fa; }
.visual-feature span { font-size: 11.5px; color: #7f93b8; }
.visual-card {
  position: relative; z-index: 2; margin-top: auto; background: rgba(16, 30, 55, .72); backdrop-filter: blur(16px);
  border: 1px solid rgba(122, 152, 220, .18); border-radius: 18px; padding: 18px 20px; max-width: 560px;
  box-shadow: 0 30px 80px rgba(0,0,0,.3);
}
.vc-head { display: flex; align-items: center; justify-content: space-between; color: #b9c9e8; font-size: 12.5px; }
.vc-live { display: inline-flex; align-items: center; gap: 6px; color: #57d6a8; font-size: 11.5px; }
.vc-live i { width: 6px; height: 6px; border-radius: 50%; background: #39d39e; box-shadow: 0 0 0 4px rgba(57,211,158,.14); animation: pulseDot 1.8s infinite; }
.vc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.vc-metric { background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.06); border-radius: 11px; padding: 11px 12px; }
.vc-metric b { display: block; font-size: 20px; font-weight: 700; color: #eef4ff; letter-spacing: .3px; }
.vc-metric span { font-size: 11px; color: #8195b8; }
.vc-wave { display: flex; align-items: flex-end; gap: 3px; height: 34px; margin-top: 16px; }
.vc-wave i { flex: 1; background: linear-gradient(180deg, #7f9dff, #4a6eee); border-radius: 3px; opacity: .75; animation: waveBar 1.4s ease-in-out infinite; }
.login-foot { position: relative; z-index: 2; margin-top: 22px; font-size: 11.5px; color: #63779c; display: flex; justify-content: space-between; max-width: 560px; }

.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px; background: linear-gradient(180deg, #ffffff 0%, #f7f9fe 100%); }
.login-form-wrap { width: 100%; max-width: 380px; animation: fadeUp .5s ease both; }
.login-mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 26px; font-size: 16px; font-weight: 700; letter-spacing: .3px; }
.login-mobile-brand span { color: #12203a; }
.login-form-wrap h2 { font-size: 27px; font-weight: 700; letter-spacing: -.3px; }
.login-form-wrap > p { color: var(--muted); margin-top: 8px; font-size: 13.5px; }
.login-tabs { display: flex; padding: 4px; background: #eef2f9; border-radius: 10px; margin: 26px 0 22px; }
.login-tabs button { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 8px; color: var(--muted); font-size: 13px; font-weight: 500; }
.login-tabs button.active { background: #fff; color: var(--text); box-shadow: 0 2px 8px rgba(16,26,47,.08); }
.field { margin-bottom: 16px; }
.field > label { display: flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.field .hint { font-size: 11.5px; color: var(--muted-2); margin-top: 6px; line-height: 1.5; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line-2); background: #fff; color: var(--text);
  border-radius: 10px; padding: 9px 12px; outline: none; transition: .18s; font-size: 13.5px;
  min-height: 40px;
}
.textarea { min-height: 86px; resize: vertical; line-height: 1.7; }
.input:focus, .select:focus, .textarea:focus { border-color: rgba(53,104,245,.65); box-shadow: 0 0 0 3px rgba(53,104,245,.12); }
.input::placeholder, .textarea::placeholder { color: #a7b3c7; }
.input:disabled, .select:disabled { background: #f4f7fc; color: var(--muted); cursor: not-allowed; }
.input-group { position: relative; }
.input-group .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #93a2ba; }
.input-group .input { padding-left: 38px; }
.password-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); padding: 4px; display: grid; place-items: center; }
.login-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 20px; font-size: 12.5px; }
.check { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); cursor: pointer; user-select: none; }
.check input { width: 15px; height: 15px; accent-color: var(--primary); }
.login-btn { width: 100%; height: 44px; border: 0; border-radius: 11px; color: #fff; font-size: 14px; font-weight: 600; letter-spacing: .5px; background: linear-gradient(105deg, #3f70f7, #6d5cf6); box-shadow: 0 10px 24px rgba(67, 103, 245, .3); transition: .2s; }
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(67, 103, 245, .38); }
.login-btn:active { transform: translateY(0); }
.login-btn:disabled { opacity: .7; transform: none; cursor: wait; }
.demo-accounts { margin-top: 26px; border-top: 1px dashed var(--line-2); padding-top: 16px; }
.demo-accounts h4 { font-size: 11.5px; color: var(--muted-2); font-weight: 600; letter-spacing: .5px; margin-bottom: 8px; }
.demo-accounts .row { display: flex; gap: 8px; flex-wrap: wrap; }
.demo-chip { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 9px; font-size: 11.5px; color: var(--text-2); transition: .15s; }
.demo-chip:hover { border-color: #b8c9f5; background: var(--primary-soft); color: var(--primary); }
.demo-chip b { font-weight: 600; }
.login-error { background: var(--red-soft); border: 1px solid #f6cfd0; color: #b42327; padding: 9px 12px; border-radius: 9px; font-size: 12.5px; margin-bottom: 14px; display: none; }
.login-error.show { display: block; }
.login-copyright { text-align: center; margin-top: 28px; font-size: 11px; color: var(--muted-2); }

/* ============ App shell ============ */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 238px; background: linear-gradient(180deg, #0b1424 0%, #0d192c 60%, #0a1322 100%);
  color: #c7d3e8; display: flex; flex-direction: column; z-index: 60; border-right: 1px solid rgba(255,255,255,.04);
}
.sidebar-brand { height: 66px; display: flex; align-items: center; gap: 11px; padding: 0 20px; border-bottom: 1px solid rgba(255,255,255,.055); }
.brand-text { line-height: 1.25; }
.brand-text strong { display: block; font-size: 15px; color: #f0f5ff; letter-spacing: .4px; font-weight: 700; }
.brand-text span { font-size: 9.5px; color: #7086ab; letter-spacing: 1.6px; }
.nav-scroll { flex: 1; overflow-y: auto; padding: 16px 12px 20px; }
.nav-scroll::-webkit-scrollbar { width: 4px; }
.nav-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); }
.nav-group { margin-bottom: 18px; }
.nav-label { font-size: 10px; color: #5e7295; letter-spacing: 1.4px; padding: 0 10px; margin-bottom: 7px; font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 11px; border-radius: 9px;
  color: #a9b8d3; font-size: 13px; cursor: pointer; transition: .16s; position: relative; margin-bottom: 2px; border: 0; width: 100%; background: none; text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,.055); color: #e4ecfb; }
.nav-item.active { background: linear-gradient(100deg, rgba(67,108,247,.24), rgba(109,92,246,.16)); 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: linear-gradient(180deg, #6f94ff, #a07bff); }
.nav-item .ic { color: #7f92b5; }
.nav-item.active .ic { color: #8dabff; }
.nav-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e5484d; color: #fff; font-size: 10px; font-weight: 600; display: grid; place-items: center; }
.sidebar-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.055); }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(9,18,36,.46); backdrop-filter: blur(1px); z-index: 55; }
.sidebar-backdrop.show { display: block; }
.engine-card { background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.07); border-radius: 11px; padding: 11px 12px; }
.engine-row { display: flex; align-items: center; justify-content: space-between; }
.engine-title { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: #b9c9e4; }
.engine-title i { width: 7px; height: 7px; border-radius: 50%; background: #2ed3a0; box-shadow: 0 0 0 4px rgba(46,211,160,.12); animation: pulseDot 1.8s infinite; }
.engine-num { font-size: 11px; color: #7b90b5; margin-top: 6px; font-variant-numeric: tabular-nums; }
.engine-num b { color: #dce7f9; font-size: 12px; }

.main { margin-left: 238px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 0 26px; background: rgba(255,255,255,.86); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.mobile-toggle { display: none; border: 1px solid var(--line); background: #fff; border-radius: 9px; width: 36px; height: 36px; place-items: center; color: var(--text-2); }
.breadcrumb { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.breadcrumb b { color: var(--text); font-weight: 600; font-size: 13.5px; }
.breadcrumb .sep { color: #c3cde0; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.global-search { position: relative; width: 230px; }
.global-search input { width: 100%; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: #f7f9fd; padding: 0 12px 0 34px; font-size: 12.5px; outline: none; transition: .18s; }
.global-search input:focus { background: #fff; border-color: #bdcdf3; box-shadow: 0 0 0 3px rgba(53,104,245,.08); }
.global-search .ic { position: absolute; left: 10px; top: 9px; color: #93a2ba; }
.global-search kbd { position: absolute; right: 8px; top: 8px; font-size: 10px; color: #9aa7bd; background: #fff; border: 1px solid var(--line-2); padding: 1px 5px; border-radius: 5px; }
.icon-btn { width: 36px; height: 36px; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--text-2); display: grid; place-items: center; position: relative; transition: .15s; }
.icon-btn:hover { background: #f1f5fb; border-color: var(--line); }
.notify-dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px #fff; }
.topbar-live { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 999px; background: var(--green-soft); color: #0b8a65; font-size: 11.5px; font-weight: 500; }
.topbar-live i { width: 6px; height: 6px; border-radius: 50%; background: #0fae7e; animation: pulseDot 1.6s infinite; }
.topbar-user { display: flex; align-items: center; gap: 9px; padding: 3px 4px 3px 8px; border-radius: 10px; border: 1px solid transparent; background: none; }
.topbar-user:hover { background: #f5f8fd; border-color: var(--line); }
.avatar { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: #fff; background: linear-gradient(135deg, #4a7bf7, #7b5cf2); flex-shrink: 0; }
.avatar.lg { width: 44px; height: 44px; border-radius: 12px; font-size: 15px; }
.avatar.sm { width: 26px; height: 26px; border-radius: 8px; font-size: 10px; }
.topbar-user .u-name { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.2; text-align: left; }
.topbar-user .u-role { display: block; font-size: 10.5px; color: var(--muted); line-height: 1.2; text-align: left; }

.content { padding: 22px 26px 44px; flex: 1; min-width: 0; }
.page { max-width: 1560px; margin: 0 auto; animation: fadeUp .32s ease both; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { font-size: 23px; font-weight: 700; letter-spacing: -.3px; display: flex; align-items: center; gap: 10px; }
.page-title .back-btn { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--text-2); }
.page-sub { color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: 9px; border: 1px solid var(--line-2); background: #fff; color: var(--text-2);
  font-size: 12.5px; font-weight: 500; transition: .16s; white-space: nowrap;
}
.btn:hover { border-color: #b9c8e4; background: #fbfcff; }
.btn:active { transform: translateY(1px); }
.btn .ic { margin: 0 -1px; }
.btn-primary { background: linear-gradient(102deg, #3f70f7, #6a5cf5); border-color: transparent; color: #fff; box-shadow: 0 5px 14px rgba(63, 112, 247, .26); }
.btn-primary:hover { background: linear-gradient(102deg, #3566ee, #5e50e8); border-color: transparent; box-shadow: 0 8px 20px rgba(63,112,247,.32); }
.btn-soft { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.btn-soft:hover { background: #e3ebff; border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: #f2f6fc; border-color: transparent; color: var(--text-2); }
.btn-danger { color: var(--red); border-color: #f2c9cb; background: #fff; }
.btn-danger:hover { background: var(--red-soft); border-color: #edb1b4; }
.btn-green { background: #0fae7e; border-color: #0fae7e; color: #fff; }
.btn-green:hover { background: #0c9c70; border-color: #0c9c70; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 11.5px; border-radius: 8px; }
.btn-lg { height: 42px; padding: 0 20px; font-size: 13.5px; border-radius: 10px; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.link-btn { border: 0; background: none; color: var(--primary); font-size: 12px; padding: 0; }
.link-btn:hover { text-decoration: underline; }

/* ============ Cards ============ */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { padding: 17px 20px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-title { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-title .ic { color: var(--muted); }
.card-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.card-body { padding: 18px 20px 20px; }
.card-tools { display: flex; align-items: center; gap: 8px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }

.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 17px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; right: -24px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: var(--primary-soft); opacity: .6; }
.stat-card.green::after { background: var(--green-soft); }
.stat-card.amber::after { background: var(--amber-soft); }
.stat-card.violet::after { background: var(--violet-soft); }
.stat-card.red::after { background: var(--red-soft); }
.stat-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.stat-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.stat-card.green .stat-icon { background: var(--green-soft); color: var(--green); }
.stat-card.amber .stat-icon { background: var(--amber-soft); color: var(--amber); }
.stat-card.violet .stat-icon { background: var(--violet-soft); color: var(--violet); }
.stat-card.red .stat-icon { background: var(--red-soft); color: var(--red); }
.stat-delta { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--green-soft); color: #0b8a65; display: inline-flex; align-items: center; gap: 2px; }
.stat-delta.down { background: var(--red-soft); color: #c03539; }
.stat-delta.flat { background: #f1f4f9; color: var(--muted); }
.stat-value { font-size: 27px; font-weight: 700; letter-spacing: -.5px; margin-top: 13px; position: relative; z-index: 1; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat-value small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; position: relative; z-index: 1; }

/* ============ Badges / tags ============ */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 500; background: #f1f4f9; color: var(--text-2); white-space: nowrap; }
.badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-green { background: var(--green-soft); color: #0a8a65; }
.badge-blue { background: var(--primary-soft); color: #2f5fe0; }
.badge-amber { background: var(--amber-soft); color: #b77906; }
.badge-red { background: var(--red-soft); color: #c33b40; }
.badge-gray { background: #f1f4f9; color: #65758e; }
.badge-violet { background: var(--violet-soft); color: #6247cf; }
.badge-cyan { background: #e6f8fb; color: #087f9c; }
.tag { display: inline-flex; align-items: center; height: 21px; padding: 0 7px; border-radius: 5px; font-size: 10.5px; color: var(--text-2); background: #f3f6fb; border: 1px solid #e8eef7; white-space: nowrap; }
.tag.blue { background: var(--primary-soft); border-color: #dbe6ff; color: #3b63d1; }
.tag.green { background: var(--green-soft); border-color: #cdefe3; color: #0a8a65; }
.tag.amber { background: var(--amber-soft); border-color: #f8e7c2; color: #a56f06; }
.tag.violet { background: var(--violet-soft); border-color: #e4dcff; color: #6247cf; }
.intent { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.intent b { font-weight: 700; font-size: 11px; }
.intent-A { background: #e7f8ef; color: #0a8a55; }
.intent-B { background: #f0f9e6; color: #58820d; }
.intent-C { background: #eaf1ff; color: #2f5fe0; }
.intent-D { background: #fff4e5; color: #b37405; }
.intent-E { background: #f1f4f9; color: #65758e; }
.intent-F { background: #fdeeee; color: #c33b40; }
.intent-none { background: #f4f6fa; color: #8b99af; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.status-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #9aa7bd; }
.status-dot.online::before { background: #0fae7e; box-shadow: 0 0 0 3px rgba(15,174,126,.14); }
.status-dot.busy::before { background: #e99a0b; box-shadow: 0 0 0 3px rgba(233,154,11,.14); }
.status-dot.offline::before { background: #9aa7bd; }
.status-dot.red::before { background: #e5484d; box-shadow: 0 0 0 3px rgba(229,72,77,.12); }

/* ============ Tables ============ */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.data-table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .2px; padding: 10px 12px; background: #f8fafd; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table th:first-child { border-left: 1px solid var(--line); border-radius: 9px 0 0 9px; }
.data-table th:last-child { border-right: 1px solid var(--line); border-radius: 0 9px 9px 0; }
.data-table td { padding: 12px; border-bottom: 1px solid #eef2f8; color: var(--text-2); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: .12s; }
.data-table tbody tr:hover { background: #fafcff; }
.data-table tbody tr.selected-row { background: #f2f7ff; }
.data-table .cell-main { font-size: 12.5px; font-weight: 500; color: var(--text); }
.data-table .cell-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.data-table .num { font-variant-numeric: tabular-nums; }
.data-table .actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.data-table .actions .btn { height: 27px; padding: 0 8px; font-size: 11px; }
.table-empty { padding: 56px 20px; text-align: center; color: var(--muted); }
.table-empty .empty-icon { width: 54px; height: 54px; border-radius: 16px; background: #f1f5fb; display: grid; place-items: center; margin: 0 auto 12px; color: #9aabc4; }
.table-empty b { display: block; color: var(--text-2); font-size: 13px; margin-bottom: 3px; }
.table-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); flex-wrap: wrap; gap: 10px; }
.pager { display: flex; align-items: center; gap: 4px; }
.pager button { min-width: 28px; height: 28px; padding: 0 8px; border: 1px solid var(--line); background: #fff; border-radius: 7px; color: var(--text-2); font-size: 11.5px; }
.pager button:hover:not(:disabled) { border-color: #b9c8e4; }
.pager button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager button:disabled { opacity: .45; cursor: not-allowed; }

.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-box { position: relative; }
.search-box .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #93a2ba; }
.search-box input { height: 34px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 10px 0 32px; font-size: 12px; width: 210px; outline: none; background: #fff; }
.search-box input:focus { border-color: #b7c8f2; box-shadow: 0 0 0 3px rgba(53,104,245,.08); }
.filters select { height: 34px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 26px 0 10px; font-size: 12px; color: var(--text-2); background: #fff; outline: none; cursor: pointer; }
.filters select:focus { border-color: #b7c8f2; }
.segmented { display: inline-flex; padding: 3px; background: #eef2f9; border-radius: 9px; }
.segmented button { border: 0; background: transparent; height: 28px; padding: 0 11px; border-radius: 7px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.segmented button.active { background: #fff; color: var(--text); box-shadow: 0 1px 4px rgba(16,26,47,.08); font-weight: 500; }

/* ============ Forms ============ */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-section { margin-bottom: 22px; }
.form-section-title { font-size: 12px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.form-section-title span { font-size: 10.5px; color: var(--muted); font-weight: 400; }
.form-section-title .ic { color: var(--primary); }
.switch { position: relative; width: 38px; height: 21px; border-radius: 999px; background: #d9e2ef; border: 0; transition: .2s; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(16,26,47,.2); transition: .2s; }
.switch.on { background: var(--primary); }
.switch.on::after { left: 19px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid #f0f4fa; }
.switch-row:last-child { border-bottom: 0; }
.switch-row .sr-title { font-size: 12.5px; font-weight: 500; }
.switch-row .sr-desc { font-size: 11px; color: var(--muted); margin-top: 2px; }
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input[type=range] { flex: 1; accent-color: var(--primary); }
.range-val { width: 42px; text-align: right; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.chip-group { display: flex; flex-wrap: wrap; gap: 7px; }
.chip-check { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 8px; font-size: 11.5px; color: var(--text-2); cursor: pointer; background: #fff; user-select: none; }
.chip-check input { display: none; }
.chip-check.checked { border-color: #a9bdf2; background: var(--primary-soft); color: var(--primary); }
.kv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.kv { background: #f8fafd; border: 1px solid #eef2f8; border-radius: 10px; padding: 11px 13px; }
.kv span { display: block; font-size: 10.5px; color: var(--muted); margin-bottom: 3px; }
.kv b { font-size: 13px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.hint-box { display: flex; gap: 9px; padding: 11px 13px; border-radius: 10px; background: #f4f8ff; border: 1px solid #e2ebff; color: #3f5c9a; font-size: 11.5px; line-height: 1.65; }
.hint-box .ic { color: #5b7fd8; margin-top: 1px; }
.hint-box.amber { background: var(--amber-soft); border-color: #f8e7c2; color: #8a6208; }
.save-bar { position: sticky; bottom: 0; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 0 0 var(--radius) var(--radius); z-index: 5; }
.save-bar .sb-hint { font-size: 11.5px; color: var(--muted); }

/* ============ Modal / Drawer / Toast ============ */
.modal-backdrop { position: fixed; inset: 0; background: rgba(9,18,36,.48); backdrop-filter: blur(3px); z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 18px 18px; overflow-y: auto; animation: fadeIn .18s ease; }
.modal { width: 560px; max-width: 100%; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); animation: popIn .2s ease; overflow: hidden; }
.modal.lg { width: 820px; }
.modal.xl { width: 1040px; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.modal-head h3 { font-size: 16px; font-weight: 650; }
.modal-head p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.modal-close { width: 30px; height: 30px; border: 0; background: #f4f7fc; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
.modal-close:hover { background: #eaf0f9; color: var(--text); }
.modal-body { padding: 20px 22px; max-height: 68vh; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: flex-end; gap: 9px; background: #fbfcff; }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(9,18,36,.42); backdrop-filter: blur(2px); z-index: 210; animation: fadeIn .16s ease; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 660px; max-width: 94vw; background: #fff; z-index: 211; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slideIn .24s ease; }
.drawer-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px 30px; }
.toast-root { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 9px; background: #101c31; color: #eef4ff; padding: 10px 16px; border-radius: 10px; font-size: 12.5px; box-shadow: 0 12px 34px rgba(9,18,36,.3); animation: toastIn .22s ease; pointer-events: auto; }
.toast .ic { color: #6fe0b6; }
.toast.error .ic { color: #ff8d90; }
.toast.warn .ic { color: #ffc554; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============ Dropdown ============ */
.dropdown { position: absolute; top: calc(100% + 8px); right: 0; min-width: 210px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 100; animation: popIn .16s ease; }
.dropdown-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 8px; font-size: 12.5px; color: var(--text-2); text-align: left; }
.dropdown-item:hover { background: #f4f8ff; color: var(--text); }
.dropdown-item .ic { color: var(--muted); }
.dropdown-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.dropdown-head { padding: 9px 10px 7px; font-size: 10.5px; color: var(--muted-2); letter-spacing: .5px; }
.notice-pop { position: absolute; top: calc(100% + 10px); right: 70px; width: 370px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 100; overflow: hidden; animation: popIn .18s ease; }
.notice-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.notice-head b { font-size: 13px; }
.notice-list { max-height: 370px; overflow-y: auto; }
.notice-item { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid #f2f5fa; cursor: pointer; }
.notice-item:hover { background: #fafcff; }
.notice-item:last-child { border-bottom: 0; }
.notice-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex-shrink: 0; }
.notice-icon.green { background: var(--green-soft); color: var(--green); }
.notice-icon.amber { background: var(--amber-soft); color: var(--amber); }
.notice-icon.red { background: var(--red-soft); color: var(--red); }
.notice-item .nt-title { font-size: 12px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; }
.notice-item .nt-desc { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notice-item .nt-time { font-size: 10px; color: var(--muted-2); margin-top: 4px; }
.unread-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--red); }

/* ============ Charts ============ */
.chart-box { position: relative; width: 100%; }
.chart-box canvas { width: 100%; display: block; }
.chart-legend { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.legend-dot { width: 8px; height: 8px; border-radius: 3px; }
.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-center b { font-size: 24px; font-weight: 700; letter-spacing: -.5px; }
.donut-center span { font-size: 10.5px; color: var(--muted); }
.donut-legend { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.donut-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11.5px; }
.donut-row .dl { display: flex; align-items: center; gap: 7px; color: var(--text-2); }
.donut-row b { font-variant-numeric: tabular-nums; font-weight: 600; }
.donut-row span { color: var(--muted); font-size: 10.5px; margin-left: 3px; }

/* ============ Dashboard ============ */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.hello h1 { font-size: 24px; font-weight: 700; letter-spacing: -.4px; }
.hello h1 em { font-style: normal; color: var(--primary); }
.hello p { color: var(--muted); font-size: 12.5px; margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hello-actions { display: flex; align-items: center; gap: 9px; }
.hello-date { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); background: #fff; border: 1px solid var(--line); padding: 6px 10px; border-radius: 8px; }
.tenant-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 16px; background: linear-gradient(100deg,#f2f7ff,#fbf9ff); border: 1px solid #e3ebfb; border-radius: 12px; flex-wrap: wrap; }
.tb-icon { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg,#4a7bf7,#7c5cf6); color: #fff; display: grid; place-items: center; }
.tb-main { flex: 1; min-width: 200px; }
.tb-title { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.tb-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.tb-sub b { color: var(--text-2); font-variant-numeric: tabular-nums; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(320px, 1fr); gap: 16px; }
.dash-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.dash-grid-2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.live-pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--green-soft); color: #0a8a65; font-size: 10.5px; font-weight: 500; }
.live-pill i { width: 6px; height: 6px; border-radius: 50%; background: #0fae7e; animation: pulseDot 1.6s infinite; }
.live-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f1f5fa; }
.live-item:last-child { border-bottom: 0; }
.live-avatar { width: 32px; height: 32px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.live-main { flex: 1; min-width: 0; }
.live-main b { font-size: 12px; font-weight: 600; display: block; }
.live-main span { font-size: 10.5px; color: var(--muted); display: block; }
.live-timer { font-size: 12px; font-weight: 600; color: var(--green); font-variant-numeric: tabular-nums; }
.mini-task { padding: 11px 0; border-bottom: 1px solid #f1f5fa; }
.mini-task:last-child { border-bottom: 0; }
.mini-task-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mini-task-top b { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-task-top span { font-size: 10.5px; color: var(--muted); }
.progress { height: 6px; background: #edf1f8; border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #4a7bf7, #7c5cf6); transition: width .5s ease; }
.progress.green > i { background: linear-gradient(90deg, #0fae7e, #36d6a6); }
.progress.amber > i { background: linear-gradient(90deg, #e99a0b, #f7c457); }
.progress.red > i { background: linear-gradient(90deg, #e5484d, #f58386); }
.mini-task-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; font-size: 10.5px; color: var(--muted); }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f2f5fa; }
.rank-row:last-child { border-bottom: 0; }
.rank-no { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; color: var(--muted); background: #f2f5fa; }
.rank-row:nth-child(1) .rank-no { background: #fff3d6; color: #b77906; }
.rank-row:nth-child(2) .rank-no { background: #eef2f8; color: #5f7190; }
.rank-row:nth-child(3) .rank-no { background: #fbeee5; color: #b06a36; }
.rank-main { flex: 1; min-width: 0; }
.rank-main b { display: block; font-size: 12px; font-weight: 600; }
.rank-main span { font-size: 10.5px; color: var(--muted); }
.rank-val { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.health-row { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-bottom: 1px solid #f2f5fa; font-size: 11.5px; }
.health-row:last-child { border-bottom: 0; }
.health-row .h-dot { width: 7px; height: 7px; border-radius: 50%; background: #0fae7e; }
.health-row .h-dot.warn { background: #e99a0b; }
.health-row .h-dot.off { background: #9aa7bd; }
.health-row .h-name { flex: 1; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.health-row .h-val { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline-row { display: flex; gap: 10px; padding: 7px 0; position: relative; }
.timeline-row::before { content: ""; position: absolute; left: 7px; top: 25px; bottom: -5px; width: 1px; background: #eaf0f7; }
.timeline-row:last-child::before { display: none; }
.tl-dot { width: 15px; height: 15px; border-radius: 50%; background: #eef3fb; border: 3px solid #fff; box-shadow: 0 0 0 1px #e4ebf5; margin-top: 3px; flex-shrink: 0; }
.tl-main { font-size: 11.5px; color: var(--text-2); }
.tl-main b { font-weight: 600; color: var(--text); }
.tl-time { font-size: 10px; color: var(--muted-2); }
.mini-stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.mini-stat { background: #f8fafd; border: 1px solid #eef2f8; border-radius: 9px; padding: 9px 11px; }
.mini-stat span { font-size: 10.5px; color: var(--muted); display: block; }
.mini-stat b { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ============ Agent cards ============ */
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.agent-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; transition: .2s; position: relative; overflow: hidden; }
.agent-card:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(16,26,47,.1); border-color: #d8e3f5; }
.agent-top { display: flex; align-items: flex-start; gap: 12px; }
.agent-avatar { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; color: #fff; font-size: 17px; font-weight: 700; background: linear-gradient(135deg, #4a7bf7, #7c5cf6); flex-shrink: 0; position: relative; }
.agent-avatar::after { content: ""; position: absolute; inset: -3px; border-radius: 15px; border: 1px solid rgba(83, 112, 255, .22); }
.agent-avatar.edu { background: linear-gradient(135deg, #f59e0b, #f97362); }
.agent-avatar.biz { background: linear-gradient(135deg, #0ea5a4, #0f766e); }
.agent-avatar.draft { background: linear-gradient(135deg, #94a3b8, #64748b); }
.agent-info { flex: 1; min-width: 0; }
.agent-info h3 { font-size: 14.5px; font-weight: 650; line-height: 1.35; }
.agent-info p { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.agent-badges { display: flex; align-items: center; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.agent-desc { font-size: 11.5px; color: var(--muted); line-height: 1.65; margin: 13px 0 12px; min-height: 38px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.agent-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 0; border-top: 1px solid #f0f4fa; border-bottom: 1px solid #f0f4fa; }
.agent-stats .as { text-align: center; }
.agent-stats b { display: block; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.agent-stats span { font-size: 10px; color: var(--muted); }
.agent-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.agent-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.agent-actions { display: flex; gap: 4px; }
.agent-actions .btn { height: 28px; padding: 0 8px; font-size: 11px; }

/* ============ Agent editor ============ */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; padding: 10px 14px; font-size: 12.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text-2); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }
.tab-body { padding: 20px 0 4px; }
.node-flow { display: flex; flex-direction: column; gap: 0; }
.node-card { display: flex; gap: 12px; position: relative; padding-bottom: 18px; }
.node-card::before { content: ""; position: absolute; left: 15px; top: 34px; bottom: 0; width: 1px; background: #e4ebf6; }
.node-card:last-child::before { display: none; }
.node-index { width: 31px; height: 31px; border-radius: 50%; background: #fff; border: 1px solid #d8e3f5; color: var(--muted); font-size: 11px; font-weight: 600; display: grid; place-items: center; flex-shrink: 0; z-index: 1; }
.node-card.start .node-index { background: var(--primary); border-color: var(--primary); color: #fff; }
.node-card.transfer .node-index { background: var(--amber-soft); border-color: #f3ddb0; color: #b77906; }
.node-card.hangup .node-index { background: var(--red-soft); border-color: #f5cdcf; color: #c33b40; }
.node-content { flex: 1; background: #f9fbfe; border: 1px solid #eaf0f8; border-radius: 10px; padding: 11px 13px; }
.node-content .nt { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; }
.node-content .nc { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.6; }
.node-type { font-size: 9.5px; padding: 1px 6px; border-radius: 4px; background: #eef3fb; color: #5c7196; font-weight: 500; }
.node-card.start .node-type { background: var(--primary-soft); color: var(--primary); }
.node-card.transfer .node-type { background: var(--amber-soft); color: #a56f06; }
.node-card.hangup .node-type { background: var(--red-soft); color: #c33b40; }
.node-edit { margin-left: auto; border: 0; background: none; color: var(--muted-2); padding: 2px; }
.intent-list { display: flex; flex-direction: column; gap: 9px; }
.intent-row { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid #eaf0f8; border-radius: 10px; background: #fbfcff; }
.intent-code { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.intent-code.A { background: #e7f8ef; color: #0a8a55; }
.intent-code.B { background: #f0f9e6; color: #58820d; }
.intent-code.C { background: #eaf1ff; color: #2f5fe0; }
.intent-code.D { background: #fff4e5; color: #b37405; }
.intent-code.E { background: #f1f4f9; color: #65758e; }
.intent-code.F { background: #fdeeee; color: #c33b40; }
.intent-info { flex: 1; min-width: 0; }
.intent-info b { font-size: 12.5px; font-weight: 600; }
.intent-info p { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.intent-kws { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.intent-action { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.voice-detail { display: flex; align-items: center; gap: 12px; background: #f8fafd; border: 1px solid #eaf0f8; border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.voice-orb { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(135deg, #4a7bf7, #7c5cf6); color: #fff; display: grid; place-items: center; font-size: 16px; font-weight: 700; flex-shrink: 0; }
.voice-detail b { display: block; font-size: 13px; color: var(--text); }
.voice-detail span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.script-var-bar { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; background: #f8fafd; border: 1px solid #eaf0f8; border-radius: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.script-var-bar .muted { padding-top: 4px; }
.var-table { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 4px 0 12px; }
.import-map { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.import-map .data-table { min-width: 780px; margin: 0; }
.import-map .input, .import-map .select { height: 32px; min-height: 32px; font-size: 11.5px; padding: 0 8px; }
.var-head, .var-row { display: grid; grid-template-columns: 128px 118px 108px 1fr 1.2fr 32px; gap: 8px; align-items: center; padding: 8px 10px; }
.var-head { background: #f8fafd; border-bottom: 1px solid var(--line); font-size: 10.5px; color: var(--muted); }
.var-row { border-bottom: 1px solid #f1f5fa; }
.var-row:last-child { border-bottom: 0; }
.var-row .input, .var-row .select { height: 32px; min-height: 32px; font-size: 11.5px; padding: 0 8px; }
@media (max-width: 900px) {
  .var-head { display: none; }
  .var-row { grid-template-columns: 1fr 1fr; }
  .var-row [data-var-desc] { grid-column: 1 / -1; }
  .voice-detail { flex-wrap: wrap; }
}
.editor-head { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.editor-head .agent-avatar { width: 52px; height: 52px; border-radius: 14px; font-size: 19px; }
.editor-head-info h2 { font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.editor-head-info p { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.editor-meta { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ============ Tasks ============ */
.task-hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.task-progress-card { padding: 20px; }
.task-progress-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.task-progress-top .big { font-size: 34px; font-weight: 700; letter-spacing: -1px; font-variant-numeric: tabular-nums; line-height: 1; }
.task-progress-top .big small { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 4px; letter-spacing: 0; }
.task-progress-top .pct { font-size: 15px; font-weight: 700; color: var(--primary); }
.task-progress-bar { height: 9px; margin: 16px 0 12px; }
.task-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.task-stat { background: #f8fafd; border-radius: 9px; padding: 10px 12px; }
.task-stat b { display: block; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.task-stat span { font-size: 10.5px; color: var(--muted); }
.task-insight { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.task-insight > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #fbfcff; border: 1px solid #eef3fa; border-radius: 9px; padding: 9px 12px; }
.task-insight span { font-size: 10.5px; color: var(--muted); }
.task-insight b { font-size: 12.5px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.task-side { padding: 18px 20px; }
.task-side-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed #edf1f8; font-size: 12px; }
.task-side-row:last-child { border-bottom: 0; }
.task-side-row span { color: var(--muted); }
.task-side-row b { font-weight: 500; color: var(--text-2); text-align: right; }
.task-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.task-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 17px; transition: .18s; }
.task-card:hover { box-shadow: 0 12px 32px rgba(16,26,47,.08); border-color: #d8e3f5; }
.task-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.task-card-top h3 { font-size: 14px; font-weight: 650; line-height: 1.45; }
.task-card-top p { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.task-card .progress { margin: 14px 0 8px; }
.task-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 11px; border-top: 1px solid #f0f4fa; font-size: 11px; color: var(--muted); }
.task-card-stats { display: flex; gap: 16px; margin-top: 10px; font-size: 10.5px; color: var(--muted); }
.task-card-stats b { font-size: 12px; color: var(--text-2); font-weight: 600; margin-right: 3px; }
.task-actions { display: flex; gap: 5px; }

/* ============ Records / Detail ============ */
.record-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.record-avatar { width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(135deg, #eef3ff, #e8e2ff); color: var(--primary); display: grid; place-items: center; font-size: 18px; font-weight: 700; }
.record-head h2 { font-size: 17px; font-weight: 700; }
.record-head p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.record-summary { background: linear-gradient(135deg, #f6f9ff, #fbf9ff); border: 1px solid #e6edfb; border-radius: 12px; padding: 14px 16px; font-size: 12px; color: var(--text-2); line-height: 1.75; }
.record-summary b { color: var(--text); }
.audio-player { display: flex; align-items: center; gap: 12px; background: #101c31; border-radius: 12px; padding: 12px 14px; color: #dfe8f7; }
.audio-player .ap-play { width: 34px; height: 34px; border-radius: 50%; border: 0; background: linear-gradient(135deg, #4a7bf7, #7c5cf6); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.waveform { flex: 1; height: 34px; display: flex; align-items: center; gap: 2px; overflow: hidden; }
.waveform i { width: 2px; border-radius: 2px; background: rgba(167, 190, 255, .55); flex-shrink: 0; }
.waveform i.played { background: #7d9dff; }
.ap-time { font-size: 10.5px; color: #8fa4c6; font-variant-numeric: tabular-nums; white-space: nowrap; }
.transcript { display: flex; flex-direction: column; gap: 10px; }
.bubble-row { display: flex; gap: 8px; align-items: flex-start; }
.bubble-row.user { flex-direction: row-reverse; }
.bubble-avatar { width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center; font-size: 10px; font-weight: 600; flex-shrink: 0; background: var(--primary-soft); color: var(--primary); }
.bubble-row.user .bubble-avatar { background: #f0eefb; color: #6d5cf6; }
.bubble { max-width: 78%; padding: 9px 12px; border-radius: 11px; background: #f5f8fd; font-size: 11.5px; line-height: 1.7; color: var(--text-2); }
.bubble-row.user .bubble { background: #edf2ff; color: #2c4a94; }
.bubble .bt { font-size: 9.5px; color: var(--muted-2); margin-top: 5px; }
.bubble em { font-style: normal; background: rgba(53,104,245,.12); color: #2f5fe0; border-radius: 3px; padding: 0 2px; }
.meta-list { display: flex; flex-direction: column; }
.meta-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px dashed #edf1f8; font-size: 11.5px; }
.meta-row:last-child { border-bottom: 0; }
.meta-row span { color: var(--muted); }
.meta-row b { font-weight: 500; color: var(--text-2); text-align: right; }
.score-ring { width: 74px; height: 74px; position: relative; flex-shrink: 0; }
.score-ring .sr-val { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-ring .sr-val b { font-size: 20px; font-weight: 700; line-height: 1; }
.score-ring .sr-val span { font-size: 9px; color: var(--muted); margin-top: 2px; }
.summary-grid { display: grid; grid-template-columns: 88px 1fr; gap: 14px; align-items: center; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

/* ============ Simulation ============ */
.sim-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.sim-phone { background: #0c1729; border-radius: 18px; overflow: hidden; color: #dbe6f8; border: 1px solid #1b2d4a; box-shadow: 0 20px 50px rgba(9,18,36,.2); }
.sim-head { padding: 18px 20px 14px; border-bottom: 1px solid rgba(255,255,255,.07); display: flex; align-items: center; gap: 12px; }
.sim-head .agent-avatar { width: 42px; height: 42px; border-radius: 12px; font-size: 16px; }
.sim-head .sh-info { flex: 1; }
.sim-head .sh-info b { display: block; font-size: 13.5px; color: #eef4ff; }
.sim-head .sh-info span { font-size: 10.5px; color: #7f95ba; }
.sim-wave { display: flex; align-items: center; gap: 3px; height: 26px; padding: 0 20px 10px; }
.sim-wave i { flex: 1; border-radius: 2px; background: linear-gradient(180deg, #6f95ff, #3f66e6); opacity: .55; animation: waveBar 1.3s ease-in-out infinite; }
.sim-wave.paused i { animation-play-state: paused; opacity: .22; }
.sim-messages { height: clamp(220px, calc(100vh - 430px), 400px); overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 13px; background: radial-gradient(800px 300px at 50% 0, rgba(58, 92, 170, .16), transparent 70%); }
.sim-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); }
.sim-msg { display: flex; gap: 9px; align-items: flex-start; max-width: 88%; }
.sim-msg.user { flex-direction: row-reverse; align-self: flex-end; }
.sim-msg .sm-avatar { width: 27px; height: 27px; border-radius: 8px; background: rgba(120,150,240,.18); color: #9fb7f3; display: grid; place-items: center; font-size: 10px; flex-shrink: 0; }
.sim-msg.user .sm-avatar { background: rgba(168, 139, 255, .18); color: #c4aeff; }
.sim-msg .sm-bubble { padding: 10px 13px; border-radius: 12px; background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.07); font-size: 12px; line-height: 1.75; color: #d5e1f4; }
.sim-msg.user .sm-bubble { background: rgba(84, 113, 235, .22); border-color: rgba(122, 149, 255, .18); color: #e6edff; }
.sim-msg .sm-time { font-size: 9px; color: #6e83a8; margin-top: 4px; }
.sim-typing { display: inline-flex; gap: 4px; padding: 2px 0; }
.sim-typing i { width: 5px; height: 5px; border-radius: 50%; background: #8fa8d6; animation: typing 1.1s infinite; }
.sim-typing i:nth-child(2) { animation-delay: .15s; }
.sim-typing i:nth-child(3) { animation-delay: .3s; }
.sim-input { padding: 12px 16px 14px; border-top: 1px solid rgba(255,255,255,.07); background: rgba(255,255,255,.025); }
.quick-phrases { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 9px; }
.quick-phrases button { border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); color: #a9bde0; font-size: 10.5px; padding: 3px 8px; border-radius: 999px; }
.quick-phrases button:hover { background: rgba(255,255,255,.08); color: #dbe7fb; }
.sim-input-row { display: flex; gap: 8px; }
.sim-input-row input { flex: 1; min-width: 0; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); color: #e6eefc; border-radius: 10px; padding: 10px 13px; font-size: 12.5px; outline: none; }
.sim-input-row input:focus { border-color: rgba(120,150,240,.5); }
.sim-input-row input::placeholder { color: #6f83a6; }
.sim-send { width: 40px; height: 40px; border-radius: 10px; border: 0; background: linear-gradient(135deg, #4a7bf7, #7c5cf6); color: #fff; display: grid; place-items: center; }
.sim-analysis { display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 180px); overflow-y: auto; padding-right: 4px; }
.analysis-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.analysis-card h4 { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; align-items: center; justify-content: space-between; }
.intent-live { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.intent-live .intent-code { width: 46px; height: 46px; font-size: 18px; border-radius: 13px; }
.intent-live .il-info b { display: block; font-size: 15px; font-weight: 700; }
.intent-live .il-info span { font-size: 10.5px; color: var(--muted); }
.score-bar { height: 5px; background: #edf1f8; border-radius: 999px; overflow: hidden; margin-top: 10px; }
.score-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #0fae7e, #6d5cf6); }
.kw-hits { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 10px; }
.sim-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sim-actions .btn { height: 36px; }

/* ============ Dialer ============ */
.dial-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); gap: 16px; align-items: start; }
.dial-panel { padding: 22px; }
.dial-display { background: #0c1729; border-radius: 14px; padding: 20px; color: #e7efff; position: relative; overflow: hidden; }
.dial-display::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(90, 120, 255, .25), transparent 70%); }
.dial-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dial-label { font-size: 10.5px; color: #7f95ba; margin-bottom: 6px; letter-spacing: .5px; }
.dial-phone { font-size: 27px; font-weight: 600; letter-spacing: 2px; color: #fff; margin: 15px 0 4px; min-height: 40px; font-variant-numeric: tabular-nums; }
.dial-phone.empty { font-size: 19px; letter-spacing: 5px; color: #475b7c; font-weight: 500; padding-top: 5px; }
.dial-sub { font-size: 11px; color: #7f95ba; }
.dialpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.key { height: 52px; border-radius: 12px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.045); color: #e7efff; font-size: 19px; font-weight: 500; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; transition: .12s; }
.key small { font-size: 8px; letter-spacing: 1px; color: #7f95ba; }
.key:hover { background: rgba(255,255,255,.09); }
.key:active { transform: scale(.97); }
.dial-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.dial-call { flex: 1; height: 48px; border: 0; border-radius: 12px; background: linear-gradient(100deg, #0fae7e, #12c78f); color: #fff; font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 10px 24px rgba(15,174,126,.28); }
.dial-call:hover { filter: brightness(1.04); }
.live-call-card { padding: 18px 20px; }
.live-call-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.caller-info { display: flex; align-items: center; gap: 12px; }
.caller-info .ci-avatar { width: 46px; height: 46px; border-radius: 13px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; position: relative; }
.caller-info .ci-avatar::after { content: ""; position: absolute; inset: -4px; border-radius: 16px; border: 1px solid rgba(53,104,245,.2); animation: pulseRing 2s infinite; }
.caller-info b { display: block; font-size: 14px; }
.caller-info span { font-size: 11px; color: var(--muted); }
.call-stage { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 11.5px; color: var(--green); margin: 14px 0 4px; }
.call-stage i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulseDot 1.4s infinite; }
.call-timer { text-align: center; font-size: 32px; font-weight: 700; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.call-waves { display: flex; align-items: center; justify-content: center; gap: 3px; height: 40px; margin: 8px 0 10px; }
.call-waves i { width: 3px; border-radius: 3px; background: linear-gradient(180deg, #6f95ff, #4a7bf7); animation: waveBar 1s ease-in-out infinite; }
.recent-call-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f1f5fa; font-size: 11.5px; }
.recent-call-row:last-child { border-bottom: 0; }
.rc-status { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }
.rc-status.ok { background: var(--green-soft); color: var(--green); }
.rc-status.miss { background: var(--red-soft); color: var(--red); }
.rc-status.live { background: var(--primary-soft); color: var(--primary); }
.rc-main { flex: 1; min-width: 0; }
.rc-main b { display: block; font-size: 11.5px; font-weight: 500; }
.rc-main span { font-size: 10px; color: var(--muted); }
.rc-time { font-size: 10px; color: var(--muted-2); white-space: nowrap; }

/* ============ Lines / Providers ============ */
.line-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.line-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 17px; }
.line-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.line-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.line-title b { display: block; font-size: 13.5px; font-weight: 600; }
.line-title span { font-size: 10.5px; color: var(--muted); }
.line-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 10px; }
.line-metric { background: #f8fafd; border-radius: 8px; padding: 8px 10px; }
.line-metric span { display: block; font-size: 10px; color: var(--muted); }
.line-metric b { font-size: 13.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.line-usage-top { display: flex; align-items: center; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-bottom: 5px; }
.line-numbers { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 10px; }
.provider-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.provider-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 17px; }
.provider-top { display: flex; align-items: flex-start; gap: 11px; }
.provider-logo { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; letter-spacing: .3px; color: #fff; background: linear-gradient(135deg, #4a7bf7, #7c5cf6); flex-shrink: 0; }
.provider-logo.tts { background: linear-gradient(135deg, #0ea5a4, #0f766e); }
.provider-logo.llm { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.provider-logo.sms { background: linear-gradient(135deg, #f59e0b, #f97316); }
.provider-logo.crm { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.provider-info { flex: 1; min-width: 0; }
.provider-info b { display: block; font-size: 12.5px; font-weight: 600; }
.provider-info span { font-size: 10.5px; color: var(--muted); }
.provider-desc { font-size: 11px; color: var(--muted); line-height: 1.6; margin-top: 11px; min-height: 35px; }
.provider-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 11px; border-top: 1px solid #f0f4fa; }
.provider-meta { display: flex; align-items: center; gap: 10px; font-size: 10.5px; color: var(--muted); }

/* ============ Settings ============ */
.settings-layout { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 16px; align-items: start; }
.settings-nav { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; position: sticky; top: 84px; }
.settings-nav button { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: none; padding: 9px 11px; border-radius: 8px; color: var(--text-2); font-size: 12px; text-align: left; }
.settings-nav button .ic { color: var(--muted); }
.settings-nav button:hover { background: #f5f8fd; }
.settings-nav button.active { background: var(--primary-soft); color: var(--primary); font-weight: 500; }
.settings-nav button.active .ic { color: var(--primary); }
.settings-panel { min-width: 0; }
.settings-panel .card-head { padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.perm-matrix { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.perm-matrix th { text-align: left; padding: 8px; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line); font-size: 10.5px; }
.perm-matrix td { padding: 8px; border-bottom: 1px solid #f0f4fa; }
.perm-matrix td.c { text-align: center; }
.perm-matrix input { width: 15px; height: 15px; accent-color: var(--primary); }
.notice-admin { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px solid #f0f4fa; }
.notice-admin:last-child { border-bottom: 0; }
.notice-admin .na-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex-shrink: 0; }
.notice-admin b { font-size: 12.5px; }
.notice-admin p { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ============ Empty / misc ============ */
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty .empty-icon { width: 56px; height: 56px; border-radius: 16px; background: #f1f5fb; display: grid; place-items: center; margin: 0 auto 12px; color: #9aabc4; }
.empty b { display: block; color: var(--text-2); font-size: 13px; margin-bottom: 3px; }
.empty span { font-size: 11.5px; }
.section-title { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.section-title .ic { color: var(--primary); }
.hr { height: 1px; background: var(--line); margin: 18px 0; }
.loading-block { padding: 60px; display: grid; place-items: center; color: var(--muted); gap: 12px; }
.spinner { width: 26px; height: 26px; border: 2.5px solid #e4ebf6; border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.chip-close { border: 0; background: none; color: var(--muted-2); display: inline-flex; padding: 0 0 0 2px; }
.copy-key { font-family: var(--mono); font-size: 10.5px; background: #f4f7fc; border: 1px solid var(--line); padding: 2px 6px; border-radius: 5px; color: var(--text-2); }
.warn-banner { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px; background: var(--amber-soft); border: 1px solid #f7e3b9; color: #8a6208; font-size: 11.5px; margin-bottom: 16px; }
.warn-banner .ic { flex-shrink: 0; }

/* ============ Animations ============ */
@keyframes pulseDot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(.86); } }
@keyframes pulseRing { 0% { transform: scale(.96); opacity: .7; } 70% { transform: scale(1.12); opacity: 0; } 100% { opacity: 0; } }
@keyframes waveBar { 0%, 100% { transform: scaleY(.45); } 50% { transform: scaleY(1); } }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }

/* ============ Responsive ============ */
@media (max-width: 1320px) {
  .dash-grid { grid-template-columns: minmax(0, 1.5fr) minmax(290px, 1fr); }
  .dash-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .sidebar { width: 70px; }
  .sidebar-brand { padding: 0 18px; }
  .brand-text, .nav-label, .nav-badge, .engine-card, .nav-item span { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item.active::before { left: 0; }
  .nav-scroll { padding: 14px 9px; }
  .nav-group { margin-bottom: 8px; }
  .main { margin-left: 70px; }
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-mobile-brand { display: flex; }
  .sim-layout, .dial-layout, .task-hero { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; display: flex; overflow-x: auto; padding: 6px; }
  .settings-nav button { white-space: nowrap; width: auto; }
}
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid, .dash-grid-2, .dash-grid-3 { grid-template-columns: 1fr; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .kv-grid { grid-template-columns: 1fr 1fr; }
  .content { padding: 16px 16px 36px; }
  .topbar { padding: 0 16px; }
  .global-search { display: none; }
  .page-title { font-size: 20px; }
}
@media (max-width: 760px) {
  .notice-pop { position: fixed; top: 66px; left: 10px; right: 10px !important; width: auto; max-height: calc(100vh - 90px); overflow-y: auto; }
  .card-head { flex-wrap: wrap; }
  .card-tools { flex-wrap: wrap; }
  .sidebar { transform: translateX(-100%); transition: .2s; width: 238px; }
  .sidebar.open { transform: none; }
  .sidebar.open .brand-text, .sidebar.open .nav-label, .sidebar.open .nav-badge, .sidebar.open .engine-card, .sidebar.open .nav-item span { display: block; }
  .sidebar.open .nav-item { justify-content: flex-start; padding: 0 11px; }
  .sidebar.open .brand-text { display: block; }
  .sidebar.open .engine-card { display: block; }
  .main { margin-left: 0; }
  .mobile-toggle { display: grid; }
  .topbar-live { display: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .page-actions { width: 100%; }
  .login-panel { padding: 26px 18px; }
  .login-copy h1 { font-size: 32px; }
  .agent-grid, .task-card-grid, .line-grid, .provider-grid { grid-template-columns: 1fr; }
  .modal-backdrop { padding-top: 2vh; }
  .modal-body { max-height: 76vh; }
}
@media (max-width: 520px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-grid .stat-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .task-stat-grid { grid-template-columns: 1fr 1fr; }
  .kv-grid { grid-template-columns: 1fr; }
  .dial-selects { grid-template-columns: 1fr; }
  .sim-actions { grid-template-columns: 1fr; }
  .topbar-user .u-name, .topbar-user .u-role { display: none; }
  .breadcrumb .sep, .breadcrumb .bc-parent { display: none; }
}
