:root {
  --laranja: #e8590c;
  --laranja-claro: #fff4ec;
  --verde: #2b8a3e;
  --azul: #1971c2;
  --vermelho: #c92a2a;
  --cinza: #868e96;
  --fundo: #faf7f4;
  --texto: #343a40;
  --borda: #e9ecef;
  --sombra: 0 1px 4px rgba(0,0,0,.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--fundo); color: var(--texto); line-height: 1.5; }
a { color: var(--azul); text-decoration: none; }
.container { max-width: 1100px; margin: 0 auto; padding: 16px; }

/* topo */
.topo { background: #fff; border-bottom: 1px solid var(--borda); position: sticky; top: 0; z-index: 10; }
.topo-inner { max-width: 1100px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.topo .logo { font-size: 1.25rem; font-weight: 800; color: var(--laranja); }
.topo .logo span { color: var(--texto); }
.topo nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.topo nav a { padding: 6px 12px; border-radius: 8px; color: var(--texto); font-weight: 600; font-size: .9rem; }
.topo nav a.ativo, .topo nav a:hover { background: var(--laranja-claro); color: var(--laranja); }

h1 { font-size: 1.4rem; margin: 16px 0 4px; }
h2 { font-size: 1.1rem; margin: 20px 0 8px; }
.sub { color: var(--cinza); font-size: .92rem; margin-bottom: 16px; }

/* cards / grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.card { background: #fff; border-radius: 14px; box-shadow: var(--sombra); overflow: hidden; display: flex; flex-direction: column; transition: transform .12s; }
a.card:hover { transform: translateY(-3px); }
.card .foto { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--laranja-claro); display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.card .info { padding: 12px 14px; }
.card .nome { font-weight: 700; font-size: 1.05rem; color: var(--texto); }
.card .meta { color: var(--cinza); font-size: .85rem; margin-top: 2px; }

/* badges */
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .75rem; font-weight: 700; }
.badge.disponivel { background: #d3f9d8; color: var(--verde); }
.badge.em_processo { background: #fff3bf; color: #e67700; }
.badge.adotado { background: #d0ebff; color: var(--azul); }
.badge.indisponivel { background: #f1f3f5; color: var(--cinza); }
.badge.ok { background: #d3f9d8; color: var(--verde); }
.badge.atencao { background: #fff3bf; color: #e67700; }
.badge.problema { background: #ffe3e3; color: var(--vermelho); }

/* filtros */
.filtros { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.filtros button, .chip { border: 1px solid var(--borda); background: #fff; padding: 7px 14px; border-radius: 99px; cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--texto); }
.filtros button.ativo { background: var(--laranja); border-color: var(--laranja); color: #fff; }

/* forms */
form .campo { margin-bottom: 14px; }
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 4px; }
input[type=text], input[type=password], input[type=tel], input[type=date], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #ced4da; border-radius: 10px; font-size: 1rem; font-family: inherit; background: #fff;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--laranja); outline-offset: 0; border-color: var(--laranja); }
.linha2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .92rem; }
.check input { width: 18px; height: 18px; accent-color: var(--laranja); }

/* botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; padding: 11px 20px; font-size: .95rem; font-weight: 700; cursor: pointer; text-align: center; }
.btn-laranja { background: var(--laranja); color: #fff; }
.btn-verde { background: var(--verde); color: #fff; }
.btn-zap { background: #25d366; color: #fff; }
.btn-claro { background: #fff; border: 1px solid var(--borda); color: var(--texto); }
.btn-vermelho { background: #fff; border: 1px solid #ffc9c9; color: var(--vermelho); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-bloco { width: 100%; }

/* painel admin */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 16px 0; }
.stat { background: #fff; border-radius: 12px; padding: 14px; box-shadow: var(--sombra); }
.stat .num { font-size: 1.7rem; font-weight: 800; }
.stat .rotulo { color: var(--cinza); font-size: .82rem; font-weight: 600; }
.stat.verde .num { color: var(--verde); }
.stat.amarelo .num { color: #e67700; }
.stat.azul .num { color: var(--azul); }

.lista-item { background: #fff; border-radius: 12px; box-shadow: var(--sombra); padding: 12px 14px; display: flex; gap: 12px; align-items: center; margin-bottom: 10px; color: var(--texto); }
.lista-item img, .lista-item .sem-foto { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--laranja-claro); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0; }
.lista-item .corpo { flex: 1; min-width: 0; }
.lista-item .titulo { font-weight: 700; }
.lista-item .detalhe { color: var(--cinza); font-size: .85rem; }

/* galeria de fotos (admin + público) */
.fotos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin: 10px 0; }
.fotos-grid .foto-item { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 1; }
.fotos-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-item .acoes { position: absolute; bottom: 0; left: 0; right: 0; display: flex; background: rgba(0,0,0,.55); }
.foto-item .acoes button { flex: 1; border: 0; background: none; color: #fff; padding: 5px 0; cursor: pointer; font-size: .78rem; }
.foto-item .tag-capa { position: absolute; top: 6px; left: 6px; background: var(--laranja); color: #fff; font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; }

/* página pública do animal */
.galeria-principal { width: 100%; max-height: 420px; object-fit: contain; background: #fff; border-radius: 14px; }
.miniaturas { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.miniaturas img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; cursor: pointer; border: 2px solid transparent; }
.miniaturas img.ativa { border-color: var(--laranja); }

.caixa { background: #fff; border-radius: 14px; box-shadow: var(--sombra); padding: 18px; margin-bottom: 16px; }
.msg-erro { background: #ffe3e3; color: var(--vermelho); padding: 10px 14px; border-radius: 10px; margin: 10px 0; font-size: .9rem; display: none; }
.msg-ok { background: #d3f9d8; color: var(--verde); padding: 10px 14px; border-radius: 10px; margin: 10px 0; font-size: .9rem; display: none; }
.vazio { text-align: center; color: var(--cinza); padding: 40px 16px; }
.vazio .emoji { font-size: 3rem; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: var(--sombra); }
th, td { padding: 10px 12px; text-align: left; font-size: .9rem; border-bottom: 1px solid var(--borda); }
th { background: #f8f9fa; font-size: .8rem; text-transform: uppercase; color: var(--cinza); }

@media (max-width: 600px) {
  .linha2 { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  h1 { font-size: 1.2rem; }
}
