/* Indicações Western × Cristal Pool. Gramática Apple na web: no computador, um app do Mac (barra lateral translúcida,
   barra de ferramentas, quadro, tabela, inspetor à direita); no celular, o iPhone (abas embaixo, listas agrupadas,
   folhas que sobem). Fonte do sistema, um verde Western para tudo que é toque, seis cores de fase sempre em par. */

:root {
  --fundo: #f2f2f7;
  --cartao: #ffffff;
  --cartao-2: #f7f7fa;
  --janela: #ffffff;
  --texto: #111113;
  --texto-2: rgba(60, 60, 67, .72);
  --texto-3: rgba(60, 60, 67, .5);
  --linha: rgba(60, 60, 67, .18);
  --preenche: rgba(118, 118, 128, .12);
  --preenche-2: rgba(118, 118, 128, .2);
  --zebra: rgba(118, 118, 128, .055);
  --tint: #1f6b43;
  --marca: #142615;       /* a tinta do logo da Western, medida no PNG */
  --tint-forte: #17573a;
  --tint-fundo: rgba(31, 107, 67, .12);
  --sobre-tint: #ffffff;
  --novo: #b85600;        --novo-f: rgba(255, 149, 0, .16);
  --andamento: #0a5fc4;   --andamento-f: rgba(0, 122, 255, .13);
  --follow: #8338b0;      --follow-f: rgba(175, 82, 222, .14);
  --convertido: #1d7a37;  --convertido-f: rgba(52, 199, 89, .16);
  --perdido: #c4141f;     --perdido-f: rgba(255, 59, 48, .13);
  --neutro: rgba(60, 60, 67, .72); --neutro-f: rgba(118, 118, 128, .14);
  --barra: rgba(249, 249, 251, .86);
  --lateral: rgba(236, 236, 241, .82);
  --sombra-folha: 0 -8px 40px rgba(0, 0, 0, .16);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --raio: 12px;
  --rapido: 200ms cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fundo: #000000; --cartao: #1c1c1e; --cartao-2: #2c2c2e; --janela: #1c1c1e; --texto: #f5f5f7;
    --texto-2: rgba(235, 235, 245, .7); --texto-3: rgba(235, 235, 245, .45); --linha: rgba(84, 84, 88, .6);
    --preenche: rgba(118, 118, 128, .24); --preenche-2: rgba(118, 118, 128, .36); --zebra: rgba(255, 255, 255, .035);
    --tint: #4cc285; --tint-forte: #6fd39f; --tint-fundo: rgba(76, 194, 133, .18); --sobre-tint: #04170d;
    --novo: #ffb340; --andamento: #5ea8ff; --follow: #d394f5; --convertido: #5ad97c; --perdido: #ff6961; --neutro: rgba(235, 235, 245, .7);
    --barra: rgba(28, 28, 30, .86); --lateral: rgba(36, 36, 40, .82); --sombra-folha: 0 -8px 40px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fundo); color: var(--texto); font: 400 17px/1.35 var(--sans);
  -webkit-font-smoothing: antialiased; letter-spacing: -.01em;
}
[hidden] { display: none !important; }
a { color: var(--tint); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--tint) 55%, transparent); outline-offset: 2px; border-radius: 8px; }
::selection { background: var(--tint-fundo); }
input, textarea { caret-color: var(--tint); }
* { scrollbar-color: var(--preenche-2) transparent; }
.num, .valor { font-variant-numeric: tabular-nums; }
.ico { width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }
.ico.p { width: 15px; height: 15px; }
.ico.g { width: 26px; height: 26px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.so-largo { display: none; }
.respiro { height: 10px; }
.respiro.g { height: 16px; }
.centro { text-align: center; }
.alerta { color: var(--perdido); }

/* ------------------------------------------------------------ casca: abas embaixo (celular), barra lateral (computador) */
.casca { min-height: 100vh; }
.abas {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around;
  background: var(--barra); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--linha); padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
}
.aba {
  position: relative; flex: 1; max-width: 120px; min-height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--texto-3); font-size: 13px; font-weight: 500; background: none; border: 0; border-radius: 10px;
}
.aba[aria-current="page"] { color: var(--tint); }
.aba .ico { width: 25px; height: 25px; }
.lateral-marca { display: none; }
.selo { position: absolute; top: 3px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--perdido); color: #fff; font-size: 13px; font-weight: 600; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.conta { display: none; }

.colunas { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.coluna { max-width: 680px; margin: 0 auto; padding: 0 0 24px; }
.painel-ficha { display: none; }

@media (min-width: 1000px) {
  .so-largo { display: inline; }
  .so-curto { display: none; }
  .casca { display: grid; grid-template-columns: 232px minmax(0, 1fr); }
  .abas {
    position: sticky; top: 0; height: 100vh; flex-direction: column; justify-content: flex-start; gap: 2px;
    border-top: 0; border-right: .5px solid var(--linha); padding: 18px 10px; background: var(--lateral);
  }
  .lateral-marca { display: flex; flex-direction: column; gap: 6px; padding: 4px 10px 20px; }
  .lateral-marca img { height: 13px; width: auto; align-self: flex-start; }
  .marca-par { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--texto-2); }
  .lateral-marca .marca-cristal { height: 12px; }
  .aba {
    flex: 0 0 auto; max-width: none; flex-direction: row; justify-content: flex-start; gap: 10px; min-height: 44px; padding: 0 10px;
    font-size: 15px; font-weight: 500; color: var(--texto); transition: background var(--rapido);
  }
  .aba:hover { background: var(--preenche); }
  .aba .ico { width: 20px; height: 20px; color: var(--tint); }
  .aba[aria-current="page"] { background: var(--preenche-2); color: var(--texto); font-weight: 600; }
  .aba-nome { flex: 1; min-width: 0; }
  .selo { position: static; margin-left: auto; }
  .conta { display: inline; margin-left: auto; color: var(--texto-2); font-size: 15px; font-variant-numeric: tabular-nums; }
  .colunas { padding-bottom: 0; display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100vh; background: var(--janela); }
  .colunas.com-ficha { grid-template-columns: minmax(0, 1fr) 400px; }
  .coluna { max-width: none; width: 100%; height: 100vh; overflow-y: auto; position: sticky; top: 0; padding-bottom: 32px; }
  .colunas.larga { background: var(--fundo); }
  .secao-dinheiro { max-width: 480px; }
  .colunas.com-ficha .painel-ficha {
    display: block; height: 100vh; overflow-y: auto; position: sticky; top: 0; background: var(--fundo); border-left: .5px solid var(--linha);
    animation: entra-lado 240ms cubic-bezier(.2, .8, .2, 1);
  }
}

/* ------------------------------------------------------------ barra de ferramentas da área */
.barra {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "titulo mais" "busca busca" "extra extra";
  align-items: end; column-gap: 12px; padding: calc(14px + env(safe-area-inset-top)) 16px 0;
}
.barra-titulo { grid-area: titulo; min-width: 0; }
.barra .busca { grid-area: busca; margin: 12px 0 2px; }
.barra > .bt-nav { grid-area: mais; }
.titulo-grande { margin: 0; font: 700 34px/1.1 var(--display); letter-spacing: -.02em; }
.sub-titulo { margin: 4px 0 0; color: var(--texto-2); font-size: 15px; }
.bt-mais {
  grid-area: mais; align-self: start; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 44px; height: 44px; border-radius: 50%; background: var(--tint); color: var(--sobre-tint); border: 0; font-size: 15px; font-weight: 600;
  transition: transform var(--rapido), background var(--rapido);
}
.bt-mais:active { transform: scale(.96); }
.bt-mais .ico { stroke-width: 2.4; width: 20px; height: 20px; }
.bt-mais-txt { display: none; }
.area-corpo { padding-top: 16px; }

@media (min-width: 1000px) {
  .barra {
    position: sticky; top: 0; z-index: 12; display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 12px 24px;
    background: var(--barra); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    border-bottom: .5px solid var(--linha);
  }
  .barra-titulo { flex: 1; }
  .titulo-grande { font-size: 26px; line-height: 1.15; }
  .sub-titulo { font-size: 13px; margin-top: 1px; }
  .barra .busca { margin: 0; width: 280px; }
  .bt-mais { width: auto; height: 44px; padding: 0 16px 0 12px; border-radius: 10px; }
  .bt-mais:hover { background: var(--tint-forte); }
  .bt-mais-txt { display: inline; }
  .area-corpo { padding: 20px 8px 0; }
  .area-corpo.estreita { max-width: 820px; margin: 0 auto; }
  .colunas.larga .barra { background: color-mix(in srgb, var(--fundo) 86%, transparent); }
  .colunas.com-ficha .barra .sub-titulo { display: none; }
  .colunas.com-ficha .barra .busca { width: 220px; }
}

/* ------------------------------------------------------------ barra de navegação (ficha e folhas) */
.nav {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 56px; padding: calc(8px + env(safe-area-inset-top)) 8px 4px 8px; background: var(--fundo);
}
.nav.vidro { background: var(--barra); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: .5px solid var(--linha); }
.nav-titulo { font-weight: 600; font-size: 17px; text-align: center; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-lado { display: flex; align-items: center; gap: 2px; min-width: 44px; }
.nav-lado.dir { justify-content: flex-end; }
.bt-nav {
  display: inline-flex; align-items: center; gap: 2px; min-height: 44px; min-width: 44px; padding: 0 8px; justify-content: center;
  color: var(--tint); background: none; border: 0; border-radius: 10px; font-size: 17px;
}
.bt-nav:hover { background: var(--preenche); }
.bt-nav:disabled { color: var(--texto-3); cursor: default; background: none; }
.bt-nav.forte { font-weight: 600; }
@media (min-width: 1000px) { .colunas.com-ficha .painel-ficha .nav { padding-top: 12px; min-height: 68px; } }

/* ------------------------------------------------------------ busca, segmentado */
.busca { position: relative; margin: 0 16px 12px; }
.busca .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--texto-3); width: 18px; height: 18px; }
.busca input { width: 100%; min-height: 44px; border: 0; border-radius: 10px; background: var(--preenche); padding: 0 12px 0 36px; font-size: 17px; }
.busca input::placeholder { color: var(--texto-3); }
.busca input:focus { outline: none; box-shadow: 0 0 0 3px var(--tint-fundo); }
@media (min-width: 1000px) { .busca input { font-size: 15px; } }

.seg { display: flex; margin: 0 16px 14px; padding: 2px; border-radius: 10px; background: var(--preenche); }
.seg.dentro { margin: 0; }
.seg button {
  flex: 1; min-height: 44px; border: 0; background: none; border-radius: 8px; font-size: 15px; font-weight: 500; color: var(--texto);
  transition: background var(--rapido), box-shadow var(--rapido);
}
.seg button[aria-pressed="true"] { background: var(--cartao); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 1px rgba(0, 0, 0, .04); font-weight: 600; }
@media (prefers-color-scheme: dark) { .seg button[aria-pressed="true"] { background: #636366; } }
.seg-filtro button { font-size: 13px; padding: 0 2px; white-space: nowrap; letter-spacing: -.02em; }
@media (min-width: 1000px) { .seg-filtro button { font-size: 15px; letter-spacing: -.01em; } .seg-filtro { display: inline-flex; margin: 0 16px 16px; } .seg-filtro button { flex: 0 0 auto; padding: 0 16px; } }

/* ------------------------------------------------------------ fases: o mesmo par de cor em todo lugar */
.s-novo { --cor: var(--novo); --cor-f: var(--novo-f); }
.s-aceito, .s-em_atendimento { --cor: var(--andamento); --cor-f: var(--andamento-f); }
.s-follow_up { --cor: var(--follow); --cor-f: var(--follow-f); }
.s-convertido, .s-paga { --cor: var(--convertido); --cor-f: var(--convertido-f); }
.s-perdido, .s-sem_comissao { --cor: var(--perdido); --cor-f: var(--perdido-f); }
.s-recusado, .s-a_definir { --cor: var(--neutro); --cor-f: var(--neutro-f); }
.s-a_pagar { --cor: var(--novo); --cor-f: var(--novo-f); }
.t-quente { color: var(--perdido); }
.t-morno { color: var(--novo); }
.t-frio { color: var(--andamento); }

.pilula { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--cor-f); color: var(--cor); white-space: nowrap; }
.pilula .ico { width: 13px; height: 13px; stroke-width: 2.2; }
.selo-prazo { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; padding: 2px 8px; border-radius: 999px; color: var(--perdido); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--perdido) 45%, transparent); white-space: nowrap; }
.selo-prazo .ico { width: 13px; height: 13px; stroke-width: 2.2; }
.titulo-fase { display: inline-flex; align-items: center; gap: 7px; }
.titulo-fase i { width: 9px; height: 9px; border-radius: 50%; background: var(--cor); }

/* trilho pequeno do acompanhamento */
.mini-trilho { display: inline-flex; align-items: center; gap: 4px; }
.mini-trilho i { width: 8px; height: 8px; border-radius: 50%; background: var(--preenche-2); }
.mini-trilho i.feito { background: var(--cor); opacity: .55; }
.mini-trilho i.agora { background: var(--cor); box-shadow: 0 0 0 3px var(--cor-f); }
.mini-trilho.fim i { width: 44px; height: 4px; border-radius: 2px; background: var(--cor); opacity: .6; }

/* ------------------------------------------------------------ listas agrupadas */
.secao { margin: 0 0 22px; }
.secao-titulo { margin: 0 32px 6px; font-size: 13px; font-weight: 500; color: var(--texto-2); text-transform: uppercase; letter-spacing: .02em; display: flex; justify-content: space-between; gap: 8px; }
.secao-rodape { margin: 6px 32px 0; font-size: 13px; color: var(--texto-2); }
.grupo { margin: 0 16px; background: var(--cartao); border-radius: var(--raio); overflow: hidden; }
.linha {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 16px; width: 100%;
  background: none; border: 0; text-align: left; color: var(--texto);
}
.linha + .linha::before, .linha + details::before, details + .linha::before { content: ""; position: absolute; top: 0; right: 0; left: var(--recuo, 16px); border-top: .5px solid var(--linha); }
button.linha:active, a.linha:active { background: var(--preenche); }
@media (hover: hover) { button.linha:hover, a.linha:hover, label.linha:hover { background: var(--zebra); } }
.linha-meio { flex: 1; min-width: 0; }
.linha-rot { color: var(--texto); }
.linha-rot.forte { font-weight: 600; }
.linha-rot.quebra { overflow-wrap: anywhere; }
.linha-sub { font-size: 15px; color: var(--texto-2); margin-top: 1px; overflow-wrap: anywhere; }
.linha-dir { color: var(--texto-2); text-align: right; flex-shrink: 0; display: flex; align-items: center; gap: 6px; max-width: 60%; overflow-wrap: anywhere; }
.linha .seta { color: var(--texto-3); width: 18px; height: 18px; }
.linha.tint { color: var(--tint); }
.linha.perigo { color: var(--perdido); }
.icone-quadro { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; background: var(--cor, var(--tint)); color: #fff; flex-shrink: 0; }
.icone-quadro .ico { width: 18px; height: 18px; stroke-width: 2; }
.marca-sel { width: 22px; color: var(--tint); }

/* linha de cliente */
.lead { --recuo: 68px; align-items: flex-start; padding-top: 11px; padding-bottom: 11px; }
.lead-link { position: absolute; inset: 0; z-index: 0; }
.lead-link:active { background: var(--preenche); }
.lead > :not(.lead-link) { position: relative; z-index: 1; pointer-events: none; }
.lead .pilula-bt { pointer-events: auto; }
.pilula-bt { display: inline-flex; align-items: center; gap: 1px; border: 0; background: none; padding: 10px 0 10px 6px; margin: -10px 0 -10px -6px !important; color: var(--cor); min-height: 44px; }
.pilula-bt .ico.p { width: 13px; height: 13px; stroke-width: 2.4; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-weight: 600; font-size: 15px;
  background: var(--cor-f, var(--preenche)); color: var(--cor, var(--texto-2));
}
.avatar.g { width: 72px; height: 72px; font-size: 26px; }
.avatar.p { width: 32px; height: 32px; font-size: 13px; }
.lead-topo { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.lead-topo .pilula, .lead-topo .pilula-bt, .lead-topo .valor-forte { flex-shrink: 0; margin-top: 1px; }
.lead-nome { font-weight: 600; flex: 1; min-width: 0; overflow-wrap: anywhere; line-height: 1.25; }
.lead-base { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.lead-sub { font-size: 15px; color: var(--texto-2); display: inline-flex; align-items: center; gap: 4px; }
.lead-sub .ico { width: 14px; height: 14px; }
.lead-sub.alerta { color: var(--perdido); font-weight: 600; }
.lead.ativo, .fazer.ativo { background: var(--tint-fundo); }

/* A fazer: a ação escrita e o botão dela */
.a-fazer .linha { --recuo: 58px; }
.fazer { align-items: center; }
.fazer-link { color: var(--texto); min-height: 44px; display: flex; flex-direction: column; justify-content: center; }
.fazer-txt { color: var(--novo); font-weight: 600; }
.fazer-txt.alerta { color: var(--perdido); }
.bt-acao {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 0; flex-shrink: 0;
  background: var(--tint); color: var(--sobre-tint); font-size: 15px; font-weight: 600; transition: transform var(--rapido), background var(--rapido);
}
.bt-acao .ico { width: 16px; height: 16px; stroke-width: 2.2; }
.bt-acao:active { transform: scale(.97); }
.bt-acao.leve { background: var(--tint-fundo); color: var(--tint); }
@media (hover: hover) { .bt-acao:hover { background: var(--tint-forte); } .bt-acao.leve:hover { background: color-mix(in srgb, var(--tint) 20%, transparent); } }

details.encerradas > summary, details.mais > summary { list-style: none; cursor: pointer; }
details.encerradas > summary::-webkit-details-marker, details.mais > summary::-webkit-details-marker { display: none; }
details[open] > summary .seta { transform: rotate(90deg); }
details > summary .seta { transition: transform var(--rapido); }
details.encerradas[open] > summary { margin-bottom: 22px; }
details.encerradas .linha-dir { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ quadro por fase (Atender no computador) */
.quadro-rola { overflow-x: auto; padding: 0 16px 4px; margin-bottom: 22px; }
.colunas.com-ficha .quadro { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.colunas.com-ficha .cartao { padding: 10px 10px 12px; }
.colunas.com-ficha .coluna-cab { font-size: 13px; gap: 6px; }
/* com a ficha aberta o cartão fica no essencial (nome, quem atende, data e selo): o resto está na ficha */
.colunas.com-ficha .cartao .cartao-sub { display: none; }
.colunas.com-ficha .tabela .td-extra { display: none; }
.cartao .selo-prazo { white-space: normal; max-width: 100%; }
.colunas.com-ficha .tabela .mini-trilho { display: none; }
.quadro { display: grid; grid-template-columns: repeat(4, minmax(208px, 1fr)); gap: 12px; align-items: start; }
.coluna-fase { background: var(--preenche); border-radius: 14px; padding: 6px 8px 8px; min-height: 160px; display: flex; flex-direction: column; gap: 8px; }
.coluna-cab { display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px 4px 2px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.coluna-cab .bolinha { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--cor); color: #fff; flex-shrink: 0; }
.coluna-cab .bolinha .ico { width: 13px; height: 13px; stroke-width: 2.6; }
.coluna-nome { flex: 1; min-width: 0; }
.coluna-conta { color: var(--texto-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.bt-mais-cartoes { min-height: 44px; border: 0; border-radius: 10px; background: none; color: var(--tint); font-size: 15px; font-weight: 600; }
.bt-mais-cartoes:hover { background: var(--cartao); }
.coluna-vazia { margin: 0; padding: 18px 8px; text-align: center; font-size: 13px; color: var(--texto-3); }
.cartao {
  position: relative; background: var(--cartao); border-radius: 10px; padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px;
  box-shadow: inset 0 0 0 2px transparent; transition: box-shadow var(--rapido), transform var(--rapido);
}
.cartao > :not(.lead-link) { position: relative; z-index: 1; pointer-events: none; }
.cartao .bt-fase { pointer-events: auto; }
.cartao:active { transform: scale(.99); }
.cartao.ativo { box-shadow: inset 0 0 0 2px var(--tint); }
@media (hover: hover) { .cartao:hover { box-shadow: inset 0 0 0 1px var(--linha); } .cartao.ativo:hover { box-shadow: inset 0 0 0 2px var(--tint); } }
.cartao-topo { display: flex; align-items: flex-start; gap: 4px; }
.cartao .lead-nome { font-size: 16px; padding-top: 2px; }
.bt-fase { width: 44px; height: 44px; margin: -10px -12px -12px 0; border: 0; border-radius: 10px; background: none; color: var(--texto-3); display: grid; place-items: center; flex-shrink: 0; }
.bt-fase:hover { color: var(--cor); background: var(--cor-f); }
.bt-fase .ico { width: 18px; height: 18px; }
.cartao-sub { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--texto-2); overflow-wrap: anywhere; }
.cartao-sub .ico { color: var(--texto-3); }
.cartao-base { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; color: var(--texto-2); }
.cartao-com { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }
.cartao-com.alerta { color: var(--perdido); font-weight: 600; }
.cartao-data { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--follow); }
.cartao-data.alerta { color: var(--perdido); }
.mini-avatar { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--preenche-2); color: var(--texto-2); font-size: 13px; font-weight: 600; letter-spacing: -.04em; }

/* ------------------------------------------------------------ Minhas indicações: resumo e tabela */
.acompanha .lead-base .pilula { margin-right: 2px; }
.tabela-rola { overflow-x: auto; }
.tabela { width: calc(100% - 32px); margin: 0 16px 24px; border-collapse: separate; border-spacing: 0; font-size: 15px; background: var(--cartao); border-radius: var(--raio); overflow: hidden; }
.tabela th { text-align: left; font-size: 13px; font-weight: 600; color: var(--texto-2); padding: 10px 14px; border-bottom: .5px solid var(--linha); white-space: nowrap; background: var(--cartao); }
.tabela td { padding: 9px 14px; vertical-align: middle; }
.tabela tbody tr { cursor: pointer; transition: background var(--rapido); }
.tabela tbody tr:nth-child(even) { background: var(--zebra); }
.tabela tbody tr:hover { background: var(--preenche); }
.tabela tbody tr.ativo { background: var(--tint-fundo); }
.tabela tbody tr:focus-visible { outline-offset: -3px; }
.tabela .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.td-cliente { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.td-cliente .lead-nome { font-size: 15px; }
.td-sub { font-size: 13px; color: var(--texto-2); }
.td-fase { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.td-com { white-space: nowrap; }
.td-sub.so-ficha { display: none; }
.colunas.com-ficha .tabela .col-com { display: none; }
.colunas.com-ficha .tabela .td-sub.so-ficha { display: block; }
.colunas.com-ficha .td-cliente { min-width: 0; }
.colunas.com-ficha .tabela td, .colunas.com-ficha .tabela th { padding-left: 10px; padding-right: 10px; }

/* ------------------------------------------------------------ ficha */
.ficha { padding-bottom: 32px; }
.ficha-cab { text-align: center; padding: 8px 20px 18px; }
.ficha-cab .avatar { margin: 0 auto 10px; }
.ficha-nome { margin: 0; font: 700 26px/1.15 var(--display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.ficha-sub { color: var(--texto-2); font-size: 15px; margin-top: 6px; display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; }
.sentido { display: inline-flex; align-items: center; gap: 4px; }
.contato { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 16px 18px; }
.contato a, .contato button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 60px; border-radius: var(--raio);
  background: var(--cartao); color: var(--tint); font-size: 13px; font-weight: 500; border: 0;
}
.contato [aria-disabled="true"] { color: var(--texto-3); pointer-events: none; }

.trilho { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 12px 8px; position: relative; }
.trilho::before { content: ""; position: absolute; top: 15px; left: 12.5%; right: 12.5%; height: 2px; background: var(--preenche-2); }
.trilho .barra-feita { position: absolute; top: 15px; left: 12.5%; width: 75%; height: 2px; background: var(--tint); transform-origin: left center; transition: transform 400ms cubic-bezier(.2, .8, .2, 1); }
.passo { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; line-height: 1.2; letter-spacing: -.02em; color: var(--texto-3); text-align: center; padding: 0 2px; }
.passo i { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--cartao); border: 2px solid var(--preenche-2); color: var(--texto-3); font-style: normal; }
.passo i .ico { width: 16px; height: 16px; stroke-width: 2.4; }
.passo.feito i { background: var(--tint); border-color: var(--tint); color: var(--sobre-tint); }
.passo.agora i { background: var(--cartao); border-color: var(--tint); color: var(--tint); box-shadow: 0 0 0 4px var(--tint-fundo); }
.passo.feito, .passo.agora { color: var(--texto); }
.passo.agora { font-weight: 600; }
.encerrado { margin: 0 16px 8px; padding: 12px 14px; border-radius: var(--raio); display: flex; gap: 10px; align-items: flex-start; background: var(--cor-f); color: var(--cor); font-size: 15px; }
.encerrado b { display: block; font-size: 17px; }
.encerrado div div { color: var(--texto); }
.proximo { margin: 12px 24px 22px; text-align: center; color: var(--texto-2); font-size: 15px; }
.proximo + .acoes { margin-top: -6px; }

.acoes { display: flex; gap: 10px; margin: 14px 16px 22px; flex-wrap: wrap; }
.acoes > * { flex: 1 1 140px; }
.acoes.dentro { margin: 12px 0 0; }
.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 18px; border-radius: 12px;
  border: 0; background: var(--tint); color: var(--sobre-tint); font-size: 17px; font-weight: 600; text-align: center; white-space: nowrap;
  transition: transform var(--rapido), opacity var(--rapido), background var(--rapido);
}
.botao:active { transform: scale(.98); }
.botao:disabled { opacity: .45; cursor: default; transform: none; }
.botao.sec { background: var(--tint-fundo); color: var(--tint); }
.botao.cinza { background: var(--cartao); color: var(--tint); }
.botao.perigo { background: var(--perdido-f); color: var(--perdido); }
.botao.cheio { width: 100%; }
@media (hover: hover) { .botao:not(.sec):not(.cinza):not(.perigo):hover { background: var(--tint-forte); } }
.sel-atende { border: 0; background: none; color: var(--tint); font-size: 17px; max-width: 180px; text-align: right; min-height: 44px; }

.tempo .linha { align-items: flex-start; --recuo: 52px; }
.tempo .marca-tempo { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--preenche); color: var(--texto-2); flex-shrink: 0; margin-top: 1px; }
.tempo .marca-tempo .ico { width: 14px; height: 14px; }
.tempo .nota .marca-tempo { background: var(--tint-fundo); color: var(--tint); }
.tempo-texto { white-space: pre-line; overflow-wrap: anywhere; }
.tempo-quem { font-size: 13px; color: var(--texto-2); margin-top: 2px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.privado { display: inline-flex; align-items: center; gap: 3px; color: var(--follow); font-weight: 600; }
.privado .ico { width: 12px; height: 12px; }

.escrever { display: flex; align-items: flex-end; gap: 8px; padding: 8px 8px 8px 16px; }
.escrever textarea { flex: 1; min-height: 44px; max-height: 160px; resize: none; border: 0; background: none; padding: 11px 0; font-size: 17px; }
.escrever textarea:focus { outline: none; }
.bt-redondo { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--tint); color: var(--sobre-tint); flex-shrink: 0; }
.bt-redondo:disabled { background: var(--preenche-2); color: var(--texto-3); }
.bt-redondo.leve { background: var(--preenche); color: var(--texto-2); }
.bt-redondo.leve[aria-pressed="true"] { background: var(--follow-f); color: var(--follow); }

/* ficha no celular: empurra por cima da lista */
@media (max-width: 999.98px) {
  .ficha-empurrada {
    position: fixed; inset: 0; z-index: 40; background: var(--fundo); overflow-y: auto; -webkit-overflow-scrolling: touch;
    animation: entra-lado 280ms cubic-bezier(.2, .8, .2, 1);
  }
  .ficha-empurrada.saindo { animation: sai-lado 220ms cubic-bezier(.4, 0, 1, 1) forwards; }
}
@keyframes entra-lado { from { transform: translateX(100%); } to { transform: none; } }
@keyframes sai-lado { to { transform: translateX(100%); } }
@media (min-width: 1000px) { @keyframes entra-lado { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } } }
body.travado { overflow: hidden; }

/* ------------------------------------------------------------ folhas (dialog) */
dialog.folha {
  border: 0; padding: 0; margin: auto 0 0; width: 100%; max-width: 100%; max-height: calc(100dvh - 24px); height: fit-content;
  border-radius: 14px 14px 0 0; background: var(--fundo); color: var(--texto); box-shadow: var(--sombra-folha); overflow: hidden;
  display: flex; flex-direction: column;
}
dialog.folha:not([open]) { display: none; }
dialog.folha[open] { animation: sobe 300ms cubic-bezier(.2, .8, .2, 1); }
dialog.folha.fechando { animation: desce 220ms cubic-bezier(.4, 0, 1, 1) forwards; }
dialog.folha::backdrop { background: rgba(0, 0, 0, .32); animation: aparece 300ms ease-out; }
.folha-corpo { overflow-y: auto; padding: 4px 0 calc(24px + env(safe-area-inset-bottom)); flex: 1; }
.folha .nav { position: static; background: var(--fundo); padding-top: 6px; border-bottom: .5px solid var(--linha); }
.puxador { width: 36px; height: 5px; border-radius: 3px; background: var(--preenche-2); margin: 6px auto 0; flex-shrink: 0; }
@keyframes sobe { from { transform: translateY(100%); } to { transform: none; } }
@keyframes desce { to { transform: translateY(100%); } }
@keyframes aparece { from { opacity: 0; } }
@media (min-width: 760px) {
  dialog.folha { margin: auto; width: 560px; max-height: min(86vh, 860px); border-radius: 14px; }
  .puxador { display: none; }
  dialog.folha[open] { animation: aparece-meio 240ms cubic-bezier(.2, .8, .2, 1); }
  dialog.folha.fechando { animation: some 160ms ease-in forwards; }
}
@keyframes aparece-meio { from { opacity: 0; transform: scale(.96); } }
@keyframes some { to { opacity: 0; transform: scale(.97); } }

/* formulário dentro do grupo */
.campo-linha { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 16px; position: relative; }
.campo-linha + .campo-linha::before, .campo-linha + .linha::before, .linha + .campo-linha::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; border-top: .5px solid var(--linha); }
.campo-linha label { flex: 0 0 34%; color: var(--texto); }
.campo-linha input, .campo-linha select, .campo-linha textarea {
  flex: 1; min-width: 0; min-height: 48px; border: 0; background: none; font-size: 17px; padding: 0; text-align: left;
}
.campo-linha textarea { padding: 12px 0; min-height: 96px; resize: vertical; }
.campo-linha.alto { align-items: flex-start; }
.campo-linha.alto label { padding-top: 13px; }
.campo-linha input:focus, .campo-linha select:focus, .campo-linha textarea:focus { outline: none; }
.campo-linha:focus-within { background: color-mix(in srgb, var(--tint) 5%, transparent); }
.campo-linha input::placeholder, .campo-linha textarea::placeholder { color: var(--texto-3); }
.campo-linha select { appearance: none; -webkit-appearance: none; color: var(--texto-2); text-align: right; direction: rtl; }
.campo-linha select option { direction: ltr; }
.so-campo input { padding-left: 0; }
.invalido { background: var(--perdido-f) !important; }
.msg-erro { margin: 6px 32px 0; color: var(--perdido); font-size: 15px; }
.erro-geral { margin: 12px 16px; padding: 12px 14px; border-radius: var(--raio); background: var(--perdido-f); color: var(--perdido); font-size: 15px; }
.aviso { margin: 12px 16px; padding: 14px; border-radius: var(--raio); background: var(--novo-f); color: var(--texto); font-size: 15px; }
.aviso b { display: block; margin-bottom: 4px; }
.ok-msg { margin: 12px 16px; padding: 14px; border-radius: var(--raio); background: var(--convertido-f); font-size: 15px; }

/* opções com ícone (o que o cliente quer) */
.escolhas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 16px; }
.escolha {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 76px; padding: 8px 4px;
  border-radius: var(--raio); border: 0; background: var(--cartao); color: var(--texto); font-size: 14px; font-weight: 500; text-align: center;
  box-shadow: inset 0 0 0 2px transparent; transition: box-shadow var(--rapido), background var(--rapido);
}
.escolha .ico { color: var(--tint); }
.escolha[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--tint); background: var(--tint-fundo); font-weight: 600; }

/* chave liga e desliga */
.chave { appearance: none; -webkit-appearance: none; width: 51px; height: 31px; border-radius: 16px; background: var(--preenche-2); position: relative; flex-shrink: 0; margin: 0; cursor: pointer; transition: background var(--rapido); }
.chave::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16); transition: transform var(--rapido); }
.chave:checked { background: #34c759; }
.chave:checked::after { transform: translateX(20px); }
.chave:focus-visible { outline: 3px solid color-mix(in srgb, var(--tint) 55%, transparent); outline-offset: 2px; }
label.linha { cursor: pointer; }

/* comissões */
.totais { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 16px 18px; }
.total { background: var(--cartao); border-radius: var(--raio); padding: 12px 14px; }
.total span { display: block; font-size: 13px; color: var(--texto-2); font-weight: 500; }
.total b { display: block; font: 700 22px/1.2 var(--display); margin-top: 2px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.valor-forte { font-weight: 600; color: var(--texto); font-variant-numeric: tabular-nums; }

/* estados */
.vazio { text-align: center; padding: 48px 32px; color: var(--texto-2); }
.vazio .ico { width: 44px; height: 44px; margin: 0 auto 12px; color: var(--texto-3); stroke-width: 1.4; }
.vazio b { display: block; color: var(--texto); font-size: 20px; margin-bottom: 4px; }
.vazio.enviado { padding-bottom: 16px; }
.vazio .ok-ico { color: var(--convertido); }
.vazio .ok-ico .ico { color: var(--convertido); stroke-width: 2; }
.carregando { padding: 16px 16px 0; }
.esqueleto { height: 64px; border-radius: var(--raio); background: var(--cartao); margin-bottom: 8px; animation: pulsa 1.2s ease-in-out infinite; }
@keyframes pulsa { 50% { opacity: .55; } }

/* entrar */
.entrar { max-width: 420px; margin: 0 auto; padding: calc(48px + env(safe-area-inset-top)) 0 40px; }
.entrar-marca { text-align: center; padding: 0 24px 26px; }
.entrar-par { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 18px; font-size: 15px; color: var(--texto-2); }
.entrar-par img { height: 14px; width: auto; display: block; }
.entrar-par .marca-cristal { height: 14px; }
.entrar-marca h1 { margin: 0; font: 700 34px/1.1 var(--display); letter-spacing: -.02em; }
/* o logo da Cristal Pool usa a mesma tinta do logo da Western: verde quase preto no claro, branco a 92% no escuro */
.marca-cristal { display: block; width: auto; aspect-ratio: 400 / 34; fill: var(--marca); flex-shrink: 0; }
.codigo { font-size: 24px !important; letter-spacing: .14em; text-transform: uppercase; text-align: center !important; font-variant-numeric: tabular-nums; }
.codigo-novo { font: 700 30px/1.2 var(--display); letter-spacing: .1em; text-align: center; margin: 8px 0 12px; font-variant-numeric: tabular-nums; }

/* no Mac escuro, uma cor de janela só em todas as áreas e no inspetor; o preto puro fica para o celular */
@media (prefers-color-scheme: dark) and (min-width: 1000px) {
  :root { --fundo: #1e1e20; --janela: #1e1e20; --cartao: #2a2a2d; --cartao-2: #323236; }
}
@media (prefers-color-scheme: dark) {
  .lateral-marca img, .entrar-marca img { filter: brightness(0) invert(1); opacity: .92; }
  :root { --marca: rgba(255, 255, 255, .92); }
  /* no escuro as cores de fase clareiam: o ícone por cima fica escuro para manter o contraste */
  .coluna-cab .bolinha, .icone-quadro { color: #0b0b0d; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
