/* ============================================================
   Tintim · Energia Vital — Mockup de redesign (dark violeta refinado)
   Design system: tokens, shell (sidebar), componentes, viz.
   ============================================================ */

:root {
  /* canvas / superfícies (plum near-black) */
  --bg: #0C0A14;
  --bg-soft: #100C1B;
  --surface: #16111F;
  --surface-2: #1C1630;
  --surface-3: #241C3A;
  --border: #2A2340;
  --border-2: #3A3158;
  /* texto */
  --text: #F0EDF7;
  --text-2: #B9B2CE;
  --muted: #837CA0;
  /* acentos */
  --violet: #A78BFA;
  --violet-2: #8B5CF6;
  --violet-3: #C9BBFD;
  --violet-deep: #6D4AE0;
  --money: #34D399;
  --money-deep: #0E9F6E;
  --loss: #FB7185;
  --loss-deep: #E11D48;
  --warn: #FBBF24;
  --info: #6CA8FF;
  /* glows */
  --glow-violet: rgba(139, 92, 246, .35);
  --glow-money: rgba(52, 211, 153, .30);
  /* sombra */
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.7);
  /* raio / espaço */
  --r-sm: 8px; --r: 14px; --r-lg: 20px; --r-pill: 999px;
  --fs-display: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --fs-body: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --fs-mono: "Geist Mono", "Spline Sans Mono", ui-monospace, monospace;
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--fs-body);
  color: var(--text);
  background:
    radial-gradient(1000px 560px at 6% -10%, rgba(139,92,246,.18), transparent 60%),
    radial-gradient(820px 520px at 102% -4%, rgba(52,211,153,.07), transparent 55%),
    radial-gradient(700px 700px at 50% 120%, rgba(109,74,224,.10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--fs-display); font-weight: 600; letter-spacing: -.015em; margin: 0; }
.mono { font-family: var(--fs-mono); font-feature-settings: "tnum" 1; }
.muted { color: var(--muted); }
.dim { color: var(--text-2); }

/* ---------- layout shell ---------- */
/* Sidebar FIXA (não scrolla com a página); só o .main rola como uma lista. */
.app { min-height: 100vh; }
.main { margin-left: var(--sidebar-w); }

.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w); z-index: 30;
  height: 100vh; overflow-y: auto;
  background: linear-gradient(180deg, rgba(28,22,48,.6), rgba(16,12,27,.5));
  border-right: 1px solid var(--border);
  backdrop-filter: blur(12px);
  padding: 18px 14px 22px;
  display: flex; flex-direction: column; gap: 6px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 16px; }
.brand .mark {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: conic-gradient(from 140deg, var(--violet-2), var(--violet-3), var(--money), var(--violet-2));
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 6px 18px -4px var(--glow-violet);
  position: relative;
}
.brand .mark::after {
  content: ""; position: absolute; inset: 6px; border-radius: 6px;
  background: var(--bg);
}
.brand .mark::before {
  content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 10px;
  background: radial-gradient(10px 10px at 50% 50%, var(--violet-3), transparent 70%);
}
.brand b { font-family: var(--fs-display); font-size: 16px; letter-spacing: -.02em; line-height: 1; }
.brand small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; letter-spacing: .02em; }

.nav-group { margin-top: 12px; }
.nav-group > span {
  display: block; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); padding: 0 10px 6px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 10px; color: var(--text-2);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: background .15s, color .15s, transform .15s;
  position: relative;
}
.nav-item:hover { background: rgba(167,139,250,.08); color: var(--text); }
.nav-item.active { background: linear-gradient(90deg, rgba(139,92,246,.22), rgba(139,92,246,.06)); color: #fff; }
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: linear-gradient(var(--violet-3), var(--violet-2));
  box-shadow: 0 0 12px var(--glow-violet);
}
.nav-item .ico { width: 17px; height: 17px; flex-shrink: 0; opacity: .9; }
.nav-item.active .ico { opacity: 1; }
.sidebar .spacer { flex: 1; }
.side-card {
  margin-top: 10px; padding: 12px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-2);
}
.side-card .row { display: flex; align-items: center; justify-content: space-between; }
.side-card .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--money); box-shadow: 0 0 8px var(--glow-money); }

/* ---------- main ---------- */
.main { min-width: 0; padding: 22px 30px 60px; }
.topbar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  margin-bottom: 22px; flex-wrap: wrap;
}
.topbar .title h1 { font-size: 27px; }
.topbar .title p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.seg {
  display: inline-flex; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-pill); padding: 3px; gap: 2px;
}
.seg button {
  font: inherit; font-size: 12.5px; color: var(--text-2); background: none; border: none;
  padding: 6px 13px; border-radius: var(--r-pill); cursor: pointer; transition: .15s;
}
.seg button.on { background: linear-gradient(135deg, var(--violet-2), var(--violet-deep)); color: #fff; box-shadow: 0 4px 14px -4px var(--glow-violet); }
.seg button:hover:not(.on) { color: var(--text); }
.pill {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pill);
  padding: 7px 13px; cursor: pointer;
}

/* ---------- grids ---------- */
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-all { grid-column: 1 / -1; }

/* ---------- card ---------- */
.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 18px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.card.glow::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(420px 120px at 100% 0%, rgba(167,139,250,.10), transparent 60%);
}
.card > .head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card > .head h3 { font-size: 14px; color: var(--text-2); font-weight: 600; letter-spacing: -.01em; }
.card-label { font-size: 12.5px; color: var(--muted); letter-spacing: .01em; }

/* KPI */
.kpi { display: flex; flex-direction: column; gap: 9px; }
.kpi .top { display: flex; align-items: center; justify-content: space-between; }
.kpi .val { font-family: var(--fs-mono); font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.kpi .val.sm { font-size: 24px; }
.kpi .unit { color: var(--muted); font-size: 15px; font-family: var(--fs-mono); }
.kpi .spark { height: 30px; margin-top: 2px; }
.kpi .ico-badge {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: rgba(167,139,250,.12); color: var(--violet-3); border: 1px solid rgba(167,139,250,.18);
}
.kpi.money .ico-badge { background: rgba(52,211,153,.12); color: var(--money); border-color: rgba(52,211,153,.2); }
.kpi.money .val { color: #C7F9E5; }

.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-family: var(--fs-mono); padding: 2px 7px; border-radius: var(--r-pill); }
.delta.up { color: var(--money); background: rgba(52,211,153,.1); }
.delta.down { color: var(--loss); background: rgba(251,113,133,.1); }
.delta.flat { color: var(--muted); background: rgba(255,255,255,.04); }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: var(--r-pill); white-space: nowrap; line-height: 1.4; }
.badge.violet { background: rgba(167,139,250,.14); color: var(--violet-3); }
.badge.money { background: rgba(52,211,153,.14); color: var(--money); }
.badge.loss { background: rgba(251,113,133,.14); color: var(--loss); }
.badge.warn { background: rgba(251,191,36,.14); color: var(--warn); }
.badge.blue { background: rgba(108,168,255,.14); color: var(--info); }
.badge.ghost { background: rgba(255,255,255,.05); color: var(--text-2); }
.tag { font-size: 11px; padding: 2px 8px; border-radius: var(--r-pill); background: rgba(167,139,250,.1); color: var(--violet-3); border: 1px solid rgba(167,139,250,.16); }
.tag.role { background: rgba(108,168,255,.1); color: var(--info); border-color: rgba(108,168,255,.16); }

/* ---------- ROI funnel (bespoke) ---------- */
.roifunnel { display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding-bottom: 4px; }
.roistep { flex: 1 1 0; min-width: 130px; position: relative; padding: 4px 0; }
.roistep .bar {
  height: 96px; border-radius: 12px; position: relative; overflow: hidden;
  background: linear-gradient(180deg, rgba(167,139,250,.16), rgba(167,139,250,.04));
  border: 1px solid rgba(167,139,250,.18);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 10px;
}
.roistep .bar .fill {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, var(--violet-2), var(--violet-deep));
  border-radius: 0 0 11px 11px; opacity: .85;
}
.roistep.money .bar { border-color: rgba(52,211,153,.25); background: linear-gradient(180deg, rgba(52,211,153,.16), rgba(52,211,153,.04)); }
.roistep.money .bar .fill { background: linear-gradient(180deg, var(--money), var(--money-deep)); }
.roistep .bar .num { position: relative; z-index: 1; font-family: var(--fs-mono); font-size: 19px; font-weight: 600; }
.roistep.money .bar .num { color: #DBFCEE; }
.roistep .lbl { font-size: 12px; color: var(--text-2); margin-top: 9px; padding: 0 4px; }
.roistep .conv {
  position: absolute; top: 38px; right: -1px; z-index: 3; transform: translateX(50%);
  font-family: var(--fs-mono); font-size: 11.5px; font-weight: 600; color: var(--violet-3);
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-pill);
  padding: 3px 8px; box-shadow: var(--shadow); white-space: nowrap;
}
.roistep .conv.bad { color: var(--loss); }
.roistep .conv.ok { color: var(--money); }

/* ---------- table ---------- */
.tbl-wrap { overflow-x: auto; border-radius: var(--r); }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; color: var(--muted); font-weight: 600; font-size: 11.5px; letter-spacing: .04em;
  text-transform: uppercase; padding: 0 14px 11px; white-space: nowrap; border-bottom: 1px solid var(--border);
}
table.data th.num, table.data td.num { text-align: right; font-family: var(--fs-mono); }
table.data td { padding: 13px 14px; border-bottom: 1px solid rgba(42,35,64,.5); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: rgba(167,139,250,.05); }
table.data tfoot td { padding: 13px 14px; border-top: 1px solid var(--border-2); font-family: var(--fs-mono); font-weight: 600; }
.roas-cell { font-family: var(--fs-mono); font-weight: 600; }
.roas-cell.good { color: var(--money); }
.roas-cell.mid { color: var(--violet-3); }
.roas-cell.bad { color: var(--loss); }

/* mini conversion bar inside table */
.minifunnel { display: inline-flex; height: 8px; width: 120px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.05); vertical-align: middle; }
.minifunnel span { display: block; height: 100%; }

/* progress / meters */
.meter { height: 8px; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--violet-2), var(--violet-3)); }
.meter.money > span { background: linear-gradient(90deg, var(--money-deep), var(--money)); }

/* lead card */
.leadcard {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--r); padding: 14px 15px;
  display: grid; grid-template-columns: 1fr auto; gap: 10px 14px; transition: border-color .15s, transform .15s;
}
.leadcard:hover { border-color: var(--border-2); transform: translateY(-1px); }
.leadcard .who { display: flex; align-items: center; gap: 11px; }
.avatar { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-family: var(--fs-display); font-weight: 600; flex-shrink: 0; background: linear-gradient(135deg, rgba(167,139,250,.25), rgba(109,74,224,.18)); color: var(--violet-3); border: 1px solid rgba(167,139,250,.2); }
.leadcard .name { font-weight: 600; font-size: 14.5px; }
.leadcard .phone { font-family: var(--fs-mono); font-size: 12px; color: var(--muted); }
.leadcard .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.leadcard .journey { grid-column: 1 / -1; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid rgba(42,35,64,.5); font-size: 12px; color: var(--text-2); }
.leadcard .journey .step { display: inline-flex; align-items: center; gap: 5px; }
.leadcard .journey .arrow { color: var(--muted); }
.leadcard .right { text-align: right; }

.stuck { color: var(--warn); }

/* timeline (lead detail) */
.tline { position: relative; padding-left: 26px; }
.tline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--violet-2), var(--border)); }
.tline .node { position: relative; padding: 0 0 20px; }
.tline .node::before { content: ""; position: absolute; left: -22px; top: 4px; width: 11px; height: 11px; border-radius: 50%; background: var(--violet-2); box-shadow: 0 0 0 4px var(--bg), 0 0 12px var(--glow-violet); }
.tline .node.money::before { background: var(--money); box-shadow: 0 0 0 4px var(--bg), 0 0 12px var(--glow-money); }

/* chat (conversa do lead) */
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 460px; overflow-y: auto; padding: 4px 2px; }
.bubble { max-width: 82%; padding: 9px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; }
.bubble.in { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.bubble.out { align-self: flex-end; background: rgba(167,139,250,.14); border: 1px solid rgba(167,139,250,.2); border-bottom-right-radius: 5px; }
.bubble.out.marker { background: rgba(167,139,250,.06); border-style: dashed; }
.bubble .mk { font-size: 12px; color: var(--text-2); }
.bubble .seal { display: inline-block; margin-left: 8px; font-size: 9.5px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; vertical-align: 1px; }
.bubble .seal.read, .bubble .seal.played { color: var(--violet-2); border-color: rgba(167,139,250,.4); }
.bubble .seal.failed { color: #f87171; border-color: rgba(248,113,113,.45); }
.bubble .txt { white-space: pre-wrap; word-break: break-word; color: var(--text); }
.bubble .meta { font-size: 10.5px; color: var(--muted); margin-top: 5px; text-align: right; }
.bubble .media { max-width: 240px; max-height: 240px; border-radius: 10px; display: block; }
.bubble audio { width: 240px; max-width: 100%; height: 38px; margin-bottom: 2px; }
.bubble video.media { max-width: 260px; }

/* axis labels for hand-rolled charts */
.chart-svg text { font-family: var(--fs-mono); font-size: 10px; fill: var(--muted); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; }

/* note */
.note { font-size: 12px; color: var(--muted); }
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: rgba(167,139,250,.07); border: 1px solid rgba(167,139,250,.16); font-size: 13px; color: var(--text-2); }
.callout b { color: var(--violet-3); }

/* page-load reveal */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.reveal { opacity: 0; animation: rise .5s cubic-bezier(.2,.7,.2,1) forwards; }

/* mobile */
.menu-btn { display: none; }
@media (max-width: 920px) {
  .sidebar { width: 264px; z-index: 50; transform: translateX(-100%); transition: transform .22s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .scrim { display: none; position: fixed; inset: 0; background: rgba(5,4,10,.6); z-index: 40; }
  .scrim.show { display: block; }
  .main { margin-left: 0; padding: 16px; }
  .menu-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .cols-3, .cols-2 { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: 1 / -1; }
  .topbar .title h1 { font-size: 22px; }
}
@media (max-width: 560px) { .cols-4 { grid-template-columns: 1fr; } }

/* ---------- componentes adicionados na integração (Fase C) ---------- */
.subhead { font-family: var(--fs-display); font-size: 13px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-2); margin: 8px 0 12px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs button { font: inherit; font-size: 13px; font-weight: 500; padding: 8px 14px; border-radius: 10px;
  cursor: pointer; border: 1px solid var(--border-2); background: var(--surface); color: var(--text-2); }
.tabs button.active { background: linear-gradient(135deg, var(--violet-2), var(--violet-deep)); color: #fff; border-color: transparent; }
.tabs button:hover:not(.active) { color: var(--text); }

/* toast */
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 80; max-width: 360px;
  background: var(--surface-2, #181226); border: 1px solid var(--border-2); color: var(--text);
  padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 13.5px;
  animation: rise .3s cubic-bezier(.2,.7,.2,1); }
.toast-error { border-color: rgba(251,113,133,.4); color: #FFD9DF; }

/* spinner de carregamento */
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(167,139,250,.2);
  border-top-color: var(--violet-3); animation: spin .7s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { text-align: center; padding: 30px; color: var(--muted); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1100px 560px at 50% -10%, rgba(124,77,255,.18), transparent 60%); }
.login-card { width: 100%; max-width: 392px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 22px; padding: 34px 30px; box-shadow: var(--shadow-lg); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.login-brand .mark { width: 38px; height: 38px; border-radius: 11px;
  background: conic-gradient(from 140deg, var(--violet-2), var(--violet-3), var(--money), var(--violet-2)); }
.login-brand b { font-family: var(--fs-display); font-size: 19px; }
.login-brand small { display: block; color: var(--muted); font-size: 12px; }
.login-card h1 { font-family: var(--fs-display); font-size: 23px; margin: 0 0 4px; }
.login-card .lede { color: var(--text-2); font-size: 13.5px; margin: 0 0 22px; }
.login-card label { display: block; font-size: 12.5px; color: var(--text-2); margin: 0 0 6px; }
.login-card input { width: 100%; background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 11px; padding: 11px 13px; color: var(--text); font: inherit; font-size: 14px; margin-bottom: 16px; }
.login-card input:focus { outline: none; border-color: var(--violet-2); box-shadow: 0 0 0 3px rgba(124,77,255,.15); }
.login-card button { width: 100%; font: inherit; font-size: 14.5px; font-weight: 600; padding: 12px; border-radius: 12px;
  cursor: pointer; border: none; color: #fff; background: linear-gradient(135deg, var(--violet-2), var(--violet-deep));
  box-shadow: 0 8px 22px -8px var(--glow-violet); }
.login-card button:disabled { opacity: .6; cursor: default; }
.login-err { color: var(--loss); font-size: 13px; margin: -6px 0 14px; min-height: 18px; }

/* ---------- botões globais (reuso em popover de data / Saúde) ---------- */
.btn { font: inherit; font-size: 13px; font-weight: 600; padding: 9px 16px; border-radius: 11px;
  cursor: pointer; border: 1px solid transparent; transition: filter .12s, opacity .12s; }
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.primary { background: linear-gradient(135deg, var(--violet-2), var(--violet-deep)); color: #fff; box-shadow: 0 6px 18px -8px var(--glow-violet); }
.btn.ghost { background: var(--surface); border-color: var(--border-2); color: var(--text); }

/* ---------- faixa de data custom (pill + popover) ---------- */
.range-wrap { position: relative; }
.range-pill { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.range-pill.on { border-color: var(--violet-2); color: #fff; background: rgba(139,92,246,.15); }
.range-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 230px;
  background: var(--surface, #15101f); border: 1px solid var(--border-2); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.range-pop[hidden] { display: none; }
.range-pop label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
.range-pop input[type=date] { background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 9px; padding: 8px 10px; color: var(--text); font: inherit; font-size: 13px;
  color-scheme: dark; }
.range-pop input[type=date]:focus { outline: none; border-color: var(--violet-2); }
.range-pop .btn { width: 100%; margin-top: 2px; }

/* ---------- barra de filtros (Leads) ---------- */
.filterbar { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.filterbar .inp, .filterbar select { background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 11px; color: var(--text); font: inherit; font-size: 13px; }
.filterbar .inp { min-width: 190px; }
.filterbar select { cursor: pointer; color-scheme: dark; }
.filterbar .inp:focus, .filterbar select:focus { outline: none; border-color: var(--violet-2); }

/* ---------- tooltip uPlot (tema dark-violet) ---------- */
.u-tooltip { position: absolute; z-index: 70; pointer-events: none; background: rgba(20,15,32,.96);
  border: 1px solid var(--border-2); border-radius: 10px; padding: 8px 10px; font-size: 12px;
  box-shadow: var(--shadow-lg); transform: translateX(-50%); white-space: nowrap; }
.u-tooltip .tt-date { color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.u-tooltip .tt-row { display: flex; align-items: center; gap: 7px; font-family: var(--fs-mono); }
.u-tooltip .tt-row i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.u-tooltip .tt-row b { margin-left: auto; font-weight: 600; }
.chart-wrap { position: relative; width: 100%; }
/* uPlot: fundo transparente + eixos discretos */
.uplot, .uplot *, .uplot *::before, .uplot *::after { box-sizing: border-box; }
.uplot .u-axis { color: var(--muted); }
.u-legend { display: none; }
