/* Torre de Controle Laf — design system do mockup aprovado */
:root {
  --bg: #0B0E17;
  --surface: #111624;
  --surface-2: #151B2E;
  --surface-deep: #0E1220;
  --hair: #1C2338;
  --hair-2: #161C2E;
  --border: #232B42;
  --border-strong: #2A3554;
  --text: #EAEEF8;
  --text-2: #98A2BC;
  --text-3: #C6CEE2;
  --muted: #5E6883;
  --ok: #34D388;
  --wait: #FFB020;
  --late: #FF4D5E;
  --late-soft: #E39BA3;
  --late-strong: #FFD9DC;
  --blue: #3D8BFF;
  --grad: linear-gradient(135deg, #0A6CFF, #A000C8);
  --av-blue-bg: #1C2742; --av-blue-fg: #A9C3F5;
  --av-violet-bg: #241E3D; --av-violet-fg: #CBB8EE;
  --av-off-bg: #171D30;
  --av-strong-bg: #1C2742; --av-strong-fg: #C9D6F5;
  --nav-active-fg: #C9D6F5;
  --late-track: #3A2230;
  --alert-fg: #FFB3BA;
  --font: 'Space Grotesk', 'Avenir Next', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}

[data-theme="light"] {
  --bg: #F3F5FA;
  --surface: #FFFFFF;
  --surface-2: #FFFFFF;
  --surface-deep: #ECEFF6;
  --hair: #E4E8F1;
  --hair-2: #EEF1F7;
  --border: #D7DDEA;
  --border-strong: #C4CCDF;
  --text: #171D2E;
  --text-2: #5A6478;
  --text-3: #3D4660;
  --muted: #8A93A9;
  --ok: #17925C;
  --wait: #B87A00;
  --late: #DC3145;
  --late-soft: #A54350;
  --late-strong: #7E1B28;
  --blue: #1F6BE0;
  --av-blue-bg: #DCE7FB; --av-blue-fg: #2E5AA8;
  --av-violet-bg: #EBDDF6; --av-violet-fg: #7A3FA8;
  --av-off-bg: #E4E8F1;
  --av-strong-bg: #DCE7FB; --av-strong-fg: #24509B;
  --nav-active-fg: #3A4C88;
  --late-track: #F3D2D6;
  --alert-fg: #A32636;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
:root { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); -webkit-font-smoothing: antialiased; font-size: 14px;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: #6FA9FF; }
button { font-family: var(--font); cursor: pointer; }
input, select, textarea {
  font-family: var(--font); font-size: 13.5px; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 12px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: #3D5AA9; }
input.mono, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

@keyframes pulseDot { 0% { box-shadow: 0 0 0 0 rgba(52,211,136,.45); } 70% { box-shadow: 0 0 0 6px rgba(52,211,136,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,136,0); } }
@keyframes pulseRed { 0% { box-shadow: 0 0 0 0 rgba(255,77,94,.4); } 70% { box-shadow: 0 0 0 9px rgba(255,77,94,0); } 100% { box-shadow: 0 0 0 0 rgba(255,77,94,0); } }
@keyframes pulseAmber { 0% { box-shadow: 0 0 0 0 rgba(255,176,32,.35); } 70% { box-shadow: 0 0 0 7px rgba(255,176,32,0); } 100% { box-shadow: 0 0 0 0 rgba(255,176,32,0); } }
@keyframes slideIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.live-dot { animation: pulseDot 2.4s ease-out infinite; border-radius: 50%; }
.late-ring { animation: pulseRed 1.8s ease-out infinite; border-radius: 50%; }
.wait-ring { animation: pulseAmber 2.8s ease-out infinite; border-radius: 50%; }

/* ── Estrutura ── */
.shell { display: flex; height: 100vh; overflow: hidden; }
.rail {
  width: 68px; flex: none; display: flex; flex-direction: column; align-items: center;
  padding: 18px 0 20px; border-right: 1px solid var(--hair); gap: 10px;
}
.rail img.logo { width: 38px; height: 38px; margin-bottom: 18px; }
.rail button.nav {
  width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent;
}
.rail button.nav svg { stroke: var(--muted); }
.rail button.nav:hover svg { stroke: var(--text-3); }
.rail button.nav.active {
  background: linear-gradient(135deg, rgba(10,108,255,.22), rgba(160,0,200,.22));
  border-color: rgba(90,90,220,.35);
}
.rail button.nav.active svg { stroke: var(--nav-active-fg); }
.rail .spacer { flex: 1; }
.rail .me {
  width: 36px; height: 36px; border-radius: 50%; background: var(--av-blue-bg); color: var(--av-blue-fg);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600;
  border: 1px solid var(--border-strong);
}

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 68px; flex: none; display: flex; align-items: center; gap: 16px;
  padding: 0 28px; border-bottom: 1px solid var(--hair);
}
.topbar h1 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.topbar .sub { font-size: 12px; color: var(--text-2); }
.topbar .grow { flex: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 12px; font-size: 12px; color: var(--text-3);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.chip.alert { border-color: rgba(255,77,94,.45); background: rgba(255,77,94,.08); color: var(--alert-fg); font-weight: 500; }
.clock { font-family: var(--mono); font-size: 13px; color: var(--text-2); }

/* ── Régua de números ── */
.pulse-row { display: flex; align-items: stretch; padding: 18px 28px; border-bottom: 1px solid var(--hair); flex: none; }
.pulse-row .fig { display: flex; flex-direction: column; gap: 4px; padding: 0 36px; }
.pulse-row .fig:first-child { padding-left: 0; }
.pulse-row .sep { width: 1px; background: var(--hair); }
.cap { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.cap.strong { color: var(--text-2); font-weight: 600; }
.fig .val { font-family: var(--mono); font-size: 26px; font-weight: 500; font-variant-numeric: tabular-nums; }
.fig .val small { color: var(--muted); font-size: 16px; }

/* ── Corpo ── */
.body { flex: 1; display: flex; gap: 20px; padding: 20px 28px 24px; min-height: 0; overflow: auto; }
.view { display: none; flex: 1; min-height: 0; }
.view.active { display: flex; }

.queue-col { flex: 1; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sec-head { display: flex; align-items: baseline; gap: 12px; }
.sec-head .hint { font-size: 12px; color: var(--muted); }
.sec-head .grow { flex: 1; }

.grad-border {
  border: 1px solid transparent;
  background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box, var(--grad) border-box;
}

.next-card { border-radius: 16px; padding: 20px 22px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.next-card .ring { width: 62px; height: 62px; border-radius: 50%; padding: 2px; background: var(--grad); flex: none; }
.next-card .ring .av { width: 100%; height: 100%; border-radius: 50%; background: var(--av-strong-bg); color: var(--av-strong-fg); display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 600; }
.next-card .name { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
.tag-davez { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #fff; padding: 3px 9px; border-radius: 999px; background: var(--grad); }
.meta { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; }

.row-card {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--surface);
  border: 1px solid var(--hair); border-radius: 12px; padding: 12px 18px;
}
.row-card.overdue { background: rgba(255,77,94,.06); border-color: rgba(255,77,94,.45); }
.row-card .pos { width: 18px; font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: center; flex: none; }
.av-sm { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex: none; }
.av-blue { background: var(--av-blue-bg); color: var(--av-blue-fg); }
.av-violet { background: var(--av-violet-bg); color: var(--av-violet-fg); }
.av-off { background: var(--av-off-bg); color: var(--muted); }
.arc-wrap { position: relative; width: 44px; height: 44px; flex: none; }
.arc-wrap svg { position: absolute; inset: 0; }
.arc-wrap .av { position: absolute; inset: 7px; border-radius: 50%; background: var(--av-strong-bg); color: var(--av-strong-fg); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.row-card .who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.row-card .who .nm { font-size: 14.5px; font-weight: 500; }
.row-card .who .md { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.row-card .grow { flex: 1; }
.state { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); }
.state .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.timer-col { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.timer { font-family: var(--mono); font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
.timer.amber { color: var(--wait); }
.timer.red { color: var(--late); font-size: 16px; font-weight: 600; }
.timer-sub { font-size: 11.5px; color: var(--text-2); }
.timer-sub.red { color: var(--late-soft); }

.row-tools { display: flex; gap: 4px; }
.icon-btn {
  background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 4px 6px; color: var(--muted);
  font-size: 12px; line-height: 1;
}
.icon-btn:hover { border-color: var(--border); color: var(--text-3); }

.off-zone { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.off-row {
  flex: 1; display: flex; align-items: center; gap: 12px; background: var(--surface-deep);
  border: 1px dashed var(--hair); border-radius: 12px; padding: 10px 16px; opacity: .68;
}
.off-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.off-grid .off-row { min-width: 300px; }

.toggle { width: 40px; height: 23px; border-radius: 999px; background: var(--border); padding: 2px; display: flex; border: none; flex: none; transition: background .15s; }
.toggle .knob { width: 19px; height: 19px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.toggle.on { background: var(--grad); justify-content: flex-start; }
.toggle.on .knob { background: #fff; transform: translateX(17px); }

/* ── Alerta ── */
.alert-banner {
  display: flex; align-items: center; gap: 16px; border-radius: 14px; padding: 14px 20px;
  background: rgba(255,77,94,.09); border: 1px solid rgba(255,77,94,.4); animation: slideIn .25s ease-out;
}
.alert-banner .txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.alert-banner .t1 { font-size: 14.5px; font-weight: 600; color: var(--late-strong); }
.alert-banner .t2 { font-size: 12.5px; color: var(--late-soft); }
.alert-banner .grow { flex: 1; }

.btn { border: none; border-radius: 10px; padding: 9px 16px; font-size: 13px; font-weight: 600; }
.btn-danger { background: var(--late); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-3); border: 1px solid var(--border-strong); font-weight: 400; }
.btn-grad { background: var(--grad); color: #fff; }
.btn-link { background: none; border: none; color: var(--blue); font-size: 13px; padding: 0; }
.btn-link.danger { color: var(--late); }

/* ── Feed ── */
.feed-col {
  width: 372px; flex: none; background: var(--surface); border: 1px solid var(--hair);
  border-radius: 16px; display: flex; flex-direction: column; min-height: 0;
}
.feed-head { display: flex; align-items: center; gap: 9px; padding: 16px 20px; border-bottom: 1px solid var(--hair); }
.feed-list { flex: 1; overflow-y: auto; padding: 6px 0; }
.feed-item { display: flex; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--hair-2); animation: slideIn .25s ease-out; }
.feed-item:first-child { border-top: none; }
.feed-item.hl { background: rgba(255,77,94,.05); }
.feed-item .tm { font-family: var(--mono); font-size: 11px; color: var(--muted); width: 36px; flex: none; padding-top: 2px; }
.feed-item .dotcol { width: 8px; flex: none; display: flex; justify-content: center; padding-top: 5px; }
.feed-item .dotcol .dot { width: 8px; height: 8px; border-radius: 50%; }
.feed-item .fx { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.feed-item .l1 { font-size: 13px; color: var(--text); overflow-wrap: anywhere; }
.feed-item .l1.red { color: var(--late-strong); }
.feed-item .l1.gray { color: var(--text-2); }
.feed-item .l2 { font-size: 11.5px; color: var(--text-2); }
.dot-grad { background: var(--grad); }
.dot-ok { background: var(--ok); }
.dot-late { background: var(--late); }
.dot-gray { background: var(--muted); }
.dot-wait { background: var(--wait); }
.dot-blue { background: var(--blue); }

/* ── Cards genéricos (config/cadastro) ── */
.panel { background: var(--surface); border: 1px solid var(--hair); border-radius: 16px; padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--text-2); }
.hr { height: 1px; background: var(--hair); }
.setting-row { display: flex; align-items: center; gap: 14px; }
.setting-row .txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.setting-row .t1 { font-size: 14px; font-weight: 500; }
.setting-row .t2 { font-size: 12px; color: var(--text-2); }
.setting-row .grow { flex: 1; }

/* ── Vendedores ── */
.sellers-layout { display: flex; gap: 20px; flex: 1; min-height: 0; width: 100%; }
.sellers-list { width: 400px; flex: none; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.seller-item {
  display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--hair);
  border-radius: 12px; padding: 12px 16px; cursor: pointer; text-align: left; width: 100%; color: var(--text);
}
.seller-item.selected { border: 1px solid transparent; background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box, var(--grad) border-box; }
.seller-item.off { opacity: .68; }
.seller-item .si-name { font-size: 14px; font-weight: 500; }
.seller-item .si-sub { font-size: 11.5px; color: var(--text-2); }
.seller-editor { flex: 1; min-width: 0; overflow-y: auto; }

.mode-cards { display: flex; gap: 12px; }
.mode-card {
  flex: 1; border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px;
  background: var(--surface-deep); border: 1px solid var(--hair); cursor: pointer; opacity: .6; color: var(--text);
  text-align: left;
}
.mode-card.selected { opacity: 1; border: 1px solid transparent; background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box, var(--grad) border-box; }
.mode-card .mc-t { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.mode-card .mc-d { font-size: 12px; color: var(--text-2); line-height: 1.45; }

/* a barra de ações gruda no rodapé do editor: o formulário é longo (7 dias de
   horário) e o botão de salvar não pode ficar escondido lá embaixo */
.seller-editor .actions {
  position: sticky; bottom: -20px; z-index: 2; margin-top: auto;
  background: var(--surface); padding: 14px 0; margin-bottom: -20px;
  box-shadow: 0 -12px 16px -12px rgba(0,0,0,.65);
}

/* vínculo com o usuário do wasbot: campo protegido, com editar/salvar próprios */
.wuser-view {
  font-size: 12.5px; color: var(--muted); border: 1px solid var(--hair);
  border-radius: 8px; padding: 6px 12px; background: var(--surface-deep);
}
.wuser-view.on { color: var(--text-2); }

/* ── Canais que o vendedor atende ── */
.chan-pick { display: flex; flex-direction: column; gap: 10px; }
.chan-list { display: flex; gap: 8px; flex-wrap: wrap; }
.chan-list.muted { opacity: .45; }
.chan-chk {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--hair); border-radius: 999px; padding: 7px 14px;
  background: var(--surface-deep); font-size: 12.5px; color: var(--text-2);
}
.chan-chk.on { color: var(--text); border: 1px solid transparent; background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box, var(--grad) border-box; }
.chan-chk.all { align-self: flex-start; font-weight: 600; }
.chan-chk input { accent-color: #7c5cff; width: 14px; height: 14px; }
.chan-import { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chan-import select { max-width: 320px; }

/* ── Abas dos rodízios (um por canal) ── */
.rotation-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.rot-tab {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  border: 1px solid var(--hair); border-radius: 12px; padding: 8px 14px;
  background: var(--surface-deep); cursor: pointer; color: var(--text-2); opacity: .7;
}
.rot-tab.on { opacity: 1; color: var(--text); border: 1px solid transparent; background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box, var(--grad) border-box; }
.rot-tab .rt-name { font-size: 13px; font-weight: 600; }
.rot-tab .rt-meta { font-size: 11px; color: var(--muted); }

.sched-editor { display: flex; flex-direction: column; gap: 6px; }
.sched-day {
  display: flex; align-items: center; gap: 14px; padding: 8px 12px;
  border: 1px solid var(--hair); border-radius: 12px; background: var(--surface);
  min-height: 52px;
}
.sched-day.closed { opacity: .6; border-style: dashed; background: var(--surface-deep); }
.day-pill {
  min-width: 48px; height: 32px; border-radius: 9px; padding: 0 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  background: var(--surface-deep); border: 1px dashed var(--hair); cursor: pointer; flex: none;
}
.day-pill.on { color: #fff; background: var(--grad); border: none; }
.ivals { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; }
.ival {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 3px 6px;
}
.ival input[type="time"] {
  border: none; background: transparent; padding: 3px 2px; border-radius: 6px;
  font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; width: 78px;
}
.ival input[type="time"]:focus { outline: 1px solid #3D5AA9; }
.ival-x { background: none; border: none; color: var(--muted); font-size: 15px; line-height: 1; padding: 0 3px; }
.ival-x:hover { color: var(--late); }
.ival-add {
  background: none; border: 1px dashed var(--border); border-radius: 9px;
  color: var(--text-2); font-size: 12px; padding: 7px 11px;
}
.ival-add:hover { border-color: var(--border-strong); color: var(--text-3); }
.copy-btn {
  background: none; border: none; color: var(--blue); font-size: 12px; padding: 4px 6px; flex: none;
  opacity: 0; transition: opacity .12s;
}
.sched-day:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { text-decoration: underline; }

.day-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.day-chip {
  width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-deep);
  border: 1px dashed var(--hair); cursor: pointer;
}
.day-chip.on { color: #fff; background: var(--grad); border: none; }
.sched-row { display: flex; align-items: center; gap: 10px; }
.sched-row .day-label { width: 44px; font-size: 12.5px; color: var(--text-2); flex: none; }
.sched-row input { width: 100%; }

.tpl-box { width: 100%; min-height: 74px; resize: vertical; line-height: 1.5; border-radius: 12px; padding: 12px 14px; }
.varchip { font-family: var(--mono); font-size: 11.5px; color: var(--text-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px; }

.actions { display: flex; align-items: center; gap: 12px; }
.actions .grow { flex: 1; }

.empty { color: var(--muted); font-size: 13px; padding: 20px; text-align: center; }
.note { font-size: 12px; color: var(--muted); }

.toast {
  position: fixed; bottom: 22px; right: 22px; background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: 12px; padding: 12px 16px; font-size: 13px; color: var(--text-3); z-index: 50;
  animation: slideIn .2s ease-out; max-width: 380px;
}
.toast.err { border-color: rgba(255,77,94,.5); color: var(--alert-fg); }

/* ── Lista de leads (overlay) ── */
.overlay {
  position: fixed; inset: 0; background: rgba(5, 8, 16, .55); z-index: 40;
  display: flex; align-items: flex-start; justify-content: center; padding: 60px 20px;
}
[data-theme="light"] .overlay { background: rgba(23, 29, 46, .35); }
.modal {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px;
  width: 860px; max-width: 100%; max-height: 80vh; display: flex; flex-direction: column;
  animation: slideIn .18s ease-out; box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--hair); }
.modal-head h2 { font-size: 15px; font-weight: 600; margin: 0; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 20px; line-height: 1; padding: 4px 8px; }
.modal-close:hover { color: var(--text); }
.modal-body { overflow-y: auto; padding: 6px 0 12px; }
.lead-row { display: flex; align-items: center; gap: 14px; padding: 11px 22px; border-top: 1px solid var(--hair-2); font-size: 13px; }
.lead-row:first-child { border-top: none; }
.lead-row .lr-time { font-family: var(--mono); font-size: 11.5px; color: var(--muted); width: 40px; flex: none; }
.lead-row .lr-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.lead-row .lr-name { font-weight: 500; }
.lead-row .lr-sub { font-size: 11.5px; color: var(--text-2); }
.lead-row .lr-notes {
  font-size: 12px; color: var(--text-2); margin-top: 2px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lead-row .lr-extra { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 3px; }
.kv {
  font-size: 11px; color: var(--text-3); background: var(--surface-deep);
  border: 1px solid var(--hair); border-radius: 6px; padding: 2px 7px;
}
.kv b { font-weight: 600; color: var(--text-2); text-transform: uppercase; font-size: 10px; letter-spacing: .04em; }
.badge { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 3px 10px; flex: none; }
.badge-ok { color: var(--ok); background: rgba(52,211,136,.12); }
.badge-wait { color: var(--wait); background: rgba(255,176,32,.12); }
.badge-late { color: var(--late); background: rgba(255,77,94,.12); }
.badge-gray { color: var(--text-2); background: var(--surface-deep); }
.badge-blue { color: var(--blue); background: rgba(61,139,255,.12); }
.fig.clickable { cursor: pointer; border-radius: 10px; }
.fig.clickable:hover .cap { color: var(--text-2); }
.fig.clickable:hover .val { color: var(--blue); }

/* ── Insights ── */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.seg button { background: none; border: none; color: var(--text-2); font-size: 12.5px; padding: 7px 14px; }
.seg button.on { color: #fff; background: var(--grad); }
.ins-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; align-content: start; width: 100%; }
.ins-card { background: var(--surface); border: 1px solid var(--hair); border-radius: 16px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; }
.ins-card:hover { border-color: var(--border-strong); }
.ins-card.open { border: 1px solid transparent; background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box, var(--grad) border-box; }
.ins-head { display: flex; align-items: center; gap: 12px; }
.ins-name { font-size: 15px; font-weight: 600; }
.ins-eff { font-family: var(--mono); font-size: 22px; font-weight: 500; margin-left: auto; }
.ins-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ins-num { display: flex; flex-direction: column; gap: 2px; }
.ins-num .v { font-family: var(--mono); font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
.ins-num .k { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ins-top { font-size: 12.5px; color: var(--text-2); }
.ins-top b { color: var(--text); font-weight: 600; }
.ins-reasons { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--hair); padding-top: 10px; }
.ins-bar { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.ins-bar .lbl { width: 150px; }
.ins-bar .track { flex: 1; height: 8px; background: var(--hair-2); border-radius: 4px; overflow: hidden; }
.ins-bar .fill { height: 100%; border-radius: 4px; background: var(--blue); }
.ins-bar .fill.win { background: var(--ok); }
.ins-bar .n { font-family: var(--mono); font-size: 12px; color: var(--text-3); width: 28px; text-align: right; }

.funnel { display: flex; align-items: flex-end; gap: 8px; }
.fstage { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fstage .fbarwrap { height: 46px; display: flex; align-items: flex-end; }
.fstage .fbar { width: 100%; border-radius: 6px 6px 4px 4px; background: linear-gradient(180deg, #0A6CFF, #7E52C2); min-height: 4px; }
.fstage .fbar.ghost { background: repeating-linear-gradient(45deg, var(--hair) 0 6px, transparent 6px 12px); height: 18px; }
.fstage .fn { font-family: var(--mono); font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.fstage .fl { font-size: 11.5px; color: var(--text-2); }
.fstage .fl small { color: var(--muted); }
.fdrop { width: 42px; text-align: center; font-family: var(--mono); font-size: 11px; color: var(--muted); padding-bottom: 40px; flex: none; }
.fdrop.worst { color: var(--late); font-weight: 600; }
.mini { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mini th { text-align: left; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 4px 8px 6px 0; border-bottom: 1px solid var(--hair); }
.mini td { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--hair-2); }
.mini td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; color: var(--text-3); }
.mini tr:last-child td { border-bottom: none; }
.ins-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ins-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.rec-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--hair-2); font-size: 13px; }
.rec-row:first-of-type { border-top: none; }
.rec-row .rec-who { width: 220px; flex: none; }
.rec-row .rec-sub { font-size: 11.5px; color: var(--text-2); }
.rec-row .rec-sug { flex: 1; color: var(--text-3); }
.rec-row .rec-sug b { color: var(--blue); font-weight: 600; }

/* ── Laudo ── */
.laudo { display: flex; flex-direction: column; gap: 14px; padding: 18px 22px; }
.laudo-row { display: flex; gap: 12px; align-items: flex-start; }
.laudo-k { width: 150px; flex: none; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.laudo-v { font-size: 13.5px; line-height: 1.5; }
.quote { border-left: 2px solid var(--border); padding: 4px 12px; font-size: 13px; color: var(--text-2); margin: 4px 0; }
.quote b { color: var(--text-3); font-weight: 600; }
.stars { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.lead-row.clickable { cursor: pointer; }
.lead-row.clickable:hover { background: var(--surface-deep); }

/* ── Login ── */
.login-wrap { height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 360px; display: flex; flex-direction: column; gap: 16px; align-items: stretch; text-align: center; }
.login-card img { width: 56px; height: 56px; margin: 0 auto; }
.login-card h1 { font-size: 19px; margin: 0; }
.login-card .sub { font-size: 13px; color: var(--text-2); margin-top: -8px; }
.login-err { color: var(--alert-fg); font-size: 12.5px; min-height: 16px; }

/* filtro de período do topo — os números abaixo respondem a ele */
.period-row { display: flex; align-items: center; gap: 8px; padding: 10px 22px 0; flex-wrap: wrap; }
.period-row .grow { flex: 1; }
.per { font-size: 12.5px; color: var(--text-2); background: none; border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 11px; cursor: pointer; }
.per:hover { color: var(--text); border-color: var(--text-3); }
.per.on { color: #fff; background: var(--grad); border-color: transparent; }
.period-row input[type="date"] { font-size: 12.5px; padding: 4px 8px; }

/* quem está esperando resposta do vendedor (modo número próprio) */
.waiting-acc { flex-basis: 100%; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.waiting-acc > summary { list-style: none; cursor: pointer; font-size: 12.5px; color: var(--muted);
  display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.waiting-acc > summary::-webkit-details-marker { display: none; }
.waiting-acc > summary .chev { flex: none; color: var(--text-3); transition: transform .15s ease; }
.waiting-acc[open] > summary .chev { transform: rotate(90deg); }
.waiting-acc > summary:hover { color: var(--text-2); }
.waiting-list { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.waiting-item { display: flex; align-items: center; gap: 9px; font-size: 12.5px;
  padding: 3px 0; color: var(--text-2); }
.waiting-item .grow { flex: 1; }
.wi-name { color: var(--text); }
.wi-phone { color: var(--muted); font-size: 12px; }
.wi-time { font-variant-numeric: tabular-nums; }
.wi-time.amber { color: var(--wait); }
.wi-time.red { color: var(--late); }

/* seletor de tag dos motivos de não qualificação (lista própria com busca) */
.tag-pick {
  display: inline-flex; align-items: center; gap: 9px; width: 248px; flex: none;
  font-family: var(--font); font-size: 12.5px; color: var(--text); text-align: left;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px;
}
.tag-pick:hover { border-color: var(--border-strong); }
.tag-pick:focus-visible, .tag-pick.open { border-color: #3D5AA9; outline: none; }
.tag-pick.none .tp-name { color: var(--muted); }
.tag-pick .tp-chev { color: var(--muted); flex: none; transition: transform .15s; }
.tag-pick.open .tp-chev { transform: rotate(180deg); }
.tp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-dots { display: inline-flex; flex: none; }
.tp-dots .tp-dot + .tp-dot { margin-left: -3px; box-shadow: 0 0 0 1.5px var(--bg); }
.tp-more { flex: none; font-size: 11px; color: var(--text-2); background: var(--surface-deep); border-radius: 6px; padding: 1px 6px; }
.tp-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tp-dot-none { border: 1.5px dashed var(--muted); background: transparent; box-sizing: border-box; }
.tag-pop {
  position: fixed; z-index: 60; display: flex; flex-direction: column; max-height: 320px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,.28); animation: slideIn .12s ease-out; overflow: hidden;
}
.tag-pop .tp-search { margin: 8px; font-size: 12.5px; padding: 8px 10px; flex: none; }
.tag-pop .tp-list { overflow-y: auto; padding: 0 6px 6px; }
.tp-opt { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 8px; font-size: 12.5px; cursor: pointer; }
.tp-opt.cur { background: var(--surface-deep); }
.tp-opt.sel .tp-name { font-weight: 500; }
.tp-check { color: var(--blue); font-size: 12px; flex: none; }
