/* ============================================================================
   RENOVAÇO — pele do sistema, sobre os tokens oficiais de /renovaco.css

   Cores: navy #1B3B69 · turquesa #29B8C0 · cinza #4D4D4D — medidas na logo.
   A proporção da marca manda: navy domina, branco respira, turquesa pontua.

   🔴 REGRA: nenhum hex de marca aqui. Só var(--…). Se aparecer um # de cor,
   ou é estado ainda não tokenizado, ou é erro. Ver IDENTIDADE-VISUAL.md §9.
   ============================================================================ */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--fundo-alt);
  color: var(--texto);
  font-family: var(--fonte-texto);
  font-size: var(--txt-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, .marca, .porta-titulo, .kpi .n {
  font-family: var(--fonte-titulo);
  letter-spacing: -0.02em;
}

a { color: var(--acento-texto); }   /* turquesa-800: o único legível sobre claro */

.wrap { max-width: 780px; margin: 0 auto; padding: 26px 20px 60px; }
.wrap-largo { max-width: var(--largura-conteudo); }

/* ---------- faixa institucional: navy sólido + logo negativa ---------- */
.topo {
  display: flex; align-items: center; gap: var(--e-3); flex-wrap: wrap;
  background: var(--navy-500);
  margin: -26px -20px var(--e-6);
  padding: var(--e-4) var(--e-6);
  border-bottom: 3px solid var(--turq-500);
}
.topo .logo { height: 34px; width: auto; display: block; }
.marca { font-weight: 700; font-size: var(--txt-lg); color: var(--texto-invertido); }
.selo {
  margin-left: auto; font-size: var(--txt-xs); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--turq-200); border: 1px solid var(--navy-400); padding: 5px 11px;
  border-radius: var(--raio-full); font-weight: 600;
}

.card {
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-radius: var(--raio-lg);
  box-shadow: var(--sombra-1);
  padding: var(--e-6);
  margin-bottom: var(--e-4);
}
.hero { padding: var(--e-8) var(--e-6); }
h1 { font-size: var(--txt-2xl); line-height: 1.15; margin: 0 0 var(--e-3); color: var(--texto-forte); }
h2 { font-size: var(--txt-lg); margin: 0 0 var(--e-2); color: var(--texto-forte); }
h3 {
  font-size: var(--txt-xs); margin: 0 0 var(--e-3); color: var(--texto-suave); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  border-left: 4px solid var(--turq-500); padding-left: var(--e-2);
}
h3 .media { text-transform: none; letter-spacing: 0; color: var(--acento-texto); }
p.sub { color: var(--texto-suave); margin: 0 0 var(--e-5); max-width: var(--largura-texto); }
.rodape { color: var(--texto-suave); font-size: var(--txt-sm); text-align: center; margin: var(--e-6) 0 0; }
.mono { font-family: var(--fonte-mono); }
.tique { font-size: 46px; line-height: 1; margin-bottom: var(--e-3); color: var(--ok); }

/* ---------- portas da tela inicial ---------- */
.portas { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--e-4); margin-top: var(--e-6); }
.porta {
  display: block; text-decoration: none; color: inherit; padding: var(--e-6);
  border: 1px solid var(--borda-forte); border-radius: var(--raio-lg);
  background: var(--superficie); transition: border-color var(--t-rapido), transform var(--t-rapido), box-shadow var(--t-rapido);
}
.porta:hover { border-color: var(--turq-500); transform: translateY(-2px); box-shadow: var(--sombra-2); }
.porta-tag { font-size: var(--txt-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--acento-texto); font-weight: 700; }
.porta.alt .porta-tag { color: var(--navy-400); }
.porta-titulo { font-size: var(--txt-lg); font-weight: 700; margin: 7px 0 var(--e-2); color: var(--texto-forte); }
.porta-desc { color: var(--texto-suave); font-size: var(--txt-sm); }
.porta-cta { margin-top: var(--e-3); font-weight: 700; color: var(--acento-texto); font-size: var(--txt-sm); }
.porta.alt .porta-cta { color: var(--navy-500); }

/* ---------- campos ---------- */
.campo { margin-bottom: var(--e-5); }
.campo > label.titulo { display: block; font-weight: 600; margin-bottom: 6px; color: var(--texto-forte); }
.campo .ajuda { color: var(--texto-suave); font-size: var(--txt-sm); margin-bottom: 9px; }

input[type="text"], input[type="tel"], input[type="email"], input[type="password"],
input[type="search"], select, textarea {
  width: 100%; min-height: var(--alvo-toque); padding: 11px 14px;
  border-radius: var(--raio-md); border: 1px solid var(--borda-forte);
  background: var(--superficie); color: var(--texto);
  font-family: inherit; font-size: var(--txt-base);
  transition: border-color var(--t-rapido), box-shadow var(--t-rapido);
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--turq-500); box-shadow: var(--anel-foco);
}

.opcoes { display: grid; gap: var(--e-2); }
.opcoes.duas { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.opcao {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; min-height: var(--alvo-toque);
  border: 1px solid var(--borda-forte); border-radius: var(--raio-md); cursor: pointer;
  background: var(--superficie); transition: border-color var(--t-rapido), background var(--t-rapido);
  font-size: var(--txt-sm);
}
.opcao:hover { border-color: var(--turq-400); }
.opcao input { accent-color: var(--turq-600); width: 18px; height: 18px; flex: none; }
.opcao.marcada { border-color: var(--turq-500); background: var(--turq-50); }

.acoes { display: flex; gap: 10px; align-items: center; margin-top: var(--e-5); flex-wrap: wrap; }
button, .btn {
  font-family: inherit; font-size: var(--txt-base); font-weight: 600; cursor: pointer;
  min-height: var(--alvo-toque); padding: 0 var(--e-6); border-radius: var(--raio-md);
  border: 1px solid transparent; transition: background var(--t-rapido), filter var(--t-rapido);
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
button:disabled { opacity: 0.45; cursor: default; }
.primario { background: var(--navy-500); color: var(--texto-invertido); }
.primario:hover:not(:disabled) { background: var(--navy-600); }
/* Acento: texto NAVY sobre turquesa. Branco sobre turquesa reprova (2,4:1). */
.acento { background: var(--turq-500); color: var(--navy-900); }
.acento:hover:not(:disabled) { background: var(--turq-600); }
.secundario { background: transparent; color: var(--navy-500); border-color: var(--navy-500); }
.secundario:hover { background: var(--navy-50); }
.mini { min-height: 34px; padding: 0 var(--e-3); font-size: var(--txt-sm); }
.aviso { color: var(--erro); font-size: var(--txt-sm); margin-top: 10px; min-height: 20px; }

/* ================= conversa ================= */
body.modo-chat { background: var(--fundo); }
body.modo-chat .wrap { padding-bottom: 210px; }

.chat-topo { position: sticky; top: 0; z-index: 5; background: var(--fundo); padding: 6px 0 var(--e-3); margin-bottom: var(--e-2); }
.barra { height: 6px; background: var(--navy-100); border-radius: var(--raio-full); overflow: hidden; }
.barra i { display: block; height: 100%; background: var(--turq-500); border-radius: var(--raio-full); transition: width 0.4s ease; }
.chat-passo { font-size: var(--txt-xs); color: var(--texto-suave); margin-top: 7px; text-transform: uppercase; letter-spacing: 0.08em; }

.chat { display: flex; flex-direction: column; gap: 10px; }
.balao { max-width: 86%; padding: 13px 17px; border-radius: var(--raio-lg); white-space: pre-wrap; animation: surge 0.24s ease; }
.balao.bot { background: var(--navy-50); border: 1px solid var(--navy-100); color: var(--texto); border-bottom-left-radius: 5px; align-self: flex-start; }
.balao.eu { background: var(--navy-500); color: var(--texto-invertido); border-bottom-right-radius: 5px; align-self: flex-end; font-weight: 500; }
@keyframes surge { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

.balao.digitando { display: flex; gap: 5px; padding: 16px 18px; }
.balao.digitando i { width: 7px; height: 7px; border-radius: 50%; background: var(--navy-300); animation: pisca 1.3s infinite; }
.balao.digitando i:nth-child(2) { animation-delay: 0.18s; }
.balao.digitando i:nth-child(3) { animation-delay: 0.36s; }
@keyframes pisca { 0%, 60%, 100% { opacity: 0.28; } 30% { opacity: 1; } }

.marco { text-align: center; margin: var(--e-5) 0 4px; }
.marco span {
  font-size: var(--txt-xs); letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
  color: var(--acento-texto); border: 1px solid var(--turq-200); border-radius: var(--raio-full);
  padding: 5px 14px; background: var(--turq-50);
}

.entrada {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), var(--fundo) 22%);
  padding: var(--e-6) 20px var(--e-4);
}
.entrada > * { max-width: 780px; margin-left: auto; margin-right: auto; }

.chips { display: flex; flex-wrap: wrap; gap: var(--e-2); }
.chip {
  min-height: var(--alvo-toque); padding: 0 17px; border-radius: var(--raio-full);
  border: 1px solid var(--borda-forte); background: var(--superficie); color: var(--texto);
  font-size: var(--txt-sm); font-weight: 600;
}
.chip:hover { border-color: var(--turq-500); color: var(--acento-texto); }
.chip.on { background: var(--turq-500); color: var(--navy-900); border-color: var(--turq-500); }
.chip.outro { color: var(--texto-suave); font-style: italic; }

.escala10 { display: flex; gap: 6px; flex-wrap: wrap; }
.nota {
  flex: 1; min-width: var(--alvo-toque); padding: 12px 0; border-radius: var(--raio-md);
  border: 1px solid var(--borda-forte); background: var(--superficie); color: var(--texto);
  font-weight: 700; font-family: var(--fonte-mono);
}
.nota:hover { background: var(--turq-500); color: var(--navy-900); border-color: var(--turq-500); }
.escala-legenda { display: flex; justify-content: space-between; font-size: var(--txt-xs); color: var(--texto-suave); margin-top: 7px; }

.campo-chat { display: flex; gap: var(--e-2); align-items: flex-end; }
.campo-chat textarea { min-height: 48px; max-height: 160px; resize: none; }
.campo-chat .enviar { flex: none; }
.campo-outro { margin-top: 9px; }
.acoes-chat { margin-top: 10px; display: flex; gap: 10px; }
.pular { display: block; margin: 9px auto 0; }

/* ================= painel ================= */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--e-3); margin-bottom: var(--e-5); }
.kpi { background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio-lg); box-shadow: var(--sombra-1); padding: 17px; }
.kpi .n { font-size: var(--txt-2xl); font-weight: 700; line-height: 1; color: var(--texto-forte); font-variant-numeric: tabular-nums; transition: color 0.4s; }
.kpi .r { font-size: var(--txt-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--texto-suave); margin-top: var(--e-2); }
.kpi.destaque { border-left: 4px solid var(--turq-500); }
.kpi.destaque .n { color: var(--acento-texto); }
.kpi .n.pulsou { color: var(--ok); }

.tabs { display: flex; gap: var(--e-2); margin-bottom: var(--e-4); flex-wrap: wrap; }
.tabs a {
  padding: 9px 16px; border-radius: var(--raio-full); border: 1px solid var(--borda-forte);
  text-decoration: none; color: var(--texto-suave); font-size: var(--txt-sm); background: var(--superficie);
}
.tabs a:hover { border-color: var(--turq-400); color: var(--acento-texto); }
.tabs a.ativa { background: var(--navy-500); color: var(--texto-invertido); border-color: var(--navy-500); font-weight: 600; }
.sub-tabs { margin-bottom: var(--e-3); }

.tabela-rolagem { overflow-x: auto; border: 1px solid var(--borda); border-radius: var(--raio-lg); background: var(--superficie); }
table { width: 100%; border-collapse: collapse; font-size: var(--txt-sm); }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--borda); white-space: nowrap; }
th {
  font-size: var(--txt-xs); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
  color: var(--navy-700); background: var(--navy-50); position: sticky; top: 0;
}
td.num, th.num { text-align: right; font-family: var(--fonte-mono); font-variant-numeric: tabular-nums; }
td.matricula { font-family: var(--fonte-mono); font-weight: 500; color: var(--texto-forte); }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--navy-50); }

/* Estado nunca é só cor: o texto da pílula entrega o sinal sozinho. */
.pill { font-size: var(--txt-xs); font-weight: 700; padding: 4px 10px; border-radius: var(--raio-full); text-transform: uppercase; letter-spacing: 0.04em; }
.pill.respondeu, .pill.ativo { background: var(--ok-bg); color: var(--ok); }
.pill.abriu, .pill.provisoria { background: var(--atencao-bg); color: var(--atencao); }
.pill.nao_abriu, .pill.inativo { background: var(--erro-bg); color: var(--erro); }
.pill.conflito { background: var(--erro-bg); color: var(--erro); }
.tag-tipo { font-size: var(--txt-xs); padding: 3px 9px; border-radius: var(--raio-full); border: 1px solid var(--borda-forte); color: var(--texto-suave); text-transform: uppercase; letter-spacing: 0.04em; }
.tag-tipo.ex { border-color: var(--navy-300); color: var(--navy-500); }

.agregado { margin-bottom: var(--e-6); }
.agregado .linha { display: grid; grid-template-columns: minmax(140px, 280px) 1fr 92px; gap: var(--e-3); align-items: center; margin-bottom: 6px; font-size: var(--txt-sm); }
.agregado .rot { color: var(--texto-suave); }
.agregado .trilho { background: var(--navy-100); border-radius: var(--raio-full); height: 22px; overflow: hidden; }
.agregado .trilho i { display: block; height: 100%; background: var(--turq-500); transition: width 0.5s; }
.agregado .qtd { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; font-family: var(--fonte-mono); }
.agregado .qtd span { color: var(--texto-suave); font-weight: 400; font-size: var(--txt-xs); }

.citacao { border-left: 3px solid var(--turq-500); padding: var(--e-2) 0 var(--e-2) var(--e-3); margin-bottom: 10px; color: var(--texto); }
.link-copia { background: var(--navy-50); border: 1px solid var(--borda); border-radius: var(--raio-md); padding: 11px 14px; font-size: var(--txt-sm); word-break: break-all; font-family: var(--fonte-mono); }

.aovivo { display: inline-flex; align-items: center; gap: 7px; font-size: var(--txt-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--texto-suave); }
.aovivo b { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: bate 2s infinite; }
@keyframes bate { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ================= cadastro da rede ================= */
.filtros { display: flex; gap: var(--e-2); flex-wrap: wrap; align-items: flex-end; margin-bottom: var(--e-4); }
.filtros .campo { margin: 0; flex: 1 1 200px; }
.filtros .campo.estreito { flex: 0 0 170px; }

.aniversarios { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--e-3); }
.aniv {
  display: flex; align-items: center; gap: var(--e-3); padding: var(--e-3) var(--e-4);
  border: 1px solid var(--borda); border-radius: var(--raio-lg); background: var(--superficie);
}
.aniv .dia {
  flex: none; width: 46px; height: 46px; border-radius: var(--raio-md);
  background: var(--turq-500); color: var(--navy-900);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--fonte-mono); font-weight: 700; line-height: 1;
}
.aniv .dia small { font-size: 9px; font-weight: 500; text-transform: uppercase; }
.aniv .quem { min-width: 0; }
.aniv .quem b { display: block; color: var(--texto-forte); font-weight: 600; }
.aniv .quem span { color: var(--texto-suave); font-size: var(--txt-sm); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aniv.hoje { border-color: var(--turq-500); box-shadow: var(--sombra-2); }

.faixa-aviso {
  background: var(--atencao-bg); border: 1px solid var(--atencao); border-left-width: 4px;
  border-radius: var(--raio-md); padding: var(--e-3) var(--e-4); margin-bottom: var(--e-4);
  color: var(--atencao); font-size: var(--txt-sm);
}
.faixa-aviso b { color: var(--atencao); }
.vazio { text-align: center; color: var(--texto-suave); padding: var(--e-12) var(--e-4); }

@media (max-width: 640px) {
  h1 { font-size: var(--txt-xl); }
  .card { padding: var(--e-5) 17px; }
  .hero { padding: var(--e-6) 20px; }
  .wrap { padding: 18px 14px 44px; }
  .topo { margin: -18px -14px var(--e-5); padding: var(--e-3) var(--e-4); }
  .balao { max-width: 92%; }
  .agregado .linha { grid-template-columns: 1fr; gap: 3px; }
  .agregado .qtd { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
