/* Teca Auditora: base visual de todas as telas (padrão Altec + Teca).
   Fonte da verdade: .claude/skills/teca-telas (SKILL.md e referencia/).
   Este arquivo substitui web/assets/teca.css. Cor e fonte só daqui: o CSS de cada tela usa var(). */

/* Fonte única da interface. Nos HTML, troque o link do Google Fonts por:
   <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Nunito:wght@500;600;700;800&display=swap"> */

:root {
  /* Marca Altec */
  --turquesa: #17B3BF;      /* símbolo, foco, anel. Nunca texto branco em cima */
  --acao: #129FAA;          /* botão principal, com texto branco peso 800 */
  --acao-hover: #158D96;
  --acao-forte: #108089;    /* link e texto turquesa pequeno (contraste AA) */
  --turq-tint: #E3F4F5;     /* fundo da Teca: bloco de texto dela, área de soltar */
  --roxo: #56485B;          /* títulos */
  --roxo-escuro: #423546;   /* menu lateral, cartão do valor, topo do celular */
  --roxo-noite: #2E2532;    /* aviso flutuante (toast) */
  --lavanda: #A098AE;
  --roxo-tint: #EEECF0;

  /* Texto e superfícies */
  --texto: #3A3F4D;
  --texto2: #6E7180;
  --apagado: #9A9FAE;
  --tela: #F4F4F6;
  --card: #FFFFFF;
  --card-alt: #F8F8FA;
  --borda: #E7E8EC;
  --borda-card: #DAD4E4;

  /* Significado: uma cor, uma coisa */
  --perda: #B84E0D;         /* texto de dinheiro acima do padrão (entra no total) */
  --perda-vivo: #FC802B;    /* barra, marcador, nota da fita com alerta */
  --perda-claro: #FFB37A;   /* valor acima do padrão sobre fundo roxo */
  --perda-tint: #FFF2DE;
  --perda-borda: #F6CFA5;
  --conf: #63537A;          /* para conferir (fora do total) */
  --conf-tint: #ECEAF1;
  --ok: #348253;            /* dentro do normal */
  --ok-tint: #E7F5EE;
  --ok-borda: #CFE9DC;
  --aviso: #F6A74A;         /* aviso do sistema (sem API); texto escuro em cima */
  --aviso-tint: #FFF6EA;

  /* WhatsApp simulado: só dentro da moldura do celular */
  --wa-fundo: #EFEAE2;
  --wa-saida: #D9FDD3;
  --wa-texto: #111B21;
  --wa-hora: #667781;
  --wa-botao: #027EB5;
  --wa-verde: #00A884;
  --moldura: #1C1A20;

  /* Tipo, forma e movimento */
  --fonte: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --raio-xs: 6px;           /* botão, campo */
  --raio-sm: 10px;          /* nota da fita, caixa interna */
  --raio-md: 14px;          /* cartão, painel */
  --raio-lg: 20px;
  --sombra: 0 4px 16px rgba(0, 0, 0, 0.08);
  --sombra-alta: 0 12px 32px rgba(26, 29, 38, 0.18);
  --curva: cubic-bezier(0.16, 1, 0.3, 1);

  /* Nomes antigos, para o painel.css, alerta.css, whatsapp.css e raio-x.css continuarem
     funcionando no primeiro passo. Ao refatorar cada tela, troque pelo nome novo e apague daqui. */
  --azul: var(--acao);
  --azul-escuro: var(--acao-forte);
  --perda-texto: var(--perda);
  --tinta: var(--texto);
  --papel: var(--tela);
  --linha: var(--borda);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--tela);
  color: var(--texto);
  font-family: var(--fonte);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* Moldura: menu lateral (header.topo, montado pelo layout.js) + conteúdo */
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  align-items: start;
}

h1, h2, h3, h4 {
  font-family: var(--fonte);
  font-weight: 800;
  color: var(--roxo);
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.15;
  text-wrap: balance;
}
h1 { font-size: 30px; letter-spacing: -0.015em; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }

p { margin: 0; line-height: 1.5; }
a { color: var(--acao-forte); font-weight: 700; }
a:hover { color: var(--roxo); }
:focus-visible { outline: 2px solid var(--turquesa); outline-offset: 2px; }
img { max-width: 100%; }

/* ---------------------------------------------------------------- moldura */
.topo {
  grid-column: 1;
  grid-row: 1;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 14px 16px;
  background: var(--roxo-escuro);
  color: #E9E5EC;
}

.marca {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px 14px;
  color: #FFFFFF;
  text-decoration: none;
}
.marca img { width: 42px; height: 42px; border-radius: 50%; background: var(--turq-tint); object-fit: cover; }
.marca b { display: block; font-size: 16px; font-weight: 800; line-height: 1.15; }
.marca small { display: block; font-size: 12px; font-weight: 600; color: #C4BCCB; }

.topo .loja {
  margin: 0 0 14px;
  padding: 9px 12px;
  border-radius: var(--raio-xs);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 700;
  font-size: 13.5px;
  color: #FFFFFF;
}
.topo .loja small { display: block; font-weight: 600; font-size: 11.5px; color: #C4BCCB; }

.menu { display: flex; flex-direction: column; gap: 4px; }
.menu a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--raio-sm);
  color: #DDD6E2;
  font-weight: 700;
  font-size: 14.5px;
  text-decoration: none;
}
.menu a:hover { background: rgba(255, 255, 255, 0.06); color: #FFFFFF; }
.menu a[aria-current="page"] {
  background: rgba(23, 179, 191, 0.16);
  box-shadow: inset 0 0 0 1px rgba(23, 179, 191, 0.35);
  color: #FFFFFF;
}
.menu a[aria-current="page"] svg { color: var(--turquesa); }
.menu svg { flex: none; }

.topo .pe {
  margin-top: auto;
  padding: 12px 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: #C4BCCB;
}
.topo .pe img { width: 74px; height: auto; }

.conteudo {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 32px 56px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.conteudo > * { flex-shrink: 0; }

@media (max-width: 900px) {
  body { grid-template-columns: minmax(0, 1fr); }
  .topo {
    grid-column: 1;
    grid-row: 1;
    height: auto;
    position: sticky;
    z-index: 5;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 10px 16px;
  }
  .marca { padding: 0; }
  .marca img { width: 34px; height: 34px; }
  .topo .loja, .topo .pe { display: none; }
  .menu { flex-direction: row; flex-wrap: wrap; margin-left: auto; }
  .menu a { padding: 8px 10px; font-size: 13.5px; }
  .conteudo { grid-column: 1; grid-row: 2; padding: 20px 16px 48px; }
}

/* ---------------------------------------------------------------- cabeçalho da tela */
.cabeca {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px 20px;
  flex-wrap: wrap;
}
.sobretitulo { font-size: 13.5px; font-weight: 600; color: var(--texto2); }
.vivo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--borda);
  background: var(--card);
  font-size: 13px;
  font-weight: 600;
  color: var(--texto2);
  white-space: nowrap;
}
.vivo::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-tint); }

/* ---------------------------------------------------------------- utilitários */
.discreto { color: var(--texto2); }
.pequeno { font-size: 13px; }
.num, .dinheiro { font-variant-numeric: tabular-nums; }
.dinheiro { font-weight: 800; white-space: nowrap; }
.perda { color: var(--perda); }
.conf { color: var(--conf); }
.ok { color: var(--ok); }

/* ---------------------------------------------------------------- cartão */
.cartao {
  background: var(--card);
  border: 0;
  border-radius: var(--raio-md);
  box-shadow: var(--sombra);
  padding: 22px 24px;
  min-width: 0;
}
.cartao-cabeca { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.cartao-cabeca small { font-size: 13px; font-weight: 600; color: var(--texto2); }

/* ---------------------------------------------------------------- botões */
.botao {
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--raio-xs);
  border: 1.5px solid var(--borda-card);
  background: var(--card);
  color: var(--texto);
  font: inherit;
  font-weight: 800;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.botao:hover { border-color: var(--lavanda); }
.botao:active { transform: scale(0.98); }
.botao-principal { background: var(--acao); border-color: var(--acao); color: #FFFFFF; font-size: 16px; }
.botao-principal:hover { background: var(--acao-hover); border-color: var(--acao-hover); color: #FFFFFF; }
.botao-fantasma { background: transparent; border-color: transparent; color: var(--acao-forte); }
.botao:disabled { background: var(--tela); border-color: var(--borda); color: var(--apagado); cursor: not-allowed; transform: none; }

/* ---------------------------------------------------------------- selos */
.selo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.selo-perda, .selo-preco { background: var(--perda-tint); color: var(--perda); }
.selo-conferir, .selo-nota { background: var(--conf-tint); color: var(--conf); }
.selo-ok { background: var(--ok-tint); color: var(--ok); }
.selo-teca { background: var(--turq-tint); color: var(--acao-forte); }

/* círculo de situação (ícone dentro) */
.no { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.no-grande { width: 40px; height: 40px; }
.no-perda { background: var(--perda-tint); color: var(--perda); }
.no-conferir { background: var(--conf-tint); color: var(--conf); }
.no-ok { background: var(--ok-tint); color: var(--ok); }
.no-teca { background: var(--turq-tint); color: var(--acao-forte); }

/* ---------------------------------------------------------------- veredito da semana */
.veredito { display: grid; grid-template-columns: minmax(0, 1.25fr) repeat(3, minmax(0, 1fr)); padding: 0; overflow: hidden; }
.veredito > div { padding: 22px 24px; min-width: 0; }
.veredito > div + div { border-left: 1px solid var(--borda); }
.veredito-teca { display: flex; gap: 14px; align-items: flex-start; background: linear-gradient(180deg, var(--turq-tint), var(--card) 85%); }
.veredito-teca img { width: 58px; height: 58px; flex: none; border-radius: 50%; background: var(--card); object-fit: cover; box-shadow: 0 0 0 3px var(--card); }
.veredito-teca small { display: block; margin-top: 8px; font-size: 12px; color: var(--texto2); }
.veredito-rotulo { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; }
.veredito-rotulo .no { width: 28px; height: 28px; }
.valor-grande { font-size: 32px; font-weight: 800; line-height: 1.1; letter-spacing: -0.015em; margin: 10px 0 4px; font-variant-numeric: tabular-nums; }
.veredito small { display: block; font-size: 12.5px; color: var(--texto2); line-height: 1.35; }
@media (max-width: 1100px) {
  .veredito { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .veredito-teca { grid-column: 1 / -1; }
  .veredito > div + div { border-left: 0; }
  .veredito > div:nth-child(n + 3) { border-left: 1px solid var(--borda); }
}
@media (max-width: 640px) {
  .veredito { grid-template-columns: minmax(0, 1fr); }
  .veredito > div:nth-child(n + 2) { border-left: 0; border-top: 1px solid var(--borda); }
}

/* ---------------------------------------------------------------- fita das notas lidas */
.fita { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.fita-nota {
  border: 1px solid var(--borda);
  background: var(--card-alt);
  border-radius: var(--raio-sm);
  padding: 9px 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
  color: var(--texto);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.fita-nota:hover { border-color: var(--lavanda); }
.fita-nota b { font-size: 13px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fita-nota small { font-size: 11px; font-weight: 600; color: var(--texto2); }
.fita-nota .no { width: 24px; height: 24px; }
.fita-nota.acima { background: var(--perda-tint); border-color: var(--perda-borda); }
.fita-nota.acima small { color: var(--perda); font-weight: 800; }
.fita-nota.lendo { border: 1.5px solid var(--turquesa); background: var(--turq-tint); color: var(--acao-forte); justify-content: center; font-size: 11px; font-weight: 700; text-align: center; animation: pisca 0.9s infinite; }
.fita-nota.novo { animation: destaque 2.4s ease-out; }
.legenda-fita { display: flex; gap: 16px; font-size: 12.5px; font-weight: 600; color: var(--texto2); }
.legenda-fita span { display: flex; align-items: center; gap: 6px; }
.legenda-fita i { width: 10px; height: 10px; border-radius: 3px; }

/* ---------------------------------------------------------------- linhas de alerta */
.lista-alertas { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.linha-alerta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 8px 14px 4px;
  border-top: 1px solid var(--borda);
  color: var(--texto);
  text-decoration: none;
}
.linha-alerta:first-child { border-top: 0; }
a.linha-alerta:hover { background: var(--card-alt); color: var(--texto); }
.linha-alerta .texto { flex: 1; min-width: 0; }
.linha-alerta b, .linha-alerta .titulo { display: block; font-weight: 800; font-size: 15px; line-height: 1.3; color: var(--texto); text-decoration: none; }
.linha-alerta a.titulo:hover { color: var(--acao-forte); }
/* a mesma linha em tabela (tbody#alertas do painel) */
tr.linha-alerta { display: table-row; }
tr.linha-alerta td { padding: 14px 8px; }
tr.linha-alerta td:first-child { width: 52px; padding-left: 4px; }
tr.linha-alerta:hover td { background: var(--card-alt); }
.linha-alerta small { display: block; font-size: 13px; color: var(--texto2); margin-top: 2px; line-height: 1.35; }
.linha-alerta .dinheiro { font-size: 16px; }
.rodape-lista { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--borda); display: flex; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 700; color: var(--texto2); }
.rodape-lista b { color: var(--texto); }

/* tabelas */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--texto2);
  font-weight: 800;
  padding: 8px 10px;
  border-bottom: 1px solid var(--borda);
}
td { padding: 12px 10px; border-bottom: 1px solid #F0F0F3; vertical-align: middle; color: var(--texto); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num, .num-direita { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.esta-nota td { background: var(--perda-tint); font-weight: 800; }
tr.esta-nota td.num { color: var(--perda); }

/* ---------------------------------------------------------------- valor em destaque (cartão roxo) */
.valor-destaque {
  background: var(--roxo-escuro);
  color: #FFFFFF;
  border-radius: var(--raio-md);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.valor-destaque .rotulo, .valor-destaque small { font-size: 13px; font-weight: 600; color: #D9D3DF; }
.valor-destaque .dinheiro { font-size: 40px; line-height: 1.1; letter-spacing: -0.02em; color: var(--perda-claro); }

/* comparação "você costuma pagar" x "a nota trouxe" */
.comparacao { display: grid; grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr); align-items: center; }
.comparacao .rotulo { font-size: 13.5px; font-weight: 700; color: var(--texto2); }
.comparacao .dinheiro { display: block; font-size: 30px; line-height: 1.15; margin: 4px 0; }
.comparacao small { display: block; font-size: 13px; color: var(--texto2); }
.comparacao .seta { color: var(--apagado); display: grid; place-items: center; }

/* nota de prova (dados do XML) */
.nota-prova { border: 1px dashed var(--borda-card); border-radius: var(--raio-sm); padding: 14px 16px; background: var(--card-alt); font-size: 13.5px; display: flex; flex-direction: column; gap: 6px; }
.nota-prova .rotulo { font-size: 12px; font-weight: 700; color: var(--texto2); }
.nota-prova .chave { font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; word-spacing: 2px; }

/* bloco de fala da Teca */
.fala-teca { display: flex; gap: 12px; align-items: flex-start; background: var(--turq-tint); border-radius: var(--raio-sm); padding: 12px 14px; font-size: 14px; }
.fala-teca img { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--card); object-fit: cover; }

/* estado vazio */
.vazio { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 16px; text-align: center; color: var(--texto2); }
.vazio img { width: 120px; height: auto; }
.vazio b { color: var(--texto); font-size: 16px; font-weight: 800; }

/* ---------------------------------------------------------------- envio de XML */
.soltar {
  border: 2px dashed #9FD8DD;
  background: var(--turq-tint);
  border-radius: var(--raio-md);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  color: var(--acao-forte);
  cursor: pointer;
}
.soltar:hover, .soltar.arrastando { border-color: var(--turquesa); }
.soltar-titulo { font-size: 16px; font-weight: 800; color: var(--texto); }
.progresso { height: 8px; border-radius: 99px; background: var(--borda); overflow: hidden; }
.progresso i { display: block; height: 100%; background: var(--acao); border-radius: 99px; transition: width 0.3s; }

/* ---------------------------------------------------------------- avisos */
.aviso-exemplo {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--raio-sm);
  background: var(--aviso-tint);
  border: 1px solid var(--aviso);
  color: var(--texto);
  font-size: 14px;
  font-weight: 600;
}
.aviso-exemplo[data-visivel="sim"] { display: flex; }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 420px;
  padding: 12px 16px;
  border-radius: var(--raio-sm);
  background: var(--roxo-noite);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--sombra-alta);
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.3s var(--curva), opacity 0.3s;
}
.toast.on { transform: none; opacity: 1; }

/* ---------------------------------------------------------------- celular (WhatsApp simulado e web no celular) */
.celular {
  width: 390px;
  max-width: 100%;
  border-radius: 52px;
  padding: 12px;
  background: var(--moldura);
  box-shadow: 0 30px 60px -20px rgba(46, 37, 50, 0.45), inset 0 0 0 2px #3A3540;
}
.celular .tela { border-radius: 42px; overflow: hidden; background: var(--wa-fundo); display: flex; flex-direction: column; height: 760px; }
.cabeca-chat { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px; background: #FFFFFF; color: var(--wa-texto); border-bottom: 1px solid #E9EDEF; }
.cabeca-chat .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--turq-tint); overflow: hidden; flex: none; }
.cabeca-chat .avatar img { width: 100%; height: 100%; object-fit: cover; }
.cabeca-chat b { font-size: 16px; font-weight: 800; }
.cabeca-chat small { display: block; font-size: 12.5px; font-weight: 600; color: var(--wa-hora); }
.conversa { flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding: 10px 12px 14px; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.conversa > * { flex-shrink: 0; }
.balao {
  align-self: flex-start;
  max-width: 300px;
  background: #FFFFFF;
  color: var(--wa-texto);
  padding: 7px 9px 5px 10px;
  border-radius: 0 10px 10px 10px;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  font-size: 14.5px;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: entra 0.35s var(--curva);
}
.balao.do-dono { align-self: flex-end; background: var(--wa-saida); border-radius: 10px 0 10px 10px; }
.balao .valor { font-weight: 800; color: var(--perda); font-variant-numeric: tabular-nums; }
.balao .evidencia { font-size: 12.5px; color: var(--wa-hora); }
.balao .hora { align-self: flex-end; font-size: 11px; color: var(--wa-hora); }
.balao .acao-balao { margin: 2px -9px -5px -10px; border-top: 1px solid #E9EDEF; padding: 9px; text-align: center; color: var(--wa-botao); font-weight: 700; text-decoration: none; }
.rodape-chat { display: flex; align-items: center; gap: 8px; padding: 8px 10px 18px; background: var(--wa-fundo); }
.rodape-chat span { flex: 1; background: #FFFFFF; border-radius: 24px; padding: 10px 14px; color: #8696A0; }

/* ---------------------------------------------------------------- movimento */
@keyframes entra { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pisca { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
@keyframes destaque { 0% { box-shadow: 0 0 0 0 rgba(252, 128, 43, 0); } 15% { box-shadow: 0 0 0 6px rgba(252, 128, 43, 0.35); } 100% { box-shadow: 0 0 0 0 rgba(252, 128, 43, 0); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
