/* GN.IA v9 — painel minimalista (2026-09-24)
   Um só sistema visual: fundo neutro, cartões com borda fina, 1 cor de destaque (azul),
   vermelho só pra número negativo. Tokens claros/escuros abaixo. */

:root {
  color-scheme: light;
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #f0efec;
  --line: #e6e5e1;
  --line-2: #d6d5d0;
  --text: #0b0b0b;
  --text-2: #52514e;
  --text-3: #8a8984;
  --accent: #2a78d6;
  --accent-ink: #1c5cab;
  --accent-soft: rgba(42, 120, 214, .10);
  --neg: #e34948;
  --good-text: #0a7a2f;
  --bad-text: #c42b2b;
  --warn-bg: #fff6e0;
  --warn-text: #8a5a00;
  --c-fat: #1d64c4;
  --c-lucro: #0a7a2f;
  --c-gasto: #c42b2b;
  --c-leads: #6b3fd4;
  --c-vendas: #0b7c73;
  --c-conv: #9a6700;
  --c-ticket: #b0307a;
  --c-meta: #c2410c;
  --btn: #0b0b0b;
  --btn-text: #ffffff;
  --shadow: 0 10px 40px rgba(11, 11, 11, .12);
  --r: 14px;
  --nav-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f0f0e;
    --surface: #1a1a19;
    --surface-2: #242422;
    --line: #2c2c2a;
    --line-2: #3a3a37;
    --text: #ffffff;
    --text-2: #c3c2b7;
    --text-3: #8d8c85;
    --accent: #3987e5;
    --accent-ink: #86b6ef;
    --accent-soft: rgba(57, 135, 229, .16);
    --neg: #e66767;
    --good-text: #4cc36b;
    --bad-text: #f07b7b;
    --warn-bg: #2e2612;
    --warn-text: #f0c060;
    --c-fat: #5ea3f2;
    --c-lucro: #4cc36b;
    --c-gasto: #f07b7b;
    --c-leads: #a98bfa;
    --c-vendas: #34d1bf;
    --c-conv: #f0c060;
    --c-ticket: #f07ab8;
    --c-meta: #fb923c;
    --btn: #ffffff;
    --btn-text: #0b0b0b;
    --shadow: 0 10px 40px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0f0e;
  --surface: #1a1a19;
  --surface-2: #242422;
  --line: #2c2c2a;
  --line-2: #3a3a37;
  --text: #ffffff;
  --text-2: #c3c2b7;
  --text-3: #8d8c85;
  --accent: #3987e5;
  --accent-ink: #86b6ef;
  --accent-soft: rgba(57, 135, 229, .16);
  --neg: #e66767;
  --good-text: #4cc36b;
  --bad-text: #f07b7b;
  --warn-bg: #2e2612;
  --warn-text: #f0c060;
  --c-fat: #5ea3f2;
  --c-lucro: #4cc36b;
  --c-gasto: #f07b7b;
  --c-leads: #a98bfa;
  --c-vendas: #34d1bf;
  --c-conv: #f0c060;
  --c-ticket: #f07ab8;
  --c-meta: #fb923c;
  --btn: #ffffff;
  --btn-text: #0b0b0b;
  --shadow: 0 10px 40px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-ink); }
[hidden] { display: none !important; }
.num, .v, .big, .hero-val, td.r { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.dim { color: var(--text-2); }
/* cores por tipo de número */
.c-fat { color: var(--c-fat); }
.c-lucro { color: var(--c-lucro); }
.c-gasto { color: var(--c-gasto); }
.c-leads { color: var(--c-leads); }
.c-vendas { color: var(--c-vendas); }
.c-conv { color: var(--c-conv); }
.c-ticket { color: var(--c-ticket); }
.c-meta { color: var(--c-meta); }
.neg-t { color: var(--bad-text); }
.pos-t { color: var(--good-text); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------- portão (PIN) ---------------- */
.gate {
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.gate-in { width: 100%; max-width: 280px; text-align: center; }
.gate-logo { display: block; width: 72px; height: 72px; border-radius: 20px; margin: 0 auto 14px; box-shadow: 0 8px 28px rgba(0, 0, 0, .18); }
.gate h1 { font-size: 20px; font-weight: 600; margin: 0 0 4px; letter-spacing: -.01em; }
.gate p { margin: 0 0 28px; color: var(--text-3); font-size: 13px; min-height: 19px; }
.gate-dots { display: flex; gap: 14px; justify-content: center; margin-bottom: 32px; }
.gate-dots i { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--line-2); }
.gate-dots i.on { background: var(--text); border-color: var(--text); }
.gate-dots.err i { border-color: var(--neg); background: transparent; }
.gate-dots.err { animation: shake .4s; }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.gate-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gate-keys button {
  height: 60px; border-radius: 50%; border: 0; background: var(--surface); font-size: 22px; font-weight: 500;
  box-shadow: inset 0 0 0 1px var(--line);
}
.gate-keys button:active { background: var(--surface-2); }
.gate-keys .blank { visibility: hidden; }
.gate-wait .gate-keys, .gate-wait .gate-dots { visibility: hidden; }

/* ---------------- barra superior ---------------- */
.top {
  position: sticky; top: 0; z-index: 20; background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.top-in { max-width: 1040px; margin: 0 auto; height: 56px; padding: 0 16px; display: flex; align-items: center; gap: 12px; }
.brand { font-weight: 700; letter-spacing: -.02em; font-size: 16px; text-decoration: none; color: var(--text); display: flex; align-items: center; gap: 8px; }
.brand img { width: 30px; height: 30px; border-radius: 8px; display: block; flex: none; }
.top-title { font-weight: 600; font-size: 16px; display: none; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.sync { font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; padding: 0 6px; white-space: nowrap; }
.sync i { width: 7px; height: 7px; border-radius: 50%; background: var(--good-text); }
.sync.off i { background: var(--neg); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 19px; height: 19px; }

/* navegação: em cima no computador, embaixo no celular */
.nav { display: flex; gap: 2px; margin-left: 20px; }
.nav button {
  border: 0; background: transparent; color: var(--text-2); font-weight: 500; font-size: 14px;
  padding: 8px 12px; border-radius: 9px; display: flex; align-items: center; gap: 7px; position: relative;
}
.nav button svg { width: 18px; height: 18px; }
.nav button:hover { background: var(--surface-2); color: var(--text); }
.nav button.on { color: var(--text); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.nav .badge {
  min-width: 17px; height: 17px; border-radius: 9px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px;
}

@media (max-width: 759px) {
  .brand span { display: none; }
  .top-title { display: block; }
  .sync span { display: none; }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .nav button { flex: 1; flex-direction: column; gap: 3px; font-size: 11px; padding: 6px 0; border-radius: 10px; }
  .nav button.on { background: transparent; box-shadow: none; color: var(--accent-ink); }
  .nav button svg { width: 22px; height: 22px; }
  .nav .badge { position: absolute; top: 2px; left: calc(50% + 6px); }
  body { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
}

/* ---------------- página ---------------- */
main { max-width: 1040px; margin: 0 auto; padding: 16px 16px 40px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; }
.page-head h1 { font-size: 22px; font-weight: 650; letter-spacing: -.02em; margin: 0; }
.page-head .sub { color: var(--text-3); font-size: 13px; }
.back { border: 0; background: transparent; color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; padding: 6px 8px 6px 2px; font-size: 14px; }
.back svg { width: 18px; height: 18px; }

.grid2 { display: grid; gap: 12px; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; align-items: start; } }
.stack { display: grid; gap: 12px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.card + .card { margin-top: 0; }
.card h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; letter-spacing: -.01em; }
.card h2 small { font-weight: 400; color: var(--text-3); font-size: 12.5px; }
.card h2 .end { margin-left: auto; }
.note { font-size: 12.5px; color: var(--text-3); margin-top: 10px; line-height: 1.5; }
.note b { color: var(--text-2); font-weight: 600; }
.empty { color: var(--text-3); font-size: 13.5px; padding: 18px 0; text-align: center; }
.sec-gap { height: 12px; }

/* controle segmentado */
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--text-2); white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08), inset 0 0 0 1px var(--line); }
.seg .n { font-size: 11.5px; color: var(--text-3); }
.seg .n.hot { color: var(--accent-ink); font-weight: 600; }
.seg.sm button { padding: 4px 10px; font-size: 12.5px; }
.seg.full { display: flex; }
.seg.full button { flex: 1; justify-content: center; }

/* frase do momento (tela Hoje) */
.mood {
  --m: var(--c-fat);
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 12px 14px; border-radius: var(--r);
  background: color-mix(in srgb, var(--m) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--m) 30%, var(--line));
}
.mood[data-s="quente"] { --m: var(--c-meta); }
.mood[data-s="batida"] { --m: var(--c-lucro); }
.mood[data-s="frio"] { --m: var(--c-leads); }
.mood[data-s="fds"] { --m: var(--c-vendas); }
.mood-e { font-size: 28px; line-height: 1; flex: none; }
.mood-t { flex: 1; min-width: 0; }
.mood-t > b { display: block; font-size: 15.5px; font-weight: 650; letter-spacing: -.01em; line-height: 1.35; }
.mood-s { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 4px; font-size: 12.5px; color: var(--text-2); }
.mood-s span { white-space: nowrap; }
.mood-s .c-fat, .mood-s .c-lucro, .mood-s .c-gasto, .mood-s .c-meta { font-weight: 600; }
.mood-live { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); }
.mood-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--m); animation: vivo 2s ease-out infinite; }
@keyframes vivo { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--m) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
.mood.novo .mood-t > b, .mood.novo .mood-e { animation: moodIn .5s ease-out; }
@keyframes moodIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .mood *, .mood.novo * { animation: none !important; } }
@media (max-width: 759px) { .mood-e { font-size: 24px; } .mood-t > b { font-size: 14.5px; } .mood-s > span:nth-child(n+4) { display: none; } }

/* número principal */
.hero-lbl { color: var(--text-2); font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.hero-val { font-size: 44px; font-weight: 650; letter-spacing: -.03em; line-height: 1.1; margin: 4px 0 2px; }
@media (min-width: 760px) { .hero-val { font-size: 56px; } }
.big { font-size: 28px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hero-sub { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--text-2); font-size: 13.5px; margin-top: 10px; }
.hero-sub b { color: var(--text); font-weight: 600; }

.delta { font-size: 12.5px; font-weight: 600; padding: 2px 7px; border-radius: 6px; white-space: nowrap; }
.delta.up { color: var(--good-text); background: color-mix(in srgb, var(--good-text) 12%, transparent); }
.delta.down { color: var(--bad-text); background: color-mix(in srgb, var(--bad-text) 12%, transparent); }
.delta.flat { color: var(--text-3); background: var(--surface-2); }

/* barras de progresso */
.bar { height: 6px; background: var(--accent-soft); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s; }
.bar.ok i { background: var(--good-text); }
.bar-lbl { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-2); margin-top: 7px; }
.bar-lbl b { color: var(--text); font-weight: 600; }

/* grade de números */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
@media (min-width: 760px) { .stats.s6 { grid-template-columns: repeat(6, 1fr); } .stats.s4 { grid-template-columns: repeat(4, 1fr); } .stats.s3 { grid-template-columns: repeat(3, 1fr); } }
.stat { background: var(--surface); padding: 12px 14px; min-width: 0; }
.stat .l { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .v { font-size: 21px; font-weight: 650; letter-spacing: -.02em; margin-top: 2px; white-space: nowrap; }
.stat .h { font-size: 12px; color: var(--text-3); margin-top: 3px; display: flex; gap: 6px; align-items: center; min-height: 20px; white-space: nowrap; overflow: hidden; }
.stat .h > span:not(.delta) { overflow: hidden; text-overflow: ellipsis; }
.stat .h .delta { font-size: 11.5px; padding: 1px 6px; }
@media (max-width: 759px) { .stat { padding: 11px 12px; } .stat .v { font-size: 19px; } }
.stat.click { cursor: pointer; }
.stat.click:hover { background: var(--surface-2); }

/* linhas rótulo → valor */
.rows { display: grid; }
.rows .row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.rows .row:first-child { border-top: 0; }
.rows .row > span:first-child { color: var(--text-2); min-width: 0; }
.rows .row > b, .rows .row > span.r { font-weight: 600; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rows .row small { color: var(--text-3); font-weight: 400; }
.rows.tap .row { cursor: pointer; }
.rows.tap .row:hover { background: var(--surface-2); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 8px; }

/* listas editáveis (planilha, recompensas) */
.list { display: grid; }
.item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); min-width: 0; }
.item:first-child { border-top: 0; }
.item .t { flex: 1; min-width: 0; }
.item .t b { font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .t span { font-size: 12.5px; color: var(--text-3); }
.item .val { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.item.tap { cursor: pointer; }
.item.tap:hover .t b { color: var(--accent-ink); }
.add-row { border: 0; background: transparent; color: var(--accent-ink); font-weight: 500; padding: 10px 0 2px; display: flex; align-items: center; gap: 6px; font-size: 14px; }
.add-row svg { width: 16px; height: 16px; }
.group-h { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 4px; }
.group-h h3 { margin: 0; font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: none; }
.group-h span { font-weight: 600; font-variant-numeric: tabular-nums; }
.owner { font-size: 11.5px; color: var(--text-3); font-weight: 500; margin-right: 6px; }

/* botões */
.btn {
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text); border-radius: 10px;
  padding: 9px 14px; font-weight: 500; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--btn); border-color: var(--btn); color: var(--btn-text); }
.btn.primary:hover { opacity: .88; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--bad-text); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.link-btn { border: 0; background: transparent; color: var(--accent-ink); padding: 0; font-weight: 500; font-size: 13px; }

/* avisos */
.alerts { display: grid; gap: 8px; margin-bottom: 12px; }
.alert { background: var(--warn-bg); color: var(--warn-text); border-radius: 12px; padding: 10px 14px; font-size: 13.5px; border: 0; text-align: left; display: flex; gap: 10px; align-items: center; width: 100%; }
.alert.info { background: var(--accent-soft); color: var(--accent-ink); }
.alert .go { margin-left: auto; font-weight: 600; white-space: nowrap; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; font-weight: 500; }
.chip.blue { background: var(--accent-soft); color: var(--accent-ink); }
.chip.good { background: color-mix(in srgb, var(--good-text) 13%, transparent); color: var(--good-text); }
.chip.warn { background: var(--warn-bg); color: var(--warn-text); }

/* formulários */
.field { display: grid; gap: 6px; margin-top: 14px; }
.field:first-child { margin-top: 0; }
.field > label, .lbl { font-size: 13px; color: var(--text-2); font-weight: 500; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line-2); background: var(--surface); border-radius: 10px;
  padding: 10px 12px; font-size: 16px; outline: none; min-width: 0;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { min-height: 120px; resize: vertical; line-height: 1.45; }
.hint { font-size: 12.5px; color: var(--text-3); line-height: 1.45; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two .field { margin-top: 14px; }
.switch { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 14px; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--accent); }
.pickrow { display: flex; flex-wrap: wrap; gap: 6px; }
.pickrow button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 9px; padding: 7px 12px; font-size: 13.5px; font-weight: 500; }
.pickrow button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.money { position: relative; }
.money span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.money .input { padding-left: 38px; }

/* folha (formulários) — de baixo no celular, centro no computador */
.sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .38); }
.sheet-card {
  position: relative; background: var(--surface); width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto;
  border-radius: 18px 18px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: var(--shadow);
  animation: up .2s ease-out;
}
@keyframes up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (min-width: 760px) { .sheet { align-items: center; } .sheet-card { border-radius: 18px; padding: 22px; } }
.sheet-card h3 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.sheet-card .sub { color: var(--text-3); font-size: 13px; margin: 3px 0 16px; }
.sheet-act { display: flex; gap: 8px; margin-top: 20px; }
.sheet-act .btn { flex: 1; padding: 11px 14px; }
.sheet-act .btn.danger { flex: 0 0 auto; }

/* conversa */
.drawer { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: flex-end; }
.drawer-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .3); }
.drawer-panel {
  position: relative; width: 100%; max-width: 480px; height: 100%; background: var(--bg); display: flex; flex-direction: column;
  box-shadow: var(--shadow); padding-top: env(safe-area-inset-top);
}
.dh { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.dh .t { min-width: 0; flex: 1; }
.dh .t b { display: block; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dh .t span { font-size: 12.5px; color: var(--text-3); }
.dchips { padding: 8px 14px 0; }
.chat { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.bub { max-width: 82%; padding: 8px 11px; border-radius: 14px; font-size: 14.5px; line-height: 1.4; white-space: pre-wrap; word-wrap: break-word; }
.bub.h { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bub.a { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.bub .tm { display: block; font-size: 10.5px; opacity: .6; margin-top: 3px; text-align: right; }
.sys { align-self: center; font-size: 12px; color: var(--text-3); background: var(--surface-2); padding: 3px 10px; border-radius: 8px; text-align: center; max-width: 90%; }
.day-sep { align-self: center; font-size: 11.5px; color: var(--text-3); margin: 8px 0 2px; font-weight: 500; }
.reply { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface); align-items: flex-end; }
.reply textarea { flex: 1; resize: none; min-height: 42px; max-height: 120px; }
.reply .btn { height: 42px; width: 46px; padding: 0; }
.dact { display: flex; gap: 6px; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); overflow-x: auto; }
.dact .btn { flex: 1; min-width: max-content; }

/* leads */
.leads-top { display: grid; gap: 10px; margin-bottom: 12px; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--text-3); }
.search .input { padding-left: 38px; }
.leads-row { display: flex; gap: 8px; align-items: stretch; }
.leads-row .search { flex: 1; min-width: 0; }
.leads-row .btn { white-space: nowrap; }
.qp-list { display: grid; gap: 10px; }
.qp-list .card.lead { box-shadow: none; }
.lead { cursor: pointer; }
.lead:hover { border-color: var(--line-2); }
.lead-h { display: flex; align-items: baseline; gap: 10px; }
.lead-h b { font-weight: 600; font-size: 15px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-h span { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.lead-s { font-size: 13px; color: var(--text-3); margin-top: 1px; }
.lead-m { font-size: 13.5px; color: var(--text-2); margin-top: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lead-m em { font-style: normal; color: var(--text-3); font-size: 12px; margin-right: 4px; }
.lead .chips { margin-top: 8px; }
.lead-a { display: flex; gap: 6px; margin-top: 12px; }
.lead.wait { border-left: 3px solid var(--accent); }
.leads-list { display: grid; gap: 10px; }
@media (min-width: 900px) { .leads-list { grid-template-columns: 1fr 1fr; } }
.fab {
  position: fixed; right: 16px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 25;
  border: 0; background: var(--btn); color: var(--btn-text); border-radius: 26px; padding: 12px 18px; font-weight: 600; font-size: 14px;
  display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow);
}
.fab svg { width: 18px; height: 18px; }
@media (min-width: 760px) { .fab { bottom: 24px; right: 24px; } }

/* menu de ações */
.menu { position: fixed; z-index: 70; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 5px; min-width: 210px; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 12px; border-radius: 8px; font-size: 14px; }
.menu button:hover { background: var(--surface-2); }
.menu button.danger { color: var(--bad-text); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* toast */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); z-index: 90;
  background: var(--btn); color: var(--btn-text); padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: calc(100vw - 32px); box-shadow: var(--shadow);
}
.toast.err { background: var(--bad-text); color: #fff; }
@media (min-width: 760px) { .toast { bottom: 28px; } }

/* faixa de notificações */
.push {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom)); z-index: 26;
  max-width: 440px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  padding: 12px 14px; display: flex; gap: 12px; align-items: center; font-size: 13.5px;
}
.push div { flex: 1; }
.push b { display: block; font-weight: 600; }
.push span { color: var(--text-3); font-size: 12.5px; }
@media (min-width: 760px) { .push { bottom: 24px; } }

/* ---------------- gráficos ---------------- */
.tip {
  position: fixed; z-index: 80; pointer-events: none; background: var(--btn); color: var(--btn-text); font-size: 12.5px;
  padding: 6px 9px; border-radius: 8px; white-space: nowrap; box-shadow: var(--shadow); transform: translate(-50%, calc(-100% - 10px));
}
.cols { display: flex; align-items: flex-end; gap: 2px; height: 120px; border-bottom: 1px solid var(--line); }
.cols > div { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; position: relative; min-width: 0; }
.cols > div > i { display: block; width: 100%; max-width: 24px; border-radius: 4px 4px 0 0; background: var(--accent); }
.cols .bg { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 24px; background: var(--surface-2); border-radius: 4px 4px 0 0; }
.cols .fg { position: relative; }
#h-hours .fg, #h-week > div > i { background: var(--c-vendas); }
.cols > div.today > i { background: var(--accent-ink); }
.axis { display: flex; gap: 2px; font-size: 11px; color: var(--text-3); margin-top: 4px; }
.axis span { flex: 1; text-align: center; min-width: 0; white-space: nowrap; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* resultado por dia: cresce pra cima (positivo) ou pra baixo (negativo) a partir do zero */
.dv { display: flex; gap: 2px; height: 140px; position: relative; }
.dv::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line-2); }
.dv > div { flex: 1; position: relative; min-width: 0; }
.dv > div > i { position: absolute; left: 50%; transform: translateX(-50%); width: 100%; max-width: 20px; }
.dv > div > i.p { bottom: 50%; background: var(--c-lucro); border-radius: 4px 4px 0 0; }
.dv > div > i.n { top: 50%; background: var(--neg); border-radius: 0 0 4px 4px; }
.dv > div > i.o { top: calc(50% - 2px); height: 4px !important; width: 4px; border-radius: 50%; background: var(--line-2); }

/* funil */
.funnel { display: grid; gap: 8px; }
.fstep { display: grid; grid-template-columns: 118px 1fr 42px; gap: 10px; align-items: center; font-size: 13px; }
.fstep .nm { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fstep .tr { height: 22px; position: relative; }
.fstep .tr i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 3px; }
.fstep .tr span { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 600; color: #fff; }
.fstep .tr span.out { color: var(--text); }
.fstep .pc { text-align: right; color: var(--text-3); font-variant-numeric: tabular-nums; }
.fstep.loss .pc { color: var(--bad-text); font-weight: 600; }

/* sparkline */
.spark { display: flex; align-items: flex-end; gap: 2px; height: 36px; margin: 10px 0 6px; }
.spark i { flex: 1; background: var(--surface-2); border-radius: 2px 2px 0 0; min-height: 2px; max-width: 14px; }
.spark i.today { background: var(--accent); }

/* tabelas simples */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: right; font-weight: 500; color: var(--text-3); font-size: 12px; padding: 0 0 8px; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl td { text-align: right; padding: 8px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.tbl td + td, .tbl th + th { padding-left: 10px; }
.tbl tr.muted td { color: var(--text-3); }
@media (max-width: 520px) { .hide-sm { display: none; } }
.show-sm { display: none; }
@media (max-width: 520px) { .show-sm { display: inline; } }

/* dias do mês */
.days { display: grid; }
.day { display: grid; grid-template-columns: 62px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.day:first-child { border-top: 0; }
.day:hover { background: var(--surface-2); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 8px; }
.day .d b { display: block; font-size: 15px; font-weight: 600; }
.day .d span { font-size: 11.5px; color: var(--text-3); text-transform: lowercase; }
.day .m { font-size: 13px; color: var(--text-2); min-width: 0; }
.day .m div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day .m small { color: var(--text-3); font-size: 12px; }
.day .r { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.day .r small { display: block; font-weight: 400; font-size: 11.5px; color: var(--text-3); }
.day.off { opacity: .55; }
.day.today .d b { color: var(--accent-ink); }
.day.future { cursor: default; opacity: .4; }
.day.future:hover { background: transparent; margin: 0; padding-left: 0; padding-right: 0; }

/* meses do ano */
.months .mo { display: grid; grid-template-columns: 44px 1fr 1fr 1fr; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; cursor: pointer; font-variant-numeric: tabular-nums; }
.months .mo:first-child { border-top: 0; }
.months .mo.head { cursor: default; color: var(--text-3); font-size: 12px; padding-top: 0; }
.months .mo > span { text-align: right; }
.months .mo > span:first-child { text-align: left; font-weight: 600; }
.months .mo.on > span:first-child { color: var(--accent-ink); }
.months .mo.none { color: var(--text-3); }

/* recompensas */
.rw { padding: 12px 0; border-top: 1px solid var(--line); }
.rw:first-child { border-top: 0; }
.rw-h { display: flex; gap: 12px; align-items: center; }
.rw-e { font-size: 22px; width: 32px; text-align: center; }
.rw-h .t { flex: 1; min-width: 0; }
.rw-h .t b { font-weight: 500; display: block; }
.rw-h .t span { font-size: 12.5px; color: var(--text-3); }
.rw .bar { margin: 10px 0 0 44px; }
.rw .bar-lbl { margin-left: 44px; }
.rw-a { display: flex; gap: 6px; margin: 10px 0 0 44px; flex-wrap: wrap; }
.rw.done { opacity: .6; }
.emojis { display: flex; flex-wrap: wrap; gap: 6px; }
.emojis button { width: 40px; height: 40px; font-size: 20px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); }
.emojis button.on { border-color: var(--accent); background: var(--accent-soft); }

/* mais */
.menu-list { display: grid; }
.menu-list button { display: flex; align-items: center; gap: 14px; border: 0; background: transparent; padding: 14px 0; border-top: 1px solid var(--line); text-align: left; width: 100%; }
.menu-list button:first-child { border-top: 0; }
.menu-list svg { width: 20px; height: 20px; color: var(--text-2); flex: none; }
.menu-list .t { flex: 1; }
.menu-list .t b { display: block; font-weight: 500; }
.menu-list .t span { font-size: 12.5px; color: var(--text-3); }
.menu-list .chev { width: 16px; height: 16px; color: var(--text-3); }

/* status */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; background: var(--text-3); }
.dot.ok { background: #0ca30c; }
.dot.warn { background: #fab219; }
.dot.bad { background: #d03b3b; }

/* conteúdos */
.drop { border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 22px; text-align: center; color: var(--text-2); cursor: pointer; font-size: 14px; }
.drop.on, .drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 8px; }
.lib-it { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; position: relative; background: var(--surface); }
.lib-it .th { aspect-ratio: 1; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 28px; overflow: hidden; }
.lib-it .th img, .lib-it .th video { width: 100%; height: 100%; object-fit: cover; }
.lib-it .in { padding: 7px 9px; font-size: 12.5px; }
.lib-it .in b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-it .in span { color: var(--text-3); font-size: 11.5px; }
.lib-it .del { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 15px; line-height: 1; }
.pick-list { display: grid; gap: 6px; max-height: 55vh; overflow-y: auto; }
.pick-list button { display: flex; gap: 12px; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 8px 10px; }
.pick-list button:hover { border-color: var(--accent); }
.pick-list .ic { width: 42px; height: 42px; border-radius: 8px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: 20px; flex: none; }
.pick-list .ic img { width: 100%; height: 100%; object-fit: cover; }
.pick-list b { display: block; font-weight: 500; font-size: 14px; }
.pick-list small { color: var(--text-3); font-size: 12px; }

/* simulador */
.slider { padding: 10px 0; border-top: 1px solid var(--line); }
.slider:first-child { border-top: 0; }
.slider .sh { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-2); }
.slider .sh b { color: var(--text); font-variant-numeric: tabular-nums; }
.slider input { width: 100%; accent-color: var(--accent); margin: 8px 0 0; }

.skel { display: inline-block; color: transparent !important; background: var(--surface-2); border-radius: 6px; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .5; } }

/* tela Mês: no celular os dias vêm logo depois da meta */
@media (max-width: 899px) {
  .mes-grid { display: flex; flex-direction: column; }
  .mes-grid > .stack { display: contents; }
}
