/* ============================================================
   PAINEL DA MENTORIA — admin.balaclava-ads.com
   Reescrito na sessão 11. Três regras que valem pro arquivo inteiro:

   1) PRETO, BRANCO E CINZA. Cor não carrega significado aqui — estado é dito
      por preenchimento (branco = fechado/pago), contorno (em aberto) ou
      apagado (morto). A ÚNICA exceção é o vermelho de `--risco`, reservado a
      "está vencendo/venceu": é a informação que não pode passar batida.
   2) HORIZONTAL. Filtro, busca e ação moram na MESMA faixa; a lista é uma
      linha por registro, com as ações à direita. Nada de empilhar coisa que
      cabe lado a lado — o time trabalha em telas largas e com pressa.
   3) TEXTO GRANDE. Base 16px (era 13,5px). Alvo de toque mínimo de 38px.
      Ninguém deveria precisar dar zoom pra ler um telefone.
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0b0b0c;
  --surface: #141416;
  --surface-2: #1b1b1f;
  --surface-3: #222227;
  --line: #26262b;
  --line-2: #34343c;
  --line-3: #4a4a54;
  --txt: #f4f4f6;
  --txt-2: #a6a6b0;
  --txt-3: #74747e;
  --risco: #ff8f8f;          /* única cor do painel: vencido / vencendo */
  --risco-bg: rgba(255, 143, 143, .12);
  --ok: #67dc91;
  --ok-bg: rgba(58, 188, 107, .13);
  --r: 14px;                 /* raio padrão */
  --r-sm: 10px;
}

html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  background: var(--bg); color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.45; min-height: 100vh; min-height: 100dvh; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; overscroll-behavior-y: contain;
}
.hidden { display: none !important; }

button, .tab, .btn, .mini, .chip, .pill, .seg-b { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.btn, .mini, .tab, .chip, .seg-b, .icon-btn { transition: background .13s ease, border-color .13s ease, color .13s ease, transform .1s ease; }
.btn:active, .mini:active, .chip:active, .seg-b:active, .icon-btn:active { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

::selection { background: #fff; color: #000; }
:focus-visible { outline: 2px solid var(--txt); outline-offset: 2px; }

/* ============================================================
   CONTROLES
   ============================================================ */
.field {
  width: 100%; padding: 11px 14px; background: #0f0f11;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  color: var(--txt); font-size: 16px; font-family: inherit; outline: none;
}
.field::placeholder { color: var(--txt-3); }
.field:focus { border-color: var(--line-3); background: #121215; }
select.field { cursor: pointer; -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a6a6b0' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 17px; padding-right: 34px; }
.field.sel { width: auto; min-width: 168px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; min-height: 42px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--txt);
  font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--line-3); background: var(--surface-3); }
.btn.primary { background: #fff; color: #0b0b0c; border-color: #fff; }
.btn.primary:hover { background: #e4e4e8; border-color: #e4e4e8; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 8px 14px; min-height: 38px; font-size: 14px; }
.btn.block { width: 100%; margin-top: 12px; }
.btn:disabled { opacity: .5; cursor: default; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex-shrink: 0;
  border: 1px solid transparent; border-radius: var(--r-sm);
  background: transparent; color: var(--txt-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--txt); }
.icon-btn svg { width: 19px; height: 19px; }

.mini {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 11px; min-height: 36px;
  font-size: 13.5px; font-weight: 600; font-family: inherit;
  border: 1px solid var(--line-2); border-radius: 9px;
  background: var(--surface-2); color: var(--txt); cursor: pointer; white-space: nowrap; text-decoration: none;
}
.mini:hover { border-color: var(--line-3); background: var(--surface-3); }
.mini.strong { background: #fff; color: #0b0b0c; border-color: #fff; }
.mini.strong:hover { background: #e4e4e8; }
.mini.danger { color: var(--risco); border-color: rgba(255,143,143,.28); background: rgba(255,143,143,.06); }
.mini.danger:hover { border-color: rgba(255,143,143,.5); background: rgba(255,143,143,.12); }
.mini svg { width: 15px; height: 15px; opacity: .8; }
.mini.copiado { border-color: #fff; color: #fff; }
/* botão que é SÓ ícone: quadrado, sem o espaço do texto que não existe */
.mini.so-icone { padding: 0; width: 38px; flex: 0 0 38px; justify-content: center; }
.mini.so-icone svg { width: 16px; height: 16px; opacity: 1; }

.chips { display: flex; gap: 7px; flex-wrap: wrap; min-width: 0; }
.chip {
  padding: 8px 13px; min-height: 38px; font-size: 13.5px; font-weight: 600; font-family: inherit;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: transparent; color: var(--txt-2); cursor: pointer; white-space: nowrap;
}
.chip:hover { color: var(--txt); border-color: var(--line-3); }
.chip.active { background: #fff; color: #0b0b0c; border-color: #fff; }

/* segmentado (2-3 opções mutuamente exclusivas, coladas) */
.seg { display: inline-flex; padding: 3px; gap: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; }
.seg.wide { display: flex; width: 100%; margin-bottom: 16px; }
.seg.wide .seg-b { flex: 1; }
.seg-b {
  padding: 7px 14px; border: none; border-radius: 999px; background: transparent;
  color: var(--txt-2); font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer; white-space: nowrap;
}
.seg-b:hover { color: var(--txt); }
.seg-b.active { background: #fff; color: #0b0b0c; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap;
  background: var(--surface-3); color: var(--txt-2); border: 1px solid transparent;
}
.pill.solid { background: #fff; color: #0b0b0c; }          /* fechado / pago */
.pill.outline { background: transparent; border-color: var(--line-3); color: var(--txt); }  /* em aberto */
.pill.dim { background: transparent; color: var(--txt-3); border-color: var(--line); }      /* morto */
.pill.risco { background: var(--risco-bg); color: var(--risco); }                            /* vencido */

.msg { margin-top: 10px; font-size: 14px; min-height: 20px; color: var(--txt-2); }
.msg.ok { color: var(--txt); font-weight: 600; }
.msg.err { color: var(--risco); }
.hint { color: var(--txt-3); font-size: 13.5px; line-height: 1.5; margin: 6px 0 12px; }
.hint b { color: var(--txt-2); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ============================================================
   BOOT — a tela que aparece enquanto a sessão é conferida.
   Existe pra NÃO piscar o formulário de login em quem já está logado: o
   `gate()` é assíncrono e, sem isto, todo mundo via "entre com seu e-mail"
   por um instante a cada abertura do app. Parece deslogado sem estar.
   ============================================================ */
.boot { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; }
.boot-mark { font-size: 20px; font-weight: 800; letter-spacing: -.03em; }
.boot-mark span { color: var(--txt-3); font-weight: 500; }
.boot-bar { width: 148px; height: 3px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.boot-bar i { display: block; width: 40%; height: 100%; border-radius: 2px; background: var(--txt-2); animation: boot-run 1.1s ease-in-out infinite; }
@keyframes boot-run { 0% { transform: translateX(-110%); } 100% { transform: translateX(280%); } }
.boot-msg { color: var(--txt-3); font-size: 13.5px; text-align: center; max-width: 280px; }

/* ============================================================
   LOGIN
   ============================================================ */
.card { max-width: 420px; margin: 12vh auto; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 34px 30px; }
.card h1 { font-size: 26px; letter-spacing: -.02em; margin-bottom: 6px; }
.adm { color: var(--txt-3); font-weight: 600; }
.sub { color: var(--txt-2); font-size: 15px; margin-bottom: 20px; }
.card .field { margin-bottom: 2px; }
.paste { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }
.paste > summary { color: var(--txt-3); font-size: 14px; cursor: pointer; list-style: none; }
.paste > summary::-webkit-details-marker { display: none; }
.paste > summary::before { content: "＋ "; }
.paste[open] > summary::before { content: "－ "; }
.paste > summary:hover { color: var(--txt); }
.paste .field { margin-top: 12px; }
.login-screen { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: calc(18px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom)); }
.login-card { width: min(100%, 390px); max-width: 390px; margin: 0; text-align: left; background: #000; }
.login-logo { display: block; width: 138px; height: 138px; object-fit: contain; margin: -17px auto -4px; }
.login-card h1, .login-card .sub { text-align: center; }
.login-back { border: 0; background: transparent; color: var(--txt-3); font: inherit; font-size: 13.5px; cursor: pointer; margin: -2px 0 14px; }
.login-back:hover { color: var(--txt); }
#login-pin-step .login-back { display: block; margin: 15px auto 0; padding: 7px 12px; text-align: center; }
.pin-field { text-align: center; font-size: 22px; font-weight: 750; letter-spacing: .32em; font-variant-numeric: tabular-nums; padding-left: calc(14px + .32em); }
.pin-field::placeholder { letter-spacing: normal; font-weight: 400; }
.pin-dots { display: flex; align-items: center; justify-content: center; gap: 17px; min-height: 30px; margin: -4px 0 19px; }
.pin-dots i { width: 12px; height: 12px; border: 1.5px solid var(--line-3); border-radius: 50%; background: transparent; transition: transform .12s ease, background .12s ease; }
.pin-dots i.filled { background: var(--txt); border-color: var(--txt); transform: scale(1.08); }
.pin-dots.shake { animation: pin-shake .3s ease; }
@keyframes pin-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-9px); } 75% { transform: translateX(9px); } }
.pin-keypad { width: min(100%, 252px); margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); justify-items: center; gap: 12px 18px; }
.pin-keypad button { display: inline-flex; align-items: center; justify-content: center; width: 62px; height: 62px; border: 1px solid var(--line-2);
  border-radius: 50%; background: var(--surface-2); color: var(--txt); font: 500 25px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; cursor: pointer;
  -webkit-user-select: none; user-select: none; touch-action: manipulation; transition: background .12s ease, transform .08s ease; }
.pin-keypad button:active { transform: scale(.91); background: var(--surface-3); }
.pin-keypad .pin-delete { border-color: transparent; background: transparent; color: var(--txt-2); }
.pin-keypad .pin-delete svg { width: 25px; height: 25px; }
.pin-keypad.busy { pointer-events: none; opacity: .55; }
.login-card #login-msg { text-align: center; }

/* ============================================================
   ESTRUTURA — tudo alinhado à ESQUERDA, numa coluna larga.
   ============================================================ */
#app { padding: 0 0 64px; }

.topbar { position: sticky; top: 0; z-index: 30; background: rgba(11,11,12,.9);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1400px; margin: 0 auto; padding: 12px 26px;
  display: flex; align-items: center; gap: 22px; }
.brand-txt { font-size: 17px; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; flex-shrink: 0; }
.brand-txt .adm { font-weight: 500; }
.topright { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0; }
.who { color: var(--txt-3); font-size: 13.5px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

.tabs { display: flex; gap: 3px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px; min-height: 40px; border: none; border-radius: var(--r-sm);
  background: transparent; color: var(--txt-3);
  font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--txt); background: var(--surface-2); }
.tab.active { color: var(--txt); background: var(--surface-3); }
.tab .ti { display: none; width: 21px; height: 21px; flex-shrink: 0; color: var(--txt-3); }
/* "Meu perfil" vive na mesma <nav>, mas só existe na tab bar do CELULAR: no
   desktop ele já está na topright, e duplicar daria dois caminhos pro mesmo
   modal na mesma tela. */
.tab-acao { display: none; }


.view { max-width: 1400px; margin: 0 auto; padding: 26px 26px 0; }

/* Cabeçalho de tela: título grande à ESQUERDA, subtítulo explicando pra que
   serve a tela, ações à direita. É o mesmo esqueleto nas 5 abas. */
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.view-title { min-width: 0; }
.view-head h2 { font-size: 31px; font-weight: 750; letter-spacing: -.035em; line-height: 1.1; }
.view-sub { color: var(--txt-3); font-size: 14.5px; margin-top: 5px; }
.hot-mobile-sub { display: none; }
.view-acts { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.m-account { display: none; align-items: center; justify-content: space-between; gap: 12px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }

/* ============================================================
   FAIXA DE FILTROS — busca + chips + seletor, tudo na MESMA linha.
   ============================================================ */
.filterbar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-select { display: flex; flex-direction: column; gap: 5px; min-width: 168px; }
.filter-select > span { color: var(--txt-3); font-size: 11px; font-weight: 700; letter-spacing: .06em; line-height: 1; text-transform: uppercase; }
.filter-select .field.sel { width: 100%; min-width: 0; }
.filter-context { display: inline-flex; align-items: center; gap: 10px; margin: -2px 0 14px; padding: 7px 9px 7px 12px;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface-2); color: var(--txt-2); font-size: 13px; font-weight: 650; }
.filter-context button { border: 0; border-radius: 999px; background: var(--surface-3); color: var(--txt-2); padding: 4px 8px;
  font: inherit; font-size: 12px; cursor: pointer; }
.filter-context button:hover { color: var(--txt); }
.search { position: relative; flex: 1 1 340px; min-width: 260px; max-width: 460px; display: flex; align-items: center; }
.search svg { position: absolute; left: 13px; width: 18px; height: 18px; color: var(--txt-3); pointer-events: none; }
.search .field { padding-left: 40px; }
.search .field::-webkit-search-cancel-button { -webkit-appearance: none; }
.lead-filterbar .chips { flex: 1 0 100%; }
.filter-toggle.active { border-color: var(--txt-2); background: var(--surface-3); }
.lead-filter-panel { flex: 1 0 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 220px)) auto;
  align-items: end; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.lead-filter-panel .btn { align-self: end; }

.summary { color: var(--txt-3); font-size: 14px; margin: 0 0 14px; }
.summary b { color: var(--txt); font-weight: 700; }

.alerta { border: 1px solid var(--line-2); border-left: 3px solid var(--risco); background: var(--surface); border-radius: var(--r-sm); padding: 12px 16px; margin-bottom: 14px; font-size: 14px; color: var(--txt-2); }
.alerta b { color: var(--txt); }

/* ============================================================
   BLOCOS (cards de conteúdo)
   ============================================================ */
.block { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; margin-bottom: 18px; min-width: 0; }
.block-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.block-head h3 { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.block-sub { color: var(--txt-3); font-size: 13.5px; margin-top: 3px; }
.block-acts { display: flex; align-items: center; gap: 8px; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.cols2 > .block { margin-bottom: 18px; }

/* faixa de indicadores (tela Mentorados) */
.statrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 15px 17px; min-width: 0; }
.stat .k { display: block; color: var(--txt-3); font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.stat .v { display: block; font-size: 27px; font-weight: 750; letter-spacing: -.035em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat .s { display: block; color: var(--txt-3); font-size: 12.5px; margin-top: 4px; }
.stat.risco .v { color: var(--risco); }

/* valor na linha da lista (mentorado, link) */
.crow-num { flex-shrink: 0; min-width: 108px; text-align: right; font-size: 15.5px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* textarea de anotações herda o visual do campo */
textarea.field { resize: vertical; min-height: 78px; line-height: 1.45; font-family: inherit; }

/* ============================================================
   QUADRO (kanban) — portado do CRM do closer, no nosso preto e branco.
   Coluna com contador, card arrastável. Sem cor por coluna: o que separa
   é a posição, e cor aqui viraria semáforo sem significado.
   ============================================================ */
.board { display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; padding-bottom: 14px; scrollbar-width: thin; outline: none; }
.board:focus-visible, .bcol-body:focus-visible { outline: 1px solid var(--line-3); outline-offset: 2px; border-radius: 16px; }
.bcol-body { outline: none; }
.bcol { flex: 0 0 264px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px; min-width: 0; }
.bcol-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 10px; }
.bcol-t { font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; }
.bcol-n { font-size: 13px; font-weight: 700; color: var(--txt-3); background: var(--surface-3); padding: 2px 9px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.bcol-body { display: flex; flex-direction: column; gap: 8px; min-height: 90px; max-height: calc(100vh - 320px); overflow-y: auto; border-radius: 12px; padding: 2px; }
.bcol-body.sobre { background: var(--surface-2); outline: 1px dashed var(--line-3); }
.bcol-vazio, .bcol-mais { color: var(--txt-3); font-size: 12.5px; padding: 10px 6px; margin: 0; }

.bcard { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; cursor: grab; }
.bcard:hover { border-color: var(--line-2); }
.bcard:active { cursor: grabbing; }
.bcard.arrastando { opacity: .45; }
.bc-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.bc-nome { font-size: 14.5px; font-weight: 650; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-dias { font-size: 11.5px; color: var(--txt-3); white-space: nowrap; flex-shrink: 0; }
.bc-nota { font-size: 12.5px; color: var(--txt-2); margin-top: 7px; line-height: 1.4; overflow-wrap: anywhere; }
.bc-info { font-size: 12.5px; color: var(--txt-3); margin-top: 5px; font-variant-numeric: tabular-nums; }
.bc-tag { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #0b0b0c; background: #fff; padding: 2px 7px; border-radius: 999px; flex-shrink: 0; }

/* REUNIÃO — o dado mais importante do card (foi ele que tirou o telefone daqui) */
.bc-reuniao { display: flex; align-items: center; gap: 6px; margin-top: 8px;
  font-size: 13px; font-weight: 650; color: var(--txt); font-variant-numeric: tabular-nums; }
.bc-reuniao svg { width: 13px; height: 13px; flex-shrink: 0; opacity: .75; }
.bc-semdata { margin-top: 8px; }

/* CLOSER da reunião — inicial em círculo, como no CRM que ele já usava */
.bc-closer { display: flex; align-items: center; gap: 7px; margin-top: 7px; font-size: 12.5px; color: var(--txt-2); }
.bc-av { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex-shrink: 0;
  border-radius: 50%; background: var(--surface-3); border: 1px solid var(--line-2);
  font-size: 11px; font-weight: 700; color: var(--txt); }
.bc-semcloser { color: var(--txt-3); }

/* a tag que move o card entre colunas */
.bcard .statsel { width: 100%; min-width: 0; margin-top: 10px; min-height: 34px; font-size: 12.5px; }
.bc-acts { display: flex; gap: 6px; margin-top: 10px; }
.bc-acts .mini { flex: 1; justify-content: center; padding: 6px 9px; min-height: 32px; }
/* o de ícone é quadrado e não estica — o espaço é do "Ver" */
.bc-acts .mini.so-icone { flex: 0 0 36px; width: 36px; padding: 0; }

@media (max-width: 760px) {
  /* No celular não se arrasta: o card abre a gaveta e o status é um select. */
  .board { gap: 10px; }
  .bcol { flex: 0 0 84vw; }
  .bcol-body { max-height: none; }
  .bcard { cursor: default; }
}

/* ===== tela Hoje: resumo (esquerda) + clientes (direita) ===== */
.hoje { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; margin-bottom: 18px; }
.resumos-hoje { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.resumo { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.r-hero { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 20px; min-width: 0; }
.resumo .r-num { display: block; font-size: 66px; font-weight: 750; letter-spacing: -.05em; line-height: .95; font-variant-numeric: tabular-nums; }
.resumo .r-cap { display: block; font-size: 15px; font-weight: 650; letter-spacing: -.01em; margin-bottom: 5px; min-width: 0; }
.r-card-ver { margin: 0 0 14px -8px; }
.r-linhas { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.r-li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.r-li:last-child { border-bottom: none; }
.r-li .rk { color: var(--txt-2); font-size: 14.5px; flex: 1; min-width: 0; }
.r-li .rv { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.r-li.risco .rv { color: var(--risco); }
/* atalho pra tela que resolve aquele número */
.r-ver { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: none; border-radius: 7px;
  background: transparent; color: var(--txt-3); font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer; white-space: nowrap; }
.r-ver:hover { background: var(--surface-2); color: var(--txt); }

.clientes { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; min-width: 0; }
.clientes-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.clientes-head h3 { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }

/* ===== LISTA DE CLIENTES — nome e botões, só isso.
   O resto do cliente (telefone, compras, histórico, link) mora no "Ver".
   Uma lista que cabe na tela inteira vale mais que 6 campos por linha. ===== */
.clist { display: flex; flex-direction: column; }
.crow { display: flex; align-items: center; gap: 14px; padding: 12px 2px; border-bottom: 1px solid var(--line); min-width: 0; }
.crow:last-child { border-bottom: none; }
.crow-nome { flex: 1; min-width: 0; }
.crow-nome .n { font-size: 16px; font-weight: 650; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow-nome .s { display: block; color: var(--txt-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow-marca { flex-shrink: 0; }
/* STATUS DO LEAD — o campo que diz se já chamaram. Fica na própria linha
   (e não só na gaveta) porque marcar "chamei" tem que ser 1 clique, logo
   depois de abrir o WhatsApp. */
.statsel {
  flex-shrink: 0; width: auto; min-width: 132px; padding: 7px 30px 7px 11px; min-height: 36px;
  font-size: 13.5px; font-weight: 600; font-family: inherit; cursor: pointer;
  background-color: transparent; border: 1px solid var(--line-2); border-radius: 9px; color: var(--txt-2);
  -webkit-appearance: none; appearance: none; outline: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2374747e' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 15px;
}
.statsel:hover { border-color: var(--line-3); }
/* já mexeram nesse lead: fica claro sem cor, só com peso e contraste */
.statsel.mexido { color: var(--txt); border-color: var(--line-3); background-color: var(--surface-3); }
.statsel.st-novo { color: var(--risco); border-color: rgba(255, 109, 120, .32); background-color: var(--risco-bg); }
.statsel.st-chamei { color: var(--ok); border-color: rgba(103, 220, 145, .30); background-color: var(--ok-bg); }
.crow-acts { display: flex; gap: 7px; flex-shrink: 0; justify-content: flex-end; min-width: 272px; }

/* COMISSÃO na linha (abas Vendas e Receitas) — os dois números que o dono
   pediu lado a lado: em cima a GERADA (sobre o contratado), embaixo a
   LIBERADA (sobre o que já caiu). Numa coluna só, e não em duas, senão as
   ações saem da linha no notebook. */
.crow-com { flex-shrink: 0; min-width: 136px; text-align: right; font-variant-numeric: tabular-nums; }
.crow-com b { display: block; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.crow-com b.zero { color: var(--txt-3); font-weight: 600; font-size: 13.5px; }
.crow-com span { display: block; color: var(--txt-3); font-size: 12.5px; }

/* As duas listas da aba Receitas vivem em cards de MEIA tela. O min-width de
   272px das ações (dimensionado pra lista de largura cheia) comia a coluna do
   nome inteira: a pessoa sumia da própria linha e sobravam só os valores. */
#rec-closers .crow-acts, #rec-sdrs .crow-acts, #rec-usuarios .crow-acts { min-width: 0; }
#rec-closers .crow-num, #rec-sdrs .crow-num { min-width: 96px; }
#rec-closers .crow-com, #rec-sdrs .crow-com { min-width: 118px; }
#rec-usuarios .statsel { min-width: 108px; }

/* percentual padrão de cada pessoa (aba Receitas, bloco de admin) */
.pctrow { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.pctrow:last-child { border-bottom: none; }
.pctrow .pn { flex: 1; min-width: 0; font-size: 15px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pctrow .pl { display: flex; align-items: center; gap: 6px; color: var(--txt-3); font-size: 12.5px; font-weight: 600; }
.pctrow .field { width: 96px; padding: 8px 10px; min-height: 36px; text-align: right; }

@media (max-width: 760px) {
  /* no celular a linha vira duas: nome em cima, botões embaixo ocupando a largura */
  .statrow { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat .v { font-size: 23px; }
  .crow { flex-wrap: wrap; gap: 10px; }
  .crow-num { min-width: 0; text-align: left; }
  .crow-com { min-width: 0; text-align: left; }
  .crow-com b, .crow-com span { display: inline; }
  .crow-com span::before { content: " · "; }
  .crow-nome { flex: 1 1 100%; }
  .crow-acts { flex: 1 1 100%; }
  .crow-acts .mini { flex: 1; justify-content: center; }
  .statsel { width: 100%; flex: 1 1 100%; min-height: 40px; }
  .pctrow { flex-wrap: wrap; }
  .pctrow .pn { flex: 1 1 100%; }
  .pctrow .field { flex: 1; width: auto; }
  .pctrow .mini { min-height: 38px; }
}

/* ============================================================
   ESQUELETO DE CARREGAMENTO
   Cada bloco vira um fantasma COM A MESMA FORMA do que vem depois: a tela não
   pisca do preto pro conteúdo e nada pula de lugar quando os dados chegam.
   O brilho que atravessa diz que está vivo — sem ele, um retângulo cinza
   parado parece tela travada.
   ============================================================ */
.sk { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--r-sm); }
.sk::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent);
  animation: sk-brilho 1.3s ease-in-out infinite;
}
@keyframes sk-brilho { to { transform: translateX(100%); } }
.sk-wrap { display: flex; flex-direction: column; gap: 8px; }
.sk-row { height: 58px; }
.sk-li { height: 40px; }
.sk-line { height: 13px; width: 60%; border-radius: 6px; }
.sk-num { height: 58px; width: 96px; margin-bottom: 12px; }
.sk-stat { height: 96px; border: 1px solid var(--line); }
.sk-card { height: 86px; }
.board-sk { display: flex; gap: 12px; align-items: flex-start; }
.board-sk .bcol { flex: 0 0 264px; }
/* o antigo .skel (ainda no HTML inicial, antes do JS rodar) segue valendo */
.skel { height: 58px; background: var(--surface-2); border-radius: var(--r-sm); margin-bottom: 8px;
  animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .35; } 50% { opacity: .6; } }

/* ============================================================
   LISTAS — uma LINHA por registro (o que era tabela de 9 colunas).
   O grid de cada tela é definido pelo id, logo abaixo.
   ============================================================ */
.rows { display: flex; flex-direction: column; }
.row {
  display: grid; align-items: center; gap: 16px;
  padding: 14px 16px; border: 1px solid transparent; border-bottom: 1px solid var(--line);
  border-radius: var(--r-sm); min-width: 0;
}
.row:hover { background: var(--surface); border-color: var(--line); }
.row .c { min-width: 0; }
.row .c1 { font-size: 15.5px; font-weight: 650; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .c2 { color: var(--txt-3); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .num { font-size: 15.5px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.row .lbl { display: none; }
.row .acts { display: flex; gap: 7px; justify-content: flex-end; flex-wrap: wrap; }
.row.vazio, .vazio { padding: 40px 16px; text-align: center; color: var(--txt-3); font-size: 15px; display: block; border: none; }

/* ⚠️ Larguras FIXAS (nada de `auto`) nas colunas da direita. Cada .row é um
   grid próprio — com `auto`, a largura passa a depender do conteúdo DAQUELA
   linha e as colunas deixam de se alinhar entre si (um lead sem telefone
   empurrava a coluna seguinte). Só a 1ª coluna é elástica. */
#link-rows .row  { grid-template-columns: minmax(150px, 1fr) 180px 132px 148px 132px 292px; }
#venda-rows .row { grid-template-columns: minmax(170px, 1fr) 184px 136px 132px 132px 192px; }
#rec-rows .row   { grid-template-columns: 124px minmax(160px, 1fr) 92px 112px 140px 116px 176px; }

.more { display: flex; justify-content: center; padding: 18px 0 6px; }

/* ============================================================
   FUNIL / PLACAR / ATENÇÃO / FEED — o "resumo visual" da tela Hoje.
   Barras em cinza com o preenchimento branco: proporção sem cor.
   ============================================================ */
.funil { display: flex; flex-direction: column; gap: 12px; }
.fstep { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline; }
.fstep .fk { font-size: 14.5px; font-weight: 600; }
.fstep .fv { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fstep .fbar { grid-column: 1 / -1; height: 9px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.fstep .ffill { height: 100%; background: #fff; border-radius: 5px; }
.fstep .ffill.mid { background: #8e8e99; }
.fstep .ffill.low { background: #4d4d57; }
.fstep .fs { grid-column: 1 / -1; color: var(--txt-3); font-size: 12.5px; }

.placar { display: flex; flex-direction: column; gap: 11px; }
.pl-row { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; align-items: baseline; }
.pl-row .pn { font-size: 15px; font-weight: 650; }
.pl-row .pv { font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pl-row .pbar { grid-column: 1 / -1; height: 7px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.pl-row .pfill { height: 100%; background: #fff; border-radius: 4px; }
.pl-row .ps { grid-column: 1 / -1; color: var(--txt-3); font-size: 12.5px; }

.atencao { display: flex; flex-direction: column; gap: 9px; }
.at-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); min-width: 0; }
.at-item.risco { border-color: rgba(255,143,143,.3); }
.at-txt { min-width: 0; flex: 1; }
.at-t { font-size: 15px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.at-s { color: var(--txt-3); font-size: 13px; margin-top: 1px; }

.feed { display: flex; flex-direction: column; }
.fd-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.fd-item:last-child { border-bottom: none; }
.fd-txt { min-width: 0; flex: 1; }
.fd-t { font-size: 15px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-s { color: var(--txt-3); font-size: 13px; }
.fd-v { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ============================================================
   GAVETA DO LEAD
   ============================================================ */
.drawer { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: flex-end; overflow: hidden; }
.drawer-bg { position: absolute; inset: 0; background: rgba(0,0,0,.6); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.drawer-box {
  position: relative; width: min(480px, 100%); max-width: 100vw; min-width: 0; height: 100%; overflow-x: hidden; overflow-y: auto;
  background: var(--surface); border-left: 1px solid var(--line);
  padding: 24px 24px calc(24px + env(safe-area-inset-bottom));
  animation: slide-in .22s cubic-bezier(.32,.72,0,1); overscroll-behavior-x: none; touch-action: pan-y;
}
@keyframes slide-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.drawer-head h2 { font-size: 25px; font-weight: 750; letter-spacing: -.03em; overflow-wrap: anywhere; }
.drawer-head, .drawer-acts, .dw-sec, .dw-form, .dw-kv, .dw-list { max-width: 100%; min-width: 0; }
.drawer-box input, .drawer-box textarea, .drawer-box select { width: 100%; max-width: 100%; min-width: 0; }
.drawer-sub { color: var(--txt-3); font-size: 14px; margin-top: 4px; }
.drawer-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.drawer-acts .mini { flex: 1 1 auto; justify-content: center; min-height: 42px; }
.dw-sec { margin-bottom: 22px; }
.dw-sec .statsel { width: 100%; min-height: 42px; }
.dw-botoes { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
/* pergunta do Google Agenda: aparece embaixo da reunião recém-salva */
.gcal { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px;
  padding: 11px 13px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); }
.gcal span { font-size: 14px; color: var(--txt); flex: 1; min-width: 140px; }
.dw-sec h4 { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--txt-3); margin-bottom: 10px; }
.dw-kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 15px; }
.dw-kv dt { color: var(--txt-3); white-space: nowrap; }
.dw-kv dd { min-width: 0; text-align: right; overflow-wrap: anywhere; word-break: break-word; font-weight: 600; }
.dw-form { padding: 15px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r); }
.dw-resposta { margin: 14px 0 12px; padding: 12px 13px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); }
.dw-resposta span { display: block; color: var(--txt-3); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.dw-resposta p { color: var(--txt); font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.dw-list { display: flex; flex-direction: column; gap: 8px; }
.dw-li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 14.5px; }
.dw-li .s { color: var(--txt-3); font-size: 13px; }

/* ============================================================
   MODAIS
   ============================================================ */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.66); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 70; }
.modal-box { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px 26px; width: 100%; max-width: 620px; max-height: 88vh; overflow-y: auto; }
.modal-box.narrow { max-width: 440px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.modal-title { font-size: 22px; font-weight: 750; letter-spacing: -.025em; }
.modal-box p { line-height: 1.5; }
.modal-box .field { margin-bottom: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.modal-actions .btn { min-width: 128px; }
.flabel { display: block; color: var(--txt-2); font-size: 13.5px; font-weight: 600; margin: 0 0 6px; }
.flabel.mt { margin-top: 6px; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.lf-advanced { margin: 2px 0 6px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.lf-advanced > summary { padding: 13px 14px; color: var(--txt-2); font-size: 14px; font-weight: 650; cursor: pointer; list-style: none; }
.lf-advanced > summary::-webkit-details-marker { display: none; }
.lf-advanced > summary::after { content: "+"; float: right; color: var(--txt-3); font-size: 18px; line-height: 16px; }
.lf-advanced[open] > summary::after { content: "−"; }
.lf-advanced[open] > summary { color: var(--txt); border-bottom: 1px solid var(--line); }
.lf-advanced .fgrid { padding: 14px 14px 0; }
.lf-advanced .fgrid.one { grid-template-columns: 1fr; }
.lf-advanced .hint { margin: -2px 14px 14px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 6px 0 4px; }
.chk { display: inline-flex; align-items: center; gap: 9px; font-size: 14.5px; color: var(--txt-2); cursor: pointer; min-height: 38px; }
.chk.mt { margin-top: 6px; width: 100%; }
.chk input { width: 19px; height: 19px; accent-color: #fff; cursor: pointer; flex-shrink: 0; }
.chk b { color: var(--txt); }

/* aviso de venda no celular — bloco próprio dentro do "Meu perfil", separado
   por uma linha porque é escolha DESTE aparelho, não do painel. */
.pushbox { margin-top: 2px; padding-top: 0; }
.pushbox-t { font-size: 15px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 6px; }
.pushbox .hint { margin: 0 0 12px; }
.pushbox-acts { display: flex; flex-wrap: wrap; gap: 10px; }
.pushbox-acts .btn { min-width: 0; }

/* o lead que originou o link, fixado no topo do formulário */
.leadchip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); margin-bottom: 16px; }
.leadchip .lk-n { font-size: 15.5px; font-weight: 700; }
.leadchip .lk-s { color: var(--txt-3); font-size: 13px; }

.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); padding: 13px 22px; border-radius: 12px; font-size: 15px; font-weight: 600; z-index: 90; max-width: 92vw; text-align: center;
  border: 1px solid var(--line-2); background: #ececf0; color: #0b0b0c; box-shadow: 0 12px 32px rgba(0,0,0,.5); }
.toast.err { background: #2a1618; color: var(--risco); border-color: rgba(255,143,143,.35); }

/* O formulário de link abre como GAVETA à direita, não como caixa no meio da
   tela: ele é longo (oferta, valor, atribuição, cliente, validade, plano) e no
   centro tapava a lista de onde o closer acabou de sair. */
@media (min-width: 761px) {
  .modal-overlay.as-drawer { align-items: stretch; justify-content: flex-end; padding: 0; }
  .modal-overlay.as-drawer .modal-box {
    width: min(520px, 100%); max-width: none; height: 100%; max-height: none;
    border-radius: 0; border: none; border-left: 1px solid var(--line);
    padding: 24px 26px 32px; animation: slide-in .22s cubic-bezier(.32,.72,0,1);
  }
}

/* ============================================================
   TABLET (<= 1080px) — 2 colunas viram 1, listas encolhem colunas.
   ============================================================ */
@media (max-width: 1080px) {
  .cols2, .hoje { grid-template-columns: 1fr; }
  .resumo .r-num { font-size: 52px; }
  .topbar-in, .view { padding-left: 20px; padding-right: 20px; }
  #link-rows .row  { grid-template-columns: minmax(150px, 1fr) 132px 148px 130px 236px; }
  #link-rows .row .c-oferta { display: none; }
  #venda-rows .row { grid-template-columns: minmax(150px, 1fr) 132px 128px 126px 184px; }
  #venda-rows .row .c-oferta { display: none; }
  #rec-rows .row   { grid-template-columns: 116px minmax(150px, 1fr) 88px 108px 112px 172px; }
  #rec-rows .row .c-origem { display: none; }
}
@media (max-width: 760px) { #rec-rows .row .c-origem { display: block; } }

/* ============================================================
   CELULAR / PWA (<= 760px)
   A nav do topo vira tab bar de rodapé (a MESMA <nav>, reposicionada) e cada
   linha de lista vira cartão. Fontes NÃO encolhem — é o mesmo tamanho de leitura
   do desktop, que era o pedido: sem zoom pra ler telefone.
   ============================================================ */
@media (max-width: 760px) {
  /* a tab bar é fixa no rodapé: este respiro é o que impede a última linha da
     lista de nascer escondida atrás dela. Cresceu junto com a barra (60→72px). */
  #app { padding-bottom: calc(env(safe-area-inset-bottom) + 106px); }
  .view { padding: calc(env(safe-area-inset-top) + 12px) 13px 0; }
  .card { margin: calc(env(safe-area-inset-top) + 6vh) auto 6vh; width: calc(100% - 28px); padding: 28px 22px calc(28px + env(safe-area-inset-bottom)); }

  .topbar { position: fixed; inset: auto 0 0 0; top: auto; border-bottom: none; border-top: 1px solid var(--line);
    box-shadow: 0 -10px 28px rgba(0,0,0,.32); }
  .topbar-in { padding: 7px 0 calc(5px + env(safe-area-inset-bottom)); gap: 0; }
  .brand-txt, .topright { display: none; }

  /* TAB BAR QUE ROLA.
     Antes os destinos dividiam a largura da tela (flex:1) — com 10 deles, cada
     um ficava com ~39px: ícone minúsculo, rótulo de 10,5px e alvo de dedo menor
     que os 44px que a Apple recomenda. Agora cada item tem largura FIXA e
     confortável, e a barra rola na horizontal.
     A largura de 76px é escolhida pra o próximo item ficar ESPIANDO na borda em
     qualquer celular comum — é esse pedaço cortado que conta pro dedo que dá
     pra arrastar. Sem ele, ninguém descobre que existe mais coisa. */
  /* Rolagem LIVRE, sem scroll-snap: numa barra de 10 destinos o snap por item
     briga com o ajuste pequeno do dedo (a pessoa quer espiar o próximo, o
     navegador recentraliza). É o comportamento das tab bars roláveis por aí. */
  .tabs {
    width: 100%; gap: 2px; padding-inline: 6px;
    overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;   /* não deixa a rolagem vazar pra página */
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab {
    flex: 0 0 auto; width: 76px;
    flex-direction: column; gap: 4px; align-items: center; justify-content: center;
    padding: 7px 3px; min-height: 60px;
    font-size: 11px; font-weight: 600; letter-spacing: -.01em; border-radius: 14px;
  }
  .tab:hover { background: none; }
  /* Agora que o item é uma pílula de largura fixa, o fundo do ativo volta a
     fazer sentido (é o mesmo que o desktop faz) — na barra antiga, coladinha de
     ponta a ponta, ele ficava pesado. */
  .tab.active { color: var(--txt); background: var(--surface-2); }
  .tab.active .ti { color: var(--txt); }
  .tab .ti { display: block; width: 25px; height: 25px; }
  .tab .tl { display: none; }
  .tab::after { content: attr(data-short); }
  .tab:active .ti { transform: scale(.9); }
  .tab-acao { display: inline-flex; }

  .view-head { align-items: center; flex-wrap: nowrap; gap: 10px; margin-bottom: 16px; }
  .view-title { flex: 1; }
  .view-head h2 { font-size: 27px; }
  .view-sub { font-size: 13.5px; line-height: 1.4; }
  .view-acts { width: auto; max-width: 52%; flex-wrap: wrap; justify-content: flex-end; }
  .view-acts .btn { min-height: 44px; padding-inline: 13px; }
  .view-acts .field.sel { width: 100%; min-width: 0; }

  .filterbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 10px; }
  .filterbar > .search { grid-column: 1 / -1; width: 100%; min-width: 0; max-width: none; }
  .filterbar > .field.sel, .filterbar > .filter-select { width: 100%; min-width: 0; }
  .filter-select > span { padding-left: 2px; }
  .field.sel { width: 100%; min-width: 0; }
  /* a régua de chips rola na horizontal; sem min-width:0 ela empurra a página */
  .filterbar > .chips { grid-column: 1 / -1; }
  #view-leads .lead-filterbar { grid-template-columns: minmax(0, 1fr) auto; }
  #view-leads .lead-filterbar > .search { grid-column: 1; }
  #view-leads .lead-filterbar > .filter-toggle { grid-column: 2; min-height: 44px; }
  #view-leads .lead-filterbar > .lead-filter-panel { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; width: 100%; }
  #view-leads .lead-filter-panel > .btn { grid-column: 1 / -1; width: 100%; }
  #view-leads .lead-filterbar > .chips { grid-column: 1 / -1; }
  .chips { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; width: 100%; min-width: 0; padding: 1px 1px 3px; }
  .chips::-webkit-scrollbar { display: none; }
  .chip, .seg-b { min-height: 44px; }

  /* TOPO MOBILE COMPARTILHADO
     Formulários virou a régua das telas operacionais: título + ação compactos,
     sem explicação redundante, e os controles já na primeira dobra. A classe
     vive só nas views que seguem essa hierarquia; o desktop continua intacto. */
  .mobile-form-top .view-head { margin-bottom: 12px; }
  .mobile-form-top .view-sub,
  .mobile-form-top > .summary { display: none; }
  .mobile-form-top .view-acts .btn {
    min-height: 38px; padding: 7px 11px; font-size: 13px;
  }
  .mobile-form-top .filterbar { margin-bottom: 10px; gap: 8px; }
  .mobile-form-top .filterbar > .field.sel {
    min-height: 42px; min-width: 0; padding: 7px 28px 7px 10px; font-size: 13px;
  }
  .mobile-form-top .filterbar > .chips {
    align-self: stretch; gap: 5px; padding-bottom: 0;
  }
  .mobile-form-top .filterbar > .chips .chip {
    min-height: 42px; padding: 6px 10px; font-size: 12.5px;
  }

  /* Busca em cima; pessoa/status na mesma faixa logo abaixo, como em Forms. */
  #view-formularios .filterbar { grid-template-columns: 145px minmax(0, 1fr); }
  #view-formularios .filterbar > .search { grid-column: 1 / -1; }
  #view-formularios #formulario-status { grid-column: 1; min-height: 42px; padding-left: 10px; font-size: 13px; }
  #view-formularios #formulario-dias { grid-column: 2; align-self: stretch; gap: 5px; padding-bottom: 0; }
  #view-formularios #formulario-dias .chip { flex: 1 1 0; min-width: 0; min-height: 42px; padding: 6px 7px; font-size: 12px; }

  #view-briefings #briefing-dias .chip { flex: 1 1 0; min-width: 0; }

  #view-links .filterbar { grid-template-columns: 145px minmax(0, 1fr); }
  #view-links .filterbar > .search { grid-column: 1 / -1; }
  #view-links #link-pessoa { grid-column: 1; }
  #view-links #link-chips { grid-column: 2; }

  #view-quadro .filterbar { grid-template-columns: 145px minmax(0, 1fr); }
  #view-quadro .filterbar > .search { grid-column: 1 / -1; }
  #view-quadro #quadro-pessoa { grid-column: 1; }

  /* Vendas tem três recortes além do status. Cabem numa única faixa sem
     transformar cada select numa linha inteira. */
  #view-vendas .filterbar { grid-template-columns: 110px repeat(2, minmax(0, 1fr)); }
  #view-vendas .filterbar > .search { grid-column: 1 / -1; }
  #view-vendas #venda-periodo { grid-column: 1; }
  #view-vendas #venda-closer { grid-column: 2; }
  #view-vendas #venda-sdr { grid-column: 3; }
  #view-vendas #venda-chips { grid-column: 1 / -1; }
  #view-vendas .filterbar > .field.sel { padding-left: 8px; padding-right: 25px; font-size: 12px; }

  /* Filtros vêm antes dos números: primeiro a pessoa escolhe o recorte, depois
     lê a faixa de resultado. O DOM não muda e o desktop conserva sua ordem. */
  #view-vendas:not(.hidden), #view-mentorados:not(.hidden) {
    display: flex; flex-direction: column;
  }
  #view-vendas > .view-head, #view-mentorados > .view-head { order: 1; }
  #view-vendas > .filterbar, #view-mentorados > .filterbar { order: 2; }
  #view-vendas > .statrow, #view-mentorados > .statrow { order: 3; }
  #view-vendas > .summary, #view-mentorados > .summary { order: 4; }
  #view-vendas > .clist, #view-mentorados > .clist { order: 5; }

  /* A barra de indicadores deixa de ocupar duas ou três telas: cartões curtos,
     em uma régua horizontal que preserva todos os números. */
  .mobile-form-top > .statrow {
    display: flex; gap: 8px; overflow-x: auto; width: 100%;
    margin-bottom: 10px; padding: 0 1px 2px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .mobile-form-top > .statrow::-webkit-scrollbar { display: none; }
  .mobile-form-top > .statrow .stat {
    flex: 0 0 136px; min-height: 72px; padding: 10px 12px; border-radius: 12px;
  }
  .mobile-form-top > .statrow .stat .k { margin-bottom: 3px; font-size: 11.5px; }
  .mobile-form-top > .statrow .stat .v { font-size: 20px; }
  .mobile-form-top > .statrow .stat .s { margin-top: 2px; font-size: 11px; }

  /* Receitas não tem busca. No mobile, o período vira a segunda faixa e o
     Atualizar fica alinhado ao título — exatamente a anatomia de Forms. */
  #view-receitas .view-head {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    align-items: center; gap: 8px 10px;
  }
  #view-receitas .view-title { grid-column: 1; grid-row: 1; }
  #view-receitas .view-acts { display: contents; }
  #view-receitas #rec-refresh { grid-column: 2; grid-row: 1; }
  #view-receitas #rec-periodo {
    grid-column: 1 / -1; grid-row: 2; width: 100%; min-width: 0;
    min-height: 42px; padding: 7px 30px 7px 10px; font-size: 13px;
  }

  #lead-rows .crow, #formulario-rows .crow {
    gap: 7px 10px; padding: 11px 12px; margin-bottom: 7px; border-radius: 12px;
  }
  #lead-rows .crow-nome, #formulario-rows .crow-nome { grid-column: 1 / -1; }
  #lead-rows .crow-nome .n, #formulario-rows .crow-nome .n { font-size: 15.5px; line-height: 1.2; }
  #lead-rows .crow-nome .s, #formulario-rows .crow-nome .s { font-size: 12px; line-height: 1.25; }
  #lead-rows .crow-marca, #formulario-rows .crow-marca { display: none; }
  #lead-rows .statsel, #formulario-rows .statsel {
    grid-column: 1 / -1; grid-row: auto; min-height: 36px; padding: 5px 28px 5px 10px; font-size: 12.5px;
  }
  #lead-rows .crow-acts, #formulario-rows .crow-acts { grid-column: 1 / -1; display: grid; gap: 6px; }
  #lead-rows .crow-acts { grid-template-columns: minmax(126px, 1.65fr) repeat(2, minmax(0, 1fr)); }
  #formulario-rows .crow-acts { grid-template-columns: minmax(122px, 1.75fr) repeat(3, minmax(0, 1fr)); }
  #lead-rows .crow-acts .mini, #formulario-rows .crow-acts .mini {
    grid-column: auto; min-height: 35px; padding: 5px 6px; font-size: 11.5px;
  }
  #lead-rows .crow-acts .mini.strong:first-child, #formulario-rows .crow-acts .mini.strong:first-child { grid-column: auto; }
  #lead-rows .crow-acts .mini svg, #formulario-rows .crow-acts .mini svg { width: 13px; height: 13px; }

  .hoje, .cols2 { gap: 12px; margin-bottom: 12px; }
  .resumos-hoje { gap: 12px; }
  .block, .resumo { padding: 16px; border-radius: var(--r); margin-bottom: 12px; }
  .r-hero { align-items: center; gap: 12px; margin-bottom: 14px; }
  .resumo .r-num { font-size: 52px; }
  .resumo .r-cap { margin: 0; font-size: 14.5px; line-height: 1.3; }
  .r-li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; min-height: 48px; padding: 8px 0; }
  .r-li .rk { line-height: 1.25; }
  .r-ver { min-height: 36px; padding: 6px 8px; }
  .r-card-ver { width: 100%; justify-content: center; min-height: 40px; margin: -2px 0 12px; background: var(--surface-2); }

  /* A lista quente já tem cartões próprios; retirar o cartão externo economiza
     duas bordas e deixa as ações respirarem na largura inteira do iPhone. */
  .clientes { padding: 0; border: none; border-radius: 0; background: transparent; }
  .clientes-head { display: block; margin: 0 2px 10px; }
  .clientes-head .block-acts { display: grid; grid-template-columns: 1fr; gap: 8px; width: 100%; margin-top: 12px; }
  .clientes-head .seg { display: flex; width: 100%; }
  .clientes-head .seg-b { flex: 1; }
  .clientes-head .btn { width: 100%; min-height: 44px; }

  /* Toda lista vira um cartão previsível: identidade no topo, contexto no meio
     e uma grade de ações embaixo. Assim WhatsApp, Link e Ver nunca espremem o
     nome nem criam alvos de toque estreitos. */
  .crow {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px;
    padding: 14px; margin-bottom: 10px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  }
  .crow:last-child { border-bottom: 1px solid var(--line); }
  .crow-nome { grid-column: 1 / 2; min-width: 0; }
  .crow-nome .n { font-size: 16.5px; white-space: normal; overflow-wrap: anywhere; }
  .crow-nome .s { margin-top: 2px; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
  .crow-marca { grid-column: 2 / 3; justify-self: end; align-self: start; }
  .crow-num { grid-column: 1 / 2; grid-row: 2; min-width: 0; text-align: left; align-self: center; }
  .crow-com { grid-column: 2 / 3; grid-row: 2; min-width: 0; text-align: right; align-self: center; }
  .crow-com b, .crow-com span { display: block; }
  .crow-com span::before { content: none; }
  .statsel { grid-column: 1 / -1; grid-row: 2; width: 100%; min-width: 0; min-height: 44px; padding-left: 13px; }
  .crow-acts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; min-width: 0; }
  .crow-acts .mini { width: 100%; min-width: 0; min-height: 44px; justify-content: center; padding-inline: 9px; }
  .crow-acts .mini.strong:first-child { grid-column: 1 / -1; }
  .crow-acts .mini.so-icone { width: 44px; min-width: 44px; justify-self: end; }
  #quentes .crow { background: var(--surface); }
  .leadgrid { grid-template-columns: 1fr; }

  /* --- linhas viram cartões --- */
  .row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
    padding: 15px; margin-bottom: 10px;
  }
  #lead-rows .row, #link-rows .row, #venda-rows .row, #rec-rows .row { grid-template-columns: 1fr 1fr; }
  #link-rows .row .c-oferta, #venda-rows .row .c-oferta { display: block; }
  .row .lbl { display: block; color: var(--txt-3); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 3px; }
  .row .c-wide { grid-column: 1 / -1; }
  .row .c1 { white-space: normal; overflow-wrap: anywhere; }
  .row .c2 { white-space: normal; overflow-wrap: anywhere; }
  .row .acts { grid-column: 1 / -1; justify-content: flex-start; }
  .row .acts .mini { flex: 1 1 auto; justify-content: center; min-height: 42px; }
  .row:hover { background: var(--surface); }

  .drawer-box { width: 100%; height: auto; max-height: 94vh; max-height: 94dvh; margin-top: auto; border-left: none; border-top: 1px solid var(--line-2);
    border-radius: 22px 22px 0 0; padding: 20px 16px calc(22px + env(safe-area-inset-bottom));
    overflow-x: hidden; overscroll-behavior: contain; overscroll-behavior-x: none; touch-action: pan-y;
    -webkit-overflow-scrolling: touch; animation: sheet-up .24s cubic-bezier(.32,.72,0,1); }
  .drawer { align-items: flex-end; }
  .drawer-box::before { content: ""; display: block; width: 38px; height: 4px; border-radius: 2px; background: var(--line-3); margin: -8px auto 16px; }
  @keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-box { max-width: none; max-height: 94vh; max-height: 94dvh; border-radius: 22px 22px 0 0; padding: 22px 16px calc(22px + env(safe-area-inset-bottom)); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; animation: sheet-up .24s cubic-bezier(.32,.72,0,1); }
  .modal-box::before { content: ""; display: block; width: 38px; height: 4px; border-radius: 2px; background: var(--line-3); margin: -8px auto 16px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }
  .fgrid { grid-template-columns: 1fr; gap: 0; }

  .dw-kv { grid-template-columns: 1fr; gap: 2px; }
  .dw-kv dd { text-align: left; margin-bottom: 8px; }
  .drawer-head .icon-btn { width: 44px; height: 44px; }

  .toast { bottom: calc(env(safe-area-inset-bottom) + 96px); }
  .m-account { display: grid; grid-template-columns: 1fr 1fr; }
  .m-account .who { grid-column: 1 / -1; white-space: normal; overflow-wrap: anywhere; }
  .m-account .btn { width: 100%; min-height: 44px; }
}

/* dentro do PWA instalado: sem seleção de texto acidental ao arrastar */
@media (display-mode: standalone) {
  body { -webkit-user-select: none; user-select: none; }
  .field, input, textarea, .row .c1, .row .c2, .crow-nome, .msg, .dw-kv dd { -webkit-user-select: text; user-select: text; }
}

/* ============================================================
   NAV VERTICAL (>= 761px) — a barra vira coluna à esquerda, com ícone
   cinza ao lado do nome. Mesmo DOM do celular: lá o CSS joga a mesma <nav>
   pro rodapé como tab bar. Um só listener no app.js.
   ============================================================ */
@media (min-width: 761px) {
  .topbar {
    position: fixed; inset: 0 auto 0 0; width: 234px; z-index: 40;
    border-bottom: none; border-right: 1px solid var(--line); background: var(--bg);
  }
  .topbar-in {
    flex-direction: column; align-items: stretch; gap: 10px;
    height: 100%; max-width: none; padding: 22px 14px 18px;
  }
  .brand-txt { font-size: 18px; padding: 0 10px 6px; }
  .tabs { flex-direction: column; gap: 2px; width: 100%; overflow: visible; }
  .tab { width: 100%; justify-content: flex-start; gap: 11px; padding: 10px 12px; min-height: 44px; font-size: 15px; }
  .tab .ti { display: block; }
  .tab:hover .ti { color: var(--txt-2); }
  .tab.active .ti { color: var(--txt); }
  /* conta e sair descem pro pé da coluna */
  .topright { margin-left: 0; margin-top: auto; flex-direction: column; align-items: stretch; gap: 8px;
    padding-top: 14px; border-top: 1px solid var(--line); }
  .topright .who { max-width: none; white-space: normal; overflow-wrap: anywhere; padding: 0 10px; }
  .topright .btn { width: 100%; }

  /* o conteúdo encosta na coluna e continua alinhado à ESQUERDA */
  .view { margin: 0 auto 0 234px; max-width: 1320px; padding: 26px 30px 0; }
}

/* ============================================================
   HOME COMPACTA DO PWA — a primeira dobra é trabalho, o resumo vem depois.
   ============================================================ */
@media (max-width: 760px) {
  .login-screen { padding-inline: 14px; }
  .login-screen .login-card { width: 100%; margin: 0; padding: 20px 21px; }
  .login-logo { width: 122px; height: 122px; margin-top: -14px; }
  .pin-keypad { gap: 10px 16px; }
  .pin-keypad button { width: 58px; height: 58px; font-size: 24px; }

  /* A área de decisão começa mais abaixo: título, contexto e janela de tempo
     viram um único bloco grande, alcançável com uma mão. */
  #view-painel { padding-top: calc(env(safe-area-inset-top) + clamp(20px, 3vh, 26px)); }
  #view-painel .view-head { display: block; margin-bottom: 12px; }
  #view-painel .view-title { width: 100%; }
  #view-painel .view-head h2 { font-size: 30px; line-height: 1.05; white-space: nowrap; letter-spacing: -.04em; }
  #view-painel .hot-mobile-sub { display: block; margin-top: 5px; color: var(--txt-3); font-size: 13px; }
  #view-painel .view-sub { display: none; }
  #view-painel .task-acts { width: 100%; max-width: none; margin: 12px 0 0; }
  #view-painel .task-acts .seg { display: flex; width: 100%; padding: 3px; gap: 3px; }
  #view-painel .task-acts .seg-b { flex: 1; min-height: 42px; padding: 7px 12px; font-size: 13.5px; }
  #painel-refresh { display: none; }

  #view-painel .hoje { display: flex; flex-direction: column; align-items: stretch; gap: 10px; width: 100%; }
  #view-painel .clientes { order: 1; width: 100%; max-width: none; }
  #view-painel .resumos-hoje { order: 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
  #view-painel .resumo { padding: 12px; margin-bottom: 0; }
  #view-painel .resumo .r-hero { display: block; margin-bottom: 9px; }
  #view-painel .resumo .r-num { font-size: 34px; line-height: 1; }
  #view-painel .resumo .r-cap { margin-top: 4px; font-size: 12px; line-height: 1.25; }
  #view-painel .resumo .r-li { grid-template-columns: minmax(0, 1fr) auto; min-height: 36px; padding: 5px 0; }
  #view-painel .resumo .r-li:nth-child(n+2) { display: none; }
  #view-painel .resumo .rk { font-size: 12px; }
  #view-painel .resumo .rv { font-size: 14px; }
  #view-painel .resumo .r-ver { display: none; }
  #view-painel .resumo .r-card-ver { min-height: 30px; margin: 0 0 7px; font-size: 12px; }

  #view-painel .clientes-head { display: none; }

  #view-painel > .cols2 { display: none; }

  /* Mesma hierarquia da Base: identidade, status largo e ações numa faixa.
     O WhatsApp fica à direita, preservando o alcance pedido para esta tela. */
  #quentes .lead-compact {
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px;
    width: 100%; padding: 11px 12px; margin: 0 0 7px; border: 1px solid var(--line);
    border-radius: 12px; background: var(--surface);
  }
  #quentes .lead-compact:last-child { border-bottom: 1px solid var(--line); margin-bottom: 0; }
  #quentes .lead-compact .crow-nome { grid-column: 1; min-width: 0; margin: 0; }
  #quentes .lead-compact .crow-nome .n { font-size: 15.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #quentes .lead-compact .crow-nome .s { display: block; margin-top: 2px; font-size: 12px; line-height: 1.25; color: var(--txt-3); }
  #quentes .lead-compact .crow-acts {
    grid-column: 1; display: grid; grid-template-columns: minmax(126px, 1.65fr) repeat(2, minmax(0, 1fr));
    gap: 6px; width: 100%; min-width: 0;
  }
  #quentes .lead-compact .crow-acts .statsel {
    grid-column: 1 / -1; grid-row: 1; width: 100%; min-width: 0; min-height: 36px;
    padding: 5px 28px 5px 10px; font-size: 12.5px;
  }
  #quentes .lead-compact .crow-acts .mini {
    width: 100%; min-width: 0; min-height: 35px;
    padding: 5px 8px; justify-content: center; font-size: 12px;
  }
  #quentes .lead-compact .crow-acts .mini svg { width: 14px; height: 14px; }
  #quentes .lead-compact .crow-acts .mini.strong:first-child { grid-column: auto; }
  #quentes .lead-compact .crow-acts [data-whats],
  #quentes .lead-compact .crow-acts [data-novolink],
  #quentes .lead-compact .crow-acts [data-lead] { grid-row: 2; }
}
