/* Visual do portal. As utilidades Tailwind reforçam o mesmo desenho quando o CDN carrega. */

:root {
  --navy: #0b1f33;
  --navy-2: #14324f;
  --ink: #0f172a;
  --muted: #475569;
  --line: #d5dee8;
  --paper: #f3f6fa;
  --card: #ffffff;
  --emerald: #047857;
  --emerald-d: #065f46;
  --emerald-s: #ecfdf5;
  --danger: #9f1239;
  --danger-s: #fff1f2;
  --warn: #92400e;
  --warn-s: #fffbeb;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
  --radius: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  line-height: 1.5;
}

.mono, code, pre, .campo input, .campo select, .campo textarea {
  font-family: "IBM Plex Mono", "Cascadia Mono", Consolas, monospace;
}

.cabecalho {
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid #0a1826;
}

.cabecalho-interno,
.faixa-abas,
.miolo {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.cabecalho-interno {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
}

.marca {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.selo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border: 1px solid rgba(110, 231, 183, 0.35);
  font-weight: 700;
  letter-spacing: 0.04em;
  flex: none;
}

.marca h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.marca p {
  margin: 0;
  color: #cbd5e1;
  font-size: 0.78rem;
}

.status-barra {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
}

.pilula {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  background: var(--navy-2);
  color: #e2e8f0;
  font-size: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ponto {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: #94a3b8;
  flex: none;
}

.pilula.online .ponto { background: #34d399; }
.pilula.offline .ponto { background: #fb7185; }
.pilula.verificando .ponto { background: #fbbf24; }

.vitrine {
  background: var(--navy);
  color: #e2e8f0;
  border-bottom: 1px solid #0a1826;
  padding: 0.9rem 0 1rem;
}

.vitrine-moldura {
  width: min(1120px, calc(100% - 2rem));
  height: 340px;
  margin: 0 auto;
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.vitrine-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  background-color: #0b1f33;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.vitrine-conteudo {
  width: min(520px, calc(100% - 2rem));
  margin: 0 0 1.15rem 1.15rem;
  padding: 1rem 1.05rem 1.05rem;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(8, 18, 32, 0.28), rgba(8, 18, 32, 0.78));
  backdrop-filter: blur(8px);
}

.vitrine-badge {
  display: inline-block;
  border-radius: 999px;
  border-width: 1px;
  border-style: solid;
  padding: 0.18rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  line-height: 1.3;
}

.vitrine-conteudo strong {
  display: block;
  margin-top: 0.45rem;
  color: #fff;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.vitrine-conteudo p {
  margin: 0.35rem 0 0.8rem;
  color: #e2e8f0;
  font-size: 0.92rem;
}

.vitrine-cta {
  display: inline-block;
  background: var(--emerald);
  color: #fff;
  text-decoration: none;
  font-weight: 650;
  font-size: 0.88rem;
  border-radius: 999px;
  padding: 0.58rem 0.95rem;
  white-space: nowrap;
}

.vitrine-cta:hover { background: var(--emerald-d); }

.vitrine-cta:focus-visible,
.vitrine-seta:focus-visible,
.vitrine-pontos button:focus-visible {
  outline: 2px solid #6ee7b7;
  outline-offset: 2px;
}

.vitrine-nav {
  position: absolute;
  right: 0.85rem;
  bottom: 0.85rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.4rem;
  border-radius: 999px;
  background: rgba(8, 18, 32, 0.55);
  backdrop-filter: blur(8px);
}

.vitrine-seta {
  appearance: none;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font: inherit;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.vitrine-seta:hover { background: rgba(255, 255, 255, 0.14); }

.vitrine-pontos {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.vitrine-pontos button {
  appearance: none;
  width: 0.45rem;
  height: 0.45rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
}

.vitrine-pontos button[aria-current="true"] {
  width: 1.15rem;
  background: #6ee7b7;
}

.faixa-abas {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.abas {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
}

.aba {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 0.95rem 0.85rem;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.aba[aria-selected="true"] {
  color: var(--navy);
  border-bottom-color: var(--emerald);
}

.etiqueta {
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: #e8eef5;
  color: #334155;
}

.aba[aria-selected="true"] .etiqueta {
  background: var(--emerald-s);
  color: var(--emerald-d);
}

.miolo { padding: 1.5rem 0 3rem; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.15fr);
  gap: 1rem;
  align-items: start;
}

.cartao {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.2rem 1.25rem;
}

.cartao h2 {
  margin: 0;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}

.ajuda {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.topo-form {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.grade {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.campo { display: flex; flex-direction: column; gap: 0.28rem; min-width: 0; }
.campo.largo { grid-column: 1 / -1; }

.campo span, .grupo-titulo {
  font-size: 0.78rem;
  font-weight: 650;
  color: #1e293b;
}

.campo input,
.campo select,
.campo textarea {
  width: 100%;
  border: 1px solid #c5d0dc;
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font-size: 0.86rem;
}

.campo textarea {
  min-height: 220px;
  resize: vertical;
  line-height: 1.45;
}

.campo input:focus,
.campo select:focus,
.campo textarea:focus,
.aba:focus-visible,
.btn:focus-visible,
.subaba:focus-visible {
  outline: 2px solid #047857;
  outline-offset: 2px;
}

.acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.95rem;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.62rem 0.9rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.btn:disabled { opacity: 0.65; cursor: progress; }

.btn-primario { background: var(--navy); color: #fff; }
.btn-primario:hover:not(:disabled) { background: var(--navy-2); }

.btn-secundario {
  background: #fff;
  color: var(--navy);
  border-color: #c5d0dc;
}
.btn-secundario:hover:not(:disabled) { background: #f8fafc; }

.btn-fantasma {
  background: #eef3f8;
  color: #1e293b;
  font-size: 0.8rem;
  padding: 0.4rem 0.65rem;
}

.btn-esmeralda { background: var(--emerald); color: #fff; }
.btn-esmeralda:hover:not(:disabled) { background: var(--emerald-d); }

.spinner {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: girar 0.7s linear infinite;
}

.btn-secundario .spinner,
.btn-fantasma .spinner {
  border-color: rgba(15, 23, 42, 0.2);
  border-top-color: var(--navy);
}

@keyframes girar { to { transform: rotate(360deg); } }

.alerta {
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  margin: 0 0 0.8rem;
  font-size: 0.86rem;
}

.alerta strong { display: block; margin-bottom: 0.15rem; }
.alerta.erro { background: var(--danger-s); color: var(--danger); border: 1px solid #fecdd3; }
.alerta.aviso { background: var(--warn-s); color: var(--warn); border: 1px solid #fde68a; }
.alerta.ok { background: var(--emerald-s); color: var(--emerald-d); border: 1px solid #a7f3d0; }

.alerta ul { margin: 0.35rem 0 0; padding-left: 1.1rem; }
.alerta li + li { margin-top: 0.35rem; }

.subabas {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--line);
  margin: -0.2rem 0 0.9rem;
  overflow-x: auto;
}

.subaba {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  white-space: nowrap;
}

.subaba[aria-selected="true"] {
  color: var(--emerald-d);
  border-bottom-color: var(--emerald);
}

.cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.kpi {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.75rem;
  background: #f8fafc;
  min-width: 0;
}

.kpi.total {
  background: var(--emerald);
  border-color: var(--emerald-d);
  color: #fff;
}

.kpi .rotulo { display: block; font-size: 0.72rem; font-weight: 650; color: var(--muted); }
.kpi.total .rotulo, .kpi.total .sub { color: #d1fae5; }
.kpi strong { display: block; margin-top: 0.15rem; font-size: 0.98rem; letter-spacing: -0.02em; }
.kpi .sub { display: block; margin-top: 0.1rem; font-size: 0.72rem; color: var(--muted); }

.tabela-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

th, td {
  text-align: left;
  padding: 0.45rem 0.35rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th { color: var(--muted); font-weight: 650; font-size: 0.72rem; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.json, .xml-saida, .memoria {
  margin: 0;
  background: #0b1f33;
  color: #e2e8f0;
  border-radius: 12px;
  padding: 0.9rem;
  overflow: auto;
  max-height: 420px;
  font-size: 0.75rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.vazio {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0.2rem 0 0.8rem;
}

.busca { position: relative; }

.sugestoes {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-height: 260px;
  overflow: auto;
  padding: 0.25rem;
}

.sugestao {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  cursor: pointer;
  font: inherit;
  display: block;
}

.sugestao:hover, .sugestao:focus { background: #f1f5f9; outline: none; }
.sugestao small { display: block; color: var(--muted); font-size: 0.75rem; }
.sugestao .codigo { font-weight: 700; }

.dropzone {
  border: 1.5px dashed #94a3b8;
  border-radius: 14px;
  padding: 1.1rem;
  background: #f8fafc;
  text-align: center;
  color: var(--muted);
  margin-bottom: 0.8rem;
}

.dropzone.arrastando {
  border-color: var(--emerald);
  background: var(--emerald-s);
  color: var(--emerald-d);
}

.dropzone strong { color: var(--ink); }

.check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  margin-top: 0.35rem;
}

.visor-pdf {
  width: 100%;
  min-height: 640px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.rodape {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.55;
  margin-top: 1.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.rodape p { margin: 0.35rem 0; }

.rodape a {
  color: var(--emerald-d);
  font-weight: 650;
}

@media (max-width: 980px) {
  .layout, .cards { grid-template-columns: 1fr; }
  .cabecalho-interno { align-items: flex-start; flex-direction: column; }
  .status-barra { justify-content: flex-start; }
}

@media (max-width: 800px) {
  .vitrine-moldura { height: 460px; }
  .vitrine-conteudo { margin-bottom: 3.4rem; }
  .vitrine-conteudo strong { font-size: 1.15rem; }
}

@media (max-width: 640px) {
  .grade { grid-template-columns: 1fr; }
  .cabecalho-interno, .faixa-abas, .miolo, .vitrine-moldura { width: min(1120px, calc(100% - 1.25rem)); }
}
