/* ===================================================================
   Minka  |  Identidade visual — indigo/violeta + sinal esmeralda
   =================================================================== */
:root {
  /* marca */
  --indigo: #4F46E5;
  --indigo-500: #6366F1;
  --violet: #8B5CF6;
  --grad: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
  --signal: #10B981;          /* esmeralda — ação / empresa ativa */
  --ink: #0B1020;             /* superfície escura / cabeçalho */
  --ink-2: #141A2B;
  /* interface */
  --bg: #F4F6FB;
  --card: #ffffff;
  --texto: #1B2130;
  --texto-suave: #64708A;
  --borda: #E3E8F2;
  --sombra: 0 1px 3px rgba(17, 24, 51, .05), 0 10px 30px rgba(17, 24, 51, .07);
  --raio: 14px;
  --ok: #047857;
  /* compat (nomes antigos usados em estilos inline) */
  --azul: #4F46E5; --azul-claro: #6366F1; --azul-2: #6366F1; --accent: #6366F1;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--texto); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased;
}
h1, h2, h3,
.topo-brand, .wordmark, .logo-area h1, .painel h2, .admin-head h2, .modal-card h3, thead th {
  font-family: "Sora", "Inter", sans-serif;
}
.dica { font-weight: 400; color: var(--texto-suave); font-size: 12px; }

/* ----------------------------- LOGIN ----------------------------- */
.tela-login {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(900px 480px at 82% -12%, #3B36B3 0%, transparent 55%),
    radial-gradient(760px 520px at -5% 112%, #2A2170 0%, transparent 52%),
    var(--ink);
  padding: 20px;
}
.card-login {
  width: 100%; max-width: 390px;
  background: var(--card); border-radius: 18px;
  box-shadow: 0 24px 70px rgba(5, 8, 25, .5);
  padding: 36px 32px 26px;
}
.logo-area { text-align: center; margin-bottom: 22px; }
.logo-area .brand-logo {
  width: 60px; height: 60px; object-fit: contain; display: block; margin: 0 auto 10px;
  filter: drop-shadow(0 10px 22px rgba(99, 102, 241, .4));
}
.logo-area h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0; color: var(--texto); }
.logo-area h1 .dot { color: var(--violet); }
.logo-area .sub { margin: 0; color: var(--texto-suave); font-size: 13px; }
.card-login label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; color: var(--texto); }
.card-login input {
  width: 100%; padding: 12px 13px; border: 1px solid var(--borda);
  border-radius: 10px; font-size: 15px; outline: none; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.card-login input:focus { border-color: var(--indigo-500); box-shadow: 0 0 0 3px rgba(99, 102, 241, .18); }
.card-login button {
  width: 100%; margin-top: 22px; padding: 13px; border: 0; border-radius: 11px;
  background: var(--grad); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer;
  font-family: inherit; box-shadow: 0 10px 24px rgba(99, 102, 241, .4);
  transition: filter .15s, transform .05s;
}
.card-login button:hover { filter: brightness(1.06); }
.card-login button:active { transform: translateY(1px); }
.card-login button:disabled { opacity: .7; cursor: default; }
.erro { color: #DC2626; font-size: 13px; margin: 12px 0 0; text-align: center; }
.rodape-login { text-align: center; color: var(--texto-suave); font-size: 12px; margin-top: 18px; }

/* ------------------------------ APP ------------------------------ */
.topo {
  background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; height: 60px; border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.topo-brand { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; letter-spacing: -.01em; }
.topo-brand .brand-logo { width: 30px; height: 30px; object-fit: contain; }
.topo-sub { opacity: .6; font-weight: 500; font-size: 14px; font-family: "Inter", sans-serif; }
.topo-acoes { display: flex; gap: 10px; align-items: center; }
.btn-sair {
  background: rgba(255, 255, 255, .1); color: #fff; border: 0; padding: 8px 16px;
  border-radius: 9px; cursor: pointer; font-size: 14px; font-family: inherit; transition: background .15s;
}
.btn-sair:hover { background: rgba(255, 255, 255, .2); }

.aviso-demo { background: #FFF6E5; color: #8A5A00; border-bottom: 1px solid #F0D9A8; padding: 10px 22px; font-size: 13px; text-align: center; }

.tag-sec { display: inline-block; margin-top: 4px; font-size: 11px; background: #EEF0FF; color: #4338CA; padding: 1px 8px; border-radius: 10px; font-weight: 600; }

.container { max-width: 1180px; margin: 24px auto; padding: 0 16px; }

.painel {
  background: var(--card); border-radius: var(--raio); box-shadow: var(--sombra);
  padding: 24px; margin-bottom: 22px; border: 1px solid #EEF1F7;
}
.painel h2 { margin: 0 0 16px; font-size: 17px; color: var(--texto); font-weight: 700; letter-spacing: -.01em; }

.filtros { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.campo { margin-bottom: 4px; }
.campo label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.campo .dica { font-weight: 400; color: var(--texto-suave); font-size: 12px; }
.campo input[type=text], .campo select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--borda);
  border-radius: 10px; font-size: 14px; outline: none; background: #fff; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.campo input:focus, .campo select:focus { border-color: var(--indigo-500); box-shadow: 0 0 0 3px rgba(99, 102, 241, .14); }

.autocomplete { position: relative; }
.autocomplete-lista {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px);
  background: #fff; border: 1px solid var(--borda); border-radius: 10px;
  box-shadow: var(--sombra); max-height: 280px; overflow-y: auto;
}
.autocomplete-lista .item { padding: 10px 12px; cursor: pointer; font-size: 13px; border-bottom: 1px solid #F0F3F6; }
.autocomplete-lista .item:hover, .autocomplete-lista .item.ativo { background: #EEF0FF; }
.autocomplete-lista .item .cod { color: var(--indigo); font-weight: 700; margin-right: 6px; }
.autocomplete-lista .nada { padding: 10px 12px; color: var(--texto-suave); font-size: 13px; }

.cnae-selecionado {
  margin-top: 8px; font-size: 13px; background: #EEF0FF; border: 1px solid #D7D9FB;
  color: #3730A3; padding: 9px 11px; border-radius: 9px; display: flex; justify-content: space-between; gap: 8px;
}
.cnae-selecionado b { color: #312E81; }
.cnae-selecionado .x { cursor: pointer; color: #6366F1; font-weight: 700; }

.campo-cidades { margin-top: 16px; }
.cidades-barra { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.cidades-barra input { flex: 1; min-width: 180px; padding: 9px 11px; border: 1px solid var(--borda); border-radius: 9px; font-size: 13px; font-family: inherit; }
.cidades-barra input:focus { outline: none; border-color: var(--indigo-500); box-shadow: 0 0 0 3px rgba(99, 102, 241, .14); }
.cidades-barra .todas { font-size: 13px; color: var(--texto-suave); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.cidades-box {
  border: 1px solid var(--borda); border-radius: 10px; padding: 10px; max-height: 190px; overflow-y: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 14px; background: #FAFBFE;
}
.cidades-box label { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 400; padding: 3px 2px; cursor: pointer; }
.cidades-box .placeholder { color: var(--texto-suave); font-size: 13px; grid-column: 1 / -1; margin: 6px; }
input[type=checkbox] { accent-color: var(--indigo); }

.acoes { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.btn-buscar {
  background: var(--grad); color: #fff; border: 0; padding: 12px 24px; border-radius: 11px;
  font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit;
  box-shadow: 0 10px 22px rgba(99, 102, 241, .32); transition: filter .15s, transform .05s;
}
.btn-buscar:hover { filter: brightness(1.06); }
.btn-buscar:active { transform: translateY(1px); }
.btn-buscar:disabled { opacity: .6; cursor: default; box-shadow: none; }
.btn-exportar {
  background: #fff; color: var(--indigo); border: 1px solid var(--indigo); padding: 12px 18px;
  border-radius: 11px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; transition: background .15s;
}
.btn-exportar:hover { background: #EEF0FF; }
.btn-exportar:disabled { opacity: .5; cursor: default; border-color: var(--borda); color: var(--texto-suave); }

/* resultado */
.resumo { font-size: 14px; color: var(--texto); margin-bottom: 12px; font-weight: 600; }
.resumo b { color: var(--indigo); }
.tabela-wrap { overflow-x: auto; background: var(--card); border-radius: var(--raio); box-shadow: var(--sombra); border: 1px solid #EEF1F7; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  background: #F1F3FA; color: #4338CA; text-align: left; padding: 12px;
  font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--borda); position: sticky; top: 0;
  font-size: 12px; letter-spacing: .01em;
}
tbody td { padding: 11px 12px; border-bottom: 1px solid #EFF2F7; vertical-align: top; }
tbody tr:nth-child(even) { background: #FAFBFE; }
tbody tr:hover { background: #EEF0FF; }
/* --- colunas agrupadas (Empresa / Atividade / Endereço / Contato / Situação) --- */
.col-empresa { min-width: 230px; }
.col-empresa .rz { font-weight: 600; color: var(--texto); line-height: 1.35; }
.col-empresa .ft { font-size: 12px; color: var(--texto-suave); margin-top: 2px; }
.col-empresa .cnpj { font-size: 12px; color: var(--texto-suave); font-variant-numeric: tabular-nums; white-space: nowrap; margin-top: 4px; }
.col-ativ { min-width: 170px; max-width: 250px; }
.col-ativ .cnae-cod { font-weight: 600; color: var(--indigo); font-variant-numeric: tabular-nums; }
.col-ativ .cnae-desc { font-size: 12px; color: var(--texto-suave); margin-top: 2px; }
.col-end { min-width: 180px; font-size: 12.5px; color: var(--texto-suave); line-height: 1.5; }
.col-end .cidade { color: var(--texto); font-weight: 500; }
.col-end .cep { font-variant-numeric: tabular-nums; }
.col-contato { min-width: 175px; font-size: 12.5px; }
.col-contato .ct { white-space: nowrap; margin-bottom: 2px; }
.col-sit { white-space: nowrap; }
.col-sit .dt { font-size: 11px; color: var(--texto-suave); margin-top: 6px; }
.vazio-cel { color: #AEB6C6; font-size: 12px; font-style: italic; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.ativa { background: #E7F8F0; color: var(--ok); }
.badge.outra { background: #FDECEA; color: #C0392B; }
a.email { color: var(--indigo); text-decoration: none; font-weight: 500; }
a.email:hover { text-decoration: underline; }

.vazio { background: var(--card); border-radius: var(--raio); box-shadow: var(--sombra); padding: 30px; text-align: center; color: var(--texto-suave); border: 1px solid #EEF1F7; }

.paginacao { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 18px 0 40px; }
.paginacao button { background: #fff; border: 1px solid var(--borda); border-radius: 9px; padding: 9px 16px; cursor: pointer; font-size: 14px; font-family: inherit; transition: background .15s, border-color .15s; }
.paginacao button:hover:not(:disabled) { background: #EEF0FF; border-color: var(--indigo-500); }
.paginacao button:disabled { opacity: .45; cursor: default; }
.paginacao #pagInfo { font-size: 13px; color: var(--texto-suave); }

/* ------------------------------ ADMIN ------------------------------ */
.admin-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.admin-head h2 { margin: 0; font-size: 18px; }
.acoes-linha { white-space: nowrap; }
.acoes-linha button { background: #fff; border: 1px solid var(--borda); border-radius: 8px; padding: 6px 12px; margin-right: 6px; cursor: pointer; font-size: 13px; font-family: inherit; transition: background .15s, border-color .15s; }
.acoes-linha button:hover { background: #EEF0FF; border-color: var(--indigo-500); }
.acoes-linha button[disabled] { opacity: .4; cursor: default; }

.modal { position: fixed; inset: 0; background: rgba(11, 16, 32, .55); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal-card { background: #fff; border-radius: 16px; padding: 26px; width: 100%; max-width: 430px; box-shadow: 0 30px 70px rgba(0, 0, 0, .4); }
.modal-card h3 { margin: 0 0 14px; color: var(--texto); font-size: 19px; }
.modal-card label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 5px; }
.modal-card input[type=text] { width: 100%; padding: 11px 13px; border: 1px solid var(--borda); border-radius: 10px; font-size: 14px; outline: none; font-family: inherit; }
.modal-card input[type=text]:focus { border-color: var(--indigo-500); box-shadow: 0 0 0 3px rgba(99, 102, 241, .14); }
.modal-card input[disabled] { background: #F1F3F8; color: #8A97A5; }
.modal-card label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin-top: 12px; }
.modal-acoes { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

@media (max-width: 720px) {
  .filtros { grid-template-columns: 1fr; }
  .topo-brand { font-size: 16px; }
}

/* ---------- Admin: nav, formulário de cliente, chips, barra de uso ---------- */
.topo-nav { display: flex; gap: 6px; margin-right: auto; margin-left: 14px; }
.topo-nav a { color: rgba(255,255,255,.72); text-decoration: none; font-size: 14px; font-weight: 500; padding: 7px 14px; border-radius: 8px; }
.topo-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.topo-nav a.ativo { background: rgba(255,255,255,.14); color: #fff; }

.modal-card.wide { max-width: 680px; max-height: 90vh; overflow-y: auto; }
.sub-h { font-family: "Sora", sans-serif; font-size: 12px; color: var(--texto-suave); margin: 4px 0 10px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.sep { border: 0; border-top: 1px solid var(--borda); margin: 18px 0 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .campo { margin: 0; }
.form-grid .span2 { grid-column: 1 / -1; }
.form-grid select, .form-grid input[type=text], .form-grid input[type=number] {
  width: 100%; padding: 10px 12px; border: 1px solid var(--borda); border-radius: 10px; font-size: 14px; outline: none; font-family: inherit; background: #fff;
}
.form-grid select:focus, .form-grid input:focus { border-color: var(--indigo-500); box-shadow: 0 0 0 3px rgba(99,102,241,.14); }
.doc-row { display: flex; gap: 8px; }
.doc-row input { flex: 1; }
.doc-row .btn-exportar { padding: 8px 14px; white-space: nowrap; border-radius: 10px; }
.inline { display: flex; align-items: center; gap: 10px; }
.inline input[type=number] { flex: 1; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--texto-suave); font-weight: 500; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; background: #EEF0FF; border: 1px solid #D7D9FB; color: #3730A3; padding: 5px 10px; border-radius: 999px; font-size: 12.5px; }
.chip b { color: #312E81; }
.chip .x { cursor: pointer; color: #6366F1; font-weight: 700; }
.barra { height: 5px; background: #EEF1F7; border-radius: 999px; overflow: hidden; margin-top: 4px; max-width: 120px; }
.barra span { display: block; height: 100%; background: var(--indigo); }

@media (max-width: 680px) { .form-grid { grid-template-columns: 1fr; } .topo-nav { margin-left: 0; } }

/* ---------- Sidebar do admin ---------- */
body.admin { background: var(--bg); }
.admin-layout { display: flex; min-height: 100vh; align-items: stretch; }
.sidebar { width: 244px; flex-shrink: 0; background: var(--ink); color: #fff; display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100vh; }
.sb-brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 20px; }
.sb-brand img { width: 36px; height: 36px; object-fit: contain; }
.sb-name { font-family: "Sora", sans-serif; font-weight: 700; font-size: 19px; line-height: 1; letter-spacing: -.01em; }
.sb-sub { font-size: 10px; color: #8A93AD; letter-spacing: .14em; text-transform: uppercase; margin-top: 4px; }
.sb-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.sb-link { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px; color: rgba(255,255,255,.72); text-decoration: none; font-size: 14.5px; font-weight: 500; transition: background .15s, color .15s; }
.sb-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.sb-link.ativo { background: linear-gradient(135deg, #6366F1, #8B5CF6); color: #fff; box-shadow: 0 8px 20px rgba(99,102,241,.35); }
.sb-link .ic { width: 20px; height: 20px; display: inline-flex; flex-shrink: 0; opacity: .95; }
.sb-link .ic svg { width: 20px; height: 20px; display: block; }
.sb-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.sb-sair { width: 100%; background: rgba(255,255,255,.1); color: #fff; border: 0; padding: 10px; border-radius: 10px; cursor: pointer; font-size: 14px; font-family: inherit; transition: background .15s; }
.sb-sair:hover { background: rgba(255,255,255,.2); }
.admin-main { flex: 1; min-width: 0; }
.admin-main .container { margin: 28px auto; }
.admin-vazio { padding: 60px 20px; text-align: center; color: var(--texto-suave); }

@media (max-width: 820px) {
  .admin-layout { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 6px; padding: 10px 14px; }
  .sb-brand { padding: 0 12px 0 2px; }
  .sb-sub { display: none; }
  .sb-nav { flex-direction: row; flex-wrap: wrap; margin-top: 0; }
  .sb-link { padding: 8px 12px; }
  .sb-foot { margin: 0 0 0 auto; padding: 0; border: 0; }
  .sb-sair { width: auto; padding: 8px 14px; }
  .admin-main .container { margin: 18px auto; }
}

/* ---------- Busca: modo cliente (banner de uso + gerar lead) ---------- */
.uso-banner { background: linear-gradient(135deg, #EEF0FF, #F3EEFF); border: 1px solid #D7D9FB; border-radius: 14px; padding: 14px 18px; margin-bottom: 18px; }
.ub-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ub-nome { font-family: "Sora", sans-serif; font-weight: 700; color: #312E81; font-size: 15px; }
.ub-leads { font-size: 14px; color: #3730A3; }
.ub-leads b { color: #312E81; }
.ub-bar { height: 7px; background: #E0E2F5; border-radius: 999px; overflow: hidden; margin-top: 10px; }
.ub-bar span { display: block; height: 100%; border-radius: 999px; }
.ub-aviso { margin-top: 10px; background: #FDECEA; color: #B23B2E; border: 1px solid #F5C6C0; padding: 8px 12px; border-radius: 9px; font-size: 13px; font-weight: 600; }
.btn-gerar { background: linear-gradient(135deg, #10B981, #059669); color: #fff; border: 0; padding: 12px 22px; border-radius: 11px; font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit; box-shadow: 0 10px 22px rgba(16,185,129,.3); transition: filter .15s, transform .05s; }
.btn-gerar:hover:not(:disabled) { filter: brightness(1.05); }
.btn-gerar:active { transform: translateY(1px); }
.btn-gerar:disabled { opacity: .5; cursor: default; box-shadow: none; }
.col-check { width: 38px; text-align: center; }
.col-check input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--indigo); }
td.col-check input:disabled { cursor: default; }
.locked { color: #8A93AD; font-size: 12.5px; font-style: italic; }
.lead-ok { display: inline-block; font-size: 11px; font-weight: 700; color: #047857; background: #E7F8F0; padding: 1px 7px; border-radius: 999px; vertical-align: middle; margin-left: 4px; }
.row-revelado { background: #F4FBF7 !important; }

/* ---------- Cidades: campo suspenso ---------- */
.dropdown { position: relative; }
.dd-trigger { width: 100%; text-align: left; padding: 11px 36px 11px 13px; border: 1px solid var(--borda); border-radius: 10px; background: #fff; font-size: 14px; font-family: inherit; color: var(--texto-suave); cursor: pointer; position: relative; transition: border-color .15s, box-shadow .15s; }
.dd-trigger.tem-selecao { color: var(--texto); font-weight: 500; }
.dd-trigger::after { content: '▾'; position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--texto-suave); font-size: 12px; }
.dd-trigger:not(:disabled):hover { border-color: var(--indigo-500); }
.dd-trigger:not(:disabled):focus { outline: none; border-color: var(--indigo-500); box-shadow: 0 0 0 3px rgba(99,102,241,.14); }
.dd-trigger:disabled { background: #F4F6FB; color: #9AA3B8; cursor: default; }
.dd-painel { position: absolute; z-index: 25; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--borda); border-radius: 12px; box-shadow: var(--sombra); padding: 12px; }
.dd-painel .cidades-box { border: 0; padding: 4px 0 0; max-height: 240px; background: transparent; }
.dd-painel .cidades-barra { margin-bottom: 4px; }

/* ---------- Financeiro (KPIs + faturas) ---------- */
.fin-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fin-toolbar input[type=month], #fStatus { padding: 9px 12px; border: 1px solid var(--borda); border-radius: 10px; font-size: 14px; font-family: inherit; background: #fff; outline: none; }
.fin-toolbar input[type=month]:focus, #fStatus:focus { border-color: var(--indigo-500); box-shadow: 0 0 0 3px rgba(99,102,241,.14); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { background: #fff; border: 1px solid #EEF1F7; border-left: 4px solid #B7791F; border-radius: 14px; padding: 16px 18px; box-shadow: var(--sombra); }
.kpi-t { font-size: 12px; color: var(--texto-suave); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi-v { font-family: "Sora", sans-serif; font-weight: 700; font-size: 24px; margin-top: 6px; color: var(--texto); letter-spacing: -.01em; }
.kpi-s { font-size: 12px; color: var(--texto-suave); margin-top: 4px; }
.kpi.ok { border-left-color: var(--signal); } .kpi.ok .kpi-v { color: #047857; }
.kpi.bad { border-left-color: #C0392B; } .kpi.bad .kpi-v { color: #C0392B; }
.kpi.mrr { border-left-color: var(--indigo); } .kpi.mrr .kpi-v { color: var(--indigo); }
.badge.pend { background: #FEF3E2; color: #B7791F; }
.badge.canc { background: #EEF1F7; color: #64708A; }
@media (max-width: 820px) { .kpis { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Contratos: lista + documento imprimível ---------- */
.acoes-linha a.btn-mini { display: inline-block; background: #fff; border: 1px solid var(--indigo); color: var(--indigo); border-radius: 8px; padding: 5px 12px; font-size: 13px; text-decoration: none; font-weight: 600; }
.acoes-linha a.btn-mini:hover { background: #EEF0FF; }
.doc-body { background: #EEF1F7; }
.doc-toolbar { max-width: 820px; margin: 18px auto 0; padding: 0 16px; display: flex; gap: 10px; justify-content: flex-end; }
.doc { max-width: 820px; margin: 16px auto 40px; background: #fff; border: 1px solid #E6E9F2; border-radius: 14px; box-shadow: var(--sombra); padding: 48px 56px; color: #1B2130; line-height: 1.65; }
.doc-head { display: flex; align-items: center; gap: 14px; border-bottom: 2px solid #EEF1F7; padding-bottom: 18px; }
.doc-logo { width: 46px; height: 46px; object-fit: contain; }
.doc-head-txt { flex: 1; }
.doc-marca { font-family: "Sora", sans-serif; font-weight: 800; font-size: 22px; letter-spacing: -.02em; }
.doc-sub { font-size: 12px; color: var(--texto-suave); }
.doc-num { text-align: right; font-size: 12px; color: var(--texto-suave); }
.doc-num b { color: var(--indigo); font-size: 14px; }
.doc h1 { font-family: "Sora", sans-serif; font-size: 20px; text-align: center; margin: 22px 0 24px; line-height: 1.3; }
.doc h2 { font-family: "Sora", sans-serif; font-size: 15px; margin: 20px 0 6px; color: var(--indigo); }
.doc p, .doc li { font-size: 14px; }
.doc ul { margin: 6px 0; padding-left: 20px; }
.doc .doc-partes { background: #F7F8FC; border: 1px solid #EEF1F7; border-radius: 10px; padding: 10px 14px; margin: 8px 0; }
.doc .ph { background: #FEF3E2; color: #B7791F; padding: 0 4px; border-radius: 4px; font-weight: 600; }
.doc-assinaturas { display: flex; gap: 40px; margin-top: 64px; }
.doc-assinaturas .ass { flex: 1; text-align: center; font-size: 13px; color: var(--texto-suave); }
.doc-assinaturas .linha { border-top: 1px solid #333; margin-bottom: 8px; }
.doc-data { margin-top: 28px; font-size: 14px; }
@media print {
  .no-print { display: none !important; }
  .doc-body { background: #fff; }
  .doc { box-shadow: none; border: 0; border-radius: 0; margin: 0; max-width: none; padding: 0; }
  .doc .ph { background: none; color: #000; }
}

/* ---------- Agendar visita (Google Agenda) ---------- */
.btn-visita { background: linear-gradient(135deg, #6366F1, #8B5CF6); color: #fff; border: 0; padding: 12px 22px; border-radius: 11px; font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit; box-shadow: 0 10px 22px rgba(99,102,241,.3); transition: filter .15s, transform .05s; }
.btn-visita:hover:not(:disabled) { filter: brightness(1.05); }
.btn-visita:active { transform: translateY(1px); }
.btn-visita:disabled { opacity: .5; cursor: default; box-shadow: none; }
.form-grid input[type=date], .form-grid input[type=time] { width: 100%; padding: 10px 12px; border: 1px solid var(--borda); border-radius: 10px; font-size: 14px; font-family: inherit; outline: none; }
.form-grid input[type=date]:focus, .form-grid input[type=time]:focus { border-color: var(--indigo-500); box-shadow: 0 0 0 3px rgba(99,102,241,.14); }
.visita-lista { display: flex; flex-direction: column; gap: 8px; max-height: 42vh; overflow-y: auto; }
.visita-lista .placeholder { color: var(--texto-suave); font-size: 13px; padding: 8px 2px; }
.visita-item { display: flex; align-items: center; gap: 12px; border: 1px solid var(--borda); border-radius: 12px; padding: 10px 12px; background: #fff; }
.visita-item .vi-hora { font-weight: 700; color: var(--indigo); font-size: 15px; min-width: 46px; font-variant-numeric: tabular-nums; }
.visita-item .vi-info { flex: 1; min-width: 0; }
.visita-item .vi-nome { font-weight: 600; color: var(--texto); font-size: 14px; }
.visita-item .vi-end { font-size: 12.5px; color: var(--texto-suave); margin-top: 2px; }
.visita-item .vi-abrir { white-space: nowrap; background: #EEF0FF; border: 1px solid #D7D9FB; color: #3730A3; border-radius: 9px; padding: 7px 12px; font-size: 13px; font-weight: 600; text-decoration: none; }
.visita-item .vi-abrir:hover { background: #E0E3FF; }

/* ---------- Minha equipe (vendedores do cliente) ---------- */
.equipe-lista { display: flex; flex-direction: column; gap: 8px; max-height: 34vh; overflow-y: auto; }
.equipe-lista .placeholder { color: var(--texto-suave); font-size: 13px; padding: 6px 2px; }
.equipe-item { display: flex; align-items: center; gap: 12px; border: 1px solid var(--borda); border-radius: 12px; padding: 10px 12px; background: #fff; }
.equipe-item.inativo { opacity: .6; }
.equipe-item .ei-info { flex: 1; min-width: 0; }
.equipe-item .ei-nome { font-weight: 600; color: var(--texto); font-size: 14px; }
.equipe-item .ei-tag { font-size: 11px; font-weight: 600; color: #B7791F; background: #FEF3E2; border-radius: 6px; padding: 1px 6px; }
.equipe-item .ei-sub { font-size: 12.5px; color: var(--texto-suave); margin-top: 2px; }
.equipe-item .ei-acoes { display: flex; gap: 6px; white-space: nowrap; }
.equipe-item .ei-acoes button { background: #fff; border: 1px solid var(--borda); border-radius: 8px; padding: 6px 11px; cursor: pointer; font-size: 13px; font-family: inherit; transition: background .15s, border-color .15s; }
.equipe-item .ei-acoes button:hover { background: #EEF0FF; border-color: var(--indigo-500); }
