/* Cobredia lead agent · dashboard. System font, light UI, dark header. No external assets (strict CSP). */
:root {
  --bg: #f3f5f9;
  --card: #ffffff;
  --ink: #0b1220;
  --body: #3b4456;
  --muted: #7a8396;
  --line: #e6e9ef;
  --line-2: #f0f2f6;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --accent-soft: #e8efff;
  --cyan: #22d3ee;
  --ai: linear-gradient(135deg, #6366f1, #22d3ee);
  --good: #15803d; --good-soft: #dcfce7;
  --warn: #b45309; --warn-soft: #fef3c7;
  --bad: #b91c1c; --bad-soft: #fee2e2;
  --live: #6d28d9; --live-soft: #ede9fe;
  --info: #1d4ed8; --info-soft: #e0ebff;
  --mute-soft: #eef0f4;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(11, 18, 32, .05), 0 8px 24px rgba(11, 18, 32, .06);
  --shadow-lg: 0 24px 60px rgba(11, 18, 32, .18);
  --top: 60px;
  color-scheme: light;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); }
h1, h2, h3 { color: var(--ink); margin: 0; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 750; }
h2 { font-size: 15px; font-weight: 700; }
h3 { font-size: 11.5px; margin: 18px 0 8px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; display: flex; align-items: center; gap: 6px; }
p { line-height: 1.5; }
button { font: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace; font-size: .92em; }
.nowrap { white-space: nowrap; }
.ellip { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ic { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
.ic.mini { width: 13px; height: 13px; vertical-align: -2px; }
.hint { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; line-height: 1.45; }
.opt { color: var(--muted); font-weight: 400; }

/* ================================================================ header */
.top {
  position: sticky; top: 0; z-index: 30; height: var(--top);
  display: flex; align-items: center; gap: 22px; padding: 0 20px;
  background: radial-gradient(600px 120px at 18% -40%, rgba(34, 211, 238, .22), transparent 70%), linear-gradient(90deg, #0b1220, #111c33 60%, #0b1220);
  color: #cbd5e1; box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 8px 24px rgba(11, 18, 32, .25);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo svg { width: 32px; height: 32px; display: block; filter: drop-shadow(0 4px 12px rgba(34, 211, 238, .35)); }
.brand-txt strong { display: block; color: #fff; font-size: 15px; letter-spacing: .01em; }
.brand-txt span { display: block; font-size: 11.5px; color: #8fa3c0; }
.tabs { display: flex; gap: 4px; background: rgba(255, 255, 255, .06); padding: 4px; border-radius: 12px; }
.tabs button {
  display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; color: #aab8cf; cursor: pointer;
  padding: 7px 13px; border-radius: 9px; font-size: 13.5px; font-weight: 600; transition: background .15s, color .15s;
}
.tabs button:hover { color: #fff; }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 10px rgba(0, 0, 0, .2); }
.badge { min-width: 18px; padding: 1px 6px; border-radius: 999px; font-size: 11px; font-weight: 800; background: var(--cyan); color: #04202a; text-align: center; }
.badge.ghost { background: rgba(148, 163, 184, .18); color: inherit; font-weight: 600; opacity: .85; }
.tabs button.on .badge.ghost { background: var(--mute-soft); color: var(--muted); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.providers { display: flex; gap: 6px; }
.prov { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, .07); font-size: 12px; color: #dbe4f0; white-space: nowrap; }
.prov i { width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; }
.prov.on i { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .22); }
.conn { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #9fb0c8; white-space: nowrap; }
.conn i { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; animation: pulse 2s infinite; }
.conn.off i { background: #ef4444; animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); } 70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .06); color: #e2e8f0; cursor: pointer; }
.icon-btn:hover { background: rgba(255, 255, 255, .12); }
.icon-btn .ic { width: 18px; height: 18px; }
.menu { position: relative; }
.menu-pop {
  position: absolute; right: 0; top: 46px; width: 300px; padding: 8px; border-radius: 14px; background: #fff; color: var(--body);
  box-shadow: var(--shadow-lg); border: 1px solid var(--line); opacity: 0; transform: translateY(-6px); pointer-events: none; transition: .16s;
}
.menu-pop.open { opacity: 1; transform: none; pointer-events: auto; }
.menu-h { margin: 6px 10px 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.tog { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: start; padding: 9px 10px; border-radius: 10px; cursor: pointer; margin: 0; font-weight: 400; }
.tog:hover { background: var(--line-2); }
.tog input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; margin: 0; }
.tog b { display: block; color: var(--ink); font-size: 13.5px; }
.tog small, .menu-item small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 2px; }
.sw-ui { width: 34px; height: 20px; border-radius: 999px; background: #cbd5e1; position: relative; transition: .15s; margin-top: 1px; }
.sw-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: .15s; }
.tog input:checked + .sw-ui { background: var(--accent); }
.tog input:checked + .sw-ui::after { left: 16px; }
.tog input:focus-visible + .sw-ui { outline: 2px solid var(--accent); outline-offset: 2px; }
.menu-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 10px; border-radius: 10px; cursor: pointer; color: var(--ink); font-size: 13.5px; font-weight: 600; }
.menu-item:hover { background: var(--line-2); }

/* ================================================================ shared */
main { padding: 20px; max-width: 1680px; margin: 0 auto; overflow-x: clip; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; border: 1px solid rgba(11, 18, 32, .04); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.seg { display: inline-flex; gap: 3px; background: #e9edf3; padding: 3px; border-radius: 11px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 650; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(11, 18, 32, .12); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--mute-soft); color: var(--body); white-space: nowrap; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.live { background: var(--live-soft); color: var(--live); }
.pill.muted { background: var(--mute-soft); color: var(--muted); }
.score-badge { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; font-size: 12px; font-weight: 800; color: #fff; background: #94a3b8; flex: none; }
.score-badge.A { background: var(--good); }
.score-badge.B { background: #d97706; }
.score-badge.C { background: #64748b; }
.score-badge.big { width: 46px; height: 46px; border-radius: 14px; font-size: 22px; }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none; font-size: 12.5px; font-weight: 800; background: hsl(var(--h, 210) 70% 92%); color: hsl(var(--h, 210) 50% 30%); }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.ai-tag { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 800; color: #4338ca; background: linear-gradient(135deg, #eef2ff, #e0f7fb); border: 1px solid #dfe3ff; white-space: nowrap; }
.ai-tag .ic { width: 11px; height: 11px; }
.note { display: flex; gap: 7px; align-items: flex-start; font-size: 12px; color: var(--muted); margin: 14px 0 0; }
.note .ic { margin-top: 1px; }

/* buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 13.5px; font-weight: 650; cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: #b8c1cf; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(37, 99, 235, .25); }
.btn.primary:hover { background: #1d4ed8; }
.btn.big { width: 100%; padding: 12px; margin-top: 16px; font-size: 14.5px; }
.btn.small { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.ghost-dark { background: var(--line-2); border-color: transparent; color: var(--body); }
.btn.busy { position: relative; color: transparent; }
.btn.busy::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
label { display: block; font-size: 12.5px; font-weight: 650; color: var(--ink); margin-top: 12px; }
input, select {
  display: block; width: 100%; margin-top: 5px; padding: 9px 11px; font: inherit; font-size: 14px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-msg { min-height: 18px; margin: 10px 0 0; font-size: 13px; color: var(--bad); }
.form-msg.ok { color: var(--good); }
.search { display: flex; align-items: center; gap: 7px; margin: 0; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); font-weight: 400; }
.search input { border: 0; margin: 0; padding: 8px 0; box-shadow: none !important; background: transparent; font-size: 13.5px; }
.search.small input { padding: 6px 0; font-size: 13px; }

/* ================================================================ cockpit */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 4px 0 18px; flex-wrap: wrap; }
.lede { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; max-width: 720px; }
.kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.hero {
  grid-column: span 2; grid-row: span 2; position: relative; overflow: hidden; color: #dbe7f7; border: 0;
  background: radial-gradient(500px 260px at 100% 0%, rgba(34, 211, 238, .28), transparent 60%), radial-gradient(400px 300px at 0% 100%, rgba(99, 102, 241, .35), transparent 60%), linear-gradient(135deg, #0b1220, #14234a);
  display: flex; flex-direction: column; justify-content: center; padding: 26px 28px;
}
.hero-glow { position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 0 0 40px rgba(255, 255, 255, .02), 0 0 0 80px rgba(255, 255, 255, .015); }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #8fd8ea; }
.hero-value { font-size: 64px; line-height: 1; font-weight: 800; color: #fff; margin: 12px 0 8px; letter-spacing: -.03em; }
.hero-sub { margin: 0; font-size: 15px; color: #c5d3e8; max-width: 440px; }
.hero-sub b { color: #fff; }
.hero-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .1); font-size: 12.5px; color: #e2ebf7; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chip .dot.a { background: #4ade80; }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 16px; }
.tile-top { display: flex; align-items: center; gap: 8px; }
.tile-ico { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.tile-label { font-size: 12.5px; font-weight: 650; color: var(--muted); }
.tile-value { font-size: 28px; font-weight: 780; color: var(--ink); letter-spacing: -.02em; }
.tile-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; }
.tile-sub { font-size: 12px; color: var(--muted); line-height: 1.35; }
.spark { flex: none; }
.viz { position: relative; }
.viz svg { display: block; max-width: 100%; height: auto; }
.viz text.tick { font-size: 11px; fill: #8a8f9c; font-variant-numeric: tabular-nums; }
.viz text.cap { font-size: 11px; fill: #3b4456; font-weight: 700; }
.viz .hit { cursor: crosshair; }
.viz .hit:hover { fill: rgba(37, 99, 235, .05); }
.viz-tip {
  position: absolute; z-index: 5; min-width: 160px; padding: 9px 11px; border-radius: 10px; background: #0b1220; color: #e2e8f0; font-size: 12px;
  pointer-events: none; opacity: 0; transition: opacity .1s; box-shadow: var(--shadow-lg);
}
.viz-tip.on { opacity: 1; }
.viz-tip b { display: block; color: #fff; margin-bottom: 5px; text-transform: capitalize; }
.viz-tip .r { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 7px; line-height: 1.7; }
.viz-tip .r:not(:has(.sw)) { grid-template-columns: 1fr auto; border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 3px; padding-top: 2px; }
.viz-tip strong { color: #fff; font-variant-numeric: tabular-nums; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 10px; font-size: 12.5px; color: var(--body); }
.viz-legend span { display: inline-flex; align-items: center; gap: 6px; }
.viz-data { margin-top: 6px; }
.viz-data summary { font-size: 12px; color: var(--muted); cursor: pointer; font-weight: 600; }
.viz-data table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.viz-data th, .viz-data td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line-2); }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hrow { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 10px; }
.hl { font-size: 12.5px; color: var(--body); font-weight: 600; }
.track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar { display: block; height: 20px; border-radius: 0 4px 4px 0; flex: none; transition: width .4s ease; }
.hv { font-size: 13px; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hv small { color: var(--muted); font-weight: 500; }
.segbar { display: flex; gap: 2px; height: 28px; margin-bottom: 10px; }
.segbar span { display: flex; align-items: center; padding-left: 9px; border-radius: 4px; color: #fff; font-size: 12px; font-weight: 700; min-width: 0; overflow: visible; white-space: nowrap; transition: flex-basis .4s; }
.sub-h { margin-top: 20px; }
.insight { margin: -4px 0 12px; font-size: 13px; color: var(--body); }
.insight b { color: var(--ink); font-size: 15px; }
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.live-dot i { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; animation: pulse 2s infinite; }
.feed-card { display: flex; flex-direction: column; }
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 330px; overflow: auto; }
.feed li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; }
.feed li:hover { background: var(--line-2); }
.f-ico { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--mute-soft); color: var(--muted); }
.f-ico .ic { width: 14px; height: 14px; }
.f-in .f-ico { background: #e7f6ef; color: var(--good); }
.f-out .f-ico { background: var(--accent-soft); color: var(--accent); }
.f-call .f-ico { background: var(--live-soft); color: var(--live); }
.f-qualified .f-ico { background: var(--good-soft); color: var(--good); }
.f-stop .f-ico { background: var(--bad-soft); color: var(--bad); }
.f-handover .f-ico { background: var(--warn-soft); color: var(--warn); }
.f-body { min-width: 0; }
.f-top { display: flex; align-items: baseline; gap: 6px; font-size: 12.5px; }
.f-top b { color: var(--ink); white-space: nowrap; }
.f-kind { color: var(--muted); font-size: 11.5px; }
.f-top time { margin-left: auto; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.f-body p { margin: 2px 0 0; font-size: 12.5px; color: var(--body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 650; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line-2); color: var(--body); }
.tbl td b { color: var(--ink); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.meter-wrap { display: flex; align-items: center; gap: 8px; }
.meter { width: 120px; height: 8px; border-radius: 999px; background: #dbe7fb; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 999px; background: #2a78d6; }
.meter-wrap b { font-size: 12.5px; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ================================================================ conversations */
.live-layout { display: grid; gap: 16px; grid-template-columns: minmax(290px, 340px) minmax(0, 1fr) minmax(310px, 370px); align-items: start; }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.form-card .card-head { margin-bottom: 2px; }
.form-card .seg { display: flex; margin-top: 12px; }
.vehicle-preview { display: grid; grid-template-columns: 84px 1fr auto; gap: 10px; align-items: center; margin-top: 10px; padding: 10px; border-radius: 12px; background: linear-gradient(135deg, #f6f8fc, #eef3fb); border: 1px solid var(--line); }
.car-art { width: 84px; height: 34px; display: block; }
.vp-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 12px; color: var(--muted); }
.vp-body b { color: var(--ink); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vp-meta { display: inline-flex; align-items: center; gap: 4px; }
.vp-price { font-weight: 800; color: var(--ink); font-size: 14px; white-space: nowrap; }
.list-card { padding: 12px; }
.list-tools { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.tabs-mini { display: flex; gap: 3px; background: #eef1f5; padding: 3px; border-radius: 10px; }
.tabs-mini button { flex: 1; border: 0; background: transparent; padding: 6px; border-radius: 7px; font-size: 12.5px; font-weight: 650; color: var(--muted); cursor: pointer; }
.tabs-mini button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(11, 18, 32, .1); }
.tabs-mini .n { font-size: 11px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.lead-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 52vh; overflow: auto; }
.lead-list li { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; padding: 9px; border-radius: 12px; cursor: pointer; border: 1px solid transparent; transition: background .12s; }
.lead-list li:hover { background: var(--line-2); }
.lead-list li.sel { background: var(--accent-soft); border-color: #c9d8fb; }
.lead-list li:focus-visible { outline: 2px solid var(--accent); }
.li-main { min-width: 0; }
.li-top { display: flex; justify-content: space-between; gap: 6px; }
.li-top b { color: var(--ink); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-top time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.li-car { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-last { font-size: 12px; color: var(--body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.li-last.out { color: var(--muted); }
.li-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; color: var(--live); }
.lead-list li.live .li-top b::after { content: "live"; margin-left: 6px; padding: 1px 5px; border-radius: 5px; font-size: 9.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; background: var(--ai); color: #fff; vertical-align: 1px; }
.dot-status { width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; }
.dot-status.info { background: #3b82f6; }
.dot-status.live { background: var(--live); animation: pulse-v 1.6s infinite; }
.dot-status.good { background: #22c55e; }
.dot-status.warn { background: #f59e0b; }
.dot-status.bad { background: #ef4444; }
@keyframes pulse-v { 0% { box-shadow: 0 0 0 0 rgba(109, 40, 217, .5); } 70% { box-shadow: 0 0 0 7px rgba(109, 40, 217, 0); } 100% { box-shadow: 0 0 0 0 rgba(109, 40, 217, 0); } }
.empty { font-size: 13px; color: var(--muted); margin: 10px 4px; }
.col-mid { position: sticky; top: calc(var(--top) + 20px); height: calc(100vh - var(--top) - 40px); min-height: 560px; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.placeholder { padding: 26px; }
.placeholder p { color: var(--muted); font-size: 14px; }
.placeholder.small { padding: 4px 0 0; }
.convo { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.convo-head { display: flex; justify-content: space-between; gap: 12px; padding: 14px 18px 12px; border-bottom: 1px solid var(--line); }
.who-row { display: flex; gap: 12px; align-items: center; min-width: 0; }
.convo-head h2 { font-size: 17px; }
.meta { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--muted); }
.meta > span { display: inline-flex; align-items: center; gap: 4px; }
.crm-ref { color: #0f766e; font-weight: 700; }
.tag-hist, .tag-live { padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.tag-hist { background: var(--mute-soft); color: var(--muted); }
.tag-live { background: var(--ai); color: #fff; }
.convo-actions { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.call-btn { background: linear-gradient(135deg, #7c3aed, #6366f1); border: 0; color: #fff; box-shadow: 0 6px 16px rgba(109, 40, 217, .28); }
.call-btn:hover { filter: brightness(1.08); }
.stepper { list-style: none; margin: 0; padding: 10px 18px; display: flex; gap: 6px; border-bottom: 1px solid var(--line); background: #fbfcfe; overflow-x: auto; }
.stepper li { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 650; color: var(--muted); white-space: nowrap; flex: 1; }
.stepper li:not(:last-child)::after { content: ""; flex: 1; height: 2px; min-width: 10px; background: var(--line); border-radius: 2px; }
.stepper li.done:not(:last-child)::after { background: #86efac; }
.st-dot { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--mute-soft); font-size: 11px; font-weight: 800; flex: none; }
.st-dot .ic { width: 12px; height: 12px; stroke-width: 3; }
.stepper li.done { color: var(--good); }
.stepper li.done .st-dot { background: var(--good); color: #fff; }
.stepper li.now { color: var(--accent); }
.stepper li.now .st-dot { background: var(--accent); color: #fff; box-shadow: 0 0 0 4px rgba(37, 99, 235, .15); }
.thread { flex: 1; overflow: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; background: radial-gradient(circle at 1px 1px, rgba(11, 18, 32, .05) 1px, transparent 0) 0 0 / 18px 18px, linear-gradient(#f8fafd, #f2f5fa); }
.day-sep { align-self: center; margin: 6px 0; }
.day-sep span { font-size: 11px; font-weight: 700; color: var(--muted); background: #fff; border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px; text-transform: capitalize; }
.msg { max-width: min(78%, 560px); display: flex; flex-direction: column; gap: 3px; }
.msg.new, .ev.new, .call.new { animation: pop .25s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg .who { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--accent); }
.msg .b { padding: 10px 13px; border-radius: 18px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.msg .t { font-size: 11px; color: var(--muted); }
.msg .t.err { color: var(--bad); }
.msg.in { align-self: flex-start; }
.msg.in .b { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 6px; color: var(--ink); box-shadow: 0 1px 2px rgba(11, 18, 32, .04); }
.msg.out { align-self: flex-end; align-items: flex-end; }
.msg.out .b { background: linear-gradient(135deg, #2563eb, #3b82f6); color: #fff; border-bottom-right-radius: 6px; box-shadow: 0 4px 14px rgba(37, 99, 235, .2); }
.msg.out.human .who { color: #0f766e; }
.msg.out.human .b { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.msg.out.failed .b, .msg.out.blocked .b { background: var(--bad); }
.msg.typing .b { display: flex; gap: 4px; padding: 13px 15px; background: #dbe6fb; box-shadow: none; }
.msg.typing .b i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); opacity: .5; animation: blink 1.2s infinite; }
.msg.typing .b i:nth-child(2) { animation-delay: .2s; }
.msg.typing .b i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.ev { align-self: center; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); background: rgba(255, 255, 255, .85); border: 1px solid var(--line); padding: 4px 11px; border-radius: 999px; max-width: 92%; }
.ev time { font-size: 11px; opacity: .8; }
.ev.error { color: var(--bad); border-color: #fecaca; }
.ev.qualified, .ev.crm { color: var(--good); border-color: #bbf7d0; background: #f3fdf6; }
.ev.email { color: #0f766e; border-color: #c4ece6; }
.ev.stop { color: var(--bad); border-color: #fecaca; }
.ev.handover { color: var(--warn); border-color: #fde68a; }
.ev.call { color: var(--live); border-color: #ddd6fe; }
.call { align-self: stretch; background: #fff; border: 1px solid #ddd6fe; border-radius: 16px; padding: 12px 14px; box-shadow: 0 6px 18px rgba(109, 40, 217, .08); }
.call.is-live { border-color: #a78bfa; background: linear-gradient(135deg, #faf7ff, #f3f0ff); }
.call-head { display: flex; align-items: center; gap: 10px; }
.call-head b { display: block; color: var(--ink); font-size: 13.5px; }
.call-head span { font-size: 12px; color: var(--live); font-weight: 600; }
.call-ico { display: grid !important; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #7c3aed, #6366f1); color: #fff !important; flex: none; }
.call.is-live .call-ico { animation: pulse-v 1.4s infinite; }
.wave { margin-left: auto; display: flex; align-items: center; gap: 3px; height: 22px; }
.wave i { width: 3px; height: 30%; border-radius: 3px; background: var(--live); animation: wave 1s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: .1s; } .wave i:nth-child(3) { animation-delay: .2s; } .wave i:nth-child(4) { animation-delay: .3s; }
.wave i:nth-child(5) { animation-delay: .4s; } .wave i:nth-child(6) { animation-delay: .5s; } .wave i:nth-child(7) { animation-delay: .6s; }
@keyframes wave { 0%, 100% { height: 25%; } 50% { height: 100%; } }
.call-sum { margin: 8px 0 0; font-size: 12.5px; color: var(--body); }
.call-sum.err { color: var(--bad); }
.tr { margin-top: 8px; }
.tr summary, details > summary { cursor: pointer; font-size: 12.5px; font-weight: 650; color: var(--accent); }
.tr-body { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.tl { display: grid; grid-template-columns: 62px 1fr; gap: 8px; font-size: 13px; }
.tl span { font-size: 11px; font-weight: 700; color: var(--muted); padding-top: 2px; }
.tl.agent span { color: var(--live); }
.tl p { margin: 0; color: var(--ink); }
.composer { border-top: 1px solid var(--line); padding: 10px 16px 12px; background: #fff; }
.composer.locked .quick, .composer.locked .composer-row { opacity: .5; }
.quick { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: thin; }
.qr { flex: none; border: 1px solid var(--line); background: #f8fafc; border-radius: 999px; padding: 5px 11px; font-size: 12.5px; color: var(--ink); cursor: pointer; }
.qr:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.composer-row { display: flex; gap: 8px; margin-top: 8px; }
.composer-row input { margin: 0; }
.composer-row .btn { padding: 9px 14px; }

/* CRM side card */
.crm-card { position: sticky; top: calc(var(--top) + 20px); max-height: calc(100vh - var(--top) - 40px); overflow: auto; }
.score-row { display: flex; gap: 14px; align-items: center; }
.score-ring { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; font-size: 26px; font-weight: 800; color: #94a3b8; background: conic-gradient(#e2e8f0 0 100%); position: relative; flex: none; }
.score-ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: #fff; }
.score-ring { isolation: isolate; }
.score-ring::before { z-index: -1; }
.score-ring.A { color: var(--good); background: conic-gradient(#22c55e 0 100%); }
.score-ring.B { color: #d97706; background: conic-gradient(#f59e0b 0 66%, #fde68a 66% 100%); }
.score-ring.C { color: #64748b; background: conic-gradient(#94a3b8 0 33%, #e2e8f0 33% 100%); }
.score-row strong { color: var(--ink); font-size: 14.5px; }
.checks { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 2px; }
.checks li { display: grid; grid-template-columns: 22px 92px 1fr auto; gap: 6px; font-size: 13px; align-items: center; padding: 6px 4px; border-radius: 8px; }
.checks li.ok { background: #f7fdf9; }
.ck { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--mute-soft); color: #fff; }
.ck .ic { width: 11px; height: 11px; stroke-width: 3; }
.checks li.ok .ck { background: var(--good); }
.checks .k { color: var(--muted); }
.checks .val { color: var(--ink); font-weight: 650; min-width: 0; overflow-wrap: anywhere; }
.summary { font-size: 13.5px; line-height: 1.55; color: var(--ink); background: #f8fafc; border: 1px solid var(--line-2); border-radius: 12px; padding: 12px; margin: 0; }
.task { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: start; margin-top: 12px; padding: 11px 12px; border-radius: 12px; background: #fffbeb; border: 1px solid #fde68a; color: var(--warn); }
.task b { display: block; color: var(--ink); font-size: 13px; }
.task span { font-size: 12px; color: var(--muted); }
.sync-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.sync-log li { display: grid; grid-template-columns: 50px 1fr auto; gap: 8px; align-items: center; font-size: 12px; }
.sync-log .p { color: var(--body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync-log time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.sync-log li.muted { display: block; }
.m { display: inline-block; padding: 1px 5px; border-radius: 5px; font-size: 10px; font-weight: 800; text-align: center; font-family: ui-monospace, Consolas, monospace; }
.m-GET { background: #e0f2fe; color: #0369a1; }
.m-POST { background: #dcfce7; color: #15803d; }
.m-PATCH { background: #fef3c7; color: #b45309; }
.crm-card details { margin-top: 12px; }
.mail { white-space: pre-wrap; font-size: 12px; line-height: 1.5; background: #0b1220; color: #e2e8f0; padding: 12px; border-radius: 12px; margin: 8px 0 0; overflow: auto; }

/* ================================================================ fake CRM (its own look) */
.crm-view { --crm: #0f766e; --crm-soft: #e6f6f3; }
.crm-app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100vh - var(--top) - 40px); background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--line); }
.crm-side { background: #f6f8fa; border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 18px; }
.crm-logo { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.crm-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--crm); color: #fff; }
.crm-logo b { display: block; color: var(--ink); font-size: 14px; }
.crm-logo span { display: block; font-size: 11.5px; color: var(--muted); }
.crm-nav { display: flex; flex-direction: column; gap: 2px; }
.crm-nav button { display: flex; justify-content: space-between; align-items: center; border: 0; background: transparent; padding: 9px 10px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--body); cursor: pointer; text-align: left; }
.crm-nav button:hover { background: #eaeef2; }
.crm-nav button.on { background: var(--crm-soft); color: var(--crm); }
.crm-nav button span { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.conn-box { margin-top: auto; padding: 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); font-size: 12px; }
.conn-box p { margin: 4px 0 0; color: var(--muted); line-height: 1.4; }
.cb-head { display: flex; align-items: center; gap: 8px; }
.cb-head b { color: var(--ink); font-size: 12.5px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; animation: pulse 2s infinite; }
.crm-main { padding: 20px 22px; min-width: 0; }
.crm-title { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.crm-title h1 { font-size: 20px; }
.crm-title .muted { font-size: 13px; }
.crm-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.crm-toolbar .search { flex: 1; min-width: 220px; }
.crm-toolbar select { width: auto; margin: 0; padding: 8px 10px; font-size: 13px; }
.chips { display: inline-flex; gap: 4px; }
.chips button { border: 1px solid var(--line); background: #fff; padding: 6px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 650; color: var(--body); cursor: pointer; }
.chips button.on { background: var(--crm); border-color: var(--crm); color: #fff; }
.crm-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; max-height: calc(100vh - var(--top) - 190px); }
.crm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.crm-table thead th { position: sticky; top: 0; z-index: 1; background: #f8fafb; text-align: left; font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.crm-table td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); color: var(--body); vertical-align: middle; }
.crm-table td b { color: var(--ink); }
.crm-table td.mono, .crm-table td:nth-child(3) { white-space: nowrap; }
.crm-table tbody tr { cursor: pointer; transition: background .3s; }
.crm-table tbody tr:hover { background: #f6faf9; }
.crm-table tbody tr.sel { background: var(--crm-soft); }
.crm-table tbody tr.live td:first-child { box-shadow: inset 3px 0 0 var(--crm); }
.crm-table tbody tr.flash { animation: flash 2.4s ease; }
@keyframes flash { 0% { background: #fef9c3; } 100% { background: transparent; } }
.crm-table.log tbody tr { cursor: default; }
.nat { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 800; }
.nat-VO { background: var(--crm-soft); color: var(--crm); }
.nat-VN { background: #e0ebff; color: #1d4ed8; }
.nat-APV { background: #f3e8ff; color: #7e22ce; }
.code { display: inline-block; padding: 1px 6px; border-radius: 5px; font-size: 11.5px; font-weight: 800; font-family: ui-monospace, Consolas, monospace; }
.code.ok { background: #dcfce7; color: #15803d; }
.code.ko { background: #fee2e2; color: #b91c1c; }
.empty-state { display: flex; gap: 12px; align-items: center; color: var(--muted); }
.empty-state .ic { width: 28px; height: 28px; }
.scrim { position: fixed; inset: var(--top) 0 0 0; background: rgba(11, 18, 32, .25); opacity: 0; pointer-events: none; transition: .2s; z-index: 20; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: var(--top); right: 0; bottom: 0; width: min(560px, 100vw); z-index: 25; background: #fff; box-shadow: var(--shadow-lg);
  transform: translateX(105%); transition: transform .25s ease; display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer-head > div { display: flex; align-items: center; gap: 8px; }
.drawer-head .mono { font-weight: 800; color: var(--ink); font-size: 14px; }
.drawer-head .icon-btn { border-color: var(--line); background: #fff; color: var(--body); }
.drawer-body { flex: 1; overflow: auto; padding: 4px 18px 18px; }
.drawer-body section { padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.drawer-body h3 { margin-top: 0; }
.drawer-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; }
.d-contact { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; }
.d-contact h2 { font-size: 18px; }
.d-contact p { margin: 3px 0 0; font-size: 12.5px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.d-car { display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; align-items: center; }
.d-car .car-art { width: 96px; height: 38px; }
.d-car b { display: block; color: var(--ink); font-size: 13.5px; }
.d-car span { font-size: 12px; color: var(--muted); }
.d-car-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--mute-soft); }
.enr { display: grid; grid-template-columns: 150px 1fr; gap: 0; margin: 0; font-size: 13px; }
.enr dt { color: var(--muted); padding: 7px 0; border-bottom: 1px dashed var(--line-2); }
.enr dd { margin: 0; padding: 7px 0; border-bottom: 1px dashed var(--line-2); display: flex; justify-content: space-between; gap: 10px; color: var(--ink); font-weight: 600; }
.enr dd time { color: #4338ca; font-size: 11px; font-weight: 700; white-space: nowrap; }
.enr dd time::before { content: "✦ IA · "; }
.task-row { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: center; margin: 0 0 6px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); font-weight: 400; cursor: pointer; }
.task-row input { width: 16px; height: 16px; margin: 0; accent-color: var(--crm); }
.task-row b { display: block; color: var(--ink); font-size: 13px; }
.task-row span { font-size: 12px; color: var(--muted); }
.task-row.done b { text-decoration: line-through; color: var(--muted); }
.task-flags { display: flex; gap: 6px; margin-top: 6px; }
.task-row span.pill { font-size: 11px; color: inherit; }
.task-row .pill.bad { color: var(--bad); }
.task-row .pill.warn { color: var(--warn); }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 13px; top: 6px; bottom: 6px; width: 2px; background: var(--line-2); }
.timeline li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 6px 0; position: relative; }
.t-ico { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2px solid var(--line); color: var(--muted); z-index: 1; }
.t-ico .ic { width: 13px; height: 13px; }
.t-ia .t-ico { border-color: #c7d2fe; color: #4f46e5; }
.t-sms_out .t-ico { border-color: #bfdbfe; color: var(--accent); }
.t-sms_in .t-ico { border-color: #bbf7d0; color: var(--good); }
.t-appel .t-ico { border-color: #ddd6fe; color: var(--live); }
.t-email .t-ico, .t-tache .t-ico { border-color: #99f6e4; color: var(--crm); }
.t-creation .t-ico { border-color: #fde68a; color: var(--warn); }
.t-top { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.t-top b { color: var(--ink); }
.t-top time { color: var(--muted); white-space: nowrap; }
.timeline p { margin: 2px 0 0; font-size: 13px; color: var(--body); }
.task-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.task-group { box-shadow: none; border: 1px solid var(--line); }
.tg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tg-head b { color: var(--ink); }
.tg-head .muted { margin-left: auto; font-size: 12px; }
.tg-item { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; }
.link { border: 0; background: none; color: var(--crm); font-weight: 700; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; padding: 4px; }
.flow { display: flex; align-items: stretch; gap: 8px; margin-bottom: 16px; overflow-x: auto; }
.flow-step { flex: 1; min-width: 150px; padding: 14px; border-radius: 14px; background: linear-gradient(180deg, #f8fafb, #fff); border: 1px solid var(--line); }
.flow-step b { display: block; color: var(--ink); margin: 8px 0 4px; }
.flow-step p { margin: 0; font-size: 12.5px; color: var(--muted); }
.fs-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--crm-soft); color: var(--crm); }
.flow-step:nth-child(7) .fs-ico { background: var(--ai); color: #fff; }
.flow-arrow { display: grid; place-items: center; color: #b6c0cc; }
.endpoints { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.endpoints li { display: grid; grid-template-columns: 52px 1fr; gap: 4px 10px; align-items: center; font-size: 13px; }
.endpoints code { font-size: 12.5px; color: var(--ink); overflow-wrap: anywhere; }
.endpoints .muted { grid-column: 2; font-size: 12px; }

/* ================================================================ toasts */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  display: flex; align-items: center; gap: 10px; max-width: 420px; padding: 11px 14px; border-radius: 12px; background: #0b1220; color: #e2e8f0; font-size: 13.5px;
  box-shadow: var(--shadow-lg); transform: translateY(12px); opacity: 0; transition: .25s; cursor: default;
}
.toast[role] { cursor: pointer; }
.toast.show { transform: none; opacity: 1; }
.toast .ic { color: #93c5fd; }
.toast.good .ic { color: #4ade80; }
.toast.bad .ic { color: #f87171; }
.toast.warn .ic { color: #fbbf24; }
.toast.live .ic { color: #c4b5fd; }

/* ================================================================ auth pages */
.auth-page { display: grid; place-items: center; padding: 20px; background: radial-gradient(700px 400px at 20% 10%, rgba(34, 211, 238, .25), transparent 60%), radial-gradient(600px 400px at 90% 90%, rgba(99, 102, 241, .3), transparent 60%), #0b1220; }
.auth { width: min(400px, 100%); padding: 28px; }
.auth h1 { font-size: 21px; margin-top: 12px; }
.auth-logo { width: 46px; height: 46px; display: block; filter: drop-shadow(0 6px 16px rgba(34, 211, 238, .35)); }
.auth .btn.primary { width: 100%; margin-top: 16px; padding: 11px; }

/* ================================================================ responsive */
@media (max-width: 1360px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { grid-column: 1 / -1; grid-row: auto; }
  .providers { display: none; }
}
@media (max-width: 1240px) {
  .live-layout { grid-template-columns: minmax(280px, 330px) minmax(0, 1fr); }
  .col-right { grid-column: 1 / -1; }
  .crm-card { position: static; max-height: none; }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 > .span-2 { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  main { padding: 12px; }
  .top { gap: 10px; padding: 0 12px; }
  .brand-txt, .conn span { display: none; }
  .tabs button { padding: 7px 9px; }
  .tabs button .badge.ghost { display: none; }
  .live-layout, .g2, .g3 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .col-mid { position: static; height: 76vh; }
  .crm-app { grid-template-columns: 1fr; }
  .crm-side { border-right: 0; border-bottom: 1px solid var(--line); }
  .crm-nav { flex-direction: row; overflow-x: auto; }
  .conn-box { display: none; }
  .hero-value { font-size: 52px; }
}
@media (max-width: 520px) {
  .tabs button .ic { display: none; }
  .kpis { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
}

/* ================================================================ round 2: AI reading, hands-free demo, email card */
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 650; font-size: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.form-card .card-head .seg { flex: none; }
.form-card .card-head .seg button { padding: 5px 9px; font-size: 12px; }
.auto-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.auto-item {
  display: grid; grid-template-columns: 36px 1fr 16px; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.auto-item:hover { border-color: #b7c7f5; box-shadow: 0 6px 18px rgba(37, 99, 235, .1); transform: translateY(-1px); }
.auto-item .ai-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.auto-item.sc-combo .ai-ico { background: linear-gradient(135deg, #eef2ff, #e0f7fb); color: #4f46e5; }
.auto-item.sc-call .ai-ico { background: var(--live-soft); color: var(--live); }
.auto-item.sc-safety .ai-ico { background: var(--warn-soft); color: var(--warn); }
.auto-item.sc-stop .ai-ico { background: var(--bad-soft); color: var(--bad); }
.ai-txt b { display: block; color: var(--ink); font-size: 13.5px; }
.ai-txt small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.auto-item .go { color: #b6c0cc; }
.auto-item.busy { opacity: .6; pointer-events: none; }
.auto-item.busy .go { animation: spin .8s linear infinite; }
.lead-list li.live.auto .li-top b::after { content: "auto"; background: linear-gradient(135deg, #0f766e, #22d3ee); }
.ai-read { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 4px; max-width: 520px; }
.msg.new .ai-read { animation: pop .3s ease .35s both; }
.ai-src { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 800; color: #4f46e5; text-transform: uppercase; letter-spacing: .05em; }
.ai-src .ic { width: 12px; height: 12px; }
.ai-chip { padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 650; background: #fff; border: 1px solid var(--line); color: var(--body); }
.ai-chip.ok { border-color: #c7d7fe; background: linear-gradient(135deg, #f5f7ff, #eefbfd); color: #3730a3; }
.ai-chip.warn { border-color: #fde68a; background: #fffbeb; color: var(--warn); }
.ai-chip.bad { border-color: #fecaca; background: #fef2f2; color: var(--bad); }
.ai-chip.call { border-color: #ddd6fe; background: var(--live-soft); color: var(--live); }
.ai-chip.muted { color: var(--muted); }
.ev.qualified { padding: 8px 14px; font-size: 13px; font-weight: 700; color: #fff; border: 0; background: linear-gradient(135deg, #15803d, #22c55e); box-shadow: 0 6px 18px rgba(21, 128, 61, .25); }
.ev.qualified time { color: rgba(255, 255, 255, .85); }
.call-btn:disabled { background: var(--mute-soft); color: var(--muted); box-shadow: none; filter: none; }
.vp-body b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.tabs button { transition: none; }
.hero-saved { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin: 14px 0 0; font-size: 13.5px; color: #c5d3e8; }
.hero-saved b { color: #fff; }
.hero-saved .ic { color: #8fd8ea; }
.hero-saved small { width: 100%; padding-left: 24px; font-size: 11.5px; color: #7f93b3; }
.mail-card { margin-top: 10px; border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fff; box-shadow: 0 4px 14px rgba(11, 18, 32, .05); font-size: 13px; }
.mc-head { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line-2); }
.mc-logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #60a5fa, #22d3ee); color: #0b1220; font-weight: 900; }
.mc-head b { display: block; color: var(--ink); font-size: 13px; }
.mc-head span { display: block; color: var(--muted); font-size: 12px; }
.mc-head time { color: var(--muted); font-size: 11.5px; }
.mc-subject { display: flex; align-items: center; gap: 8px; margin: 10px 0 6px; font-weight: 750; color: var(--ink); font-size: 14px; }
.mail-card p { margin: 6px 0; color: var(--body); }
.mc-sum { padding: 10px 12px; border-left: 3px solid var(--accent); background: #f8fafd; border-radius: 0 10px 10px 0; color: var(--ink) !important; }
.mc-table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: 12.5px; }
.mc-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 4px 0; width: 38%; }
.mc-table td { color: var(--ink); padding: 4px 0; border-bottom: 1px dashed var(--line-2); }
.mc-cta { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; font-size: 12.5px; }
