:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg-soft: #eef2f8;
  --hover: #f1f5f9;
  --th-bg: #f8fafc;
  --brand: #1d4ed8;
  --brand-dark: #1e40af;
  --brand-soft: #eef3ff;
  --danger: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
}

/* Tema escuro (ativado por data-theme="dark" no <html>). */
:root[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #151e2e;
  --ink: #e2e8f0;
  --muted: #94a3b8;
  --line: #2a3650;
  --bg-soft: #1c2740;
  --hover: #22304c;
  --th-bg: #1a2338;
  --brand: #3b82f6;
  --brand-dark: #60a5fa;
  --brand-soft: #1b2b4d;
  --danger: #f87171;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }

.ic { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
/* Menu lateral visível; o botão ☰ recolhe/mostra. */
.sidebar {
  width: 248px; flex: none; background: var(--surface); border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden;
  padding: 14px 12px; z-index: 40;
}
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.content { padding: 22px 28px; width: 100%; }
.scrim { display: none; }
/* Desktop: recolher esconde a sidebar (mais espaço). */
@media (min-width: 901px) { body.sidebar-collapsed .sidebar { display: none; } }

.brand { display: flex; align-items: center; font-weight: 700; font-size: 18px; padding: 10px 12px 16px; }
.brand-logo { max-width: 190px; width: 100%; height: auto; display: block; }
.brand-mark { color: var(--ink); }
.brand-rest { color: var(--brand); }

.nav-group { margin-bottom: 16px; }
.nav-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 6px 12px; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; color: var(--ink); font-weight: 500; font-size: 14px; margin-bottom: 2px; }
.nav-item:hover { background: var(--hover); text-decoration: none; }
.nav-item.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.nav-item .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line); margin: 0 6px; flex: none; }
.nav-item.active .dot { background: var(--brand); }

/* ---------- Topbar ---------- */
.topbar {
  height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 24px;
  border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 20;
}
.hamburger { display: inline-flex; background: none; border: none; color: var(--ink); cursor: pointer; padding: 4px; border-radius: 8px; }
.hamburger:hover { background: var(--hover); }
.theme-toggle { background: none; border: none; cursor: pointer; font-size: 17px; padding: 4px 7px; border-radius: 8px; line-height: 1; }
.theme-toggle:hover { background: var(--hover); }
/* Grupos do menu como acordeão (ramificação que abre ao clicar). */
details.nav-group { margin-bottom: 8px; }
details.nav-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 700; padding: 8px 12px; border-radius: 8px; user-select: none; }
details.nav-group > summary::-webkit-details-marker { display: none; }
details.nav-group > summary:hover { background: var(--hover); }
details.nav-group > summary::after { content: "⌄"; font-size: 13px; transition: transform 0.15s ease; opacity: 0.7; }
details.nav-group[open] > summary::after { transform: rotate(180deg); }
.spacer { flex: 1; }
.user { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.user-meta { display: flex; flex-direction: column; line-height: 1.15; }
.user-name { font-weight: 600; font-size: 14px; }
.user-tenant { font-size: 12px; color: var(--muted); }
.logout { background: none; border: 1px solid var(--line); color: var(--muted); padding: 6px 12px; border-radius: 8px; cursor: pointer; font: inherit; }
.logout:hover { color: var(--ink); border-color: var(--muted); }

.scrim { display: none; }

/* ---------- Auth (login/convite) ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 30px; box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08); }
.auth h1 { margin: 0 0 18px; }
.auth .hint { color: var(--muted); font-size: 13px; margin-top: 16px; }

/* ---------- Page head ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 10px; align-items: center; }

/* ---------- Buttons ---------- */
.btn { background: var(--brand); color: #fff; padding: 9px 16px; border-radius: 8px; font-weight: 600; font-size: 14px; border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { background: var(--brand-dark); text-decoration: none; }
/* Botões de ação sem classe herdam o visual primário (consistência). */
button:not([class]) { background: var(--brand); color: #fff; padding: 9px 16px; border-radius: 8px; font-weight: 600; font-size: 14px; border: none; cursor: pointer; }
button:not([class]):hover { background: var(--brand-dark); }
.btn-outline { background: var(--surface); border: 1px solid var(--line); color: var(--ink); padding: 8px 15px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.btn-outline:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); text-decoration: none; }
.cancel { color: var(--muted); font-size: 14px; }
.cancel:hover { color: var(--ink); }
.link { background: none; border: none; color: var(--brand-dark); cursor: pointer; font: inherit; padding: 0; }
.link:hover { text-decoration: underline; }
button.link:disabled { color: var(--muted); opacity: 0.5; cursor: default; text-decoration: none; }
.danger-btn { background: var(--danger); color: #fff; border: none; padding: 9px 16px; border-radius: 8px; font-weight: 600; cursor: pointer; }
.danger-btn:hover { filter: brightness(0.95); }

/* ---------- Cards / panels ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 16px; margin-bottom: 22px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.card .num { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.card .lbl { color: var(--muted); font-size: 13px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.panel h2 { margin: 0 0 14px; font-size: 15px; }

/* ---------- Tables ---------- */
.list { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list th, .list td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.list th { background: var(--th-bg); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; }
.list tbody tr:last-child td { border-bottom: none; }
.list tbody tr:hover { background: #fafcfc; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; max-width: 720px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.form label input, .form label select, .form label textarea { width: 100%; }
/* Formulários de página em 2 colunas nas telas largas (aproveita o espaço). */
@media (min-width: 1080px) {
  .content > .form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; align-items: start; max-width: 1000px; }
  .content > .form > h1, .content > .form > h2, .content > .form > p,
  .content > .form > .actions, .content > .form > fieldset,
  .content > .form > .form-section, .content > .form > textarea,
  .content > .form > label:has(textarea) { grid-column: 1 / -1; }
  .content > .form > .actions { display: flex; gap: 10px; justify-content: flex-end; }
}
input, select, textarea, button { font: inherit; }
input, select, textarea {
  font-size: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea { width: 100%; resize: vertical; }
.actions { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.search { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.search input { flex: 1; min-width: 160px; }

/* ---------- Badges / chips ---------- */
.badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 2px 10px; border-radius: 999px; width: fit-content; }
.badge-nova { background: #e0edff; color: #1d4ed8; }
.badge-em_andamento { background: #e0f2fe; color: #0369a1; }
.badge-vendida { background: #dcfce7; color: #15803d; }
.badge-perdida { background: #fee2e2; color: #b91c1c; }
.badge-pausada { background: #eef2f6; color: var(--muted); }
.chip { display: inline-flex; align-items: center; font-size: 12px; background: #eef2f6; color: var(--muted); padding: 3px 10px; border-radius: 999px; margin-left: 6px; }
.chips { margin: 6px 0 2px; }

/* ---------- Kanban ---------- */
.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
/* Colunas dividem a largura disponível; só rolam na horizontal quando não cabem. */
.col { flex: 1 1 0; min-width: 208px; background: var(--bg-soft); border-radius: var(--radius); padding: 12px; }
.col h3 { font-size: 13px; font-weight: 600; margin: 2px 6px 12px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
.col .count { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; font-size: 12px; color: var(--muted); }
.deal { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 7px; }
.deal-title { font-weight: 600; color: var(--ink); font-size: 14px; }
.deal .val { color: var(--brand-dark); font-weight: 600; font-size: 13px; }
.deal .move select { width: 100%; font-size: 13px; padding: 6px 8px; }

/* ---------- Dashboard reports ---------- */
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.funnel { list-style: none; padding: 0; margin: 0; }
.funnel li { margin-bottom: 14px; }
.funnel-name { font-weight: 600; }
.funnel-num { color: var(--muted); }
.bar { height: 8px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--brand); border-radius: 999px; min-width: 3px; }
.statuslist { list-style: none; padding: 0; margin: 0; }
.statuslist li { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.statuslist li:last-child { border-bottom: none; }
.statusnum { color: var(--muted); font-size: 13px; }
.tasks { list-style: none; padding: 0; margin: 0; }
.tasks li { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 11px 13px; margin-bottom: 8px; font-size: 14px; }
.tasks small { color: var(--muted); margin-left: 8px; }

/* ---------- Deal detail ---------- */
.detail { display: grid; grid-template-columns: 1fr 360px; gap: 18px; align-items: start; }
.detail-main, .detail-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.d-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.d-card > h2:first-child, .d-card > .form-section:first-child { margin-top: 0; border-top: none; padding-top: 0; }
.d-card > h2 { font-size: 15px; margin: 0 0 12px; }
.big-val { font-size: 28px; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.02em; }
.kv { list-style: none; padding: 0; margin: 16px 0; }
.kv li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv li:last-child { border-bottom: none; }
.kv span { color: var(--muted); }
.inline-forms { display: flex; gap: 16px; margin-top: 16px; flex-wrap: wrap; }
.inline label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.inline select { width: auto; }
.detail-side h2 { font-size: 15px; margin: 0 0 12px; }
.detail-side h2:not(:first-child) { margin-top: 22px; }
.activity-add { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.activity-add input, .activity-add select { width: auto; }
.activity-add input[name="content"] { flex: 1; min-width: 120px; }
.activities, .timeline { list-style: none; padding: 0; margin: 0; }
.activities li { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.activities li.done .act-text { text-decoration: line-through; color: var(--muted); }
.activities .chk { margin: 0; }
.activities .chk button { background: none; border: none; color: var(--brand); cursor: pointer; font-size: 16px; padding: 0; }
.act-text { flex: 1; }
.timeline li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.timeline small, .activities small { color: var(--muted); }
.ai-box { background: var(--brand-soft); border: 1px solid #c7d7fe; border-radius: 10px; padding: 12px; white-space: pre-wrap; font-size: 14px; line-height: 1.55; }
.ai-meta { color: var(--muted); margin: 6px 0 10px; }
.ai-form { margin-top: 6px; }

/* ---------- Plans ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 14px 0; }
.plan-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.plan-card.current { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.plan-card h2 { margin: 0; }
.plan-card .price { font-size: 18px; font-weight: 700; margin: 0; }
.feats { list-style: none; padding: 0; margin: 6px 0; font-size: 13px; color: var(--muted); }
.feats li { padding: 4px 0; }
.feats li::before { content: "✓"; color: var(--brand); font-weight: 700; margin-right: 7px; }

/* ---------- Config forms ---------- */
.cf-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cf-form input, .cf-form select { width: auto; }
.cf-form input[name="name"] { flex: 1; min-width: 140px; }
.form-section { font-size: 14px; font-weight: 600; margin: 14px 0 2px; border-top: 1px solid var(--line); padding-top: 14px; color: var(--ink); }
.row-actions { display: flex; gap: 10px; align-items: center; }
.inline-role { margin: 0; }
.inline-role input { max-width: 200px; width: auto; }
.qualify .qn { margin-bottom: 14px; }
.qualify .qn > strong { display: block; margin-bottom: 6px; }
.qualify label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.comm-row { margin-bottom: 14px; }
.comm-row > strong { display: block; margin-bottom: 6px; font-size: 14px; }
.topsearch { margin: 0; }
.topsearch input { width: 300px; max-width: 42vw; }
.pager { display: flex; gap: 12px; align-items: center; margin-top: 14px; }
.bell { position: relative; color: var(--ink); padding: 4px; display: inline-flex; }
.bell:hover { color: var(--brand-dark); }
.bell-badge { position: absolute; top: -3px; right: -4px; background: var(--danger); color: #fff; border-radius: 999px; font-size: 10px; font-weight: 700; padding: 0 5px; line-height: 16px; }
.chk-inline { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.chk-inline input { width: auto; }

/* ---------- Alerts ---------- */
.alert { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }
.info { background: var(--brand-soft); color: var(--brand-dark); border: 1px solid #c7d7fe; padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; word-break: break-all; }
.muted { color: var(--muted); }
code { background: var(--bg-soft); padding: 1px 6px; border-radius: 5px; font-size: 0.9em; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; width: 264px; transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: 2px 0 24px rgba(15, 23, 42, 0.14); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.4); z-index: 30; }
  .content { padding: 16px; }
  .report-grid, .detail { grid-template-columns: 1fr; }
}

/* Agenda — calendário do mês (estilo Google) */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head .cap { font-size: 18px; text-transform: capitalize; }
.cal-nav { display: inline-flex; gap: 6px; }
.cal-nav a { border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; color: var(--ink); font-size: 15px; }
.cal-nav a:hover { background: var(--hover); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cal-wd { text-align: center; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 0; text-transform: uppercase; background: var(--bg-soft); }
.cal-cell { background: var(--surface); min-height: 108px; padding: 6px; display: flex; flex-direction: column; gap: 3px; }
.cal-cell.empty { background: var(--bg-soft); }
.cal-cell .cal-day { font-size: 13px; color: var(--muted); font-weight: 600; align-self: flex-end; }
.cal-cell.today .cal-day { background: var(--brand); color: #fff; border-radius: 999px; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; }
.cal-ev { display: block; font-size: 11px; line-height: 1.3; padding: 2px 5px; border-radius: 5px; background: var(--brand-soft); color: var(--brand-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.meet { background: #dcfce7; color: #15803d; }
:root[data-theme="dark"] .cal-ev.meet { background: #14331f; color: #4ade80; }
.cal-ev .cal-t { font-weight: 700; }
.cal-more { font-size: 10px; color: var(--muted); padding-left: 4px; }
@media (max-width: 720px) {
  .cal-cell { min-height: 72px; }
  .cal-ev { font-size: 10px; }
}

/* Agenda — dia clicável + modal de detalhes */
.cal-cell.clickable { cursor: pointer; }
.cal-cell.clickable:hover { background: var(--hover); }
.cal-cell.today.clickable:hover { background: var(--hover); }
#day-scrim { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 60; }
#day-scrim.open { display: flex; }
.day-modal { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; max-width: 460px; width: 100%; padding: 22px; max-height: 86vh; overflow: auto; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.day-modal h2 { margin: 0 0 14px; font-size: 17px; text-transform: capitalize; }
.day-modal .x { background: none; border: none; font-size: 22px; cursor: pointer; float: right; color: var(--muted); line-height: 1; }
.day-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.day-item { border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 8px; padding: 10px 12px; background: var(--bg-soft); }
.day-item.meet { border-left-color: #16a34a; }
.day-item.done { opacity: .6; }
.di-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.di-time { font-weight: 700; font-size: 14px; }
.di-badge { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.di-done { font-size: 11px; color: #16a34a; margin-left: auto; }
.di-body { font-size: 14px; color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.di-link { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 600; }

/* Relatórios — KPIs, gráficos SVG, pizza, funil, barra de range */
.range-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); font-size: 13px; }
.pill:hover { background: var(--hover); }
.pill.active { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.kpi { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.kpi .lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.kpi .num { font-size: 22px; font-weight: 700; color: var(--ink); }
.kpi .sub { font-size: 12px; color: var(--muted); }
.delta { display: inline-block; font-weight: 700; font-size: 11px; padding: 1px 6px; border-radius: 4px; }
.delta.up { color: #15803d; background: #dcfce7; }
.delta.down { color: #b91c1c; background: #fee2e2; }
.delta.neutral { color: var(--muted); background: var(--hover); }
:root[data-theme="dark"] .delta.up { background: #14331f; color: #4ade80; }
:root[data-theme="dark"] .delta.down { background: #3a1414; color: #f87171; }

/* Chart SVG */
.chart-wrap { width: 100%; overflow-x: auto; }
.chart { width: 100%; height: 260px; display: block; }
@media (max-width: 820px) { .chart { height: 200px; } }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .chart-bar { fill: var(--brand); }
.chart .chart-bar:hover { fill: var(--brand-dark); }
.chart .xlbl { fill: var(--muted); font-size: 11px; font-family: inherit; text-transform: capitalize; }
.chart .vlbl { fill: var(--ink); font-size: 10px; font-family: inherit; font-weight: 600; }

/* Barra inline (produtividade) */
.inline-bar { position: relative; background: var(--bg-soft); border-radius: 999px; height: 20px; min-width: 100px; }
.inline-bar-fill { background: var(--brand); height: 100%; border-radius: 999px; }
.inline-bar-lbl { position: absolute; left: 0; right: 0; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--ink); }

/* Funil */
.funnel-row { margin: 10px 0; }
.funnel-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.funnel-bar { background: var(--bg-soft); border-radius: 6px; height: 22px; overflow: hidden; }
.funnel-fill { background: linear-gradient(90deg, var(--brand), var(--brand-dark)); height: 100%; border-radius: 6px; transition: width .3s; }

/* Pizza */
.pie-wrap { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.pie { width: 180px; height: 180px; flex-shrink: 0; }
.legend { list-style: none; padding: 0; margin: 0; font-size: 13px; display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 180px; }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }

.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 820px) { .report-grid { grid-template-columns: 1fr; } }

/* Qualificação (passos lead → fechado) */
.qual-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qual-step { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; text-align: center; min-width: 110px; }
.qual-step strong { display: block; font-size: 22px; font-weight: 700; color: var(--ink); }
.qual-step span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.qual-step.win { background: #dcfce7; border-color: #86efac; color: #15803d; }
:root[data-theme="dark"] .qual-step.win { background: #14331f; color: #4ade80; }
.qual-arrow { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }

/* Heatmap de atividades */
.heatmap { overflow-x: auto; }
.hm-row { display: flex; gap: 2px; margin-bottom: 2px; }
.hm-day { width: 36px; font-size: 11px; color: var(--muted); display: flex; align-items: center; justify-content: center; font-weight: 600; }
.hm-cell { flex: 1 1 0; min-width: 22px; aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center; font-size: 10px; color: var(--ink); background: var(--bg-soft); border-radius: 3px; }
.hm-head .hm-cell.hm-hr { background: transparent; color: var(--muted); font-size: 10px; aspect-ratio: auto; }
.info { background: #e0f2fe; border: 1px solid #7dd3fc; color: #075985; padding: 10px 14px; border-radius: 8px; font-size: 14px; }
:root[data-theme="dark"] .info { background: #0b2d4a; border-color: #0369a1; color: #7dd3fc; }
