/* ============================================================
   LeadMap — design tokens
   ============================================================ */
:root, [data-theme="dark"] {
  --bg: #0a0b13;
  --bg-2: #0e1019;
  --surface: rgba(255,255,255,.045);
  --surface-2: rgba(255,255,255,.07);
  --surface-solid: #13151f;
  --surface-solid-2: #181b27;
  --line: rgba(255,255,255,.085);
  --line-strong: rgba(255,255,255,.16);
  --text: #eceef7;
  --text-2: #a4a9be;
  --text-3: #6c7189;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --accent-soft: rgba(139,92,246,.16);
  --accent-grad: linear-gradient(135deg,#8b5cf6 0%,#6d7bff 55%,#22d3ee 130%);
  --ok: #34d399;   --ok-soft: rgba(52,211,153,.14);
  --warn: #fbbf24; --warn-soft: rgba(251,191,36,.14);
  --hot: #fb7185;  --hot-soft: rgba(251,113,133,.15);
  --info: #60a5fa; --info-soft: rgba(96,165,250,.15);
  --wa: #25d366;
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 12px 40px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 30px 80px -20px rgba(0,0,0,.75);
  --aurora-1: rgba(139,92,246,.34);
  --aurora-2: rgba(34,211,238,.20);
  --aurora-3: rgba(52,211,153,.13);
  --grid-line: rgba(255,255,255,.035);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f4f5fb;
  --bg-2: #eceef8;
  --surface: rgba(255,255,255,.72);
  --surface-2: rgba(255,255,255,.95);
  --surface-solid: #ffffff;
  --surface-solid-2: #f7f8fd;
  --line: rgba(20,24,60,.09);
  --line-strong: rgba(20,24,60,.18);
  --text: #14172b;
  --text-2: #50557a;
  --text-3: #8a8fae;
  --accent: #6d4aed;
  --accent-2: #0891b2;
  --accent-soft: rgba(109,74,237,.10);
  --accent-grad: linear-gradient(135deg,#7c4dff 0%,#5b6cff 55%,#14b8d4 130%);
  --ok: #059669;   --ok-soft: rgba(5,150,105,.11);
  --warn: #b45309; --warn-soft: rgba(217,119,6,.13);
  --hot: #e11d48;  --hot-soft: rgba(225,29,72,.10);
  --info: #2563eb; --info-soft: rgba(37,99,235,.10);
  --shadow: 0 1px 2px rgba(20,24,60,.05), 0 10px 30px -14px rgba(40,50,120,.22);
  --shadow-lg: 0 30px 70px -24px rgba(40,50,120,.35);
  --aurora-1: rgba(139,92,246,.22);
  --aurora-2: rgba(34,211,238,.20);
  --aurora-3: rgba(52,211,153,.14);
  --grid-line: rgba(20,24,60,.035);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 14px/1.5 "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: #fff; }
.mono, .num { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }
.ic { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.sm { width: 15px; height: 15px; }
.ic.lg { width: 22px; height: 22px; }
kbd {
  font: 600 10.5px/1 "JetBrains Mono", monospace;
  padding: 3px 6px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-3);
}
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 8px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* Fundo aurora + grade sutil */
.bg-aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg-aurora::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
}
.bg-aurora i { position: absolute; border-radius: 50%; filter: blur(110px); will-change: transform; }
.bg-aurora i:nth-child(1) { width: 640px; height: 640px; left: -160px; top: -240px; background: var(--aurora-1); animation: drift 26s ease-in-out infinite alternate; }
.bg-aurora i:nth-child(2) { width: 520px; height: 520px; right: -140px; top: 10%; background: var(--aurora-2); animation: drift 32s ease-in-out infinite alternate-reverse; }
.bg-aurora i:nth-child(3) { width: 460px; height: 460px; left: 35%; bottom: -260px; background: var(--aurora-3); animation: drift 38s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate3d(60px, 40px, 0) scale(1.12); } }

/* ============================================================
   Layout
   ============================================================ */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: 276px minmax(0,1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 18px 14px 14px; border-right: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-2) 88%, transparent), color-mix(in srgb, var(--bg) 70%, transparent));
  backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 16px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: #fff;
  background: var(--accent-grad); box-shadow: 0 10px 28px -8px var(--accent), inset 0 1px 0 rgba(255,255,255,.35);
}
.brand-mark .ic { width: 21px; height: 21px; stroke-width: 2; }
.brand-name { font-weight: 800; font-size: 16.5px; letter-spacing: -.02em; }
.brand-sub { font-size: 11.5px; color: var(--text-3); font-weight: 600; letter-spacing: .02em; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid transparent;
  background: none; color: var(--text-2); font-weight: 600; text-align: left; position: relative; transition: .18s;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.on { background: var(--accent-soft); color: var(--text); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.nav-item.on::before { content: ""; position: absolute; left: -15px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 4px 4px 0; background: var(--accent-grad); }
.nav-item .count { margin-left: auto; font: 600 11px "JetBrains Mono", monospace; color: var(--text-3); background: var(--surface-2); padding: 2px 7px; border-radius: 20px; }

.side-head { display: flex; align-items: center; justify-content: space-between; margin: 18px 8px 4px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.lists { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 4px; padding-right: 2px; }
.list-item { text-align: left; border: 1px solid transparent; background: none; padding: 10px 12px; border-radius: 12px; display: grid; gap: 7px; transition: .18s; }
.list-item:hover { background: var(--surface); }
.list-item.on { background: var(--surface-2); border-color: var(--line-strong); box-shadow: var(--shadow); }
.list-item .row1 { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13.5px; }
.list-item .row1 span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .row1 .count { margin-left: auto; font: 600 11px "JetBrains Mono", monospace; color: var(--text-3); }
.list-item .row2 { font-size: 11.5px; color: var(--text-3); display: flex; justify-content: space-between; }
.mini-bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.mini-bar b { display: block; height: 100%; background: var(--accent-grad); border-radius: 4px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.side-empty { padding: 14px 12px; border: 1px dashed var(--line-strong); border-radius: 14px; color: var(--text-3); font-size: 12.5px; }

.side-foot { display: grid; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.usage { font-size: 11.5px; color: var(--text-3); display: grid; gap: 6px; padding: 0 6px; }
.usage .mini-bar b { background: linear-gradient(90deg, var(--ok), var(--accent-2)); }
.foot-row { display: flex; gap: 8px; }
.ghost-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 10px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: 12.5px; transition: .18s; }
.ghost-btn:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-2); }

.main { min-width: 0; padding: 0 clamp(16px, 3vw, 36px) 80px; }
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 20px 0 16px; margin-bottom: 4px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  margin-left: calc(-1 * clamp(16px, 3vw, 36px)); margin-right: calc(-1 * clamp(16px, 3vw, 36px));
  padding-left: clamp(16px, 3vw, 36px); padding-right: clamp(16px, 3vw, 36px);
  border-bottom: 1px solid transparent;
}
.top-title { min-width: 0; margin-right: auto; }
.top-title h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.top-title p { margin: 2px 0 0; color: var(--text-3); font-size: 12.5px; font-weight: 500; }
.search {
  display: flex; align-items: center; gap: 10px; width: min(380px, 100%); padding: 0 12px; height: 42px;
  border-radius: 13px; background: var(--surface); border: 1px solid var(--line); color: var(--text-3);
  transition: .18s; backdrop-filter: blur(12px);
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); color: var(--text); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font-size: 13.5px; }
.search input::placeholder { color: var(--text-3); }
.search input::-webkit-search-cancel-button { display: none; }
.top-actions { display: flex; gap: 8px; }

.only-mobile { display: none !important; }
.scrim { display: none; }

/* ============================================================
   Controles
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px;
  border-radius: 13px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 700; font-size: 13.5px;
  transition: transform .15s, background .18s, border-color .18s, box-shadow .18s; backdrop-filter: blur(12px); white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 10px; }
.btn.primary { background: var(--accent-grad); border-color: transparent; color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.glow { box-shadow: 0 10px 28px -8px var(--accent), inset 0 1px 0 rgba(255,255,255,.3); }
.btn.wa { background: linear-gradient(135deg,#22c55e,#16a34a); border-color: transparent; color: #fff; box-shadow: 0 10px 24px -10px #16a34a; }
.btn.wa:hover { filter: brightness(1.08); }
.btn.danger { color: var(--hot); }
.btn.danger:hover { background: var(--hot-soft); border-color: color-mix(in srgb, var(--hot) 40%, transparent); }
.btn[disabled], .btn.off { opacity: .45; pointer-events: none; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); transition: .18s; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--line-strong); }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 9px; }
.icon-btn.sm .ic { width: 15px; height: 15px; }

.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: 12.5px; transition: .18s; white-space: nowrap;
}
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--text); }
.chip .ic { width: 15px; height: 15px; }
.chip .n { font: 600 11px "JetBrains Mono", monospace; color: var(--text-3); }
.select, .input, .textarea {
  background: var(--surface); border: 1px solid var(--line); color: var(--text); border-radius: 11px; padding: 0 12px; height: 38px; outline: 0; transition: .18s; width: 100%;
}
.select { appearance: none; -webkit-appearance: none; padding-right: 32px; width: auto; font-weight: 600; font-size: 12.5px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8fae' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }
.select option { background: var(--surface-solid); color: var(--text); }
.textarea { height: auto; min-height: 110px; padding: 11px 13px; line-height: 1.55; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field { display: grid; gap: 6px; }
.field > label, .lbl { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.invalid .input, .invalid .select { border-color: var(--hot); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); backdrop-filter: blur(14px) saturate(130%); -webkit-backdrop-filter: blur(14px) saturate(130%); }
.card-pad { padding: 20px; }
.card h3 { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.card .sub { color: var(--text-3); font-size: 12px; margin-top: 2px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }

/* ============================================================
   View: Painel
   ============================================================ */
.view { outline: 0; animation: rise .45s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.hero { position: relative; overflow: hidden; border-radius: 26px; padding: clamp(22px, 3vw, 34px); border: 1px solid var(--line-strong); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, var(--surface-solid)), var(--surface-solid) 60%); box-shadow: var(--shadow-lg); display: grid; gap: 22px; grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); align-items: center; }
.hero::after { content: ""; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent-2) 40%, transparent), transparent 70%); pointer-events: none; }
.hero h2 { margin: 0 0 8px; font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -.035em; line-height: 1.12; font-weight: 800; }
.hero h2 em { font-style: normal; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 0 0 18px; color: var(--text-2); max-width: 54ch; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-ring { display: flex; align-items: center; justify-content: center; gap: 22px; position: relative; z-index: 1; }
.ring-wrap { position: relative; width: 150px; height: 150px; flex: none; }
.ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-wrap .ring-bg { stroke: var(--line-strong); }
.ring-wrap .ring-fg { stroke: url(#grad-ring); transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-label b { font: 700 32px "JetBrains Mono", monospace; letter-spacing: -.04em; }
.ring-label span { font-size: 11px; color: var(--text-3); font-weight: 600; }
.hero-stats { display: grid; gap: 12px; font-size: 12.5px; color: var(--text-2); }
.hero-stats b { color: var(--text); font: 700 18px "JetBrains Mono", monospace; display: block; letter-spacing: -.03em; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 14px; margin: 18px 0; }
.kpi { padding: 18px; position: relative; overflow: hidden; transition: transform .2s, border-color .2s; cursor: default; }
.kpi:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.kpi .k-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 14px; background: var(--accent-soft); color: var(--accent); }
.kpi.ok .k-ic { background: var(--ok-soft); color: var(--ok); }
.kpi.hot .k-ic { background: var(--hot-soft); color: var(--hot); }
.kpi.info .k-ic { background: var(--info-soft); color: var(--info); }
.kpi.warn .k-ic { background: var(--warn-soft); color: var(--warn); }
.kpi .k-val { font: 700 30px/1 "JetBrains Mono", monospace; letter-spacing: -.05em; }
.kpi .k-lbl { color: var(--text-2); font-weight: 600; font-size: 12.5px; margin-top: 6px; }
.kpi .k-hint { color: var(--text-3); font-size: 11.5px; margin-top: 2px; }
.spark { position: absolute; right: 14px; top: 16px; display: flex; align-items: flex-end; gap: 3px; height: 28px; opacity: .85; }
.spark i { width: 5px; border-radius: 3px; background: currentColor; opacity: .55; }
.kpi.ok .spark { color: var(--ok); } .kpi.hot .spark { color: var(--hot); } .kpi.info .spark { color: var(--info); } .kpi.warn .spark { color: var(--warn); } .kpi .spark { color: var(--accent); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; margin-bottom: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin-bottom: 14px; }
.bars { display: grid; gap: 11px; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 150px) 1fr auto; gap: 12px; align-items: center; font-size: 12.5px; }
.bar-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-weight: 600; }
.bar-track { height: 9px; background: var(--line); border-radius: 9px; overflow: hidden; }
.bar-track b { display: block; height: 100%; border-radius: 9px; background: var(--accent-grad); animation: grow .9s cubic-bezier(.2,.8,.2,1); transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } }
.bar-row .v { font: 600 12px "JetBrains Mono", monospace; color: var(--text-3); min-width: 28px; text-align: right; }
.funnel { display: grid; gap: 8px; }
.f-step { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; font-weight: 700; font-size: 13px; }
.f-step i { position: absolute; inset: 0; width: var(--w); background: var(--c); opacity: .2; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.f-step span, .f-step em { position: relative; font-style: normal; }
.f-step em { font: 700 14px "JetBrains Mono", monospace; }
.f-step .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 9px; }
.histo { display: flex; align-items: stretch; gap: 8px; height: 150px; padding-top: 4px; }
.histo .hcol { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3); min-width: 0; }
.histo .htrack { flex: 1; width: 100%; position: relative; border-radius: 8px 8px 3px 3px; background: color-mix(in srgb, var(--line) 60%, transparent); }
.histo .htrack b { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 8px 8px 3px 3px; background: var(--accent-grad); min-height: 3px; transition: height .8s cubic-bezier(.2,.8,.2,1); opacity: .95; }
.histo .hcol span.v { font: 600 11px "JetBrains Mono", monospace; color: var(--text-2); }
.top-list { display: grid; gap: 4px; }
.top-item { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; transition: .15s; cursor: pointer; border: 1px solid transparent; }
.top-item:hover { background: var(--surface-2); border-color: var(--line); }
.top-item .nm { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-item .meta { color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-card { display: grid; place-items: center; text-align: center; gap: 6px; padding: 28px 16px; color: var(--text-3); font-size: 13px; }

/* ============================================================
   Score ring (anel mini)
   ============================================================ */
.score { position: relative; width: 44px; height: 44px; flex: none; }
.score svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score .bg { stroke: var(--line-strong); fill: none; stroke-width: 4; }
.score .fg { fill: none; stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset .6s; }
.score b { position: absolute; inset: 0; display: grid; place-items: center; font: 700 12.5px "JetBrains Mono", monospace; letter-spacing: -.04em; }
.score.hot .fg { stroke: var(--hot); } .score.warm .fg { stroke: var(--warn); } .score.cold .fg { stroke: var(--info); }
.score.lg { width: 76px; height: 76px; } .score.lg b { font-size: 22px; } .score.lg .bg, .score.lg .fg { stroke-width: 5; }

/* ============================================================
   View: Leads
   ============================================================ */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 14px; }
.toolbar .sp { flex: 1; }
.view-toggle { display: inline-flex; padding: 3px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); }
.view-toggle button { border: 0; background: none; width: 34px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--text-3); }
.view-toggle button.on { background: var(--surface-2); color: var(--text); box-shadow: var(--shadow); }
.count-line { color: var(--text-3); font-size: 12.5px; margin: 0 2px 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.count-line b { color: var(--text); }

.rows { display: grid; gap: 8px; }
.row {
  display: grid; grid-template-columns: 22px 44px minmax(0,2.2fr) minmax(0,1.3fr) 108px 196px 118px; gap: 16px; align-items: center;
  padding: 12px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); cursor: pointer;
  transition: border-color .18s, background .18s, transform .18s; position: relative;
  content-visibility: auto; contain-intrinsic-size: 0 74px;
}
.row:hover { background: var(--surface-2); border-color: var(--line-strong); transform: translateY(-1px); }
.row.sel { border-color: var(--accent); background: var(--accent-soft); }
.row.done { opacity: .62; }
.row .who { min-width: 0; }
.row .nm { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.row .meta { display: flex; gap: 8px; align-items: center; color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; }
.row .meta .ic { width: 13px; height: 13px; }
.row .reach { display: flex; gap: 6px; flex-wrap: wrap; }
.row .rate { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.row .rate .ic { color: var(--warn); fill: var(--warn); width: 15px; height: 15px; }
.row .rate small { color: var(--text-3); font-weight: 500; font-size: 11.5px; }
.row .acts { display: flex; gap: 6px; justify-content: flex-end; }
.row-head { display: grid; grid-template-columns: 22px 44px minmax(0,2.2fr) minmax(0,1.3fr) 108px 196px 118px; gap: 16px; padding: 0 16px; color: var(--text-3); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: -2px; }
.cb { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; transition: .15s; margin: 0; }
.cb:checked { background: var(--accent-grad); border-color: transparent; }
.cb:checked::after { content: ""; width: 9px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px,-1px); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.lcard { padding: 16px; cursor: pointer; display: grid; gap: 12px; transition: .18s; position: relative; content-visibility: auto; contain-intrinsic-size: 0 220px; }
.lcard:hover { transform: translateY(-2px); border-color: var(--line-strong); background: var(--surface-2); }
.lcard.sel { border-color: var(--accent); }
.lcard.done { opacity: .62; }
.lcard .top { position: static; padding: 0; margin: 0; background: none; display: flex; gap: 12px; align-items: center; flex-wrap: nowrap; }
.lcard .nm { font-weight: 700; font-size: 14.5px; letter-spacing: -.01em; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lcard .meta { color: var(--text-3); font-size: 12px; }
.lcard .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 8px; font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.tag .ic { width: 12px; height: 12px; }
.tag.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag.hot { background: var(--hot-soft); color: var(--hot); border-color: transparent; }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.tag.acc { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.rbtn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; color: var(--text-2); transition: .15s; }
.rbtn:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-2); }
.rbtn.wa { color: var(--wa); } .rbtn.wa:hover { background: color-mix(in srgb, var(--wa) 16%, transparent); border-color: color-mix(in srgb, var(--wa) 45%, transparent); }
.rbtn.off { opacity: .3; pointer-events: none; }
.status {
  appearance: none; -webkit-appearance: none; border: 1px solid transparent; border-radius: 10px; height: 32px; padding: 0 26px 0 12px; font-weight: 700; font-size: 12px; cursor: pointer; outline: 0;
  background-color: var(--c-soft, var(--surface-2)); color: var(--c, var(--text-2));
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; max-width: 100%;
}
.status option { background: var(--surface-solid); color: var(--text); }
.st-novo { --c: var(--text-2); --c-soft: var(--surface-2); }
.st-contatado { --c: var(--info); --c-soft: var(--info-soft); }
.st-respondeu { --c: var(--accent); --c-soft: var(--accent-soft); }
.st-reuniao { --c: var(--warn); --c-soft: var(--warn-soft); }
.st-fechado { --c: var(--ok); --c-soft: var(--ok-soft); }
.st-perdido { --c: var(--hot); --c-soft: var(--hot-soft); }

.bulk { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; z-index: 40; display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 18px; border-radius: 18px; background: var(--surface-solid-2); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg); transition: .25s cubic-bezier(.2,.8,.2,1); max-width: calc(100vw - 24px); flex-wrap: wrap; justify-content: center; }
.bulk.show { opacity: 1; transform: translateX(-50%); pointer-events: auto; }
.bulk b { font-family: "JetBrains Mono", monospace; }

.pager { display: flex; justify-content: center; margin: 18px 0; }

/* ============================================================
   View: Funil (kanban)
   ============================================================ */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(268px, 1fr); gap: 14px; overflow-x: auto; padding: 4px 2px 18px; scroll-snap-type: x proximity; }
.col { display: flex; flex-direction: column; gap: 10px; min-height: 320px; padding: 12px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); scroll-snap-align: start; transition: .15s; }
.col.over { border-color: var(--c); background: color-mix(in srgb, var(--c) 9%, var(--surface)); }
.col-head { display: flex; align-items: center; gap: 9px; padding: 2px 4px 6px; font-weight: 800; letter-spacing: -.01em; }
.col-head .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 12px var(--c); }
.col-head .n { margin-left: auto; font: 600 11.5px "JetBrains Mono", monospace; color: var(--text-3); background: var(--surface-2); padding: 2px 8px; border-radius: 20px; }
.col-body { display: flex; flex-direction: column; gap: 9px; flex: 1; }
.kcard { padding: 12px; border-radius: 15px; background: var(--surface-solid-2); border: 1px solid var(--line); cursor: grab; display: grid; gap: 9px; transition: .15s; }
.kcard:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.kcard.drag { opacity: .35; transform: rotate(2deg); }
.kcard .nm { font-weight: 700; font-size: 13.5px; line-height: 1.3; }
.kcard .meta { font-size: 11.5px; color: var(--text-3); }
.kcard .foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.col-more { text-align: center; color: var(--text-3); font-size: 12px; padding: 6px; }

/* ============================================================
   View: Mensagens
   ============================================================ */
.tpl-layout { display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 14px; align-items: start; }
.tpl-list { display: grid; gap: 8px; padding: 12px; }
.tpl-item { text-align: left; padding: 12px; border-radius: 14px; border: 1px solid transparent; background: none; display: grid; gap: 5px; transition: .15s; }
.tpl-item:hover { background: var(--surface-2); }
.tpl-item.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.tpl-item .t1 { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.tpl-item .t2 { color: var(--text-3); font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tpl-editor { display: grid; gap: 14px; padding: 20px; }
.vars { display: flex; flex-wrap: wrap; gap: 6px; }
.var { border: 1px dashed var(--line-strong); background: var(--surface); color: var(--accent-2); font: 600 12px "JetBrains Mono", monospace; padding: 5px 9px; border-radius: 8px; transition: .15s; }
.var:hover { border-style: solid; background: var(--accent-soft); }
.preview-split { display: grid; grid-template-columns: 1fr; gap: 14px; }
.phone { max-width: 380px; margin: 0 auto; width: 100%; border-radius: 32px; padding: 10px; background: var(--surface-solid-2); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg); }
.phone-screen { border-radius: 24px; overflow: hidden; background: #0b141a; min-height: 280px; display: flex; flex-direction: column; }
[data-theme="light"] .phone-screen { background: #e7ddd3; }
.phone-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #1f2c34; color: #e9edef; font-weight: 700; font-size: 13px; }
[data-theme="light"] .phone-top { background: #0f7a6a; color: #fff; }
.phone-top i { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-grad); display: block; }
.phone-chat { padding: 16px 14px; display: flex; flex-direction: column; flex: 1; justify-content: flex-end; }
.bubble { align-self: flex-end; max-width: 92%; padding: 9px 12px 6px; border-radius: 14px 14px 4px 14px; background: #005c4b; color: #e9edef; font-size: 13px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.bubble small { display: block; text-align: right; font-size: 10px; color: rgba(233,237,239,.65); margin-top: 2px; }
.mail-prev { padding: 16px; border-radius: 16px; background: var(--surface-solid-2); border: 1px solid var(--line); white-space: pre-wrap; font-size: 13px; line-height: 1.6; }
.mail-prev b { display: block; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }

/* ============================================================
   Drawer (detalhe do lead)
   ============================================================ */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(4,5,12,.55); backdrop-filter: blur(6px); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(560px, 100vw); background: var(--surface-solid); border-left: 1px solid var(--line-strong); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .32s cubic-bezier(.2,.8,.2,1); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer-head { display: flex; gap: 14px; align-items: flex-start; padding: 22px 22px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent); }
.drawer-head h2 { margin: 0; font-size: 19px; letter-spacing: -.02em; line-height: 1.25; }
.drawer-head .sub { color: var(--text-3); font-size: 12.5px; margin-top: 4px; }
.drawer-head .grow { flex: 1; min-width: 0; }
.drawer-body { flex: 1; overflow: auto; padding: 18px 22px 28px; display: grid; gap: 20px; align-content: start; }
.drawer-foot { display: flex; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-solid-2); }
.drawer-foot .btn { flex: 1; }
.sec { display: grid; gap: 10px; }
.sec-t { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); display: flex; align-items: center; gap: 8px; }
.sec-t::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.status-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.status-seg button { border: 1px solid var(--line); background: var(--surface); border-radius: 11px; padding: 9px 6px; font-weight: 700; font-size: 12px; color: var(--text-2); display: flex; align-items: center; justify-content: center; gap: 7px; transition: .15s; }
.status-seg button .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.status-seg button:hover { border-color: var(--line-strong); color: var(--text); }
.status-seg button.on { background: var(--c-soft); color: var(--c); border-color: color-mix(in srgb, var(--c) 50%, transparent); }
.info-grid { display: grid; gap: 2px; }
.info-row { display: grid; grid-template-columns: 22px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 12px; transition: .15s; }
.info-row:hover { background: var(--surface); }
.info-row .ic { color: var(--text-3); }
.info-row .v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.info-row .v small { display: block; color: var(--text-3); font-weight: 500; font-size: 11.5px; }
.info-row .acts { display: flex; gap: 5px; }
.socials { display: flex; gap: 8px; flex-wrap: wrap; }
.soc { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; font-weight: 700; transition: .15s; }
.soc:hover { border-color: var(--accent); background: var(--accent-soft); }
.score-break { display: grid; gap: 7px; font-size: 12.5px; }
.score-break div { display: flex; justify-content: space-between; color: var(--text-2); padding: 7px 11px; border-radius: 10px; background: var(--surface); }
.score-break div b { font-family: "JetBrains Mono", monospace; color: var(--ok); }
.score-break div.neg b { color: var(--text-3); }
.timeline { display: grid; gap: 0; padding-left: 6px; }
.tl { position: relative; padding: 0 0 14px 20px; border-left: 2px solid var(--line); font-size: 12.5px; color: var(--text-2); }
.tl::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tl small { display: block; color: var(--text-3); font-size: 11px; }
.tags-edit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tags-edit .tag button { background: none; border: 0; padding: 0; margin-left: 2px; color: inherit; display: grid; opacity: .7; }
.tags-edit input { flex: 1; min-width: 110px; height: 30px; background: none; border: 1px dashed var(--line-strong); border-radius: 8px; padding: 0 10px; outline: 0; font-size: 12.5px; }
.tags-edit input:focus { border-style: solid; border-color: var(--accent); }

/* ============================================================
   Modal
   ============================================================ */
.modal-wrap { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(4,5,12,.6); backdrop-filter: blur(8px); animation: fade .2s; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; border-radius: 24px; background: var(--surface-solid); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg); animation: pop .28s cubic-bezier(.2,.9,.3,1.2); }
@keyframes pop { from { transform: scale(.94) translateY(10px); opacity: 0; } }
.modal-h { padding: 22px 24px 8px; }
.modal-h h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.modal-h p { margin: 6px 0 0; color: var(--text-2); }
.modal-b { padding: 12px 24px 8px; display: grid; gap: 14px; }
.modal-f { padding: 14px 24px 22px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.summary { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px; border-radius: 16px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.summary div { flex: 1; min-width: 80px; }
.summary b { display: block; font: 700 22px "JetBrains Mono", monospace; letter-spacing: -.04em; }
.summary span { font-size: 11.5px; color: var(--text-2); font-weight: 600; }

.dropzone { position: relative; display: grid; place-items: center; gap: 10px; text-align: center; padding: 38px 20px; border-radius: 22px; border: 1.5px dashed var(--line-strong); background: var(--surface); transition: .2s; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.01); }
.dropzone .big { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; background: var(--accent-grad); color: #fff; box-shadow: 0 14px 32px -10px var(--accent); }
.dropzone h3 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.dropzone p { margin: 0; color: var(--text-2); max-width: 44ch; }

/* ============================================================
   Modo prospecção (foco)
   ============================================================ */
.focus { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: radial-gradient(ellipse at top, color-mix(in srgb, var(--accent) 22%, var(--bg)), var(--bg) 70%); animation: fade .25s; overflow: auto; }
.focus-inner { width: min(760px, 100%); display: grid; gap: 16px; }
.focus-top { display: flex; align-items: center; gap: 14px; }
.focus-top .prog { flex: 1; }
.focus-top .prog .mini-bar { height: 7px; }
.focus-top small { color: var(--text-3); font-weight: 600; display: block; margin-bottom: 6px; }
.focus-card { padding: clamp(18px, 3vw, 30px); display: grid; gap: 18px; animation: swap .35s cubic-bezier(.2,.8,.2,1); }
@keyframes swap { from { opacity: 0; transform: translateX(26px) scale(.99); } }
.focus-who { display: flex; gap: 16px; align-items: center; }
.focus-who h2 { margin: 0; font-size: clamp(20px, 3vw, 26px); letter-spacing: -.03em; line-height: 1.15; }
.focus-who p { margin: 4px 0 0; color: var(--text-2); }
.focus-tags { display: flex; gap: 7px; flex-wrap: wrap; }
.focus-keys { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; color: var(--text-3); font-size: 12px; }
.focus-keys span { display: inline-flex; gap: 6px; align-items: center; }
.focus-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.focus-actions .btn { height: 50px; }
.focus-actions .btn.big { grid-column: 1 / -1; height: 58px; font-size: 15.5px; border-radius: 16px; }
.focus-done { text-align: center; padding: 50px 20px; display: grid; gap: 12px; justify-items: center; }
.focus-done h2 { margin: 0; font-size: 26px; letter-spacing: -.03em; }

/* ============================================================
   Paleta de comandos
   ============================================================ */
.palette { width: min(620px, 100%); border-radius: 22px; background: var(--surface-solid); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .22s cubic-bezier(.2,.9,.3,1.2); align-self: start; margin-top: 12vh; }
.palette-in { display: flex; align-items: center; gap: 12px; padding: 0 18px; height: 58px; border-bottom: 1px solid var(--line); color: var(--text-3); }
.palette-in input { flex: 1; background: none; border: 0; outline: 0; font-size: 16px; color: var(--text); }
.palette-list { max-height: 50vh; overflow: auto; padding: 8px; }
.pal-grp { padding: 10px 12px 4px; font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.pal-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; background: none; border-radius: 12px; text-align: left; font-weight: 600; color: var(--text-2); }
.pal-item.on { background: var(--accent-soft); color: var(--text); }
.pal-item small { margin-left: auto; color: var(--text-3); font-weight: 500; }
.palette-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 11.5px; }

/* ============================================================
   Toasts
   ============================================================ */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 10px; justify-items: end; }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; border-radius: 14px; background: var(--surface-solid-2); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg); font-weight: 600; animation: toast .35s cubic-bezier(.2,.9,.3,1.2); max-width: min(420px, calc(100vw - 32px)); }
.toast.err { border-color: var(--hot); }
.toast .ic { color: var(--ok); } .toast.err .ic { color: var(--hot); }
.toast button { border: 0; background: var(--accent-soft); color: var(--accent); font-weight: 800; padding: 5px 10px; border-radius: 8px; }
@keyframes toast { from { transform: translateY(16px) scale(.96); opacity: 0; } }

.hide-sm { }

/* ============================================================
   Refinamentos v2
   ============================================================ */
/* Lista na sidebar com botão de editar */
.list-wrap { position: relative; }
.list-wrap .list-item { width: 100%; }
.list-more { position: absolute; top: 7px; right: 7px; width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-solid-2); color: var(--text-2); display: grid; place-items: center; opacity: 0; transition: .15s; }
.list-more .ic { width: 16px; height: 16px; }
.list-wrap:hover .list-more, .list-wrap.on .list-more, .list-more:focus-visible { opacity: 1; }
.list-wrap:hover .list-item .row1 .count, .list-wrap.on .list-item .row1 .count { visibility: hidden; }
.list-more:hover { color: var(--text); border-color: var(--line-strong); }
.list-item .row2 .due { display: inline-flex; align-items: center; gap: 4px; color: var(--warn); font-weight: 700; }
.list-item .row2 .due .ic { width: 12px; height: 12px; }
@media (hover: none) { .list-more { opacity: 1; } .list-item .row1 .count { visibility: hidden; } }

/* KPIs clicáveis com medidor real */
button.kpi { text-align: left; color: inherit; font: inherit; cursor: pointer; display: block; width: 100%; }
.kpi .k-go { position: absolute; right: 16px; top: 18px; color: var(--text-3); opacity: 0; transform: translateX(-4px); transition: .2s; }
.kpi:hover .k-go { opacity: 1; transform: none; }
.k-meter { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 12px; }
.k-meter b { display: block; height: 100%; border-radius: 4px; background: var(--accent); animation: grow .9s cubic-bezier(.2,.8,.2,1); transform-origin: left; }
.kpi.ok .k-meter b { background: var(--ok); } .kpi.hot .k-meter b { background: var(--hot); } .kpi.info .k-meter b { background: var(--info); } .kpi.warn .k-meter b { background: var(--warn); }
.pill { display: inline-block; font: 700 10.5px "JetBrains Mono", monospace; padding: 1px 6px; border-radius: 20px; background: var(--accent-soft); color: var(--accent); margin-left: 4px; vertical-align: 1px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.status.pill-st { height: 24px; padding: 0 9px; display: inline-flex; align-items: center; background-image: none; font-size: 11px; cursor: inherit; }

/* Linha do lead: status + retorno lado a lado */
.status-col { display: flex; align-items: center; gap: 6px; min-width: 0; }
.status-col .tag { flex: none; }
.rbtn.wa.fixo { color: var(--text-3); }
.rbtn.wa.fixo:hover { color: var(--wa); }

/* Avisos */
.warn-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 12px; border-radius: 11px; background: var(--warn-soft); color: var(--warn); font-size: 12.5px; font-weight: 600; }
.warn-box .ic { width: 14px; height: 14px; }
.hint { font-size: 12px; color: var(--text-3); line-height: 1.45; }
.hint code { font: 600 11px "JetBrains Mono", monospace; color: var(--accent-2); }

/* Formulário de lead */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } .form-grid .field { grid-column: 1 / -1 !important; } }
.modal-f .btn.danger:first-child { margin-right: auto; }

/* Mensagens: preferências */
.tpl-side { display: grid; gap: 14px; align-content: start; }
.tpl-prefs { display: grid; gap: 12px; padding: 16px; }
.radio-list { display: grid; gap: 6px; }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; transition: .15s; }
.radio:hover { border-color: var(--line-strong); }
.radio.on { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: var(--accent-soft); }
.radio input { accent-color: var(--accent); margin: 3px 0 0; }
.radio b { display: block; font-size: 13px; }
.radio small { display: block; color: var(--text-3); font-size: 11.5px; font-weight: 500; }

/* Drawer: não repetir animação em re-render */
.drawer.still, .overlay.still { animation: none; }

/* ============================================================
   Responsivo
   ============================================================ */
@media (max-width: 1400px) {
  .row .meta .hide-md { display: none; }
}
@media (max-width: 1280px) {
  /* Mantém o botão de WhatsApp; esconde ligar/e-mail (estão na gaveta) */
  .row, .row-head { grid-template-columns: 22px 44px minmax(0,2fr) minmax(0,1.2fr) 100px 190px 34px; gap: 14px; }
  .row .acts .rbtn:not(.wa) { display: none; }
}
@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .tpl-layout { grid-template-columns: 1fr; }
  .row, .row-head { grid-template-columns: 22px 44px minmax(0,1fr) auto 34px; }
  .row .reach-col, .row .rate-col, .row-head .h-reach, .row-head .h-rate { display: none; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 90; left: 0; top: 0; width: min(310px, 88vw); transform: translateX(-102%); transition: transform .3s cubic-bezier(.2,.8,.2,1); background: var(--surface-solid); }
  .side.open { transform: none; box-shadow: var(--shadow-lg); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 89; background: rgba(4,5,12,.55); backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: .25s; }
  .scrim.show { opacity: 1; pointer-events: auto; }
  .only-mobile { display: grid !important; }
  .nav-item.on::before { display: none; }
  .search { order: 5; width: 100%; flex: 1 1 100%; }
  .top { padding-top: 14px; }
}
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .btn { padding: 0 13px; }
  .top-title h1 { font-size: 20px; }
  .row-head { display: none; }
  .row { grid-template-columns: 22px 44px minmax(0,1fr) 34px; gap: 10px 12px; padding: 12px; }
  .row .who { grid-column: 3 / 5; }
  .row .status-col { grid-column: 2 / 4; }
  .row .acts { grid-column: 4; }
  .hero-ring { flex-direction: column; align-items: flex-start; }
  .bar-row { grid-template-columns: minmax(70px, 110px) 1fr auto; }
  .status-seg { grid-template-columns: repeat(2, 1fr); }
  .focus-actions { grid-template-columns: 1fr 1fr; }
  .focus-actions .btn.off-x { grid-column: 1 / -1; }
  .toasts { left: 12px; right: 12px; bottom: 12px; justify-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
