/* Painel, login e página de conexão — identidade da Vital Inteligência (azul-marinho e dourado do logotipo oficial, as
   mesmas cores de apps/web/src/app/(publico)/tema-vital.css no icomercio). Sem fonte externa, sem imagem externa. */
:root {
  --marinho-escuro: #0a1a33; --marinho: #012751; --marinho-2: #2a4676;
  --dourado: #d4a844; --dourado-texto: #7a5a10; --dourado-claro: #fbf3df;
  --fundo: #f5f7fb; --superficie: #ffffff; --linha: #dde3ee; --linha-forte: #c8d1e0;
  --texto: #0f1b2e; --suave: #4a5a75; --campo: #7d8ca8;
  --sucesso: #1f6b4a; --alerta: #b3261e; --aviso: #8a4b05;
  --sombra: 0 1px 2px rgba(10, 26, 51, .06), 0 4px 16px rgba(10, 26, 51, .06);
  --raio: .65rem;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; font: 15.5px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: var(--fundo); color: var(--texto); }
main { flex: 1 0 auto; width: 100%; max-width: 72rem; margin: 0 auto; padding: 1.5rem 1.25rem 2.5rem; }
a { color: var(--marinho); text-underline-offset: .15em; }
a:hover { color: var(--marinho-2); }
:focus-visible { outline: 3px solid var(--dourado); outline-offset: 2px; }

/* --- marca --- */
.marca { display: inline-flex; align-items: center; gap: .6rem; color: var(--marinho); text-decoration: none; }
.marca img { display: block; flex-shrink: 0; }
.marca-texto { display: flex; flex-direction: column; line-height: 1; }
.marca-nome { font-weight: 800; font-size: 1.05rem; letter-spacing: .2em; }
.marca-sub { font-weight: 600; font-size: .58rem; letter-spacing: .3em; margin-top: .2rem; }
.marca-produto { margin-left: .4rem; padding-left: .9rem; border-left: 1px solid currentColor; font-size: .9rem; font-weight: 500; opacity: .85; line-height: 1.2; }
.marca-escura { color: #fff; }
.marca-escura .marca-sub { color: var(--dourado); }
.marca-escura .marca-produto { border-left-color: rgba(255, 255, 255, .3); }
.marca-escura img { background: #fff; border-radius: .5rem; padding: 3px 4px; width: 46px; height: auto; }

/* --- cabeçalho --- */
header.topo { position: sticky; top: 0; z-index: 10; background: var(--marinho); border-bottom: 3px solid var(--dourado); box-shadow: 0 2px 10px rgba(10, 26, 51, .25); }
.topo-faixa { max-width: 72rem; margin: 0 auto; padding: .65rem 1.25rem; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; }
.topo-marca { text-decoration: none; }
.topo-nav { display: flex; flex-wrap: wrap; gap: .25rem; flex: 1 1 auto; }
.topo-nav a { color: #d9e1ef; text-decoration: none; font-weight: 600; font-size: .92rem; padding: .45rem .8rem; border-radius: .45rem; }
.topo-nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.topo-nav a.ativo { color: var(--marinho-escuro); background: var(--dourado); }
.topo-usuario { display: flex; align-items: center; gap: .75rem; margin-left: auto; }
.topo-email { color: #b9c5da; font-size: .85rem; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topo-usuario form { margin: 0; }
button.botao-sair { min-height: 0; padding: .4rem .85rem; font-size: .85rem; background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .35); }
button.botao-sair:hover { background: rgba(255, 255, 255, .1); }
.topo-publico .topo-faixa { justify-content: center; }

.rodape { flex-shrink: 0; text-align: center; color: var(--suave); font-size: .8rem; padding: 1.25rem; border-top: 1px solid var(--linha); background: var(--superficie); }

/* --- tipografia --- */
h1 { font-size: 1.6rem; line-height: 1.25; margin: .25rem 0 1.25rem; color: var(--marinho); letter-spacing: -.01em; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
h2 { font-size: 1.1rem; margin: 0 0 .85rem; color: var(--marinho); }
.cartao > h2:first-child { padding-bottom: .65rem; border-bottom: 1px solid var(--linha); }
h3 { font-size: 1rem; color: var(--marinho); }
.dica { color: var(--suave); font-size: .87rem; margin: .35rem 0 0; }
code, .link { word-break: break-all; font-size: .85rem; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }

/* --- cartões e tabelas --- */
.cartao { background: var(--superficie); border: 1px solid var(--linha); border-radius: var(--raio); padding: 1.25rem 1.35rem; margin: 0 0 1.25rem; box-shadow: var(--sombra); }
.rolagem { overflow-x: auto; border: 1px solid var(--linha); border-radius: var(--raio); background: var(--superficie); box-shadow: var(--sombra); }
.cartao .rolagem { box-shadow: none; }
table { border-collapse: collapse; width: 100%; background: var(--superficie); }
th, td { border-bottom: 1px solid var(--linha); padding: .7rem .85rem; text-align: left; vertical-align: top; font-size: .92rem; }
thead th { background: #f0f3f9; color: var(--suave); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; white-space: nowrap; }
tbody th { color: var(--suave); font-weight: 600; width: 1%; white-space: nowrap; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody tr:hover td { background: #f8fafd; }

/* --- formulários --- */
label { display: block; margin: 1rem 0 .3rem; font-weight: 600; font-size: .9rem; }
input, select, textarea { width: 100%; font: inherit; padding: .6rem .75rem; border: 1px solid var(--campo); border-radius: .45rem; background: #fff; color: var(--texto); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--marinho); box-shadow: 0 0 0 3px rgba(212, 168, 68, .45); }
input[readonly] { background: #f3f5f9; }
input[type=radio], input[type=checkbox] { width: auto; accent-color: var(--marinho); }
textarea { min-height: 6rem; }
.em-linha { display: inline-flex; align-items: center; gap: .4rem; margin-right: 1rem; }
@media (min-width: 42rem) { .duas { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; } }

/* --- botões --- */
button, .botao { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 600; font-size: .92rem; padding: .65rem 1.15rem; border: 1px solid var(--marinho); border-radius: .45rem; background: var(--marinho); color: #fff; cursor: pointer; text-decoration: none; min-height: 2.6rem; transition: background .15s, border-color .15s; }
button:hover, .botao:hover { background: var(--marinho-2); border-color: var(--marinho-2); color: #fff; }
button.secundario, .botao.secundario { background: #fff; color: var(--marinho); border-color: var(--linha-forte); }
button.secundario:hover, .botao.secundario:hover { background: #f0f3f9; border-color: var(--marinho-2); color: var(--marinho); }
button.perigo { background: var(--alerta); border-color: var(--alerta); }
button.perigo:hover { background: #8f1d17; border-color: #8f1d17; }
button[disabled] { opacity: .5; cursor: not-allowed; }
.acoes { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0 0; align-items: center; }
.acoes form { margin: 0; }
main > .acoes:first-of-type { margin: -.5rem 0 1.25rem; }

/* --- mensagens --- */
.erro, .ok, .aviso { padding: .75rem 1rem; border-radius: .5rem; border: 1px solid; border-left-width: 4px; margin: 0 0 1rem; }
.erro { color: var(--alerta); background: #fdeeec; border-color: #f2b8b2; border-left-color: var(--alerta); }
.ok { color: var(--sucesso); background: #e9f5ef; border-color: #b4dcc6; border-left-color: var(--sucesso); }
.aviso { color: var(--aviso); background: var(--dourado-claro); border-color: #f0d9a4; border-left-color: var(--dourado); }
.erro ul { margin: 0; padding-left: 1.2rem; }
.aviso-fixo { position: sticky; top: 0; z-index: 11; text-align: center; border-radius: 0; margin: 0; border-width: 0 0 1px; }

/* --- selos de estado --- */
.selo { display: inline-block; padding: .15rem .65rem; border-radius: 999px; background: #e9eef7; color: var(--marinho); font-size: .78rem; font-weight: 600; white-space: nowrap; border: 1px solid #d3dcec; letter-spacing: 0; }
h1 .selo { font-size: .8rem; }
.selo-coletando, .selo-analisando, .selo-conectado, .selo-em_revisao, .selo-pendente { background: var(--dourado-claro); color: var(--dourado-texto); border-color: #efd8a0; }
.selo-entregue, .selo-encerrado_fechou, .selo-ativo, .selo-concluido, .selo-aprovado { background: #e6f4ec; color: var(--sucesso); border-color: #b9dcc8; }
.selo-sem_historico, .selo-expirado, .selo-revogado, .selo-erro, .selo-falhou, .selo-encerrado_nao_fechou { background: #fdeeec; color: var(--alerta); border-color: #f2c2bc; }

/* --- peças específicas --- */
.termo { max-height: 22rem; overflow-y: auto; border: 1px solid var(--linha); padding: .5rem 1.1rem; background: #fbfcfe; border-radius: .5rem; }
.termo h2, .termo h3, .termo h4 { margin: 1rem 0 .4rem; }
.linha-copia { display: flex; gap: .6rem; flex-wrap: wrap; }
.linha-copia input { flex: 1 1 16rem; }
.centro { max-width: 34rem; }
.entrada { display: flex; flex-direction: column; justify-content: center; padding-top: 3rem; }
.entrada-marca { display: flex; justify-content: center; margin-bottom: 1.5rem; }
.entrada h1 { justify-content: center; font-size: 1.3rem; }
.entrada .acoes button { width: 100%; }
.publico { max-width: 40rem; }
.previa { padding: 0; overflow: hidden; }

@media (max-width: 40rem) {
  main { padding: 1rem .85rem 2rem; }
  .marca-produto { display: none; }
  header.topo { position: static; }
  .topo-faixa { padding: .55rem .85rem; gap: .5rem; }
  .topo-marca { order: 1; }
  .topo-usuario { order: 2; margin-left: auto; }
  .topo-email { display: none; }
  .topo-nav { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; }
  .topo-nav a { white-space: nowrap; padding: .4rem .7rem; font-size: .88rem; }
  h1 { font-size: 1.35rem; }
  .cartao { padding: 1rem; }
}
