/* VoiceReach console */
:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --line: #e6e9f2;
  --line-strong: #d6dbe7;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --accent: #4f46e5;
  --accent-2: #06b6d4;
  --accent-soft: #eef0ff;
  --green: #16a34a;
  --green-soft: #e8f7ee;
  --amber: #d97706;
  --amber-soft: #fff4e0;
  --red: #dc2626;
  --red-soft: #fdecec;
  --orange: #ea580c;
  --orange-soft: #fff0e6;
  --blue: #2563eb;
  --blue-soft: #e8f0ff;
  --slate-soft: #eef1f6;
  --violet: #7c3aed;
  --violet-soft: #f2ecff;
  --nav: #0b1222;
  --nav-2: #121b31;
  --nav-text: #a8b3cf;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, .18), 0 4px 12px rgba(15, 23, 42, .08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex: 0 0 236px; background: linear-gradient(180deg, var(--nav) 0%, #0d1528 100%);
  color: var(--nav-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 18px; color: #fff; }
.logo { display: flex; align-items: center; }
.logo { background: #fff; border-radius: 9px; padding: 5px 7px; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.logo img, .logo svg { height: 24px; width: auto; max-width: 120px; display: block; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 6px 12px; flex: 1; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #5d6a88; padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px; color: var(--nav-text);
  font-weight: 500; transition: background .15s, color .15s;
}
.nav a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 18px; }
.nav a:hover { background: rgba(255, 255, 255, .05); color: #e2e8f5; }
.nav a.active { background: linear-gradient(90deg, rgba(99, 102, 241, .28), rgba(99, 102, 241, .08)); color: #fff; box-shadow: inset 2px 0 0 #818cf8; }
.nav .badge { margin-left: auto; background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 0 7px; line-height: 18px; }
.nav .badge.live-badge { background: #16a34a; }
.sidebar-foot { padding: 14px; border-top: 1px solid rgba(255, 255, 255, .06); }
.campaign-mini { display: flex; gap: 10px; align-items: center; background: var(--nav-2); border-radius: 10px; padding: 10px 12px; }
.cm-label { font-size: 11px; color: #6b7894; }
.cm-name { color: #e2e8f5; font-weight: 600; font-size: 13px; line-height: 1.3; }
.studio-link { display: block; margin-top: 10px; font-size: 12.5px; color: #8b98b8; padding: 2px 4px; }
.studio-link:hover { color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: 0 0 8px; }
.dot.live { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 18px 32px 14px; position: sticky; top: 0; z-index: 20;
  background: rgba(244, 246, 251, .88); backdrop-filter: saturate(1.4) blur(10px);
}
.page-title h1 { font-size: 22px; font-weight: 700; }
.page-title p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.topbar-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.content { padding: 8px 32px 40px; }
.icon-btn.menu-btn { display: none; }

/* ---------- buttons, inputs ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--text-2); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: #f8f9fc; border-color: #c7cede; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(79, 70, 229, .3); }
.btn.primary:hover { background: #4338ca; }
.btn.success { background: var(--green); border-color: var(--green); color: #fff; }
.btn.success:hover { background: #15803d; }
.btn.danger { color: var(--red); }
.btn.danger.solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--slate-soft); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--text-2); stroke-width: 2; stroke-linecap: round; }
.input, select.input, textarea.input {
  height: 36px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-strong); background: #fff; outline: none; min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; padding: 9px 12px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: #a5b4fc; box-shadow: 0 0 0 3px rgba(99, 102, 241, .15); }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 10px; width: 16px; height: 16px; fill: none; stroke: var(--faint); stroke-width: 2; stroke-linecap: round; }
.search .input { padding-left: 34px; width: 260px; }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--line-strong); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 0 11px; height: 28px; border-radius: 7px; font-weight: 600; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--accent-soft); color: var(--accent); }
label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 12.5px; color: var(--text-2); }
label.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
label.field .input, label.field select, label.field textarea { font-weight: 400; color: var(--text); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 6px; }
.card-head h3 { font-size: 15px; font-weight: 650; }
.card-head .sub { color: var(--muted); font-size: 12.5px; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 10px 18px 18px; }
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.mt { margin-top: 18px; }
.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 220px; }
.chart-box.lg { height: 300px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { padding: 16px 18px; position: relative; overflow: hidden; }
.kpi .k-top { display: flex; align-items: center; gap: 9px; color: var(--muted); font-weight: 600; font-size: 12.5px; }
.kpi .k-ico { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.kpi .k-ico svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kpi .k-val { font-size: 28px; font-weight: 750; letter-spacing: -0.03em; margin-top: 10px; line-height: 1.1; }
.kpi .k-val small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.kpi .k-foot { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.kpi .k-foot b { color: var(--text-2); font-weight: 600; }
.tone-indigo { background: var(--accent-soft); color: var(--accent); }
.tone-cyan { background: #e2f8fc; color: #0891b2; }
.tone-green { background: var(--green-soft); color: var(--green); }
.tone-amber { background: var(--amber-soft); color: var(--amber); }
.tone-violet { background: var(--violet-soft); color: var(--violet); }
.tone-blue { background: var(--blue-soft); color: var(--blue); }
.tone-red { background: var(--red-soft); color: var(--red); }
.tone-slate { background: var(--slate-soft); color: #475569; }
.meter { height: 6px; background: var(--slate-soft); border-radius: 4px; overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--slate-soft); color: #475569; }
.chip .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.hot { background: var(--red-soft); color: #c2410c; }
.chip.warm { background: var(--amber-soft); color: #b45309; }
.chip.cold { background: var(--blue-soft); color: var(--blue); }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.amber { background: var(--amber-soft); color: #b45309; }
.chip.blue { background: var(--blue-soft); color: var(--blue); }
.chip.violet { background: var(--violet-soft); color: var(--violet); }
.chip.indigo { background: var(--accent-soft); color: var(--accent); }
.chip.slate { background: var(--slate-soft); color: #475569; }
.chip.outline { background: #fff; border: 1px solid var(--line-strong); color: var(--text-2); }
.chip.live { background: #dcfce7; color: #15803d; }
.chip.sim { background: #f1f5f9; color: #64748b; border: 1px dashed #cbd5e1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* tables */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfe; white-space: nowrap; position: sticky; top: 0; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr:hover { background: #f8f9fd; }
.tbl tbody tr.sel { background: #f5f6ff; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tbl .who .nm { font-weight: 600; color: var(--text); white-space: nowrap; }
.tbl .who .co { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
.tbl .num { font-variant-numeric: tabular-nums; }
.tbl .muted { color: var(--muted); }
.tbl input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.avatar { width: 32px; height: 32px; border-radius: 50%; flex: 0 0 32px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; color: #fff; }
.avatar.lg { width: 48px; height: 48px; flex-basis: 48px; font-size: 16px; }
.score { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.score .meter { flex: 1; }
.score b { font-variant-numeric: tabular-nums; font-size: 12.5px; width: 24px; text-align: right; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.toolbar .spacer { flex: 1; }
.selbar { display: flex; align-items: center; gap: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 600; padding: 8px 12px; border-radius: 10px; }
.trunc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* overview pieces */
.funnel { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
.funnel .row { display: grid; grid-template-columns: 92px 1fr 74px; align-items: center; gap: 10px; }
.funnel .lbl { color: var(--text-2); font-weight: 600; font-size: 13px; }
.funnel .bar { height: 30px; border-radius: 8px; background: var(--slate-soft); position: relative; overflow: hidden; }
.funnel .bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 8px; }
.funnel .bar span { position: absolute; left: 10px; top: 0; line-height: 30px; font-weight: 700; color: #fff; font-size: 13px; text-shadow: 0 1px 1px rgba(0, 0, 0, .15); }
.funnel .pct { text-align: right; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.list { display: flex; flex-direction: column; }
.list .li { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.list .li:last-child { border-bottom: 0; }
.list .li:hover .nm { color: var(--accent); }
.list .li .nm { font-weight: 600; }
.list .li .meta { color: var(--muted); font-size: 12.5px; }
.list .li .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.autopilot { background: linear-gradient(135deg, #1e1b4b 0%, #312e81 55%, #0e7490 130%); color: #e0e7ff; border: 0; position: relative; overflow: hidden; }
.autopilot::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .12), transparent 70%); }
.autopilot .card-head h3 { color: #fff; }
.autopilot .card-head .sub { color: #a5b4fc; }
.autopilot .ap-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.autopilot select.input { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); color: #fff; }
.autopilot select.input option { color: var(--text); }
.autopilot .btn { border-color: transparent; }
.autopilot .ap-stat { font-size: 13px; color: #c7d2fe; }
.autopilot .ap-progress { height: 8px; border-radius: 6px; background: rgba(255, 255, 255, .14); overflow: hidden; margin: 14px 0 10px; position: relative; z-index: 1; }
.autopilot .ap-progress i { display: block; height: 100%; background: linear-gradient(90deg, #a5b4fc, #22d3ee); border-radius: 6px; transition: width .5s; }
.autopilot .ap-log { position: relative; z-index: 1; max-height: 132px; overflow: auto; font-size: 12.5px; display: flex; flex-direction: column; gap: 4px; }
.autopilot .ap-log div { color: #c7d2fe; }
.autopilot .ap-log time { color: #818cf8; font-variant-numeric: tabular-nums; margin-right: 8px; }
.autopilot .ap-note { position: relative; z-index: 1; font-size: 12px; color: #a5b4fc; margin-top: 10px; }
.pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); } 70% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

/* ---------- live call ---------- */
.live-grid { display: grid; grid-template-columns: 270px minmax(0, 1fr) 350px; gap: 18px; align-items: start; }
.lead-card .lc-top { display: flex; gap: 12px; align-items: center; padding: 18px 18px 12px; }
.lead-card .lc-top h3 { font-size: 16px; }
.lead-card .lc-top .co { color: var(--muted); font-size: 13px; }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 7px 10px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text-2); font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.points { margin: 0; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 7px; color: var(--text-2); font-size: 13px; }
.points li::marker { color: var(--accent); }
.subhead { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 650; margin: 16px 0 8px; }
.phone { overflow: hidden; }
.phone-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: linear-gradient(135deg, #111a33, #1e2a4d); color: #e2e8f5; }
.phone-head .who { font-weight: 650; color: #fff; }
.phone-head .sub2 { font-size: 12.5px; color: #9fb0d6; }
.phone-head .timer { margin-left: auto; font-family: var(--mono); font-size: 18px; color: #fff; letter-spacing: .02em; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px; border-radius: 13px; font-size: 12.5px; font-weight: 650; }
.status-pill.dialing { background: rgba(251, 191, 36, .16); color: #fbbf24; }
.status-pill.in_progress { background: rgba(34, 197, 94, .16); color: #4ade80; }
.status-pill.completed, .status-pill.done { background: rgba(148, 163, 184, .18); color: #cbd5e1; }
.status-pill.failed { background: rgba(248, 113, 113, .18); color: #fca5a5; }
.status-pill .pulse { width: 7px; height: 7px; }
.phone-frame { height: 560px; background: #0f172a; }
.phone-frame iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.phone-foot { padding: 11px 18px; font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; border-top: 1px solid var(--line); }
.phone-foot svg { width: 16px; height: 16px; fill: none; stroke: var(--accent); stroke-width: 2; flex: 0 0 16px; }
.transcript { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; overflow-y: auto; }
.live-transcript { height: 560px; }
.bubble-row { display: flex; flex-direction: column; max-width: 88%; }
.bubble-row.agent { align-self: flex-start; }
.bubble-row.lead { align-self: flex-end; align-items: flex-end; }
.bubble { padding: 9px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; }
.bubble-row.agent .bubble { background: var(--slate-soft); color: var(--text); border-top-left-radius: 4px; }
.bubble-row.lead .bubble { background: var(--accent); color: #fff; border-top-right-radius: 4px; }
.bubble-meta { font-size: 11.5px; color: var(--faint); margin: 3px 4px 0; }
.typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 10px 13px; background: var(--slate-soft); border-radius: 14px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.empty-mini { color: var(--faint); text-align: center; padding: 40px 12px; font-size: 13px; }
.banner { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 12px; font-weight: 600; }
.banner svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 22px; }
.banner.green { background: var(--green-soft); color: #166534; border: 1px solid #bbf7d0; }
.banner.indigo { background: var(--accent-soft); color: #3730a3; border: 1px solid #c7d2fe; }
.banner.slate { background: #fff; color: var(--text-2); border: 1px solid var(--line); }
.banner .sm { font-weight: 500; font-size: 13px; color: inherit; opacity: .85; }
.analysis-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat { background: #fafbfe; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat .s-lbl { color: var(--muted); font-size: 12px; font-weight: 600; }
.stat .s-val { font-size: 20px; font-weight: 750; margin-top: 4px; letter-spacing: -0.02em; }
.gauge { position: relative; width: 100%; max-width: 150px; margin: 4px auto 0; }
.gauge svg { width: 100%; height: auto; }
.gauge .g-val { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; font-size: 22px; font-weight: 800; letter-spacing: -0.03em; }
.summary-box { background: #fafbfe; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--text-2); font-size: 13.5px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(79, 70, 229, .2); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: 0 0 18px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- CRM ---------- */
.crm-stats { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.crm-stats .card { padding: 12px 16px; min-width: 160px; }
.crm-stats .s-lbl { color: var(--muted); font-size: 12px; font-weight: 600; }
.crm-stats .s-val { font-size: 20px; font-weight: 750; letter-spacing: -0.02em; }
.board { display: grid; grid-template-columns: repeat(5, minmax(178px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; align-items: start; }
.col { background: #eceff6; border-radius: 14px; padding: 10px; min-height: 360px; transition: background .15s, box-shadow .15s; }
.col.over { background: #e3e7ff; box-shadow: inset 0 0 0 2px #a5b4fc; }
.col-head { display: flex; align-items: center; gap: 7px; padding: 4px 4px 10px; }
.col-head .cdot, .col-head .cnt, .col-head .val { flex: 0 0 auto; }
.col-head .cdot { width: 9px; height: 9px; border-radius: 50%; }
.col-head h4 { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.col-head .cnt { color: var(--muted); font-size: 12px; font-weight: 600; background: #fff; border-radius: 10px; padding: 0 7px; }
.col-head { flex-wrap: wrap; row-gap: 2px; }
.col-head .val { flex-basis: 100%; padding-left: 16px; color: var(--muted); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.deal { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; margin-bottom: 9px; cursor: grab; box-shadow: var(--shadow); transition: box-shadow .15s, transform .1s; }
.deal:hover { box-shadow: 0 6px 16px rgba(15, 23, 42, .1); }
.deal.dragging { opacity: .5; transform: rotate(1.5deg); }
.deal .d-top { display: flex; align-items: center; gap: 8px; }
.deal .d-name { font-weight: 650; font-size: 13.5px; }
.deal .d-co { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.deal .d-next { font-size: 12.5px; color: var(--text-2); margin-top: 8px; display: flex; gap: 6px; align-items: flex-start; }
.deal .d-next svg { width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 2; flex: 0 0 14px; margin-top: 2px; }
.deal .d-foot { display: flex; align-items: center; gap: 6px; margin-top: 9px; }
.deal .d-val { margin-left: auto; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.col-empty { border: 1.5px dashed #cdd3e2; border-radius: 11px; padding: 22px 10px; text-align: center; color: var(--faint); font-size: 12.5px; }

/* ---------- drawer, modal, toasts ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; right: 0; top: 0; bottom: 0; width: min(640px, 96vw); background: #fff; box-shadow: var(--shadow-lg); transform: translateX(105%); transition: transform .25s ease; z-index: 41; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { font-size: 17px; }
.drawer-head .sub { color: var(--muted); font-size: 13px; }
.drawer-head .right { margin-left: auto; display: flex; gap: 8px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px 30px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px 0 16px; }
.tabs button { border: 0; background: none; padding: 10px 12px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal-backdrop.open { display: flex; }
.modal { background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); width: min(620px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: pop .18s ease; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { padding: 18px 22px 6px; display: flex; align-items: flex-start; gap: 10px; }
.modal-head h3 { font-size: 17px; }
.modal-head p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.modal-head .icon-btn { margin-left: auto; border: 0; }
.modal-body { padding: 12px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px 18px; display: flex; gap: 10px; justify-content: flex-end; align-items: center; }
.modal-foot .left { margin-right: auto; color: var(--muted); font-size: 12.5px; }
.code-hint { font-family: var(--mono); font-size: 12px; background: #f8fafc; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; color: #475569; white-space: pre; overflow-x: auto; }
.toasts { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.toast { display: flex; gap: 10px; align-items: center; background: #0f172a; color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 500; min-width: 260px; max-width: 420px; animation: pop .2s ease; }
.toast svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 18px; }
.toast.ok svg { color: #4ade80; }
.toast.err svg { color: #f87171; }

/* empty + skeleton */
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .e-ico { width: 52px; height: 52px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.empty .e-ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.empty h4 { color: var(--text); font-size: 15px; margin-bottom: 4px; }
.skel { background: linear-gradient(90deg, #eef1f6 25%, #f6f8fb 50%, #eef1f6 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 10px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel-kpi { height: 112px; border-radius: var(--radius); }
.skel-card { height: 320px; border-radius: var(--radius); }
.err-box { background: var(--red-soft); color: #991b1b; border: 1px solid #fecaca; border-radius: 12px; padding: 14px 16px; }

/* misc */
.legend-dots { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend-dots span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dots i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.profile-tbl td, .profile-tbl th { padding: 9px 12px; }
.note { color: var(--muted); font-size: 12.5px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.opening { background: linear-gradient(135deg, #eef0ff, #e6fbff); border: 1px solid #c7d2fe; border-radius: 12px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; }
.opening .o-ico { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; flex: 0 0 34px; }
.opening .o-ico svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.opening q { font-size: 14.5px; color: #1e1b4b; font-weight: 500; quotes: "“" "”"; }
.opening .o-lbl { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); font-weight: 700; margin-bottom: 3px; }

/* ---------- responsive ---------- */
@media (max-width: 1360px) {
  /* laptop demo screen: call window + transcript side by side first, lead details underneath */
  .live-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .live-grid .lead-col { grid-column: 1 / -1; order: 3; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 18px; align-items: start; }
  .live-grid .lead-col > .mt { margin-top: 0; }
}
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analysis-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .g-2, .g-3, .g-21, .g-12 { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .icon-btn.menu-btn { display: inline-flex; }
  .topbar, .content { padding-left: 18px; padding-right: 18px; }
  .live-grid { grid-template-columns: minmax(0, 1fr); }
  .search .input { width: 180px; }
  .form-grid { grid-template-columns: 1fr; }
}

.last-call { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.last-call .when { color: var(--muted); font-size: 12px; white-space: nowrap; }
.btn.push { margin-right: auto; }
.ap-today { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; position: relative; z-index: 1; }
.ap-today div { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); border-radius: 10px; padding: 9px 12px; }
.ap-today b { display: block; color: #fff; font-size: 19px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ap-today span { font-size: 12px; color: #a5b4fc; font-weight: 600; white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.card.fill { display: flex; flex-direction: column; }
.card.fill > .card-body { flex: 1; display: flex; flex-direction: column; }
.card.fill > .card-body > .chart-box { flex: 1; height: auto; min-height: 300px; }

.sync { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 20px; }
.sync svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.sync.ok { background: var(--green-soft); color: var(--green); }
.sync.err { background: var(--red-soft); color: var(--red); }
.deal .d-val { white-space: nowrap; }

/* ---------- voices page ---------- */
.voice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.voice-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; display: flex; flex-direction: column; gap: 10px; text-align: left; font: inherit; color: inherit; }
.voice-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.voice-card.add { align-items: center; justify-content: center; border-style: dashed; cursor: pointer; background: #fbfcff; min-height: 170px; gap: 6px; }
.voice-card.add:hover { border-color: #a5b4fc; background: var(--accent-soft); }
.voice-card .add-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.voice-card .add-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.vc-top { display: flex; align-items: center; gap: 10px; }
.vc-ico { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: 0 0 40px; color: #fff; background: linear-gradient(135deg, #64748b, #94a3b8); }
.vc-ico.g-female { background: linear-gradient(135deg, #a855f7, #ec4899); }
.vc-ico.g-male { background: linear-gradient(135deg, #2563eb, #06b6d4); }
.vc-ico svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.vc-name { font-weight: 650; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vc-top .icon-btn { flex: 0 0 auto; }
.vc-actions .btn { flex: 1; justify-content: center; }
.vc-id { font-family: var(--mono, ui-monospace, monospace); font-size: 11.5px; color: var(--faint); }
.vc-meta { font-size: 12.5px; color: var(--muted); }
.vc-actions { display: flex; gap: 8px; align-items: center; margin-top: auto; }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn.sm svg { width: 15px; height: 15px; }
.input.sm { height: 32px; padding: 0 8px; font-size: 12.5px; border-radius: 8px; }
.rule { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcff; margin-bottom: 8px; }
.rule .kw { font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
.rule .rule-n { width: 20px; height: 20px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.rule select.input { max-width: 170px; }
.rule .time-win { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.rule .time-win input { width: 96px; }
.rule [data-rm] { margin-left: auto; }
.rule.otherwise { background: #fff; border-style: dashed; margin-top: 12px; }
.pool-chip { border: 1px solid var(--line-strong); background: #fff; border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.pool-chip small { color: var(--faint); font-weight: 500; margin-left: 2px; }
.pool-chip.on { background: var(--accent-soft); border-color: #a5b4fc; color: var(--accent); }
.script-box { margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: #f8fafc; border: 1px solid var(--line); max-height: 180px; overflow: auto; }
.script-box p { margin: 0; font-size: 15px; line-height: 1.75; color: var(--text); }
.recorder { display: flex; align-items: center; gap: 16px; margin-top: 16px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); }
.rec-btn { width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(220, 38, 38, .35); flex: 0 0 56px; }
.rec-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.rec-btn.on { animation: recpulse 1.2s infinite; background: #b91c1c; }
@keyframes recpulse { 0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .5); } 70% { box-shadow: 0 0 0 14px rgba(220, 38, 38, 0); } 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); } }
.rec-time { font-size: 22px; font-variant-numeric: tabular-nums; }
.rec-time.good { color: var(--green); }
.rec-progress { position: relative; height: 8px; border-radius: 4px; background: var(--slate-soft); margin: 8px 0 6px; overflow: visible; }
.rec-progress > i { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .2s; }
.rec-progress .mark { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--faint); }
.rec-level { height: 4px; border-radius: 2px; background: var(--slate-soft); overflow: hidden; }
.rec-level > i { display: block; height: 100%; width: 0; background: var(--green); transition: width .08s; }
.rec-level > i.hot { background: var(--red); }
.take { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--text-2); }
.take svg { width: 18px; height: 18px; fill: none; stroke: var(--green); stroke-width: 2.4; }
.take audio { height: 34px; margin-left: auto; }
.consent { display: flex; gap: 8px; align-items: flex-start; margin-top: 16px; font-size: 13px; color: var(--text-2); }
.consent input { margin-top: 3px; }
.btn .spinner { width: 14px; height: 14px; flex: 0 0 14px; border-width: 2px; border-color: rgba(255, 255, 255, .35); border-top-color: currentColor; }
.btn:not(.primary) .spinner { border-color: rgba(79, 70, 229, .2); border-top-color: var(--accent); }

/* ---- customers (tenants) */
.nav-dot { width: 18px; height: 18px; flex: 0 0 18px; border-radius: 5px; color: #fff; font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.t-logo { border-radius: 10px; color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; font-size: 14px; }
.cust-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.cust-card { display: flex; flex-direction: column; gap: 12px; padding: 18px; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.cust-card:hover { border-color: var(--accent); box-shadow: var(--shadow-lg); }
.cust-top { display: flex; gap: 12px; align-items: center; }
.cust-top h3 { font-size: 16px; }
.cust-top .sub { color: var(--muted); font-size: 12.5px; }
.cust-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.cust-use { color: var(--text-2); font-size: 13px; line-height: 1.5; margin: 0; flex: 1; }
.cust-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.cust-facts div { display: flex; flex-direction: column; }
.cust-facts b { font-size: 17px; }
.cust-facts span { color: var(--muted); font-size: 11.5px; }
.cust-open { display: flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; font-size: 13px; }
.cust-open svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.t-tabs a { padding: 10px 12px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; }
.t-tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
.t-test { grid-template-columns: 300px minmax(0, 1fr) 340px; align-items: start; }
.topbar-actions .chip { align-self: center; }
textarea.mono, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.small { font-size: 12.5px; }
.trunc { max-width: 360px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--text-2); }
.an-sum { background: var(--slate-soft); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; line-height: 1.5; }
.an-h { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 8px; }
dd.red, .kv .red { color: var(--red); }
@media (max-width: 1200px) { .t-test { grid-template-columns: 1fr; } }
.cust-card .muted, #tView .muted, .muted.small { color: var(--muted); }
.kv dd .chip { white-space: normal; height: auto; min-height: 22px; }

/* ---- knowledge tab */
.kb-banner { display: flex; align-items: center; gap: 10px; background: var(--amber-soft); color: #92400e; border-radius: 10px; padding: 9px 12px; margin-bottom: 14px; font-weight: 600; font-size: 13px; }
.kb-banner svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.kb-banner .btn { margin-left: auto; }
.kb-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.kb-seg a { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; height: 30px; border-radius: 7px; font-weight: 600; font-size: 13px; color: var(--muted); text-decoration: none; }
.kb-seg a.on { background: var(--accent-soft); color: var(--accent); }
.kb-seg a span { font-size: 11.5px; background: var(--slate-soft); color: #475569; border-radius: 9px; padding: 0 6px; line-height: 17px; }
.kb-docs { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.kb-list { display: flex; flex-direction: column; position: sticky; top: 12px; }
.kb-drop { margin: 6px 14px 8px; border: 1.5px dashed var(--line-strong); border-radius: 10px; padding: 10px; display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 12.5px; cursor: pointer; transition: all .15s; }
.kb-drop svg { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.kb-drop.over, .kb-drop:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.kb-items { display: flex; flex-direction: column; padding: 4px 8px; max-height: 560px; overflow-y: auto; }
.kb-item { text-align: left; border: 0; background: none; border-radius: 9px; padding: 9px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.kb-item b { font-size: 13px; font-weight: 600; color: var(--text); }
.kb-item span { font-size: 11.5px; color: var(--muted); }
.kb-item i { font-style: normal; font-weight: 600; }
.kb-item i.ok { color: var(--green); } .kb-item i.warn { color: #b45309; }
.kb-item:hover { background: #f5f6fb; }
.kb-item.on { background: var(--accent-soft); }
.kb-item.on b { color: var(--accent); }
.kb-foot { border-top: 1px solid var(--line); padding: 8px 12px; }
.kb-viewer { min-height: 480px; }
.kb-vhead { display: flex; gap: 12px; align-items: flex-start; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.kb-vhead h3 { font-size: 17px; }
.kb-vhead .sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kb-vhead .right { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.kb-edit { padding: 14px 20px 20px; }
.kb-edit textarea { width: 100%; min-height: 520px; }
.md-body { padding: 8px 24px 24px; font-size: 14px; line-height: 1.6; color: var(--text-2); max-width: 860px; }
.md-body h2 { font-size: 20px; margin: 16px 0 8px; color: var(--text); }
.md-body h3 { font-size: 16px; margin: 18px 0 6px; color: var(--text); }
.md-body h4, .md-body h5 { font-size: 14px; margin: 14px 0 4px; color: var(--text); }
.md-body p { margin: 8px 0; }
.md-body ul, .md-body ol { margin: 6px 0; padding-left: 22px; }
.md-body li { margin: 3px 0; }
.md-body code { background: var(--slate-soft); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.md-tbl { border-collapse: collapse; margin: 10px 0; font-size: 13px; width: 100%; }
.md-tbl th, .md-tbl td { border: 1px solid var(--line); padding: 6px 9px; text-align: left; vertical-align: top; }
.md-tbl th { background: #fafbfe; font-weight: 650; }
.kb-hist { display: flex; flex-direction: column; }
.kb-hv { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.kb-hv .row-actions { margin-left: auto; }
.kb-hprev { border: 1px solid var(--line); border-radius: 10px; margin-top: 14px; max-height: 360px; overflow-y: auto; }
.canned-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.canned { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.canned-top { display: flex; align-items: center; }
.canned-top .row-actions { margin-left: auto; }
.canned-when { font-size: 12.5px; color: var(--text-2); }
.canned-when span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-right: 6px; }
.canned .bubble-row { max-width: 100%; }
.chip-btn { border: 0; cursor: pointer; }
@media (max-width: 1100px) { .kb-docs { grid-template-columns: 1fr; } .kb-list { position: static; } }

/* ---- sign-in / user box */
.user-box { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.ub { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, .05); }
.ub .avatar { width: 30px; height: 30px; font-size: 11px; flex: 0 0 30px; }
.ub-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ub-txt b { color: #e2e8f5; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ub-txt span { color: #8e9ab8; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ub-btn { width: 28px; height: 28px; color: #8e9ab8; background: transparent; border: 0; }
.ub-btn:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.ub-btn svg { width: 15px; height: 15px; }
.pw-warn { display: flex; align-items: center; gap: 6px; border: 0; border-radius: 8px; background: rgba(245, 158, 11, .18); color: #fbbf24; font-size: 12px; font-weight: 600; padding: 7px 9px; cursor: pointer; text-align: left; }
.pw-warn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; flex: 0 0 14px; }
.pw-code { font-size: 14px; background: var(--slate-soft); padding: 4px 8px; border-radius: 6px; user-select: all; }
body.tenant-user .admin-only { display: none !important; }

/* ---- support: settings, callers, tickets, recordings */
.check { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.check input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--accent); flex: 0 0 16px; }
.check small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.levels { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; font-size: 12.5px; color: var(--text-2); border-top: 1px solid var(--line); padding-top: 12px; }
.lk-out { margin-top: 4px; }
.hookurl { margin: 8px 0; padding: 8px 10px; background: var(--slate-soft); border-radius: 8px; overflow-wrap: anywhere; }
.act-tbl .input { height: 32px; font-size: 12.5px; }
.act-tbl td { padding: 6px 8px; }
.dest { display: grid; grid-template-columns: 1fr 1fr 2fr auto; gap: 8px; align-items: start; margin-bottom: 8px; }
.dest .input { font-size: 12.5px; }
audio.rec { width: 100%; height: 36px; margin: 6px 0 2px; }
.rec-wrap { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.memory { white-space: pre-wrap; background: #0f172a; color: #e2e8f5; border-radius: 10px; padding: 12px 14px; font-size: 12.5px; line-height: 1.55; margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.pcall { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 4px; }
.tk-line { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.tk-line:last-child { border-bottom: 0; }
.tk-fields { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font-size: 11.5px; color: var(--text-2); max-width: 520px; }
.tk-fields i { font-style: normal; color: var(--muted); }
.cx-line { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.chip a { color: inherit; text-decoration: none; }
@media (max-width: 1100px) { .dest { grid-template-columns: 1fr; } }

/* ---- telephony */
.tel-acct { display: flex; gap: 12px; align-items: center; }
.tel-logo { width: 38px; height: 38px; border-radius: 10px; background: #00a650; color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 18px; flex: 0 0 38px; }
.li.pick { cursor: pointer; }
.li.pick input { accent-color: var(--accent); }
pre.preview { white-space: pre-wrap; background: #0f172a; color: #cbd5f5; border-radius: 8px; padding: 10px 12px; font-size: 12px; margin: 6px 0 0; max-height: 220px; overflow: auto; }
.chk { display: flex; gap: 10px; padding: 7px 10px; border-radius: 8px; margin-bottom: 6px; font-size: 13px; }
.chk span { font-weight: 800; }
.chk.ok { background: var(--green-soft); color: #14532d; }
.chk.bad { background: var(--red-soft); color: #7f1d1d; }
.pstep { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-size: 13px; }
.red { color: var(--red); }
.lim-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); }
.tel-logo.tw { background: #f22f46; }
.tel-provs { display: flex; flex-direction: column; gap: 12px; }
.chk.warn span { color: #b45309; }
