:root {
  --verde: #2f6d4f;
  --verde-escuro: #234f39;
  --verde-claro: #e8f3ee;
  --cinza: #667085;
  --borda: #e0e4e8;
  --fundo: #f5f7f6;
  --branco: #ffffff;
  --vermelho: #c0392b;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--fundo);
  margin: 0;
  color: #1f2933;
  padding-bottom: 60px;
}

.topo {
  background: var(--verde);
  color: white;
  padding: 20px 16px;
  text-align: center;
}

.topo h1 {
  margin: 0 0 4px 0;
  font-size: 22px;
}

.topo p {
  margin: 0;
  font-size: 13px;
  opacity: 0.9;
}

.container {
  max-width: 900px;
  margin: 24px auto;
  padding: 0 16px;
}

.card {
  background: var(--branco);
  border: 1px solid var(--borda);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.card h2 {
  font-size: 16px;
  margin: 0 0 16px 0;
  color: var(--verde-escuro);
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #344054;
}

input[type=text], input[type=date], input[type=number], textarea, select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--borda);
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 14px;
  font-family: inherit;
  background: white;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--verde);
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.grid4 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

@media (min-width: 640px) {
  .grid4 { grid-template-columns: repeat(4, 1fr); }
}

table.itens {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  font-size: 13px;
}

table.itens th {
  background: var(--verde-claro);
  color: var(--verde-escuro);
  text-align: left;
  padding: 8px 6px;
  font-size: 12px;
  white-space: nowrap;
}

table.itens td {
  padding: 4px;
  border-bottom: 1px solid var(--borda);
  vertical-align: top;
}

table.itens td input,
table.itens td select {
  margin-bottom: 0;
}

.btn {
  background: var(--verde);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn:hover { background: var(--verde-escuro); }

.btn-secundario {
  background: white;
  color: var(--verde);
  border: 1px solid var(--verde);
}

.btn-secundario:hover { background: var(--verde-claro); }

.btn-remover {
  background: transparent;
  color: var(--vermelho);
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 8px;
}

.acoes {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

.msg {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 18px;
  display: none;
}

.msg.sucesso {
  background: #e8f5e9;
  color: #1b5e20;
  border: 1px solid #a5d6a7;
}

.msg.erro {
  background: #fdecea;
  color: #b3261e;
  border: 1px solid #f5c6c2;
}

.rodape {
  text-align: center;
  font-size: 12px;
  color: var(--cinza);
  margin-top: 30px;
}

/* Dashboard */
.barra-dash {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.filtros {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filtros input {
  margin-bottom: 0;
  min-width: 160px;
}

table.dash {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.dash th {
  text-align: left;
  padding: 10px 8px;
  background: var(--verde-claro);
  color: var(--verde-escuro);
  cursor: pointer;
  white-space: nowrap;
}

table.dash td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--borda);
  vertical-align: top;
}

tr.linha-req:hover { background: #fafbfa; cursor: pointer; }

.detalhe {
  display: none;
  background: #fafbfa;
}

.detalhe td {
  padding: 12px 16px;
}

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--verde-claro);
  color: var(--verde-escuro);
}

.badge-pendente {
  background: #fdecea;
  color: #b3261e;
}

.badge-parcial {
  background: #fff4e0;
  color: #9a6700;
}

.badge-entregue {
  background: #e8f5e9;
  color: #1b5e20;
}

.link-sair {
  color: white;
  font-size: 13px;
  text-decoration: underline;
  opacity: 0.9;
}

.login-box {
  max-width: 360px;
  margin: 80px auto;
}

.vazio {
  text-align: center;
  color: var(--cinza);
  padding: 40px 0;
  font-size: 14px;
}

.miniatura {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--borda);
}
