:root {
  /* Paleta Texas Center */
  --creme: #F5E8C6;
  --creme-clara: #FBF5E4;
  --dourado: #E6D296;
  --dourado-escuro: #C9AD68;
  --verde: #1D544A;
  --verde-escuro: #123930;
  --marrom: #54382F;
  --marrom-claro: #7A5C4E;

  --texto: #3A2A1F;
  --texto-suave: #8A7565;
  --borda: #E3D3A8;
  --verde-ok: #1D544A;
  --vermelho: #A5402A;
  --sombra: 0 6px 20px rgba(84, 56, 47, .10);
  --topbar-h: 54px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--creme);
  color: var(--texto);
}

.topbar {
  background: linear-gradient(135deg, var(--verde) 0%, var(--verde-escuro) 100%);
  color: var(--creme-clara);
  height: var(--topbar-h);
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: .92rem;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 2px 10px rgba(18, 57, 48, .25);
}
.topbar a { color: var(--dourado); text-decoration: none; font-weight: 700; font-size: .82rem; letter-spacing: .04em; }
.topbar a:hover { color: var(--creme-clara); }

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 16px 64px;
}
.wrap-login { max-width: 380px; padding-top: 12vh; }
.wrap-relatorio { max-width: 920px; }

h1 { font-size: 1.5rem; margin: 0 0 4px; color: var(--marrom); font-weight: 800; }
h2 { font-size: 1.12rem; margin: 0 0 4px; color: var(--marrom); }
.subtitle { color: var(--texto-suave); margin: 0 0 22px; }

.card {
  background: var(--creme-clara);
  border: 1px solid var(--borda);
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--sombra);
}
.login-card { text-align: center; }
.login-card h1 {
  color: var(--verde);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 1.3rem;
}
.login-card h1::after {
  content: "";
  display: block;
  width: 46px;
  height: 3px;
  background: var(--dourado-escuro);
  margin: 10px auto 0;
  border-radius: 2px;
}

.menu-cards { display: flex; flex-direction: column; gap: 14px; }
.card-menu {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: var(--texto);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  cursor: pointer;
}
.card-menu:hover { border-color: var(--dourado-escuro); box-shadow: 0 10px 24px rgba(84, 56, 47, .16); transform: translateY(-1px); }
.card-menu p { margin: 2px 0 0; color: var(--texto-suave); font-size: .92rem; }
.card-icone {
  font-size: 1.6rem;
  line-height: 1;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--creme);
  border-radius: 14px;
}
.card-relatorio { background: linear-gradient(135deg, var(--dourado) 0%, var(--creme-clara) 120%); }

.tag {
  display: inline-block;
  margin-top: 6px;
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: .02em;
}
.tag-ok { background: rgba(29, 84, 74, .12); color: var(--verde); }
.tag-pendente { color: var(--texto-suave); font-size: .85rem; font-weight: 400; }

label { display: block; font-weight: 700; font-size: .85rem; margin-bottom: 7px; color: var(--marrom); }

input, select, textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--borda);
  border-radius: 12px;
  font-size: 1rem;
  background: #fff;
  color: var(--texto);
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--verde); box-shadow: 0 0 0 3px rgba(29, 84, 74, .14); }

.campo { margin-bottom: 16px; }
.linha-campos { display: flex; gap: 12px; }
.linha-campos .campo { flex: 1; }

.data-hora-fixa {
  display: inline-block;
  background: var(--creme-clara);
  border: 1px solid var(--borda);
  color: var(--marrom);
  font-weight: 700;
  font-size: .85rem;
  padding: 7px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.progresso-sticky {
  position: sticky;
  top: var(--topbar-h);
  z-index: 15;
  background: var(--creme);
  padding: 10px 0;
  margin: 0 -16px 4px;
  padding-left: 16px;
  padding-right: 16px;
  border-bottom: 1px solid var(--borda);
}
.progresso-wrap { margin: 0; }
.progresso-texto { font-size: .82rem; font-weight: 700; color: var(--verde); margin-bottom: 6px; }
.progresso-barra { height: 8px; background: var(--creme-clara); border: 1px solid var(--borda); border-radius: 999px; overflow: hidden; }
.progresso-preenchido { height: 100%; background: linear-gradient(90deg, var(--dourado-escuro), var(--verde)); border-radius: 999px; transition: width .2s ease; }

.lista-itens { margin: 8px 0 20px; }

.grupo-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 6px;
  padding: 10px 12px;
  background: var(--dourado);
  border-radius: 10px;
}
.grupo-header:first-child { margin-top: 0; }
.grupo-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--verde);
  color: var(--creme-clara);
  font-size: .75rem;
  font-weight: 800;
  flex-shrink: 0;
}
.grupo-titulo { font-weight: 800; font-size: .88rem; color: var(--marrom); text-transform: uppercase; letter-spacing: .02em; }

.grupo-header.grupo-info { background: var(--creme-clara); border: 1px dashed var(--dourado-escuro); }
.grupo-header.grupo-info .grupo-num { background: none; width: auto; height: auto; font-size: 1rem; }
.grupo-header.grupo-info .grupo-titulo { color: var(--marrom-claro); }
.nota-lista { padding: 4px 12px 14px 40px; }
.nota-item {
  font-size: .88rem;
  color: var(--texto-suave);
  padding: 5px 0;
  font-style: italic;
}
.nota-item::before { content: "• "; }

.secao-titulo {
  margin: 20px 0 8px;
  font-size: .76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--marrom-claro);
  border-top: 1px dashed var(--dourado-escuro);
  padding-top: 16px;
}

.item-check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 10px;
  border-bottom: 1px solid var(--borda);
  cursor: pointer;
}
.item-check.item-sub {
  padding-left: 26px;
  border-bottom: 1px solid rgba(227, 211, 168, .6);
}
.item-check input[type="checkbox"] {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 1px;
  accent-color: var(--verde);
}
.item-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--creme);
  color: var(--marrom);
  font-weight: 800;
  font-size: .75rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.item-texto { font-size: .96rem; line-height: 1.35; }

.item-check-leitura { cursor: default; }
.item-marca { font-size: 1.1rem; }
.item-ok .item-texto { color: var(--texto); }
.item-pendente .item-texto { color: var(--texto-suave); }

.btn {
  display: inline-block;
  text-align: center;
  padding: 14px 22px;
  border-radius: 12px;
  border: none;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s ease, transform .12s ease;
}
.btn-primary { background: var(--verde); color: var(--creme-clara); }
.btn-primary:hover { background: var(--verde-escuro); }
.btn-secundario { background: var(--dourado); color: var(--marrom); border: 1px solid var(--dourado-escuro); }
.btn-secundario:hover { background: var(--dourado-escuro); }
.btn-full { width: 100%; }
.btn-csv { display: inline-block; margin-bottom: 18px; }

.alerta { padding: 13px 15px; border-radius: 12px; margin-bottom: 16px; font-size: .92rem; }
.alerta-erro { background: #F6DFD6; color: var(--vermelho); }

.card-sucesso { text-align: center; }
.card-sucesso .card-icone { font-size: 2.4rem; background: none; width: auto; height: auto; }
.botoes { display: flex; gap: 10px; margin-top: 16px; }
.botoes .btn { flex: 1; }

.tabela-relatorio { width: 100%; border-collapse: collapse; background: var(--creme-clara); border-radius: 14px; overflow: hidden; box-shadow: var(--sombra); }
.tabela-relatorio th, .tabela-relatorio td { padding: 13px; border-bottom: 1px solid var(--borda); text-align: left; vertical-align: top; }
.tabela-relatorio th { background: var(--verde); color: var(--creme-clara); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.col-data { font-weight: 800; white-space: nowrap; color: var(--marrom); }
.linha-registro { display: block; background: none; border: none; text-align: left; width: 100%; padding: 0; text-decoration: none; color: var(--texto); margin-bottom: 8px; cursor: pointer; font-family: inherit; }
.linha-registro:last-child { margin-bottom: 0; }
.linha-registro strong { display: block; color: var(--marrom); }
.linha-registro .meta { font-size: .82rem; color: var(--texto-suave); }
.linha-registro:hover strong { color: var(--verde); text-decoration: underline; }

.resumo-detalhe div { margin-bottom: 6px; font-size: .95rem; }

.detalhe-expandido { padding: 14px; background: var(--creme); border-radius: 12px; margin-top: 8px; }

.spinner-msg { color: var(--texto-suave); padding: 20px 0; text-align: center; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(58, 42, 31, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal-caixa {
  background: var(--creme-clara);
  border-radius: 18px;
  padding: 24px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(18, 57, 48, .35);
}
.modal-caixa h2 { margin: 0 0 8px; color: var(--marrom); }
.modal-caixa p { margin: 0 0 18px; color: var(--texto); font-size: .95rem; line-height: 1.4; }
.modal-caixa .botoes { margin-top: 0; flex-direction: column-reverse; }

@media (max-width: 480px) {
  .linha-campos { flex-direction: column; gap: 0; }
  .tabela-relatorio { font-size: .88rem; }
}
