/* Prospector CRM — design system
   Identidade: verde-pinho (estrutura, confiança) + amarelo de sinalização (ação).
   Modo de superfície: Operate. Densidade alta, tipografia legível, números tabulares. */

/* ============ TOKENS ============ */
:root {
  /* marca */
  --pine-950: #071719;
  --pine-900: #0B2124;
  --pine-800: #0F2B2E;
  --pine-700: #18393D;
  --pine-600: #24504F;
  --pine-300: #8FB0AC;
  --pine-tx: #B9CFCD;
  --sig: #F2B705;
  --sig-600: #D9A300;
  --sig-soft: #FDF3D1;
  --on-sig: #14262A;

  /* superfícies e texto (claro) */
  --bg: #F2F5F4;
  --surface: #FFFFFF;
  --surface-2: #F7F9F8;
  --surface-3: #EBF0EF;
  --line: #DDE5E3;
  --line-strong: #C3D0CD;
  --ink: #102226;
  --ink-2: #33494D;
  --muted: #566A6E;
  --ring: #0F2B2E;

  /* estados */
  --ok: #1B7556; --ok-bg: #E2F2EA;
  --warn: #855505; --warn-bg: #FBF0D6;
  --bad: #AE3A2A; --bad-bg: #F9E4DF;
  --info: #285C86; --info-bg: #E3EDF6;

  /* dados */
  --data: #18393D;
  --data-track: #E3EAE8;

  /* tipografia */
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --fs-xs: 12.5px; --fs-sm: 13.5px; --fs-md: 15px; --fs-lg: 17px; --fs-xl: 21px; --fs-2xl: 28px; --fs-kpi: 34px;

  /* espaço (densidade alta: 4–32) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 32px;

  /* forma e profundidade */
  --r-sm: 6px; --r: 10px; --r-lg: 14px; --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(11, 33, 36, .06), 0 1px 1px rgba(11, 33, 36, .04);
  --sh-2: 0 4px 12px -2px rgba(11, 33, 36, .10), 0 2px 4px -2px rgba(11, 33, 36, .06);
  --sh-3: 0 18px 48px -12px rgba(7, 23, 25, .32);

  /* movimento */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --t-fast: 140ms; --t: 200ms; --t-slow: 260ms;

  --side-w: 248px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A1517; --surface: #112124; --surface-2: #142729; --surface-3: #1A3134;
    --line: #22393C; --line-strong: #2F4B4E;
    --ink: #E6EFEE; --ink-2: #C3D3D1; --muted: #93A9AC; --ring: #F2B705;
    --ok: #5CCB9F; --ok-bg: #11342A; --warn: #F0BC52; --warn-bg: #382B0F; --bad: #F2907E; --bad-bg: #3A1D18; --info: #8DBFE8; --info-bg: #142C40;
    --sig-soft: #3A2F0C; --data: #F2B705; --data-track: #1E3538;
    --sh-1: 0 1px 2px rgba(0, 0, 0, .35); --sh-2: 0 6px 16px -4px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A1517; --surface: #112124; --surface-2: #142729; --surface-3: #1A3134;
  --line: #22393C; --line-strong: #2F4B4E;
  --ink: #E6EFEE; --ink-2: #C3D3D1; --muted: #93A9AC; --ring: #F2B705;
  --ok: #5CCB9F; --ok-bg: #11342A; --warn: #F0BC52; --warn-bg: #382B0F; --bad: #F2907E; --bad-bg: #3A1D18; --info: #8DBFE8; --info-bg: #142C40;
  --sig-soft: #3A2F0C; --data: #F2B705; --data-track: #1E3538;
  --sh-1: 0 1px 2px rgba(0, 0, 0, .35); --sh-2: 0 6px 16px -4px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ============ BASE ============ */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-strong) transparent; }
body {
  margin: 0; min-height: 100vh; font: 400 var(--fs-md)/1.5 var(--font); color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; caret-color: var(--sig-600);
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.015em; line-height: 1.2; text-wrap: balance; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: 3px; }
code { font: 500 .92em var(--mono); background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
::selection { background: var(--sig); color: var(--on-sig); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
.num, .kpi-n, td, .meter, .tot { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* contém elementos sr-only dentro de áreas com rolagem própria */
.kc, .col, .rc, .leads td, .task, .mini-row { position: relative; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--sig); color: var(--on-sig); padding: 10px 14px; border-radius: var(--r-sm); font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ============ SHELL ============ */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: var(--s5);
  background: var(--pine-800); color: var(--pine-tx); padding: var(--s5) var(--s3);
}
:root[data-theme="dark"] .side { background: var(--pine-950); border-right: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .side { background: var(--pine-950); border-right: 1px solid var(--line); } }
.side :focus-visible { outline-color: var(--sig); }
.brand { display: flex; align-items: center; gap: var(--s3); padding: var(--s1) var(--s2); color: #fff; text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--sig); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 22px; height: 22px; fill: none; stroke: var(--on-sig); stroke-width: 2.6; }
.brand-mark .fill { fill: var(--on-sig); stroke: none; }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -.02em; line-height: 1.1; }
.brand-name small { display: block; font-size: var(--fs-xs); font-weight: 500; letter-spacing: 0; color: var(--pine-300); margin-top: 2px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: var(--s3); min-height: 44px; padding: 0 var(--s3); border-radius: var(--r-sm);
  color: var(--pine-tx); text-decoration: none; font-weight: 600; font-size: var(--fs-md);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a[aria-current="page"] { background: var(--pine-700); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.nav a[aria-current="page"] svg { color: var(--sig); }
.nav .badge { margin-left: auto; min-width: 24px; padding: 1px 7px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .1); color: #fff; font-size: var(--fs-xs); font-weight: 700; text-align: center; }
.side-foot { margin-top: auto; display: grid; gap: var(--s3); }
.store-note { font-size: var(--fs-xs); line-height: 1.45; color: var(--pine-300); padding: 0 var(--s2); }
.store-note b { color: #fff; font-weight: 600; }
.store-note a { color: var(--sig); font-weight: 600; }
.theme-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 3px; border-radius: var(--r-sm); background: rgba(0, 0, 0, .22); }
.theme-switch button { border: 0; background: none; color: var(--pine-tx); font-size: var(--fs-xs); font-weight: 600; padding: 6px 4px; border-radius: 4px; min-height: 32px; }
.theme-switch button[aria-pressed="true"] { background: var(--pine-700); color: #fff; }

main { padding: var(--s7) clamp(16px, 3vw, 40px) 72px; min-width: 0; outline: none; }
.view { max-width: 1240px; margin: 0 auto; }
.view.wide { max-width: none; }
.view.narrow { max-width: 860px; }
.ph { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s6); }
.ph h1 { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.025em; }
.ph p { margin-top: var(--s1); color: var(--muted); max-width: 70ch; }
.ph-actions { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }

/* ============ CONTROLES ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 40px; padding: 0 var(--s4);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: var(--r-sm);
  font-weight: 600; font-size: 14px; line-height: 1.2; text-decoration: none; white-space: nowrap;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn:hover { border-color: var(--muted); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; }
.btn.pri { background: var(--sig); border-color: var(--sig); color: var(--on-sig); }
.btn.pri:hover { background: var(--sig-600); border-color: var(--sig-600); }
.btn.dark { background: var(--pine-800); border-color: var(--pine-800); color: #fff; }
.btn.dark:hover { background: var(--pine-700); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.danger { color: var(--bad); }
.btn.sm { min-height: 34px; padding: 0 var(--s3); font-size: var(--fs-sm); }
.btn.lg { min-height: 46px; padding: 0 var(--s5); font-size: 15px; }
.btn.icon { padding: 0; width: 40px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn .spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-strong); }
.link:hover { text-decoration-color: currentColor; }
.row { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.grow { flex: 1 1 200px; }

.f { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.f em { font-style: normal; font-weight: 500; color: var(--muted); }
.f input, .f select, .f textarea, .in {
  width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font-size: 15px; font-weight: 400; line-height: 1.4;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.f select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23566A6E' stroke-width='2' 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 10px center; background-size: 16px; }
.f textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
.f input::placeholder, .f textarea::placeholder, .in::placeholder { color: var(--muted); opacity: .85; }
.f input:focus, .f select:focus, .f textarea:focus, .in:focus { outline: none; border-color: var(--pine-600); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sig) 45%, transparent); }
.f [aria-invalid="true"] { border-color: var(--bad); }
.f.inline { flex-direction: row; align-items: center; gap: var(--s2); }
.f.inline select { width: auto; min-height: 36px; padding-top: 6px; padding-bottom: 6px; font-size: 14px; }
.field-err { color: var(--bad); font-size: var(--fs-sm); font-weight: 600; margin-top: var(--s2); }
.hint { font-size: var(--fs-sm); color: var(--muted); line-height: 1.5; }
.note { font-size: var(--fs-sm); color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--s3); margin-top: var(--s3); }
.note:empty { display: none; }

.chip {
  display: inline-flex; align-items: center; gap: var(--s2); min-height: 36px; padding: 0 var(--s3); border-radius: var(--r-pill);
  border: 1px solid var(--line-strong); background: var(--surface); font-size: 14px; font-weight: 600; cursor: pointer; user-select: none;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.chip input { width: 16px; height: 16px; margin: 0; accent-color: var(--pine-800); }
.chip:has(input:checked) { background: var(--surface-3); border-color: var(--pine-600); }
.chip:has(input:focus-visible) { outline: 2px solid var(--ring); outline-offset: 2px; }

.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; line-height: 1.6; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tag svg { width: 13px; height: 13px; }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
.tag.info { background: var(--info-bg); color: var(--info); }
.tag.sig { background: var(--sig-soft); color: var(--warn); }

/* potencial */
.meter { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 700; font-size: var(--fs-sm); }
.meter i { display: block; width: 46px; height: 6px; border-radius: 3px; background: var(--data-track); overflow: hidden; }
.meter i b { display: block; height: 100%; border-radius: 3px; background: var(--ok); }
.meter.media i b { background: var(--sig-600); }
.meter.baixa i b { background: var(--bad); }
.meter small { font-weight: 600; color: var(--muted); font-size: var(--fs-xs); }
.pot { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.pot-n { display: inline-flex; align-items: baseline; gap: 4px; padding: 3px 10px; border-radius: var(--r-pill); font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.pot-n small { font-size: 11.5px; font-weight: 700; }
.pot-n.alta { background: var(--ok-bg); color: var(--ok); }
.pot-n.media { background: var(--sig-soft); color: var(--warn); }
.pot-n.baixa { background: var(--bad-bg); color: var(--bad); }

/* ============ PAINEL ============ */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--sh-1); min-width: 0; }
.panel-h { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.panel-h h2 { font-size: var(--fs-lg); }
.count { min-width: 26px; padding: 1px 8px; border-radius: var(--r-pill); background: var(--surface-3); font-weight: 700; font-size: var(--fs-xs); text-align: center; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); margin-bottom: var(--s5); }
.kpi { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--sh-1); display: flex; flex-direction: column; gap: var(--s1); text-decoration: none; color: inherit; transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
a.kpi:hover { border-color: var(--line-strong); box-shadow: var(--sh-2); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); color: var(--ink-2); font-weight: 600; font-size: 14px; }
.kpi-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--pine-700); }
:root[data-theme="dark"] .kpi-ic { color: var(--sig); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .kpi-ic { color: var(--sig); } }
.kpi-n { font-size: var(--fs-kpi); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; margin-top: var(--s2); }
.kpi-sub { font-size: var(--fs-sm); color: var(--muted); }

.dash { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: var(--s4); align-items: start; }
.dash-col { display: grid; gap: var(--s4); min-width: 0; }

/* Funil em destaque: o elemento assinatura da tela */
.funnel-panel { background: var(--pine-800); border-color: var(--pine-800); color: #E8F1EF; }
:root[data-theme="dark"] .funnel-panel { background: #0D2629; border-color: var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .funnel-panel { background: #0D2629; border-color: var(--line); } }
.funnel-panel :focus-visible { outline-color: var(--sig); }
.funnel-panel .link { color: #E8F1EF; text-decoration-color: rgba(255, 255, 255, .35); }
.fun { display: grid; gap: 10px; }
.fun-row { display: grid; grid-template-columns: 24px minmax(110px, 150px) minmax(0, 1fr) 44px; gap: var(--s3); align-items: center; text-decoration: none; color: inherit; border-radius: var(--r-sm); padding: 4px 6px; margin: 0 -6px; }
.fun-row:hover { background: rgba(255, 255, 255, .05); }
.fun-step { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: rgba(255, 255, 255, .1); color: #fff; }
.fun-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fun-track { height: 26px; border-radius: 6px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.fun-track b { display: block; height: 100%; min-width: 4px; border-radius: 6px; background: linear-gradient(90deg, #C99A0A, var(--sig)); transform-origin: left; animation: grow var(--t-slow) var(--ease) both; }
.fun-row.zero .fun-track b { background: rgba(255, 255, 255, .18); }
.fun-n { text-align: right; font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
@keyframes grow { from { transform: scaleX(0); } }
.fun-foot { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid rgba(255, 255, 255, .12); font-size: var(--fs-sm); color: #C3D6D3; }
.fun-foot b { color: #fff; font-size: 15px; font-variant-numeric: tabular-nums; }

.task { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: var(--s3); align-items: center; padding: 10px 6px; margin: 0 -6px; border-radius: var(--r-sm); border: 0; background: none; width: calc(100% + 12px); text-align: left; }
.task + .task { border-top: 1px solid var(--line); border-radius: 0; }
.task:hover { background: var(--surface-2); }
.task-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); }
.task-ic.hot { background: var(--sig-soft); color: var(--warn); }
.task-ic.alert { background: var(--bad-bg); color: var(--bad); }
.task b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task small { display: block; color: var(--muted); font-size: var(--fs-sm); }
.more { margin-top: var(--s3); }

.rev { display: grid; gap: var(--s3); }
.rev-item { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); }
.rev-item span { color: var(--ink-2); font-weight: 600; font-size: 14px; }
.rev-item b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.mini { display: grid; }
.mini-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s3); align-items: center; padding: 10px 6px; margin: 0 -6px; border-radius: var(--r-sm); border: 0; background: none; text-align: left; width: calc(100% + 12px); }
.mini-row + .mini-row { border-top: 1px solid var(--line); border-radius: 0; }
.mini-row:hover { background: var(--surface-2); }
.mini-row b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; }
.mini-row small { color: var(--muted); font-size: var(--fs-sm); }

.empty { text-align: center; padding: var(--s7) var(--s4); color: var(--muted); display: grid; justify-items: center; gap: var(--s2); }
.empty .empty-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); margin-bottom: var(--s1); }
.empty .empty-ic svg { width: 24px; height: 24px; }
.empty h3 { color: var(--ink); font-size: var(--fs-lg); }
.empty p { max-width: 46ch; }
.empty .row { justify-content: center; margin-top: var(--s2); }
.funnel-panel .empty { color: #C3D6D3; }
.funnel-panel .empty h3 { color: #fff; }

/* ============ BUSCA ============ */
.search { display: grid; gap: var(--s4); margin-bottom: var(--s5); }
.search-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: var(--s3); align-items: end; }
.filters { border: 0; margin: 0; padding: var(--s4) 0 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: center; }
.res-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s3); min-height: 0; }
.res-head:empty { display: none; }
.res-sum { font-size: 14px; color: var(--ink-2); }
.res-sum b { font-variant-numeric: tabular-nums; }
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: var(--s3); }
.rc { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4); display: grid; gap: var(--s3); box-shadow: var(--sh-1); transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.rc:hover { border-color: var(--line-strong); }
.rc.sel { border-color: var(--pine-600); box-shadow: 0 0 0 1px var(--pine-600); }
.rc.in-crm { background: var(--surface-2); }
.rc-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s3); align-items: start; }
.rc-top input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--pine-800); }
.rc h3 { font-size: 16px; line-height: 1.3; }
.rc-cat { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.facts li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: var(--s2); align-items: start; }
.facts .mut { color: var(--muted); }
.facts svg { width: 16px; height: 16px; margin-top: 2px; color: var(--muted); }
.facts .tagline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rc-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); padding-top: var(--s3); border-top: 1px solid var(--line); }
.stars { color: var(--warn); font-weight: 700; }
.skel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4); display: grid; gap: 10px; }
.skel i { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skel i:nth-child(1) { width: 60%; height: 16px; } .skel i:nth-child(2) { width: 35%; } .skel i:nth-child(3) { width: 85%; } .skel i:nth-child(4) { width: 50%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.pager { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; justify-content: space-between; margin-top: var(--s4); }
.pager:empty { display: none; }
.pages { display: flex; gap: 4px; flex-wrap: wrap; }
.pages .btn { min-width: 40px; padding: 0 10px; }
.pages .btn[aria-current="page"] { background: var(--pine-800); border-color: var(--pine-800); color: #fff; }
.err-box { background: var(--bad-bg); color: var(--bad); border-radius: var(--r-lg); padding: var(--s5); display: grid; gap: var(--s2); grid-column: 1 / -1; }
.err-box h3 { font-size: var(--fs-lg); }
.err-box p { color: var(--ink-2); }

/* ============ FUNIL (KANBAN) ============ */
.stage-tabs { display: none; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: var(--s3); overflow-x: auto; padding-bottom: var(--s3); align-items: start; scroll-snap-type: x proximity; }
.col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); min-height: 280px; display: flex; flex-direction: column; scroll-snap-align: start; transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease); }
.col.over { border-color: var(--sig-600); background: var(--sig-soft); }
.col.arq { opacity: .92; }
.col-h { position: sticky; top: 0; display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s3) var(--s2); }
.col-h h2 { font-size: 14.5px; font-weight: 700; flex: 1; }
.col-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--pine-300); flex: none; }
.col-list { display: grid; gap: var(--s2); padding: 0 var(--s2) var(--s2); }
.col-empty { margin: 0 var(--s2) var(--s2); padding: var(--s5) var(--s3); text-align: center; font-size: var(--fs-sm); color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--r); }
.kc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s3); display: grid; gap: var(--s2); box-shadow: var(--sh-1); cursor: grab; transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), opacity var(--t-fast); }
.kc:hover { border-color: var(--line-strong); box-shadow: var(--sh-2); }
.kc.drag { opacity: .45; }
.kc.flash { animation: flash 1.2s var(--ease); }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--sig); } 100% { box-shadow: var(--sh-1); } }
.kc-h { display: flex; justify-content: space-between; gap: var(--s2); align-items: flex-start; }
.kc-name { border: 0; background: none; padding: 0; text-align: left; font-weight: 700; font-size: 14.5px; line-height: 1.3; color: var(--ink); }
.kc-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.kc-sub { font-size: var(--fs-sm); color: var(--muted); }
.kc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.kc-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s2); }
.kc-foot time { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
.kc-foot .move { margin-left: auto; }
.move { min-height: 32px; max-width: 150px; padding: 4px 28px 4px 10px; font-size: 13px; font-weight: 600; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background-color: var(--surface); appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23566A6E' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 14px; color: var(--ink); }

/* ============ LEADS ============ */
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: end; margin-bottom: var(--s4); }
.toolbar .f:not(.grow) { flex: 0 1 180px; }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1); }
table.leads { width: 100%; border-collapse: collapse; font-size: 14px; }
.leads th { text-align: left; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.leads td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.leads tbody tr:first-child td { border-top: 0; }
.leads tr.lr { cursor: pointer; transition: background var(--t-fast); }
.leads tr.lr:hover td { background: var(--surface-2); }
.leads td small { display: block; color: var(--muted); font-size: var(--fs-sm); }
.lead-name { border: 0; background: none; padding: 0; font-weight: 700; font-size: 14.5px; text-align: left; color: var(--ink); }
.steps { display: flex; gap: 3px; margin-top: 6px; }
.steps i { width: 14px; height: 4px; border-radius: 2px; background: var(--data-track); }
.steps i.on { background: var(--data); }

/* ============ AJUSTES ============ */
.settings { display: grid; gap: var(--s4); margin-bottom: var(--s4); }
.set { display: grid; gap: var(--s4); margin-bottom: var(--s4); }
.settings .set { margin-bottom: 0; }
.set-h h2 { font-size: var(--fs-lg); }
.set-h p { color: var(--muted); font-size: 14px; margin-top: 2px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.set-save { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.key-form { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: end; }
.integr { list-style: none; margin: 0; padding: 0; display: grid; }
.integr li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--line); align-items: center; }
.integr li:first-child { border-top: 0; padding-top: 0; }
.integr b { font-size: 14.5px; }
.integr p { grid-column: 1 / -1; font-size: var(--fs-sm); color: var(--muted); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px var(--s5); margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ============ GAVETA ============ */
#scrim { position: fixed; inset: 0; background: rgba(7, 23, 25, .52); opacity: 0; transition: opacity var(--t) var(--ease); z-index: 40; }
#scrim.open { opacity: 1; }
#drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(680px, 100vw); background: var(--bg); z-index: 41; display: flex; flex-direction: column; transform: translateX(100%); transition: transform var(--t-slow) var(--ease); box-shadow: var(--sh-3); outline: none; }
#drawer.open { transform: none; }
.dh { background: var(--surface); padding: var(--s5) var(--s6) 0; border-bottom: 1px solid var(--line); }
.dh-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s3); align-items: start; }
.dh h2 { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.dh-sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.dh-meta { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: center; margin-top: var(--s4); }
.dh-meta .f.inline select { min-width: 170px; font-weight: 600; }
.dh-meta time { font-size: var(--fs-sm); color: var(--muted); }
.tabs { display: flex; gap: 2px; margin-top: var(--s4); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; padding: 10px 12px 12px; font-weight: 600; font-size: 14px; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; min-height: 44px; }
.tabs button:hover { color: var(--ink); }
.tabs .t-short { display: none; }
@media (max-width: 520px) { .tabs .t-long { display: none; } .tabs .t-short { display: inline; } .tabs button { padding-left: 10px; padding-right: 10px; } }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--sig); }
.db { flex: 1; overflow-y: auto; padding: var(--s5) var(--s6); display: flex; flex-direction: column; gap: var(--s4); overscroll-behavior: contain; }
.df { background: var(--surface); border-top: 1px solid var(--line); padding: var(--s3) var(--s6); padding-bottom: max(var(--s3), env(safe-area-inset-bottom)); display: flex; gap: var(--s2); justify-content: space-between; flex-wrap: wrap; }
.sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4) var(--s5); display: grid; gap: var(--s3); }
.sec-h { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.sec h3 { font-size: 15.5px; }
.score-box { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s5); align-items: center; }
.score-n { font-size: 44px; font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.score-n small { display: block; font-size: var(--fs-sm); font-weight: 700; letter-spacing: 0; margin-top: 4px; }
.score-n.alta { color: var(--ok); } .score-n.media { color: var(--warn); } .score-n.baixa { color: var(--bad); }
.parts { display: grid; gap: 6px; font-size: var(--fs-sm); }
.part { display: grid; grid-template-columns: minmax(0, 1fr) 70px 34px; gap: var(--s2); align-items: center; }
.part i { height: 6px; border-radius: 3px; background: var(--data-track); overflow: hidden; }
.part i b { display: block; height: 100%; background: var(--data); border-radius: 3px; }
.part span:last-child { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.check { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.check li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: var(--s2); align-items: start; font-size: 14.5px; }
.check svg { width: 20px; height: 20px; }
.check .y { color: var(--ok); } .check .n { color: var(--muted); }
.check small { display: block; color: var(--muted); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.dl { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--s2) var(--s3); font-size: 14px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); font-size: 14px; }
.timeline li { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: var(--s3); align-items: start; }
.timeline li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pine-300); margin-top: 7px; }
.timeline time { display: block; color: var(--muted); font-size: var(--fs-xs); }
.callout { border-radius: var(--r-lg); padding: var(--s4); display: grid; gap: var(--s3); background: var(--sig-soft); border: 1px solid color-mix(in srgb, var(--sig-600) 45%, transparent); }
.callout p { font-size: 14px; color: var(--ink); }
.callout.ok { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.seg { display: inline-grid; grid-auto-flow: column; gap: 2px; padding: 3px; background: var(--surface-3); border-radius: var(--r-sm); }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 4px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); min-height: 34px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
#out { min-height: 220px; font: 13.5px/1.55 var(--mono); }
.counter { font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.counter.over { color: var(--bad); font-weight: 700; }
.tot { display: grid; gap: var(--s2); font-size: 14.5px; }
.tot div { display: flex; justify-content: space-between; gap: var(--s3); }
.tot .sum { border-top: 1px solid var(--line); padding-top: var(--s2); font-weight: 800; font-size: 17px; }
.tot .opt { color: var(--muted); font-size: 14px; }
.chat { background: #DCE8E1; border-radius: var(--r-lg); padding: var(--s4); }
:root[data-theme="dark"] .chat { background: #0C2A25; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chat { background: #0C2A25; } }
.chat textarea { width: 100%; min-height: 320px; resize: vertical; border: 0; background: #fff; color: #1C2B2A; border-radius: 12px 12px 12px 3px; padding: 12px 14px; line-height: 1.5; font-size: 15px; box-shadow: 0 1px 1px rgba(0, 0, 0, .12); }
.chat textarea:focus { outline: 2px solid var(--sig); outline-offset: 2px; }

/* conversa do WhatsApp */
.chatlog { list-style: none; margin: 0; padding: var(--s3); display: flex; flex-direction: column; gap: var(--s2); max-height: 380px; overflow-y: auto; background: #DCE8E1; border-radius: var(--r); }
:root[data-theme="dark"] .chatlog { background: #0C2A25; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chatlog { background: #0C2A25; } }
.chatlog li { max-width: 85%; padding: 8px 12px; border-radius: 12px; background: #fff; color: #1C2B2A; box-shadow: 0 1px 1px rgba(0, 0, 0, .12); align-self: flex-start; border-top-left-radius: 3px; }
.chatlog li.out { align-self: flex-end; background: #D3F5C4; border-top-left-radius: 12px; border-top-right-radius: 3px; }
.chatlog p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.45; }
.chatlog time { display: block; margin-top: 4px; font-size: 12px; color: #4F6260; text-align: right; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--sig-600); margin-right: 7px; vertical-align: middle; }
.tab-n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 6px; padding: 0 5px; border-radius: 10px; background: var(--sig); color: var(--on-sig); font-size: 12px; font-weight: 800; }
.callout.bad { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.preview summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.preview pre { white-space: pre-wrap; font: 14px/1.5 var(--font); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--s3); margin: var(--s2) 0 0; max-height: 260px; overflow: auto; }
dialog.qdlg { border: 0; border-radius: var(--r-lg); padding: 0; width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--ink); box-shadow: var(--sh-3); }
dialog.qdlg::backdrop { background: rgba(7, 23, 25, .52); }
.q-wrap { padding: var(--s5) var(--s6); display: grid; gap: var(--s4); }
.q-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); }
.q-head h2 { font-size: var(--fs-xl); }
#qBody { display: grid; gap: var(--s4); }
.q-f { padding-top: 0; border-top: 0; }
.q-f legend { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); margin-right: var(--s2); float: left; padding-top: 8px; }
.qlog { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; max-height: 200px; overflow: auto; }
.qlog li.ok::marker { color: var(--ok); }
.qlog li.err { color: var(--bad); }
@media (max-width: 760px) { .q-wrap { padding: var(--s4); } }

.posts { display: grid; gap: var(--s3); }
.post { border: 1px solid var(--line); border-radius: var(--r); padding: var(--s3); display: grid; gap: var(--s2); background: var(--surface-2); }
.post h4 { font-size: 14.5px; }

.filters.src { border-top: 0; padding-top: 0; }
.src-l { float: left; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); padding: 8px var(--s2) 0 0; }
.chip:has(input[type="radio"]:checked) { background: var(--pine-800); border-color: var(--pine-800); color: #fff; }
.chip input[type="radio"] { accent-color: var(--sig); }

/* diálogo e toast */
dialog#dlg { border: 0; border-radius: var(--r-lg); padding: 0; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: var(--sh-3); }
dialog#dlg::backdrop { background: rgba(7, 23, 25, .52); }
dialog#dlg form { padding: var(--s6); display: grid; gap: var(--s3); }
dialog#dlg h2 { font-size: var(--fs-lg); }
dialog#dlg p { color: var(--ink-2); font-size: 14.5px; }
#toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60; display: flex; align-items: center; gap: var(--s3);
  max-width: min(520px, calc(100vw - 32px)); padding: 10px 10px 10px 16px; border-radius: var(--r);
  background: var(--pine-800); color: #fff; font-size: 14px; box-shadow: var(--sh-3);
  opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
#toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast.err { background: #6E2318; }
#toastAct { border: 0; background: rgba(255, 255, 255, .1); color: var(--sig); font-weight: 700; padding: 6px 12px; border-radius: var(--r-sm); min-height: 34px; }
#toastMsg { padding: 4px 0; }

/* ============ RESPONSIVO ============ */
@media (max-width: 359px) { .brand-name { display: none; } }
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .dash { grid-template-columns: 1fr; }
  .dash-col { display: contents; }
  .funnel-panel { order: 1; } .dash-tasks { order: 2; } .dash-rev { order: 3; } .dash-rec { order: 4; }
}
@media (max-width: 900px) {
  .app { display: block; }
  .side { position: sticky; top: 0; z-index: 30; height: auto; flex-direction: row; align-items: center; gap: var(--s3); padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
  .brand-name small { display: none; }
  .brand-mark { width: 32px; height: 32px; }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; flex-direction: row; justify-content: space-around; gap: 0; background: var(--pine-800); border-top: 1px solid rgba(255, 255, 255, .08); padding: 4px 4px max(4px, env(safe-area-inset-bottom)); }
  .nav a { flex: 1; flex-direction: column; justify-content: center; gap: 2px; min-height: 56px; padding: 4px 2px; font-size: 12px; text-align: center; }
  .nav a[aria-current="page"] { background: transparent; box-shadow: none; color: #fff; }
  .nav a[aria-current="page"] svg { color: var(--sig); }
  .nav .badge { display: none; }
  .side-foot { margin: 0 0 0 auto; }
  .store-note { display: none; }
  .theme-switch button { padding: 6px 8px; }
  main { padding: var(--s5) 16px calc(96px + env(safe-area-inset-bottom)); }
  #toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .search-row { grid-template-columns: 1fr 1fr; }
  .search-row .btn { grid-column: 1 / -1; }
  .grid3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .ph h1 { font-size: 24px; }
  .ph-actions { width: 100%; }
  .ph-actions .btn { flex: 1 1 auto; }
  .kpi { padding: var(--s4); }
  .kpi-n { font-size: 28px; }
  .search-row, .grid2, .grid3 { grid-template-columns: 1fr; }
  .fun-row { grid-template-columns: 22px minmax(84px, 108px) minmax(0, 1fr) 34px; gap: var(--s2); }
  .fun-name { font-size: 13.5px; }
  /* funil: uma etapa por vez, sem depender de arrastar */
  .stage-tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: var(--s3); padding-bottom: 4px; scrollbar-width: none; }
  .stage-tabs::-webkit-scrollbar { display: none; }
  .stage-tabs button { flex: none; border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--r-pill); padding: 0 14px; min-height: 40px; font-weight: 600; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
  .stage-tabs button[aria-selected="true"] { background: var(--pine-800); border-color: var(--pine-800); color: #fff; }
  .stage-tabs .n { font-variant-numeric: tabular-nums; opacity: .8; }
  .board { display: block; overflow: visible; }
  .board .col { display: none; min-height: 0; }
  .board .col.cur { display: flex; }
  .move { max-width: 100%; min-height: 40px; }
  /* tabela vira lista de cartões */
  .table-wrap { background: none; border: 0; box-shadow: none; overflow: visible; }
  table.leads, .leads tbody { display: block; }
  .leads thead { display: none; }
  .leads tr.lr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px var(--s3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4); margin-bottom: var(--s2); box-shadow: var(--sh-1); }
  .leads td { padding: 0; border: 0; }
  .leads tr.lr:hover td { background: none; }
  .leads td[data-c="empresa"] { grid-column: 1 / 2; }
  .leads td[data-c="pot"] { grid-column: 2; grid-row: 1; justify-self: end; }
  .leads td[data-c="contato"], .leads td[data-c="google"], .leads td[data-c="insta"] { grid-column: 1 / -1; display: flex; gap: var(--s2); align-items: baseline; flex-wrap: wrap; }
  .leads td[data-c="contato"]::before, .leads td[data-c="google"]::before, .leads td[data-c="insta"]::before { content: attr(data-label); color: var(--muted); font-size: var(--fs-sm); min-width: 76px; }
  .leads td small { display: inline; }
  .leads td[data-c="empresa"] small { display: block; }
  .leads td[data-c="etapa"] { grid-column: 1 / 2; }
  .leads td[data-c="upd"] { grid-column: 2; justify-self: end; align-self: end; color: var(--muted); font-size: var(--fs-sm); }
  .dh { padding: var(--s4) var(--s4) 0; }
  .db { padding: var(--s4); }
  .df { padding: var(--s3) var(--s4); padding-bottom: max(var(--s3), env(safe-area-inset-bottom)); }
  .df .btn { flex: 1 1 auto; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: var(--s2); }
  .score-box { grid-template-columns: 1fr; gap: var(--s3); }
  .toolbar .f:not(.grow) { flex: 1 1 140px; }
}
@media (max-width: 400px) {
  .side { gap: var(--s2); padding-left: 12px; padding-right: 12px; }
  .kpis { gap: var(--s2); }
  .kpi { padding: var(--s3); }
  .kpi-top { font-size: 13px; }
  .kpi-ic { display: none; }
  .kpi-n { font-size: 26px; }
  .brand-name { font-size: 16px; }
  .theme-switch button { padding: 6px 5px; font-size: 12px; }
  .filters .f.inline { flex: 1 1 100%; justify-content: space-between; }
  .filters .f.inline select { flex: 0 1 60%; }
}
@media (pointer: coarse) {
  .btn, .btn.sm { min-height: 44px; }
  .chip { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .side, .nav, #toast, .ph-actions { display: none !important; }
  .app { display: block; }
}
