:root {
    --bg: #f5f4f0;
    --surface: #ffffff;
    --sidebar-bg: #fbfaf7;
    --border: #eceae4;
    --text: #2b2b2b;
    --text-muted: #8a887f;
    /* Paleta da marca MinhaCirurgia */
    --primary: #221C59;        /* azul-marinho */
    --primary-soft: #ecebf4;
    --accent-orange: #EC8A2E;  /* laranja */
    --accent-purple: #8E2C6E;  /* roxo/magenta */
    --accent-navy: #221C59;    /* azul-marinho */
    --danger: #c0492f;
    --radius: 14px;
    --shadow: 0 1px 3px rgba(0,0,0,.05), 0 6px 20px rgba(0,0,0,.03);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}

/* ---------- Shell ---------- */
.admin-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 248px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    position: sticky;
    top: 0;
    /* 100vh primeiro como reserva para navegador antigo; 100dvh vence onde existir.
       No Safari do iPhone, 100vh e calculado COMO SE as barras do navegador estivessem
       escondidas - fica maior que a area visivel, e o fim do menu some atras da barra
       inferior. Com dez itens e submenus abertos, os ultimos ficam inalcancaveis.
       O dvh acompanha a altura real. No Android o 100vh ja se comporta bem. */
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px 16px;
}
.brand img { max-width: 168px; height: auto; display: block; }

.earnings-badge {
    background: #fff7e0;
    border: 1px solid #f0e2b6;
    color: #8a6d1a;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12.5px;
    margin-bottom: 14px;
}
.earnings-badge strong { display: block; font-size: 15px; color: #6b5310; }

.nav { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.nav a {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 11px; border-radius: 10px;
    color: var(--text); text-decoration: none;
    font-size: 13.5px;
}
.nav a:hover { background: #f0eee8; }
.nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
/* Os ícones do menu são SVG de traço (ver Views/Shared/_Icone.cshtml), não mais
   caractere de fonte nem emoji. currentColor faz o desenho acompanhar a cor do item:
   cinza quando inativo, cor da marca quando ativo — o que emoji nunca permitiu. */
/* Os desenhos de Views/Shared/_Icone.cshtml.
   O tamanho vem do font-size do recipiente — exatamente como acontecia com o
   emoji que eles substituiram. Isso importa porque cada lugar do sistema ja
   estava calibrado para segurar um glifo: o heroi tem font-size 44px, o botao
   de acao 16px, a linha de contato 11.5px. Herdando, tudo continua calibrado
   sem precisar de uma regra por tela. Quem quer medida fixa sobrescreve. */
.ico { width: 1em; height: 1em; vertical-align: -.14em; flex-shrink: 0; }

/* Icone que prefixa um rotulo curto (linha de contato, etiqueta de canal):
   um tico maior que a letra e mais claro, para nao competir com o texto. */
.ref-sub .ico, .nps-canal-tag .ico, .ft-label .ico, .per-pill .ico { width: 1.2em; height: 1.2em; opacity: .75; margin-right: 2px; }

/* Caixa de aviso: o desenho fica no alto, alinhado com a primeira linha,
   e nao no meio de um paragrafo de tres linhas. */
.imp-hint, .em-notice, .warn-box { }
.imp-hint .ico, .em-notice .ico, .warn-box .ico { width: 1.25em; height: 1.25em; vertical-align: -.22em; margin-right: 4px; }

/* Botao que so tem desenho: o alvo de toque e do botao, o desenho so preenche. */
.act-btn .ico, .int-copy .ico, .lm-close .ico, .int-row-del .ico { width: 1.15em; height: 1.15em; vertical-align: -.18em; }

.nav .ico { width: 18px; height: 18px; flex-shrink: 0; opacity: .75; }
.nav a.active .ico, .nav-details > summary.active .ico { opacity: 1; }
.nav a .badge-count {
    margin-left: auto; background: #eceae4; color: var(--text-muted);
    border-radius: 20px; font-size: 11px; padding: 1px 8px;
}
.nav-sep { height: 1px; background: var(--border); margin: 10px 4px; }

/* Submenu (Recompensas) */
.nav-details > summary { list-style: none; display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px; font-size: 13.5px; cursor: pointer; color: var(--text); }
.nav-details > summary::-webkit-details-marker { display: none; }
.nav-details > summary:hover { background: #f0eee8; }
.nav-details > summary.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-caret { margin-left: auto; display: inline-flex; opacity: .5; transition: transform .18s ease; }
.nav-caret .ico { width: 14px; height: 14px; opacity: 1; }
.nav-details[open] .nav-caret { transform: rotate(180deg); }
.subnav { list-style: none; padding: 2px 0 4px 26px; margin: 0; display: flex; flex-direction: column; gap: 1px; border-left: 2px solid var(--border); margin-left: 18px; }
.subnav a { display: block; padding: 7px 10px; border-radius: 8px; font-size: 12.5px; color: var(--text-muted); text-decoration: none; }
.subnav a:hover { background: #f0eee8; color: var(--text); }
.subnav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

/* ---------- Main ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
    height: 60px; background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 16px;
    padding: 0 24px;
    position: sticky; top: 0; z-index: 5;
}
.topbar .ticker { color: var(--text-muted); font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; flex: 1; }
.topbar .user { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.topbar .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-orange); color: #fff; display: grid; place-items: center; }

/* max-width existe para texto e tabela nao ficarem largos demais de ler, mas 1240px
   sobrava muito espaco em monitor grande: 248px da barra lateral + 1240px param em
   1488px, deixando ~400px vazios numa tela de 1900px. E, sem margin auto, essa sobra
   ficava TODA a direita, o que parece pagina quebrada em vez de respiro proposital.
   1560px aproveita o monitor sem virar linha longa demais, e o auto centraliza o que sobrar. */
.content { padding: 26px 28px; max-width: 1560px; width: 100%; margin-inline: auto; }
.page-title { font-size: 24px; font-weight: 700; margin: 0 0 2px; }
.page-sub { color: var(--text-muted); margin: 0 0 20px; }

/* Botões */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 9px; font-size: 13.5px; font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid transparent; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { filter: brightness(1.12); }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: #f4f2ec; }

/* Cabeçalho de página com ação */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head .page-title, .page-head .page-sub { margin: 0; }
.page-head .page-sub { margin-top: 2px; }
.btn.sm { padding: 5px 12px; font-size: 12.5px; }
.toast-ok { background: #e7f4ec; color: #2e8b57; border: 1px solid #bfe3cd; border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-size: 13.5px; }

/* Tabela genérica */
table.table { width: 100%; border-collapse: collapse; }
table.table th, table.table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
table.table th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .02em; }
table.table td.num, table.table th.num { text-align: right; }
table.table .sub { color: var(--text-muted); font-size: 11.5px; }
table.table tr:last-child td { border-bottom: none; }
.empty { color: var(--text-muted); text-align: center; padding: 30px 0; }

/* ================= Wizard de campanha ================= */
.wizard-body { background: var(--bg); min-height: 100vh; margin: 0; }
.wizard-header { background: var(--primary); color: #fff; padding: 14px 26px; display: flex; align-items: center; justify-content: space-between; }
.wz-brand { font-weight: 700; font-size: 18px; }
.wz-camp { font-size: 12.5px; opacity: .8; margin-top: 2px; }
.btn-light { background: #fff; color: var(--primary); border: none; }
.btn-light:hover { background: #f0f0f5; }

/* Dropdown "Voltar para o painel" (wizard) */
.wz-exit { position: relative; }
.wz-exit > summary { list-style: none; cursor: pointer; }
.wz-exit > summary::-webkit-details-marker { display: none; }
.wz-exit-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.18); min-width: 170px; overflow: hidden; }
.wz-exit-menu button, .wz-exit-menu a { display: block; width: 100%; text-align: left; padding: 12px 16px; background: none; border: none; font-size: 13.5px; font-family: inherit; color: var(--text); cursor: pointer; text-decoration: none; }
.wz-exit-menu button:hover, .wz-exit-menu a:hover { background: #f4f2ec; }

.wizard-main { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; max-width: 1120px; margin: 26px auto; padding: 0 20px; align-items: start; }
@media (max-width: 880px) { .wizard-main { grid-template-columns: 1fr; } }

.wizard-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 30px; }
.wz-step-label { color: var(--text-muted); font-size: 13px; }
.wz-h1 { font-size: 24px; font-weight: 700; margin: 2px 0 6px; }
.wz-sub { color: var(--text-muted); font-size: 13px; margin: 0 0 12px; max-width: 640px; line-height: 1.5; }
.wz-label { display: block; font-weight: 700; font-size: 13.5px; margin: 20px 0 8px; }
.wz-input { width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 9px; font-size: 14px; font-family: inherit; color: var(--text); background: #fff; }
.wz-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* Objetivo (cards) */
.obj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .obj-grid { grid-template-columns: 1fr; } }
.obj-card { position: relative; border: 1.5px solid var(--border); border-radius: 14px; padding: 22px 18px; text-align: center; cursor: pointer; display: block; transition: .15s; }
.obj-card:hover { border-color: #c9c6be; }
.obj-card input { position: absolute; opacity: 0; }
.obj-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.obj-check { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; display: none; place-items: center; font-size: 12px; }

/* Reforco para navegador sem :has() (Safari anterior ao 15.4, Chrome anterior ao 105).
   Quando o navegador nao entende :has(), ele descarta a REGRA INTEIRA - e ai a pessoa
   toca no cartao e nada muda na tela, o que le como "o botao nao funciona".
   O input e o primeiro filho do <label>, entao o combinador de irmao alcanca o
   selo de escolhido e funciona em qualquer navegador. O fundo do cartao continua
   dependendo do :has(), mas ele e enfeite: quem decide se a pessoa entendeu que
   escolheu e o selo. */
.obj-card input:checked ~ .obj-check { display: grid; }
.obj-card:has(input:checked) .obj-check { display: grid; }
.obj-ico { color: var(--primary); line-height: 0; }
.obj-ttl { font-weight: 700; font-size: 15px; margin: 8px 0 6px; }
.obj-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

/* Abordagens (linhas de rádio) */
.appr-list { display: flex; flex-direction: column; gap: 8px; }
.appr-row { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; background: #f3f2ee; color: var(--text); font-size: 13.5px; cursor: pointer; }
.appr-row input { position: absolute; opacity: 0; }
/* O "certinho" fica sempre no HTML (via content), mas transparente enquanto a opcao
   nao esta marcada. Assim o tamanho da bolinha nao muda ao selecionar - se o ✓ so
   aparecesse ao marcar, a linha inteira daria um pulinho de um pixel. Mesma
   linguagem visual do .obj-check dos cartoes de objetivo, logo acima nesta tela. */
.appr-mark {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #b9b6ad;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 11px;
    line-height: 1;
    color: transparent;
    transition: background .15s, border-color .15s, color .15s;
}
/* O visto desenhado com borda, nao com o caractere de fonte: em 11px o "check"
   sai com espessura e centralizacao diferentes em cada sistema, e aqui ele mora
   dentro de um circulo de 18px, onde um pixel de desvio aparece. Continua usando
   currentColor, entao a transicao de cor ao marcar segue igual. */
.appr-mark::before {
    content: '';
    width: 4.5px;
    height: 8.5px;
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    transform: rotate(42deg) translateY(-1px);
}
/* Sem :has(), a linha nao fica laranja - entao o visto NAO pode ser branco, ou
   ficaria branco no branco, invisivel. Aqui ele vira laranja cheio com o visto
   branco dentro, que se explica sozinho numa linha clara. A regra com :has()
   vem logo depois e tem a mesma forca, entao vence pela ordem quando existe. */
.appr-row input:checked ~ .appr-mark { border-color: var(--accent-orange); background: var(--accent-orange); color: #fff; }
.appr-row:has(input:checked) { background: var(--accent-orange); color: #fff; }
.appr-row:has(input:checked) .appr-mark { border-color: #fff; background: #fff; color: var(--accent-orange); }

/* O radio de verdade e invisivel (opacity 0), entao sem isto quem navega por teclado
   nao enxerga onde esta. Vale para as duas escolhas desta etapa. */
.appr-row:has(input:focus-visible),
.obj-card:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Interruptores das regras da campanha (dentro de Configuracoes avancadas).
   Cada um traz a explicacao junto: sao regras que mexem em dinheiro, e um rotulo
   curto sozinho ("Permitir autoindicacao") nao deixa claro o que se ganha ou perde
   ao ligar. */
.adv-sep { height: 1px; background: var(--border); margin: 18px 0 14px; }
.adv-group-title { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }
.adv-switch { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; cursor: pointer; }
.adv-switch + .adv-switch { border-top: 1px solid var(--border); }
.adv-switch .switch { flex-shrink: 0; margin-top: 2px; }
.adv-switch-txt { display: flex; flex-direction: column; gap: 3px; }
.adv-switch-txt b { font-size: 13.5px; font-weight: 600; }
.adv-switch-txt small { font-size: 12px; color: var(--text-muted); line-height: 1.45; }

/* Configurações avançadas */
.adv { margin-top: 20px; border: 1px solid var(--border); border-radius: 10px; padding: 0 14px; }
.adv summary { cursor: pointer; padding: 12px 0; font-weight: 600; font-size: 13.5px; }
.adv[open] { padding-bottom: 14px; }

.wz-actions { display: flex; justify-content: flex-end; margin-top: 24px; }
.wz-note { font-size: 11.5px; color: var(--text-muted); margin-top: 18px; background: #faf9f6; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.soon-tag { font-size: 10px; font-weight: 600; color: #7a5cc0; background: #f1eef8; border-radius: 20px; padding: 1px 7px; vertical-align: middle; }

/* Recompensas: tabs de tipo */
.rw-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.rw-tab { flex: 1; min-width: 140px; position: relative; text-align: center; padding: 14px; border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--text-muted); }
.rw-tab:hover { border-color: #c9c6be; }
/* Sem :has(), a aba nao fica laranja: o texto dentro dela assume a cor e o peso,
   que ja basta para dizer qual das tres esta escolhida.
   O PAR desta regra esta logo abaixo da regra com :has() e nao pode faltar. Quando
   o navegador entende :has(), o fundo da aba fica laranja e o color:#fff vai para o
   <label> - mas ele so chegaria ao <span> por HERANCA, e a linha abaixo da ao span
   uma cor PROPRIA. Declaracao direta sempre vence heranca (sao elementos diferentes,
   nao e questao de ordem nem de especificidade), entao sem o par o rotulo fica
   laranja sobre laranja: invisivel. E como o tipo "Valor fixo" ja nasce marcado, a
   tela abriria assim, antes de qualquer clique. */
.rw-tab input:checked ~ span { color: var(--accent-orange); font-weight: 800; }
.rw-tab input { position: absolute; opacity: 0; }
.rw-tab:has(input:checked) { background: var(--accent-orange); border-color: var(--accent-orange); color: #fff; }
/* O par prometido acima: devolve o branco ao span quando o fundo laranja existe.
   O desenho dentro do span usa currentColor, entao ele volta junto. */
.rw-tab:has(input:checked) span { color: #fff; }
/* Opcao existente porem indisponivel: continua visivel para nao sumir do vocabulario da
   tela, mas nao clicavel. Ver Recompensas.cshtml - pontos so volta com a loja de pontos. */
.rw-tab-off { opacity: .5; cursor: not-allowed; }
.rw-tab-off:hover { border-color: var(--border); }
.rw-tab-off small { font-weight: 500; }

.rw-fields { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .rw-fields { grid-template-columns: 1fr; } }

.rw-toggles { display: flex; flex-direction: column; gap: 12px; }
.rw-toggle { display: flex; align-items: center; gap: 12px; font-size: 13.5px; }

/* Recompensas: cards de resgate */
.rg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.rg-card { position: relative; border: 1.5px solid var(--border); border-radius: 14px; padding: 18px 16px; text-align: center; cursor: pointer; }
.rg-card:hover { border-color: #c9c6be; }
.rg-card input { position: absolute; opacity: 0; }
/* Mesmo reforco dos cartoes de objetivo: sem :has() o cartao nao muda de cor,
   entao o titulo e o desenho assumem a cor da marca e engrossam. */
.rg-card input:checked ~ .rg-ico { color: var(--primary); }
.rg-card input:checked ~ .rg-ttl { color: var(--primary); font-weight: 800; }
.rg-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.rg-ico { color: var(--primary); line-height: 0; }
.rg-ttl { font-weight: 600; font-size: 13.5px; margin: 8px 0 5px; }
.rg-desc { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }

/* Comunicação */
.ai-box { border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 8px; background: #faf9f6; }
.ai-title { font-weight: 700; font-size: 14px; color: var(--primary); }
.ai-summary { margin-top: 10px; font-size: 12px; color: #2e8b57; background: #e7f4ec; border: 1px solid #bfe3cd; border-radius: 8px; padding: 8px 10px; }
.comm-section-title { font-size: 16px; font-weight: 700; margin: 26px 0 4px; padding-bottom: 8px; border-bottom: 2px solid var(--accent-orange); display: inline-block; }
.comm-channel { border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.comm-channel-head { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.comm-channel.muted-channel { opacity: .7; }
.vars-hint { font-size: 11px; color: var(--text-muted); margin-top: 8px; }
.vars-hint code { background: #f1eff0; border-radius: 4px; padding: 1px 5px; font-size: 10.5px; color: var(--primary); }
.notif-list { display: flex; flex-direction: column; gap: 10px; }
.notif-card { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 12px; padding: 13px 15px; }
.notif-ico { color: var(--primary); line-height: 0; flex-shrink: 0; }
.notif-body { flex: 1; }
.notif-ttl { font-weight: 600; font-size: 13.5px; }
.notif-desc { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* Formulário de indicação (etapa 4) */
.form-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 18px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.form-tab { font-size: 12.5px; padding: 8px 12px; border-radius: 8px; background: #f1efe9; color: var(--text-muted); }
.form-tab.on { background: var(--primary); color: #fff; font-weight: 600; }
.form-cfg-grid { display: grid; grid-template-columns: 1fr 300px; gap: 22px; align-items: start; }
@media (max-width: 780px) { .form-cfg-grid { grid-template-columns: 1fr; } }
.field-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 2px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.field-row:last-child { border-bottom: none; }
.field-row.fixed { color: var(--text-muted); }
.req { font-size: 10.5px; font-weight: 600; color: #a9791b; background: #fbeecd; border-radius: 20px; padding: 1px 8px; }

/* Prévia do formulário */
.form-preview { position: sticky; top: 12px; }
.preview-label { text-align: center; font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.preview-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 20px 18px; box-shadow: var(--shadow); }
.preview-title { font-weight: 700; font-size: 16px; text-align: center; }
.preview-subtitle { font-size: 11.5px; color: var(--text-muted); text-align: center; margin: 6px 0 16px; line-height: 1.4; }
.preview-field { margin-bottom: 14px; }
.preview-field label { display: block; font-size: 11.5px; color: var(--text-muted); margin-bottom: 4px; }
.pf-input { display: block; height: 30px; border-bottom: 1.5px solid var(--border); font-size: 12px; color: var(--text-muted); line-height: 30px; }
.preview-terms { font-size: 10px; color: var(--text-muted); text-align: center; margin: 8px 0 12px; }
.preview-button { background: var(--primary); color: #fff; text-align: center; padding: 11px; border-radius: 10px; font-weight: 600; font-size: 13.5px; }

/* Publicação de páginas (etapa 5) */
.pub-card { border: 1px solid var(--border); border-radius: 14px; padding: 4px 18px; margin-bottom: 14px; background: var(--surface); box-shadow: var(--shadow); }
.pub-card > summary { cursor: pointer; padding: 14px 0; font-weight: 700; font-size: 15px; }
.pub-card[open] { padding-bottom: 16px; }
.pub-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .pub-options { grid-template-columns: 1fr; } }
.pub-opt { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px; cursor: pointer; font-size: 13.5px; }
.pub-opt small { color: var(--text-muted); font-size: 11.5px; }
.pub-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.pub-detail { display: none; margin-top: 14px; }
.pub-card:has(input[value="Builder"]:checked) .pub-builder { display: block; }
.pub-card:has(input[value="Embed"]:checked) .pub-embed { display: block; }
.url-box { background: #f4f2ec; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; color: var(--primary); word-break: break-all; }
.wz-input.code { font-family: monospace; font-size: 11.5px; }

/* Publicação — cards de método */
.method-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 8px; }
@media (max-width: 600px) { .method-cards { grid-template-columns: 1fr; } }
.method-card { position: relative; border: 1.5px solid var(--border); border-radius: 14px; padding: 18px 16px; text-align: center; cursor: pointer; display: block; }
.method-card:hover { border-color: #c9c6be; }
.method-card input { position: absolute; opacity: 0; }
.method-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.mc-check { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; display: none; place-items: center; font-size: 12px; }
.method-card:has(input:checked) .mc-check { display: grid; }
.mc-ico { color: var(--primary); line-height: 0; display: flex; justify-content: center; }
.mc-ttl { font-weight: 700; font-size: 14px; margin: 10px 0 6px; }
.mc-desc { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }

/* Publicação — blocos numerados */
.pub-block { border-top: 1px solid var(--border); margin-top: 18px; padding-top: 16px; }
.pub-block-num { font-weight: 700; font-size: 14px; color: var(--primary); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.pub-block-num .num { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--primary); display: inline-grid; place-items: center; font-size: 12px; }
.domain-tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.dtab { font-size: 12px; padding: 7px 12px; border-radius: 8px; background: #f1efe9; color: var(--text-muted); }
.dtab.on { background: var(--accent-orange); color: #fff; font-weight: 600; }
.slug-input { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.slug-prefix { background: #f4f2ec; color: var(--text-muted); font-size: 12.5px; padding: 0 10px; white-space: nowrap; border-right: 1px solid var(--border); display: flex; align-items: center; }
.slug-input input { border: none; border-radius: 0; flex: 1; min-width: 80px; }
.slug-input input:focus { box-shadow: none; outline: none; }
.warn-box { background: #fdf6e3; border: 1px solid #f0e2b6; color: #7a5f14; border-radius: 8px; padding: 10px 12px; font-size: 11.5px; margin-top: 10px; }
.upload-box { border: 1.5px dashed var(--border); border-radius: 9px; padding: 14px; text-align: center; color: var(--text-muted); font-size: 12.5px; }

/* Publicação — prévia social */
.social-preview { display: flex; gap: 12px; border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: #f4f7f4; margin-top: 6px; }
.sp-img { width: 64px; height: 64px; border-radius: 8px; background: linear-gradient(135deg, var(--accent-orange), var(--accent-purple)); flex-shrink: 0; }
.sp-body { min-width: 0; }
.sp-title { font-weight: 700; font-size: 13.5px; }
.sp-desc { font-size: 12px; color: var(--text-muted); margin: 3px 0 6px; }
.sp-url { font-size: 11px; color: var(--primary); word-break: break-all; }

/* Stepper (direita) */
.wizard-steps { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 20px; display: flex; flex-direction: column; gap: 16px; }
.wz-step { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text-muted); text-decoration: none; }
.wz-step .wz-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #d3cfc4; flex-shrink: 0; }
.wz-step.on { color: var(--primary); font-weight: 700; }
.wz-step.on .wz-dot { border-color: var(--primary); background: var(--primary); }
.wz-step.disabled { opacity: .55; }

/* Abas de filtro (lista de campanhas) */
.filter-tabs-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; margin-bottom: 16px; }
.ft-label { color: var(--text-muted); font-weight: 600; font-size: 13px; margin-right: 6px; }
.ft { padding: 6px 14px; border-radius: 8px; font-size: 13px; text-decoration: none; color: var(--text-muted); }
.ft:hover { background: #f0eee8; }
.ft.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

/* Cards de campanha */
.camp-list { display: flex; flex-direction: column; gap: 14px; }
/* SEM overflow:hidden de proposito. O menu de tres pontos (.kebab-menu) e
   position:absolute dentro deste card; com overflow:hidden o card recortava o menu e
   as opcoes "Duplicar" e "Excluir" ficavam invisiveis. O arredondamento que o
   overflow garantia agora e feito pelo .camp-foot, que e o unico filho com fundo
   proprio encostando na borda de baixo. */
.camp-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.camp-main { display: grid; grid-template-columns: auto 2fr 1.4fr 1.3fr auto; align-items: center; gap: 18px; padding: 16px 18px; }
.camp-toggle-form { margin: 0; }
.camp-name { font-weight: 700; font-size: 15px; }
.camp-desc { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.camp-id { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.camp-type { font-size: 12.5px; color: var(--accent-orange); }
.camp-reward { font-size: 12.5px; color: var(--text); }
.camp-actions { display: flex; align-items: center; gap: 6px; }
.kebab { position: relative; }
.kebab > summary { list-style: none; cursor: pointer; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; font-size: 17px; color: var(--text-muted); border: 1px solid var(--border); background: #fff; }
.kebab > summary::-webkit-details-marker { display: none; }
.kebab > summary:hover { background: #f4f2ec; }
.kebab[open] > summary { background: var(--primary-soft); color: var(--primary); }
.kebab-menu { position: absolute; right: 0; top: 34px; z-index: 20; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); min-width: 130px; overflow: hidden; }
.kebab-menu form { margin: 0; }
.kebab-menu button { display: block; width: 100%; text-align: left; padding: 10px 14px; background: none; border: none; font-size: 13px; font-family: inherit; color: var(--text); cursor: pointer; }
.kebab-menu button:hover { background: #f4f2ec; }
.kebab-menu button.danger { color: var(--danger); }

/* O arredondamento de baixo vem daqui, e nao de um overflow:hidden no card (ver .camp-card). */
.camp-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; background: #faf9f6; border-top: 1px solid var(--border); border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius); }
.camp-pages { display: flex; gap: 28px; flex-wrap: wrap; }
.cp { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }
.cp b { color: var(--accent-orange); font-weight: 600; }
@media (max-width: 860px) {
    .camp-main { grid-template-columns: auto 1fr; row-gap: 8px; }
    .camp-type, .camp-reward, .camp-actions { grid-column: 2; }
}

/* Indicações — pills de período e filtros */
.per-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.per-pill { padding: 6px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; text-decoration: none; color: var(--text-muted); background: #fff; }
.per-pill:hover { background: #f0eee8; }
.per-pill.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.per-pill.clear { border-style: dashed; }
.all-filters { position: relative; }
.all-filters > summary { list-style: none; cursor: pointer; }
.all-filters > summary::-webkit-details-marker { display: none; }
.all-filters-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 25; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.15); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 260px; }

/* Indicações — lista */
.ref-list { padding: 6px 0; overflow: visible; }
.ref-row { display: grid; grid-template-columns: 28px 100px 1.2fr 1.1fr 1.5fr 130px 40px; gap: 12px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.ref-row:last-child { border-bottom: none; }
.ref-row.ref-head { font-size: 12px; font-weight: 700; color: var(--text-muted); padding: 10px 18px; }
/* A bolinha de situacao. Era o caractere "●", que sai de um tamanho em cada
   fonte de sistema; agora e forma desenhada, sempre 9px redondos.

   As cores estao repetidas aqui de proposito. Os nomes .st-new, .st-nego, .st-won
   e .st-lost sao usados TAMBEM pelo selo de etapa (.st-badge, mais abaixo neste
   arquivo), que define background e color proprios. Como aquele bloco vem depois
   e tem a mesma forca, ele vencia: a bolinha herdava um retangulo claro atras de
   si. Com dois seletores (.ref-dot.st-won) a bolinha volta a mandar na propria cor. */
.ref-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: currentColor; vertical-align: middle; }
.ref-dot.st-new     { color: #3b6fd4; background: currentColor; }
.ref-dot.st-contact { color: #b98a12; background: currentColor; }
.ref-dot.st-qualif  { color: #7a5cc0; background: currentColor; }
.ref-dot.st-nego    { color: var(--accent-orange); background: currentColor; }
.ref-dot.st-won     { color: #2e9e5b; background: currentColor; }
.ref-dot.st-lost    { color: #a33b3b; background: currentColor; }
.ref-date { font-size: 13px; font-weight: 600; }
.ref-strong { font-size: 13px; font-weight: 600; }
.ref-lead { font-size: 12.5px; font-weight: 700; }
.ref-sub { font-size: 11.5px; color: var(--text-muted); }
.ref-source { display: inline-block; margin-top: 4px; font-size: 10.5px; color: var(--accent-orange); font-weight: 600; }
.ref-menu { min-width: 240px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.ref-menu label { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.ref-menu select, .ref-menu input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; }
@media (max-width: 900px) { .ref-row { grid-template-columns: 24px 1fr 1fr 36px; } .ref-row > :nth-child(3), .ref-row > :nth-child(4) { display: none; } }

/* Conversões — lista */
.conv-row { display: grid; grid-template-columns: 90px 150px 1fr 1.5fr 1fr 70px 100px 40px; gap: 12px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.conv-row:last-child { border-bottom: none; }
.conv-row.ref-head { font-size: 12px; font-weight: 700; color: var(--text-muted); padding: 10px 18px; }
.conv-code { font-size: 12.5px; font-weight: 700; letter-spacing: .5px; color: var(--text-muted); }
.conv-reward { color: var(--accent-orange); font-weight: 700; }
.conv-deal { font-size: 12px; font-style: italic; color: var(--primary); margin-top: 4px; }
@media (max-width: 1000px) { .conv-row { grid-template-columns: 1fr 1.5fr 100px 36px; } .conv-row > :nth-child(1), .conv-row > :nth-child(2), .conv-row > :nth-child(3), .conv-row > :nth-child(6) { display: none; } }

/* Embaixadores — lista */
.amb-row { display: grid; grid-template-columns: 90px 1.3fr 1.3fr 70px 100px 44px 36px; gap: 12px; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.amb-row:last-child { border-bottom: none; }
.amb-row.ref-head { font-size: 12px; font-weight: 700; color: var(--text-muted); padding: 10px 18px; }
.amb-count { text-align: center; font-size: 15px; font-weight: 700; }
.amb-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chip { display: inline-block; border-radius: 20px; font-size: 10.5px; font-weight: 600; padding: 3px 10px; border: 1px solid var(--border); }
.chip-ok { background: #e7f4ec; color: #247a46; border-color: #bfe3cd; }
.chip-no { background: #f9f0f0; color: #8f3434; border-color: #ecd1d1; }
.link-btn { width: 36px; height: 36px; border-radius: 50%; border: none; background: var(--primary); color: #fff; font-size: 15px; cursor: pointer; display: grid; place-items: center; }
.link-btn:hover { filter: brightness(1.15); }
.link-btn.copied { background: #2e9e5b; }
@media (max-width: 900px) { .amb-row { grid-template-columns: 80px 1fr 44px 36px; } .amb-row > :nth-child(3), .amb-row > :nth-child(4), .amb-row > :nth-child(5) { display: none; } }

/* Importação de participantes */
.imp-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
@media (max-width: 640px) { .imp-methods { grid-template-columns: 1fr; } }
.imp-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: 14px; padding: 18px 14px; text-align: center; cursor: pointer; font-family: inherit; }
.imp-card:hover { border-color: #c9c6be; }
.imp-card.on { border-color: var(--primary); background: var(--primary-soft); }
.imp-ico { font-size: 24px; }
.imp-ttl { font-weight: 700; font-size: 14.5px; margin: 8px 0 4px; }
.imp-desc { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }
.imp-panel h3 { margin: 0 0 10px; font-size: 16px; }
.imp-hint { background: #eef4fb; border: 1px solid #d4e3f5; color: #3a5c86; border-radius: 8px; padding: 9px 12px; font-size: 12px; margin-bottom: 14px; }
.imp-hint a { color: var(--primary); font-weight: 600; }
.imp-row { display: grid; grid-template-columns: 1.2fr 1.4fr 1fr 42px; gap: 10px; margin-bottom: 10px; }
.imp-row input { padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; font-size: 13.5px; font-family: inherit; }
.imp-row input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.imp-add { border: 1.5px solid var(--primary); background: #fff; color: var(--primary); border-radius: 9px; font-size: 17px; cursor: pointer; }
.imp-add:hover { background: var(--primary-soft); }

/* Integrações */
.api-code { background: #1d1b2e; color: #e8e6f0; border-radius: 10px; padding: 14px 16px; font-size: 12.5px; overflow-x: auto; font-family: Consolas, 'Courier New', monospace; margin-top: 10px; line-height: 1.6; }
.int-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .int-cards { grid-template-columns: 1fr; } }
.int-card-head { font-weight: 700; font-size: 14.5px; background: var(--primary); color: #fff; margin: -18px -18px 14px; padding: 12px 18px; border-radius: var(--radius) var(--radius) 0 0; }
.int-value-row { display: flex; gap: 8px; }
.int-value-row input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; font-family: Consolas, monospace; font-size: 12.5px; background: #faf9f6; color: var(--text); }
.int-copy { width: 38px; border: none; border-radius: 9px; background: var(--primary); color: #fff; font-size: 14px; cursor: pointer; }
/* Enquanto confirma, o botao mostra a palavra "Copiado!" no lugar do desenho — e 38px
   seguram um desenho, nao uma palavra. Verde para o retorno ser visivel de canto de olho. */
.int-copy.copiado { width: auto; padding: 0 12px; font-size: 11.5px; font-weight: 700; background: #2e9e5b; }
.int-webhook-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.int-webhook-form input, .int-webhook-form select { padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; font-size: 13px; font-family: inherit; }
.api-doc { margin-bottom: 16px; }
.api-doc h3 { margin: 0 0 6px; font-size: 15px; display: flex; align-items: center; gap: 10px; }
.api-doc p { font-size: 13px; color: var(--text-muted); margin: 4px 0; }
.api-resp { margin-top: 8px; }
.api-method { font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 6px; color: #fff; letter-spacing: .5px; }
.api-method.post { background: #2e9e5b; }
.api-method.get { background: #2f6fd4; }

/* Fechamento de recompensas */
.fech-filtros { margin-bottom: 18px; }
.fech-filtros-top { display: flex; align-items: center; margin-bottom: 12px; }
.fech-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 800px) { .fech-grid { grid-template-columns: 1fr; } }
.fech-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }
@media (max-width: 700px) { .fech-cards { grid-template-columns: 1fr; } }
.fech-card { padding: 22px 22px; }
.fech-num { font-size: 26px; font-weight: 800; }
.fech-num.azul { color: #2f6fd4; }
.fech-num.verde { color: #22a65a; }
.fech-lbl { font-size: 13.5px; font-weight: 600; margin-top: 6px; }

/* Modal Links pessoais */
.links-modal { border: none; border-radius: 18px; padding: 28px 30px; width: min(680px, 92vw); box-shadow: 0 20px 70px rgba(0,0,0,.3); }
.links-modal::backdrop { background: rgba(20,18,40,.45); }
.lm-close { position: absolute; top: 16px; right: 18px; width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--border); background: #fff; cursor: pointer; font-size: 14px; }
.lm-head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; padding-right: 40px; }
.lm-title { font-size: 22px; font-weight: 800; margin: 0 0 4px; }
.lm-name { font-size: 14px; color: var(--text); }
.lm-email { font-size: 12.5px; color: var(--text-muted); font-style: italic; }
.lm-table { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.lm-cols { display: grid; grid-template-columns: 1.2fr 70px 1.6fr 44px; gap: 14px; align-items: center; }
.lm-cols-head { font-size: 13px; font-weight: 700; padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.lm-body { background: #faf9f6; border-radius: 10px; padding: 14px; }
.lm-camp { font-size: 13px; }
.lm-clicks { font-size: 13px; color: var(--text-muted); text-align: center; }
.lm-links label { display: block; font-size: 11px; color: var(--text-muted); margin: 8px 0 4px; }
.lm-links label:first-child { margin-top: 0; }
.lm-linkbox { display: flex; gap: 6px; }
.lm-linkbox input { flex: 1; min-width: 0; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 12px; color: var(--text); background: #fff; }
.lm-linkbox button { width: 36px; border: none; border-radius: 8px; background: var(--primary); color: #fff; font-size: 14px; cursor: pointer; }
.lm-mailbtn { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--border); background: #fff; display: grid; place-items: center; text-decoration: none; color: var(--text); font-size: 15px; }
.lm-mailbtn:hover { background: #f4f2ec; }

/* ----- Lista de integrações (Marketing & vendas / E-Commerce) ----- */
.int-list-card { max-width: 780px; padding: 26px 28px; border-radius: 16px; }
.int-list-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.int-list-title { font-size: 21px; font-weight: 800; color: #1c1a27; margin: 0; }
.int-new-btn { background: var(--accent-orange, #f26522); color: #fff; border: none; border-radius: 24px; padding: 11px 22px; font-size: 14px; font-weight: 700; cursor: pointer; }
.int-new-btn:hover { filter: brightness(1.06); }
.int-row { display: flex; align-items: center; gap: 16px; border: 1px solid var(--border, #e4e1d8); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; background: #fff; }
.int-row-toggle { margin: 0; display: flex; align-items: center; }
.switch { width: 44px; height: 24px; border-radius: 24px; border: none; background: #d6d3cc; position: relative; cursor: pointer; padding: 0; transition: background .15s; flex: none; }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s; }
.switch.on { background: #12b5a5; }
.switch.on .knob { left: 23px; }
.int-row-info { flex: 1; min-width: 0; }
.int-row-name { font-weight: 800; font-size: 14.5px; color: #1c1a27; letter-spacing: .3px; }
.int-row-sub { font-size: 12.5px; color: var(--text-muted, #7b7690); margin-top: 2px; }
.int-row-del { background: none; border: none; color: #d5322f; font-size: 17px; cursor: pointer; padding: 6px; }
.int-row-del:hover { transform: scale(1.12); }
.int-adv { margin-top: 6px; }
.int-adv summary { list-style: none; cursor: pointer; font-weight: 800; font-size: 15px; color: #1c1a27; display: flex; align-items: center; gap: 8px; }
.int-adv summary::-webkit-details-marker { display: none; }
.int-adv-plus { color: var(--text-muted, #7b7690); font-weight: 400; }
.int-adv-body { font-size: 13px; color: var(--text-muted, #7b7690); padding-top: 10px; }

/* ----- Hub de integrações: telas fieis ao BuzzLead ----- */
.bz-blue-btn { background: #3b9af6; color: #fff; border: none; border-radius: 10px; padding: 11px 20px; font-size: 14px; font-weight: 700; cursor: pointer; }
.bz-blue-btn:hover { filter: brightness(1.06); }
.bz-orange-outline { border: 1.5px solid var(--accent-orange, #f26522); color: var(--accent-orange, #f26522); background: #fff; border-radius: 10px; padding: 10px 18px; font-weight: 700; }
.bz-orange-outline:hover { background: #fdeee0; }
.wh-grid { display: grid; grid-template-columns: 64px 150px 1fr 130px 110px 150px; gap: 12px; align-items: center; }
.wh-grid-head { padding: 6px 18px 12px; font-weight: 700; font-size: 13px; color: #555; }
.wh-row { border: 1.5px solid #cfe6fb; background: #f6fbff; border-radius: 26px; padding: 10px 18px; margin-bottom: 12px; font-size: 13px; }
.wh-url { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wh-actions { display: flex; gap: 8px; align-items: center; }
.act-btn { background: none; border: none; color: #3b9af6; font-size: 16px; cursor: pointer; padding: 4px; }
.act-btn:hover { transform: scale(1.15); }
.act-btn.act-del { color: #d5322f; }
.rw-icon { font-size: 28px; background: #eef5fd; border-radius: 12px; padding: 10px; }
.rw-search { display: flex; align-items: center; gap: 10px; background: #fff; border: 1.5px solid var(--border, #e4e1d8); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; }
.rw-search input { border: none; outline: none; flex: 1; font-size: 14px; background: transparent; }
.rw-empty { text-align: center; color: var(--text-muted, #7b7690); padding: 56px 20px; font-size: 15px; }
.rw-row { margin-bottom: 14px; }
.rw-row-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.rw-urls label { display: block; font-size: 12px; font-weight: 700; color: #555; margin: 8px 0 4px; }
.flt-card { position: relative; margin-bottom: 18px; }
.flt-title { font-weight: 700; margin-bottom: 10px; }
.flt-export { position: absolute; top: 16px; right: 18px; }
.flt-form { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.flt-grow { flex: 1; min-width: 240px; }
.flt-btn { padding: 11px 26px; }
.auto-switch.on { background: #f26522; }
.diag-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border, #e4e1d8); }
.diag-row:last-child { border-bottom: none; }
.diag-ico { font-size: 18px; }
.diag-name { font-weight: 700; font-size: 14px; color: #1c1a27; }
.diag-detail { font-size: 12.5px; color: var(--text-muted, #7b7690); margin-top: 2px; }
.diag-status { font-size: 11.5px; font-weight: 800; letter-spacing: .4px; }
.logo-preview { border: 1.5px dashed var(--border, #e4e1d8); border-radius: 12px; padding: 26px; display: grid; place-items: center; background: #faf9f7; }
.logo-preview img { max-height: 90px; max-width: 100%; }
.nps-hero { text-align: center; padding: 48px 32px; }
.nps-hero-ico { font-size: 44px; color: var(--accent-orange, #f26522); margin-bottom: 14px; }
.nps-canais-title { font-size: 13.5px; color: var(--text-muted, #7b7690); margin: 40px 0 18px; }
.nps-canais { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; text-align: left; }
.nps-canal { border: 1.5px solid var(--border, #e4e1d8); border-radius: 14px; padding: 22px; }
.nps-canal-tag { font-size: 11.5px; font-weight: 800; color: #3b9af6; letter-spacing: .5px; margin-bottom: 10px; }
.nps-canal h3 { font-size: 16px; font-weight: 800; color: #1c1a27; margin: 0 0 8px; }
.nps-canal p { font-size: 13px; color: var(--text-muted, #7b7690); margin: 0; line-height: 1.6; }
.com-card { display: flex; align-items: center; gap: 20px; padding: 18px 22px; border-radius: 14px; margin-bottom: 14px; }
.com-info { flex: 1.6; min-width: 0; }
.com-status { display: inline-block; background: #f5a623; color: #fff; font-size: 10.5px; font-weight: 800; padding: 3px 10px; border-radius: 12px; margin-bottom: 6px; }
.com-status.on { background: #21a366; }
.com-name { font-weight: 800; font-size: 14.5px; color: #1c1a27; }
.com-sub { font-size: 12.5px; color: var(--text-muted, #7b7690); margin-top: 2px; }
.com-channel { font-size: 20px; width: 34px; text-align: center; }
.com-goal { flex: 0.8; font-size: 12.5px; color: var(--text-muted, #7b7690); letter-spacing: .4px; }
.com-trigger { flex: 1.2; font-size: 12.5px; color: var(--text-muted, #7b7690); }
.com-sends { border: 1.5px solid var(--border, #e4e1d8); border-radius: 10px; padding: 10px 22px; text-align: center; }
.com-sends-num { font-size: 20px; font-weight: 800; color: #4a4657; }
.com-sends-label { font-size: 11.5px; color: var(--text-muted, #7b7690); }
.com-ver { border: 1.5px solid #3b9af6; color: #3b9af6; background: #fff; border-radius: 20px; padding: 7px 26px; font-size: 13px; font-weight: 700; text-decoration: none; }
.com-ver:hover { background: #eef5fd; }
.disp-tabs { display: flex; gap: 8px; border-bottom: 1.5px solid var(--border, #e4e1d8); padding-bottom: 0; }
.disp-tab { background: none; border: none; border-bottom: 3px solid transparent; padding: 10px 16px; font-size: 14px; font-weight: 700; color: var(--text-muted, #7b7690); cursor: pointer; }
.disp-tab.on { color: var(--navy, #221C59); border-bottom-color: var(--accent-orange, #f26522); }
.em-usage { height: 10px; background: #eceae3; border-radius: 6px; overflow: hidden; }
.em-usage-fill { height: 100%; background: linear-gradient(90deg, #3b9af6, #56c6f0); border-radius: 6px; }
.em-notice { background: #fdf6e3; border: 1.5px solid #f0d48a; border-radius: 12px; padding: 16px 18px; font-size: 13px; color: #6b5b1e; margin: 18px 0; line-height: 1.6; }
.em-badge { background: #21c07a; color: #fff; font-size: 10.5px; font-weight: 800; padding: 4px 10px; border-radius: 12px; letter-spacing: .4px; }
.rk-conv-head { background: #eceff3; border-radius: 8px 8px 0 0; }
.rk-conv { background: #f6f8fa; }
.pt-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.pt-card { padding: 24px 26px; border-radius: 14px; }
.pt-num { font-size: 26px; font-weight: 800; color: #4a4657; }
.pt-num.pt-blue { color: #3b9af6; }
.pt-num.pt-green { color: #21a366; }
.pt-num.pt-red { color: #e33d3d; }
.fail-badge { background: #e33d3d; color: #fff; font-size: 10.5px; font-weight: 800; padding: 4px 10px; border-radius: 12px; letter-spacing: .4px; }
.pt-label { font-size: 14px; font-weight: 600; color: #1c1a27; margin-top: 6px; }
.rr-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 40px; }
.rr-form .filter-field select, .rr-form .filter-field input { width: 100%; box-sizing: border-box; }
.rr-submit { grid-column: 1 / -1; }
.imp-hero, .conn-hero { text-align: center; padding: 48px 32px; max-width: 720px; }
.imp-xicon { width: 84px; height: 84px; margin: 0 auto 18px; background: #21a366; border-radius: 18px; display: grid; place-items: center; }
.imp-xicon span { color: #fff; font-size: 40px; font-weight: 900; font-family: Georgia, serif; }
.conn-hero-ico { font-size: 64px; margin-bottom: 12px; }
.imp-hero-title { font-size: 22px; font-weight: 800; color: #1c1a27; margin: 0 0 10px; }
.imp-hero-sub { font-size: 14px; color: var(--text-muted, #7b7690); max-width: 560px; margin: 0 auto 22px; line-height: 1.6; }

/* ----- Login do admin ----- */
.auth-body { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, var(--navy, #221C59) 0%, #2e2775 55%, #453a9e 100%); padding: 24px; }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 14px; padding: 36px 32px; box-shadow: 0 18px 50px rgba(10, 8, 40, .35); text-align: center; }
.auth-logo { height: 54px; margin-bottom: 14px; }
.auth-title { font-size: 20px; font-weight: 800; color: var(--navy, #221C59); margin: 0 0 4px; }
.auth-sub { font-size: 13px; color: var(--text-muted, #7b7690); margin: 0 0 20px; }
.auth-error { background: #f9e9e9; color: #8f3434; border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }
.auth-label { display: block; text-align: left; font-size: 12.5px; font-weight: 600; color: var(--text, #2c2a38); margin: 12px 0 5px; }
.auth-input { width: 100%; box-sizing: border-box; border: 1.5px solid var(--border, #e4e1d8); border-radius: 8px; padding: 11px 12px; font-size: 14px; }
.auth-input:focus { outline: none; border-color: var(--navy, #221C59); }
.auth-btn { width: 100%; margin-top: 20px; padding: 12px; font-size: 14.5px; }
.topbar-sair { background: none; border: 1.5px solid var(--border, #e4e1d8); border-radius: 8px; padding: 6px 12px; font-size: 12.5px; color: var(--text, #2c2a38); cursor: pointer; }
.topbar-sair:hover { background: #f4f2ec; }
.lm-sharebtns { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.lm-wa { border-color: #25d366; font-size: 12px; }
.lm-wa:hover { background: #e9f9ef; }
.lm-fb { border-color: #1877f2; color: #1877f2; font-weight: 800; font-family: Georgia, serif; }
.lm-fb:hover { background: #e9f1fd; }
.lm-foot { display: flex; justify-content: flex-end; margin-top: 18px; }

/* Cores por status do funil */
.st-new { color: #3b6fd4; } .status-badge.st-new { background: #e8effb; color: #2f5bb0; }
.st-contact { color: #b98a12; } .status-badge.st-contact { background: #fdf3d7; color: #93700c; }
.st-qualif { color: #7a5cc0; } .status-badge.st-qualif { background: #f1eef8; color: #64499f; }
.st-nego { color: var(--accent-orange); } .status-badge.st-nego { background: #fdeee0; color: #c56d1d; }
.st-won { color: #2e9e5b; } .status-badge.st-won { background: #e7f4ec; color: #247a46; }
.st-lost { color: #a33b3b; } .status-badge.st-lost { background: #f9e9e9; color: #8f3434; }

/* Status badge */
.status-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.status-badge.ok { background: #e7f4ec; color: #2e8b57; }
.status-badge.muted { background: #eceae4; color: #8a887f; }
.status-badge.warn { background: #fbeecd; color: #a9791b; }

/* Formulário */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.grow { flex: 1; min-width: 240px; }
.form-field > label { font-size: 13px; font-weight: 600; color: var(--text); }
.form-field input[type=text], .form-field input[type=date], .form-field input:not([type]), .form-field textarea {
    padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px; font-size: 13.5px; font-family: inherit; background: #fff; color: var(--text);
}
.form-field textarea { resize: vertical; }
.form-field input:focus, .form-field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.val { color: var(--danger); font-size: 12px; }
.val-summary:empty { display: none; }
.val-summary { color: var(--danger); font-size: 13px; }
.val-summary ul { margin: 0; padding-left: 18px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* Switch (toggle) */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #cfccc4; border-radius: 20px; transition: .2s; cursor: pointer; }
.switch .slider::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* Cards de formato */
.fmt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.fmt-card { position: relative; border: 1.5px solid var(--border); border-radius: 12px; padding: 14px 14px 14px 40px; cursor: pointer; display: block; transition: .15s; }
.fmt-card:hover { border-color: #c9c6be; }
.fmt-card input { position: absolute; top: 15px; left: 14px; }
.fmt-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.fmt-title { font-weight: 600; font-size: 13.5px; margin-bottom: 4px; }
.fmt-desc { font-size: 12px; color: var(--text-muted); line-height: 1.35; }

/* Barra de filtro */
.filter-bar { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-field { display: flex; flex-direction: column; gap: 5px; }
.filter-field label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.filter-field select, .filter-field input { padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px; font-size: 13.5px; background: #fff; font-family: inherit; color: var(--text); }
.filter-field select:focus, .filter-field input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.filter-note { width: 100%; font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* .kpi-grid e .kpi-card estavam definidos aqui e foram REMOVIDOS: eram codigo morto que
   confundia. O .kpi-card nao era usado por nenhuma view, e havia um segundo .kpi-grid mais
   abaixo no arquivo que, por vir depois, sempre vencia este - quem editasse aqui nao veria
   efeito nenhum e concluiria que o CSS "nao pega". A definicao viva esta junto do .kpi, na
   secao dos indicadores. */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 18px;
}
.pill { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: #eef7f0; color: #2e9e5b; font-weight: 600; }
.pill.soon { background: #f1eef8; color: #7a5cc0; }

/* ---------- Sections ---------- */
.section-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .section-grid { grid-template-columns: 1fr; } }
.card h3 { margin: 0 0 16px; font-size: 16px; }

/* Funil do programa (afunilado; badge de taxa colado na borda de cada etapa) */
.funnelb { display: flex; flex-direction: column; gap: 30px; padding: 4px 0 8px; }
.funnelb-step { display: flex; justify-content: center; }
.fb-wrap { position: relative; }                 /* largura definida inline por etapa */
.fb-body {
    text-align: center;
    padding: 16px 12px;
    background: #eef0f2;
    color: var(--text);
    clip-path: polygon(0 0, 100% 0, calc(100% - 26px) 100%, 26px 100%);
}
.funnelb-step:first-child .fb-body { background: var(--accent-orange); color: #fff; }
.fb-value { font-size: 23px; font-weight: 700; line-height: 1.1; }
.fb-label { font-size: 12.5px; opacity: .92; }
.fb-rate {
    position: absolute;
    left: 50%; bottom: -22px;                    /* centralizado no vão entre as etapas */
    transform: translateX(-50%);
    z-index: 3;
}
.fb-rate-badge {
    background: var(--primary); color: #fff;
    font-weight: 700; font-size: 13px;
    padding: 5px 14px; border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
    white-space: nowrap;
}
.fb-rate-text {                                  /* rótulo da taxa, ao lado do badge */
    position: absolute; left: calc(100% + 12px); top: 50%;
    transform: translateY(-50%);
    font-size: 11.5px; color: var(--text-muted);
    white-space: nowrap;
}

/* Gráfico de linha */
.legend { display: flex; gap: 18px; margin-bottom: 4px; font-size: 12px; color: var(--text-muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.linechart { width: 100%; height: auto; }
.linechart .axis { font-size: 10px; fill: var(--text-muted); }
.linechart .pt { font-size: 9.5px; fill: var(--text-muted); font-weight: 600; }

/* Rosca (distribuição) */
.donut-wrap { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; flex-shrink: 0; }
.donut-num { font-size: 22px; font-weight: 700; fill: var(--text); }
.donut-lbl { font-size: 9px; fill: var(--text-muted); }
.donut-legend { display: flex; flex-direction: column; gap: 14px; flex: 1; min-width: 200px; }
.dl-block { line-height: 1.3; }
.dl-head { font-size: 13.5px; }
.dl-nums { font-size: 12.5px; color: var(--text-muted); margin: 1px 0 2px 15px; }
.dl-nums span { font-weight: 700; }
.dl-desc { font-size: 11px; color: var(--text-muted); margin-left: 15px; max-width: 260px; }

/* Stat tiles (rentabilização) */
.stat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.stat { background: #faf9f6; border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.stat-lbl { font-size: 11.5px; color: var(--text-muted); }
.stat-val { font-size: 19px; font-weight: 700; margin-top: 2px; }

/* Lista chave/valor (outros indicadores) */
.kv { display: flex; flex-direction: column; }
.kv-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 2px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.kv-row:last-child { border-bottom: none; }
.kv-row span { color: var(--text-muted); }
.kv-row b { font-size: 16px; }

/* Ranking */
table.rank { width: 100%; border-collapse: collapse; }
table.rank th, table.rank td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); font-size: 13px; }
table.rank th { color: var(--text-muted); font-weight: 600; }
table.rank td.num, table.rank th.num { text-align: right; }
.rank-pos { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #f1efe9; font-size: 12px; font-weight: 700; }
.rank-pos.p1 { background: #fdf1c9; color: #9a7a12; }
.rank-pos.p2 { background: #ececec; color: #6b6b6b; }
.rank-pos.p3 { background: #f6e2cf; color: #a4632a; }

/* ==========================================================================
   Camada do console comercial. Reúne classes que já eram usadas nas views mas
   nunca tinham sido definidas (.card-title, .toast-err, --navy) e o vocabulário
   novo de comparação de período, ranking e paginação.
   ========================================================================== */

:root {
    /* Usada em várias views admin; só existia em painel.css/lp-cadastro.css,
       que o _AdminLayout não carrega — os usos caíam no fallback. */
    --navy: #221C59;
    --pos: #21a366;
    --neg: #e33d3d;
    --warn: #d79a1b;
    --info: #4c8fd6;
}

/* Título de bloco dentro de um card. */
.card-title { font-size: 15px; font-weight: 700; color: var(--navy); margin: 0 0 14px; }

/* Par do .toast-ok para mensagens de erro. */
.toast-err { background: #fdeaea; color: #b52d2d; border: 1px solid #f3c2c2; border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-size: 13.5px; }
.toast-warn { background: #fdf6e3; color: #8a6a12; border: 1px solid #f0e0b0; border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-size: 13.5px; }

/* Aviso de confiança do dado, ao lado de um número. */
.warn-box { background: #fdf6e3; border-left: 3px solid var(--warn); border-radius: 8px; padding: 9px 12px; font-size: 12.5px; color: #6b5a2a; line-height: 1.55; }

/* ----- Comparação com o período anterior ----- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
/* Quem le estas telas e consultora comercial, nao analista: o rodape precisa ser legivel
   de relance. Antes: 11,5px em cinza-claro (#8a887f) - abaixo do contraste minimo de
   acessibilidade para texto pequeno, e ilegivel na tela do celular em pe na rua.
   O rotulo perdeu o caixa-alta com espacamento entre letras, que atrapalha a leitura
   rapida justamente em rotulos longos ("RECEITA LIQUIDA DE RECOMPENSA"). */
.kpi-label { font-size: 12.5px; font-weight: 600; color: #6b6875; letter-spacing: 0; }
.kpi-value { font-size: 26px; font-weight: 800; color: #1c1a27; line-height: 1.2; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi-value.sm { font-size: 20px; }
.kpi-foot { font-size: 12px; color: #6b6875; margin-top: 7px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; line-height: 1.4; }

.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 20px; white-space: nowrap; }
.delta-up { background: #e7f4ec; color: var(--pos); }
.delta-down { background: #fdeaea; color: var(--neg); }
.delta-flat { background: #f1efe9; color: var(--text-muted); }
.delta-none { background: transparent; color: var(--text-muted); font-weight: 600; }
/* Frase de "ainda nao ha comparacao": texto corrido, sem a pilula do delta - nao e uma
   variacao, e a ausencia dela. Em italico para nao competir com o numero grande acima. */
.kpi-sembase { font-style: italic; color: #8b8896; }

/* ----- Filtro de período em pílulas ----- */
.per-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.per-pills a { padding: 6px 13px; border: 1px solid var(--border); border-radius: 20px; font-size: 12.5px; color: #5c5866; text-decoration: none; background: var(--surface); white-space: nowrap; }
.per-pills a:hover { border-color: #b9d4ee; }
.per-pills a.on { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }

/* ----- Barra horizontal de ranking / progresso ----- */
.bar { height: 8px; background: #efedea; border-radius: 99px; overflow: hidden; min-width: 60px; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--info); }
.bar.pos > span { background: var(--pos); }
.bar.warn > span { background: var(--warn); }
.bar.neg > span { background: var(--neg); }

/* ----- Faixa horizontal de etapas do funil (foto da situação atual) ----- */
.stage-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.stage { flex: 1 1 118px; border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; text-decoration: none; background: var(--surface); border-top: 3px solid var(--border); }
.stage:hover { border-color: #b9d4ee; }
.stage-n { font-size: 21px; font-weight: 800; color: #1c1a27; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stage-l { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.stage.s-new { border-top-color: #9aa5b8; }
.stage.s-qual { border-top-color: var(--info); }
.stage.s-nego { border-top-color: var(--warn); }
.stage.s-won { border-top-color: var(--pos); }
.stage.s-lost { border-top-color: var(--neg); }
.stage.s-dup { border-top-color: #b9a5c8; }

/* Selo de etapa dentro de tabela. */
.st-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.st-new { background: #eef1f6; color: #59637a; }
.st-qual { background: #e8f2fd; color: #2f6fae; }
.st-nego { background: #fdf6e3; color: #8a6a12; }
.st-won { background: #e7f4ec; color: #1c7a4c; }
.st-lost { background: #fdeaea; color: #b52d2d; }
.st-dup { background: #f4eef8; color: #6b4a80; }

/* Situação de atividade do embaixador. */
.sit { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.sit-ativo { background: #e7f4ec; color: #1c7a4c; }
.sit-adormecido { background: #fdf6e3; color: #8a6a12; }
.sit-inativo { background: #fdeaea; color: #b52d2d; }
.sit-nunca { background: #f1efe9; color: #6b6b6b; }

/* ----- Tabela larga, rodapé e paginação ----- */
.table-scroll { overflow-x: auto; }
.table-scroll table { min-width: 100%; }
table.rank td.money, table.rank th.money { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty-cell { color: var(--text-muted); font-size: 13px; }
.list-foot { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; font-size: 12.5px; color: var(--text-muted); }
.pager { display: flex; gap: 6px; align-items: center; }
.pager a, .pager span { padding: 5px 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; color: #5c5866; text-decoration: none; background: var(--surface); }
.pager a:hover { border-color: #b9d4ee; }
.pager .on { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.pager .off { opacity: .45; }

/* ----- Fila de ação: lista curta com contato e motivo ----- */
.queue { display: grid; gap: 8px; }
.queue-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border: 1px solid var(--border); border-left: 3px solid var(--warn); border-radius: 9px; background: var(--surface); }
.queue-row.q-cold { border-left-color: var(--neg); }
.queue-row.q-stuck { border-left-color: var(--warn); }
.queue-row.q-never { border-left-color: #9aa5b8; }
.queue-main { flex: 1; min-width: 0; }
.queue-name { font-size: 13.5px; font-weight: 600; color: #1c1a27; }
.queue-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.queue-why { font-size: 12px; color: #5c5866; white-space: nowrap; }

/* Gráfico de linha em SVG inline. */
.linechart { width: 100%; height: auto; display: block; }
.linechart .axis { font-size: 10px; fill: var(--text-muted); }

/* ==============================================================================
   MENU NO CELULAR — TEM QUE FICAR NO FIM DO ARQUIVO
   ==============================================================================
   Media query NAO acrescenta especificidade: em empate, vence a regra que vem
   DEPOIS. Este bloco ja esteve logo apos .admin-shell, antes de .sidebar (que
   define position:sticky e width:248px) e de .main. Resultado no celular: o
   position:fixed daqui era sobrescrito, a barra continuava EM FLUXO ocupando
   248px de uma tela de 390px, e sobrava pouco mais de 100px para o conteudo -
   com o transform:translateX(-100%) fazendo a barra sumir da vista mas manter o
   espaco reservado. Parecia que o conteudo tinha encolhido sozinho.
   Ao mexer neste arquivo, mantenha este bloco por ultimo.
   ============================================================================== */
/* ---------- Menu no celular: barra lateral vira gaveta ----------
   Sem JavaScript. O checkbox #nav-toggle guarda o estado e os <label> abrem/fecham.
   No computador nada disto aparece: o botao e o fundo escurecido ficam com
   display:none e a barra segue fixa na lateral, como sempre foi.
   Por que gaveta e nao empilhar (como faz o painel da consultora): o menu do
   administrador tem dez itens de primeiro nivel com submenus, e empilhado empurraria
   o conteudo para muito abaixo da dobra em toda pagina. */
.nav-toggle { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.nav-burger { display: none; }
.nav-scrim { display: none; }

@media (max-width: 900px) {
    .nav-burger {
        display: grid;
        place-items: center;
        width: 38px;
        height: 38px;
        flex-shrink: 0;
        border: 1px solid var(--border);
        border-radius: 9px;
        background: #fff;
        font-size: 17px;
        color: var(--text);
        cursor: pointer;
        user-select: none;
    }
    .nav-burger:hover { background: #f4f2ec; }

    /* fixed (e nao sticky) para a gaveta deslizar por cima do conteudo */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 60;
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: 0 0 34px rgba(0, 0, 0, .22);
    }
    .nav-toggle:checked ~ .admin-shell .sidebar { transform: translateX(0); }

    /* Fundo escurecido: tocar nele fecha a gaveta. So existe com a gaveta aberta. */
    .nav-toggle:checked ~ .admin-shell .nav-scrim {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 55;
        background: rgba(0, 0, 0, .42);
    }

    /* Sem a barra ocupando 248px, o conteudo usa a largura toda. */
    .main { width: 100%; min-width: 0; }
    .topbar { gap: 10px; padding-left: 14px; padding-right: 14px; }
    /* O texto decorativo da barra superior some para sobrar espaco ao nome e ao Sair. */
    .topbar .ticker { display: none; }
    .content { padding: 16px 14px; }
}

/* ---------- Funil do dashboard no celular ----------
   No computador o rotulo da taxa fica AO LADO do badge (.fb-rate-text e absoluto em
   left: calc(100% + 12px), com white-space: nowrap). Em 390px de largura, um rotulo
   como "Indicacoes por embaixador ativo" simplesmente sai pela direita da tela.
   Aqui ele desce para baixo do badge e passa a quebrar linha. O .fb-rate continua
   centralizado na etapa; como ele e absoluto e encolhe para caber no conteudo, dar
   uma largura em vw ao rotulo faz o conjunto ficar centralizado sem depender da
   largura do trapezio, que e estreita e varia a cada etapa. */
@media (max-width: 600px) {
    .funnelb { gap: 58px; }          /* espaco para badge + rotulo em duas linhas */

    .fb-rate {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        bottom: -30px;
    }
    .fb-rate-text {
        position: static;
        transform: none;
        white-space: normal;
        text-align: center;
        width: 78vw;
        line-height: 1.35;
    }
}

/* ---------- Tabelas no celular ----------
   CAUSA RAIZ DE VARIAS TELAS "QUEBRADAS" AO MESMO TEMPO. Uma tabela mais larga que a
   tela nao estoura so ela: ela estica o DOCUMENTO. E com o documento mais largo que a
   janela, todo o resto passa a ser posicionado em relacao a essa largura maior - por
   isso a barra superior desalinhava, os cartoes apareciam deslocados e, em algumas
   telas, o conteudo sumia pela esquerda. Nao eram varias telas com defeitos
   diferentes; era a tabela empurrando a pagina em cada uma delas.

   A rolagem fica DENTRO do cartao: o dedo arrasta a tabela para o lado e a pagina
   continua parada. O projeto ja tinha .table-scroll para isto, mas so 8 das 43 telas
   com tabela usavam. O :has() resolve as 43 sem depender de alguem lembrar de
   envolver cada <table> - inclusive as telas que ainda nao existem.

   So no celular: no computador as tabelas cabem, e overflow-x recortaria os menus
   suspensos das colunas de acao (foi exatamente esse o defeito do menu de tres
   pontos na tela de Campanhas). */
@media (max-width: 900px) {
    .card:has(table) { overflow-x: auto; }

    /* O MENU DE AÇÕES (⋮) NO CELULAR — vira uma folha presa ao rodapé da tela.
       As duas tentativas anteriores falharam por motivos OPOSTOS, e os dois casos
       apareceram nos prints do Chrome no iPhone:
         - position:absolute era recortado pelo cartão que rola de lado;
         - position:static, que veio no lugar, crescia dentro da linha e empurrava a
           lista de Embaixadores para fora da tela pela direita — e, dentro da tabela
           de Indicações, espremia numa célula de 30px, saindo UMA PALAVRA POR LINHA.
       position:fixed é a única que resolve os dois: escapa de qualquer container com
       overflow e de qualquer célula estreita, porque se ancora na janela. */
    .kebab-menu {
        position: fixed;
        left: 10px; right: 10px; bottom: 10px; top: auto;
        min-width: 0; z-index: 210;
        border-radius: 14px;
        box-shadow: 0 -2px 40px rgba(20, 18, 40, .3);
        padding: 4px;
    }

    /* Alvo de toque de verdade: 30px é menor que os 44px que a Apple recomenda, e
       aqui cada opção decide dinheiro (aprovar, pagar, desativar). */
    .kebab-menu button,
    .kebab-menu a {
        padding: 15px 16px !important;
        font-size: 15px !important;
        border-radius: 10px;
    }

    /* Fundo escuro atrás da folha. Serve para dois fins: separa o menu do conteúdo,
       e é a área que fecha ao toque (ver o script no _AdminLayout). Sem ele, a folha
       flutuava sobre a lista sem nenhuma pista de que era modal.
       Usa top/right/bottom/left em vez de `inset`, que só existe no Safari 14.5+. */
    .kebab[open]::before {
        content: "";
        position: fixed;
        top: 0; right: 0; bottom: 0; left: 0;
        z-index: 200;
        background: rgba(20, 18, 40, .38);
    }

    .kebab > summary { width: 40px; height: 40px; }
}

/* Respeita quem pediu menos animacao no sistema. */
@media (prefers-reduced-motion: reduce) {
    .sidebar { transition: none; }
}

/* Faixa de recompensa no ranking — selo discreto, para não competir com o valor em R$ */
.rk-faixa {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: #fff4e0;
    color: #8a5a00;
    border: 1px solid #f0d6a8;
    font-size: 12px;
    font-weight: 700;
}

/* ===================================================================================
   O ZOOM DO iPHONE
   Ao focar um campo com font-size MENOR que 16px, o iOS dá zoom na página — e NÃO
   desfaz ao sair do campo. A pessoa toca no primeiro campo, a página pula, e ela passa
   o resto do formulário arrastando de lado para ver o que digita.
   Vale em toda versão do iOS, inclusive dentro do navegador embutido do WhatsApp.
   A saída NÃO é bloquear o zoom no viewport (user-scalable=no): isso tira o pinch-zoom
   de quem enxerga mal, e boa parte deste público é médico lendo no celular.
   Só em tela de toque — no computador o tamanho original fica como está.
   =================================================================================== */
@media (pointer: coarse) {
    input, select, textarea { font-size: 16px; }
}

/* ===================================================================================
   <dialog> EM NAVEGADOR ANTIGO
   O elemento só existe no Safari a partir do 15.4 (março/2022) e no Chrome 37+.
   Onde ele não existe, o navegador o trata como elemento desconhecido: a regra interna
   `dialog:not([open]) { display: none }` não existe, e TODO o conteúdo do modal fica
   plantado no meio da página, permanentemente — campos vazios de "Links pessoais"
   aparecendo embaixo da lista de Embaixadores, por exemplo.
   Esta regra devolve o comportamento mínimo: fechado é invisível. O JavaScript
   correspondente (ver _AdminLayout) abre com setAttribute('open') quando showModal não
   existe, então o modal vira um bloco expandido em vez de uma função morta.
   =================================================================================== */
dialog:not([open]) { display: none; }

/* Links de serviço da porta: "primeiro acesso", "esqueci minha senha", "já tenho senha".
   Cada tela resolvia isso do seu jeito — uma com <p style="..."> solto, outra com classe
   própria —, e o resultado eram portas com a mesma função e três aparências. Agora
   compartilham a mesma regra. */
/* O campo de código de 6 dígitos: espaçado e centralizado, para a pessoa conferir
   dígito a dígito contra o e-mail sem perder a conta. */
.auth-codigo { letter-spacing: 6px; text-align: center; font-size: 18px; }

.auth-links { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.auth-links a { font-size: 13px; color: var(--navy, #221C59); text-decoration: none; font-weight: 600; }
.auth-links a:hover, .auth-links a:focus-visible { text-decoration: underline; }

/* Rodapé das telas de login: a saída para quem caiu na porta errada.
   Até 12/08/2026 as três portas eram mudas e não se conheciam — quem recebia o link
   trocado ouvia "CPF ou senha inválidos" e não tinha para onde ir. */
.auth-portas {
    margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border);
    font-size: 12.5px; color: var(--text-muted); text-align: center; line-height: 1.7;
}
.auth-portas a { color: var(--primary); text-decoration: none; font-weight: 600; }
.auth-portas a:hover, .auth-portas a:focus-visible { text-decoration: underline; }
