/* ==========================================================================
   Portal de Publicacao — eduCAT

   Interface minima e sem framework de CSS (secao 10 da spec). As quatro
   cores sao as da logo, amostradas do proprio arquivo:

     #23607A  teal escuro  — o "CAT", ancora da identidade
     #46C0F5  azul         — o "edu" e a barra menor
     #87DB55  verde        — a barra alta
     #F5C246  ambar        — a barra do meio

   Mapeamento semantico: teal para estrutura e acao primaria, azul para
   links e foco, verde para "no ar", ambar para "atencao". O vermelho de
   erro nao vem da logo — foi escolhido para conviver com o teal sem brigar.
   ========================================================================== */

:root {
  --brand-escuro: #23607a;
  --brand-azul: #46c0f5;
  --brand-verde: #87db55;
  --brand-ambar: #f5c246;

  --texto: #17272e;
  --texto-suave: #5c7482;
  --texto-fraco: #8ba1ac;

  --superficie: #ffffff;
  --fundo: #f2f6f8;
  --fundo-sutil: #f8fafb;
  --borda: #dde7ec;
  --borda-forte: #c6d5dd;

  --sucesso: #2f8a3e;
  --sucesso-fundo: #eaf7ec;
  --atencao: #9a6b00;
  --atencao-fundo: #fdf4de;
  --erro: #c0392b;
  --erro-fundo: #fdeceb;

  --raio: 10px;
  --raio-sm: 6px;
  --sombra: 0 1px 2px rgba(23, 39, 46, 0.05), 0 2px 8px rgba(23, 39, 46, 0.04);
  --sombra-alta: 0 4px 16px rgba(23, 39, 46, 0.1);

  --largura: 68rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* As quatro barras da logo, como fio no topo da pagina. */
body::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(
    to right,
    var(--brand-azul) 0 25%,
    var(--brand-ambar) 25% 50%,
    var(--brand-verde) 50% 75%,
    var(--brand-escuro) 75% 100%
  );
}

/* ---------------------------------------------------------------- header */
.topo {
  background: var(--superficie);
  border-bottom: 1px solid var(--borda);
}

.topo-interno {
  max-width: var(--largura);
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.marca {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
}

.marca img {
  height: 30px;
  width: auto;
  display: block;
}

.marca span {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--texto-suave);
  padding-left: 0.7rem;
  border-left: 1px solid var(--borda);
  letter-spacing: 0.01em;
}

.topo nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.topo nav a {
  color: var(--texto-suave);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.7rem;
  border-radius: var(--raio-sm);
}

.topo nav a:hover {
  color: var(--brand-escuro);
  background: var(--fundo-sutil);
}

.usuario {
  color: var(--texto-fraco);
  font-size: 0.85rem;
  padding-right: 0.5rem;
}

.inline {
  display: inline;
  margin: 0;
}

/* ------------------------------------------------------------------ main */
main {
  max-width: var(--largura);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

h1 {
  font-size: 1.55rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  margin: 0 0 0.35rem;
  color: var(--brand-escuro);
}

h2 {
  font-size: 1.05rem;
  font-weight: 650;
  margin: 2rem 0 0.75rem;
  color: var(--texto);
}

.cabecalho-secao {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.cabecalho-secao h1 {
  margin-bottom: 0;
}

/* ----------------------------------------------------------------- cards */
.cartao {
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  padding: 1.4rem;
  margin-bottom: 1.25rem;
}

.cartao > h2:first-child {
  margin-top: 0;
}

/* --------------------------------------------------------------- tabelas */
.tabela-envolucro {
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  overflow-x: auto;
}

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

th {
  text-align: left;
  padding: 0.7rem 1rem;
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--texto-fraco);
  background: var(--fundo-sutil);
  border-bottom: 1px solid var(--borda);
  white-space: nowrap;
}

td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--borda);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--fundo-sutil);
}

tr.atual {
  background: var(--sucesso-fundo);
}

tr.atual:hover {
  background: #e0f2e4;
}

tr.inativo td {
  color: var(--texto-fraco);
}

table form {
  display: inline;
  margin: 0;
}

/* --------------------------------------------------------------- botoes */
.botao,
button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--raio-sm);
  background: var(--brand-escuro);
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}

.botao:hover,
button[type="submit"]:hover {
  background: #1b4c62;
}

.botao:active,
button[type="submit"]:active {
  background: #163d4f;
}

.botao-secundario {
  background: var(--superficie);
  color: var(--brand-escuro);
  border-color: var(--borda-forte);
}

.botao-secundario:hover {
  background: var(--fundo-sutil);
  border-color: var(--brand-escuro);
}

a.secundario {
  margin-left: 0.85rem;
  color: var(--texto-suave);
  font-size: 0.9rem;
  text-decoration: none;
}

a.secundario:hover {
  color: var(--texto);
  text-decoration: underline;
}

button.link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--brand-escuro);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

button.link:hover {
  color: var(--erro);
}

a {
  color: #1a7fa8;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ------------------------------------------------------------ formularios */
form p {
  margin: 0 0 1.1rem;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--texto);
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="file"],
select {
  width: 100%;
  max-width: 26rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--borda-forte);
  border-radius: var(--raio-sm);
  background: var(--superficie);
  font: inherit;
  font-size: 0.9rem;
  color: var(--texto);
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--brand-azul);
  outline-offset: 1px;
  border-color: var(--brand-azul);
}

input[type="file"] {
  padding: 0.45rem;
  background: var(--fundo-sutil);
  cursor: pointer;
}

.ajuda {
  display: block;
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--texto-suave);
  margin-top: 0.35rem;
}

/* Linha de campos lado a lado (filtros, cadastro de cliente). */
.linha-campos {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
}

.linha-campos label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--texto-fraco);
}

.linha-campos input,
.linha-campos select {
  max-width: 15rem;
  text-transform: none;
  letter-spacing: normal;
}

/* --------------------------------------------------------------- avisos */
.mensagens {
  list-style: none;
  max-width: var(--largura);
  margin: 1.25rem auto -0.5rem;
  padding: 0 1.5rem;
}

.mensagens li {
  padding: 0.7rem 1rem;
  border-radius: var(--raio-sm);
  border-left: 3px solid var(--borda-forte);
  background: var(--superficie);
  box-shadow: var(--sombra);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.mensagens li.success {
  border-left-color: var(--brand-verde);
  background: var(--sucesso-fundo);
}

.mensagens li.warning {
  border-left-color: var(--brand-ambar);
  background: var(--atencao-fundo);
}

.mensagens li.error {
  border-left-color: var(--erro);
  background: var(--erro-fundo);
  color: var(--erro);
}

.erros {
  list-style: none;
  margin: 0 0 1.1rem;
  padding: 0.7rem 1rem;
  border-radius: var(--raio-sm);
  border-left: 3px solid var(--erro);
  background: var(--erro-fundo);
  color: var(--erro);
  font-size: 0.9rem;
}

.erro {
  color: var(--erro);
  font-size: 0.85rem;
}

.aviso {
  padding: 0.85rem 1rem;
  border-radius: var(--raio-sm);
  border-left: 3px solid var(--brand-ambar);
  background: var(--atencao-fundo);
  color: #6d4c00;
  font-size: 0.9rem;
  margin: 1rem 0;
}

.nota {
  color: var(--texto-suave);
  font-size: 0.87rem;
  line-height: 1.6;
}

.vazio {
  color: var(--texto-fraco);
  font-size: 0.9rem;
  text-align: center;
  padding: 2.5rem 1rem;
}

/* -------------------------------------------------------------- etiquetas */
.etiqueta {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  background: var(--sucesso-fundo);
  color: var(--sucesso);
  white-space: nowrap;
}

.etiqueta-neutra {
  background: var(--fundo);
  color: var(--texto-suave);
}

.etiqueta-atencao {
  background: var(--atencao-fundo);
  color: var(--atencao);
}

.etiqueta-erro {
  background: var(--erro-fundo);
  color: var(--erro);
}

.parcial {
  color: var(--atencao);
  font-weight: 500;
}

.indisponivel {
  color: var(--texto-fraco);
  font-style: italic;
  font-size: 0.85rem;
}

.tentativa {
  color: var(--erro);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82em;
}

/* ----------------------------------------------------------- descritivos */
.resumo {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1.5rem;
  margin: 0;
}

.resumo dt {
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--texto-fraco);
  align-self: center;
}

.resumo dd {
  margin: 0;
  font-size: 0.92rem;
}

code,
.hash {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--fundo);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  word-break: break-all;
}

.hash {
  color: var(--texto-suave);
}

/* ------------------------------------------------------------- detalhes */
details.nota {
  margin-top: 1.5rem;
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  padding: 0.9rem 1.1rem;
}

details.nota summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--texto);
  font-size: 0.9rem;
}

details.nota ul {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
}

details.nota li {
  margin-bottom: 0.35rem;
}

/* ------------------------------------------------------------- paginacao */
.paginacao {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  margin-top: 1.25rem;
  color: var(--texto-fraco);
  font-size: 0.85rem;
}

/* ----------------------------------------------------------------- login */
.tela-login {
  max-width: 24rem;
  margin: 4rem auto;
  padding: 0 1.5rem;
}

.tela-login .marca-login {
  display: block;
  text-align: center;
  margin-bottom: 2rem;
}

.tela-login .marca-login img {
  height: 42px;
  width: auto;
}

.tela-login .cartao {
  padding: 1.75rem;
}

.tela-login h1 {
  font-size: 1.2rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.tela-login input {
  max-width: none;
}

.tela-login button[type="submit"] {
  width: 100%;
  margin-top: 0.35rem;
}

.tela-login .nota {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.82rem;
}

/* -------------------------------------------------------------- rodape */
.rodape {
  max-width: var(--largura);
  margin: 0 auto;
  padding: 1.5rem;
  color: var(--texto-fraco);
  font-size: 0.8rem;
  border-top: 1px solid var(--borda);
}

/* ---------------------------------------------------------- responsivo */
@media (max-width: 40rem) {
  .topo-interno {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .marca span {
    display: none;
  }

  main {
    padding: 1.25rem 1rem 3rem;
  }

  .mensagens {
    padding: 0 1rem;
  }

  .resumo {
    grid-template-columns: 1fr;
    gap: 0.15rem 0;
  }

  .resumo dd {
    margin-bottom: 0.6rem;
  }

  .linha-campos {
    flex-direction: column;
    align-items: stretch;
  }

  .linha-campos input,
  .linha-campos select {
    max-width: none;
  }
}

/* URL completa na listagem: legivel para copiar, sem estourar a coluna. */
.link-acesso {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82em;
  display: inline-block;
  max-width: 30rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
