:root {
  --verde: #78ae20;
  --verde-esc: #5a9a27;
  --roxo: #a71f85;
  --fundo: #f7f6f2;
  --texto: #2f2f2f;
  --suave: #6b6b6b;
  --borda: #e3e1da;
  --branco: #fff;
  --erro: #b3261e;
  --raio: 16px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 17px; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--fundo);
  color: var(--texto);
  line-height: 1.4;
  padding-bottom: 24px;
}
.topo {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--branco);
  border-bottom: 3px solid var(--verde);
}
.topo strong { display: block; color: var(--roxo); font-size: 1rem; line-height: 1.1; }
.topo small { color: var(--suave); font-size: .75rem; }
.conteudo { max-width: 640px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.45rem; margin: 4px 0 12px; color: var(--roxo); }
h1 small { font-size: .9rem; color: var(--suave); font-weight: 500; }
h2 { font-size: 1.05rem; margin: 22px 0 8px; color: var(--verde-esc); }
.muted { color: var(--suave); font-size: .9rem; }
.ok { color: var(--verde-esc); font-weight: 600; }
code { background: #eee; padding: 1px 5px; border-radius: 6px; font-size: .85em; }

/* formulários */
label { display: block; font-weight: 600; margin: 12px 0; font-size: .95rem; }
input:not([type=checkbox]):not([type=hidden]), select, textarea {
  width: 100%; min-height: 50px; margin-top: 6px;
  padding: 12px 14px; font: inherit; color: inherit;
  background: var(--branco); border: 2px solid var(--borda); border-radius: 12px;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--verde); }
input[type=search] { margin: 0 0 12px; }
fieldset { border: 2px solid var(--borda); border-radius: 12px; margin: 12px 0; padding: 8px 12px 4px; }
legend { font-weight: 700; padding: 0 6px; }
.pet-linha { display: grid; grid-template-columns: 1fr 110px; gap: 8px; margin-bottom: 8px; }
.pet-linha input, .pet-linha select { margin-top: 0; }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; }
.check input { width: 26px; height: 26px; margin-top: 2px; flex: none; accent-color: var(--verde-esc); }

/* botões */
.btn {
  display: block; width: 100%; min-height: 52px; margin-top: 14px;
  padding: 14px 18px; border: 0; border-radius: 14px;
  background: var(--verde-esc); color: #fff; font: inherit; font-weight: 700;
  text-align: center; text-decoration: none; cursor: pointer;
}
.btn:active { transform: scale(.98); }
.btn-sec { background: var(--branco); color: var(--roxo); border: 2px solid var(--roxo); }
.btn-wa { background: #1faa59; }
.btn-peq { min-height: 44px; margin-top: 0; font-size: .9rem; padding: 10px 14px; }
.btn-perigo { background: var(--erro); }
.acoes { display: flex; gap: 10px; flex-wrap: wrap; }
.acoes form { flex: 1 1 140px; margin: 0; }
.acoes .btn { margin-top: 12px; }
.grade { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-serv { margin: 0; min-height: 92px; background: var(--branco); color: var(--texto); border: 2px solid var(--verde); }
.btn-serv span { display: block; font-size: 1.8rem; }
.btn-serv:active { background: var(--verde); color: #fff; }

/* cartões e listas */
.card { background: var(--branco); border: 1px solid var(--borda); border-radius: var(--raio); padding: 14px 16px; margin: 14px 0; }
.card-perigo { border-color: #e8c4c1; }
.card .btn:first-of-type { margin-top: 10px; }
.texto h2 { margin-top: 6px; }
.texto ul { padding-left: 20px; }
.texto li { margin: 8px 0; }
.citacao { background: var(--fundo); border-left: 4px solid var(--roxo); padding: 10px 12px; border-radius: 8px; }
.lista { margin: 8px 0 12px; }
.linha, .res {
  display: block; width: 100%; text-align: left; font: inherit; color: inherit; text-decoration: none;
  background: var(--branco); border: 1px solid var(--borda); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 8px; cursor: pointer;
}
.linha strong, .res strong { display: block; }
.linha:active, .res:active { background: #eef6e0; }
.tag { font-style: normal; font-size: .75rem; padding: 2px 8px; border-radius: 99px; display: inline-block; margin-top: 4px; }
.tag-a { background: #fff1cc; color: #7a5a00; }
.tag-r { background: #fde0de; color: var(--erro); }
.vazio { text-align: center; color: var(--suave); padding: 16px 0; }
.voltar { display: inline-block; margin: 2px 0 8px; color: var(--roxo); text-decoration: none; font-weight: 600; }

.item { background: var(--branco); border: 1px solid var(--borda); border-left: 6px solid var(--borda); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
.item-pronto { border-left-color: var(--verde); }
.item-agendado { border-left-color: #e8b730; }
.item-feito { opacity: .85; }
.item details { margin: 6px 0; }
.item summary { color: var(--roxo); font-weight: 600; cursor: pointer; }
.msg { white-space: pre-wrap; background: var(--fundo); border-radius: 10px; padding: 10px; font: inherit; font-size: .9rem; margin: 6px 0 0; }
.badge-n { background: var(--verde-esc); color: #fff; font-size: .75rem; padding: 1px 8px; border-radius: 99px; }

.aviso { padding: 12px 14px; border-radius: 12px; margin: 0 0 12px; font-weight: 600; }
.aviso-ok { background: #e4f3d0; color: #2f5d0c; }
.aviso-erro { background: #fde0de; color: var(--erro); }
.aviso-atencao { background: #fff1cc; color: #7a5a00; }

.login { text-align: center; padding-top: 24px; }
.login img { border-radius: 24px; }
.login form { text-align: left; }

/* linha do tempo do banho */
.linha-tempo { list-style: none; margin: 8px 0; padding: 0 0 0 14px; border-left: 3px solid var(--verde); }
.linha-tempo li { position: relative; padding: 4px 0 4px 10px; font-size: .95rem; }
.linha-tempo li::before { content: ""; position: absolute; left: -22px; top: 11px; width: 11px; height: 11px; border-radius: 50%; background: var(--verde); }
.linha-tempo li.vazio-ponto::before { background: #ccc; }
.linha-tempo b { font-variant-numeric: tabular-nums; margin-right: 4px; }
.hist { padding: 6px 0; border-top: 1px solid #eee; font-size: .92rem; }
.atencao { color: var(--roxo); font-weight: 600; }
details.card summary { cursor: pointer; padding: 4px 0; }
details.card[open] summary { margin-bottom: 8px; }
a.tag { background: #eef6e0; color: var(--verde-esc); text-decoration: none; margin: 2px 4px 2px 0; padding: 6px 12px; font-size: .9rem; }

/* raça, foto, clube */
.pet-linha { grid-template-columns: 1fr 110px; }
.pet-linha .pet-raca { grid-column: 1 / -1; }
.cab-pet { display: flex; gap: 12px; align-items: center; margin: 6px 0; }
.foto-pet { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; background: #eef6e0; }
.foto-vazia { display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem; }
.foto-grande { width: 84px; height: 84px; }
.clube { display: inline-block; background: #f6e3f0; color: var(--roxo); font-weight: 700; font-size: .85rem; padding: 2px 10px; border-radius: 99px; }
.clube-venc { background: #fde0de; color: var(--erro); }
.obs-banho { background: #fff8e1; border-radius: 10px; padding: 8px 10px; margin: 6px 0; font-size: .95rem; }

.venda-linha { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--borda); }
.venda-linha select { grid-column: 1 / -1; }
.dia-nav .btn { margin-top: 0; }
a.aviso { display: block; text-decoration: none; }

/* receita impressa */
body.receita {font-family:Georgia,serif;max-width:720px;margin:24px auto;padding:0 20px;color:#222}
body.receita h1 {font-size:1.3rem;margin:0}
body.receita .cab {display:flex;gap:14px;align-items:center;border-bottom:3px solid #78ae20;padding-bottom:10px;margin-bottom:16px}
body.receita .cab img {width:60px;height:60px}
body.receita .meta {margin:12px 0;line-height:1.6}
body.receita pre {white-space:pre-wrap;font-family:inherit;font-size:1.05rem;line-height:1.6}
body.receita .ass {margin-top:80px;text-align:center}
body.receita .ass div {border-top:1px solid #222;width:280px;margin:0 auto;padding-top:6px}
body.receita .nao {margin-top:30px;font-size:.8rem;color:#666}
body.receita .botao {margin-bottom:16px}
@media print { body.receita .botao { display: none; } body.receita { margin: 0 auto; } }

/* ===== visual novo (inspirado em sistemas de clínica, com a nossa paleta) ===== */
html { font-size: 16px; }
.faixa-teste { background: var(--roxo); color: #fff; text-align: center; font-size: .82rem; padding: 6px 12px; }
.topo { border-bottom: 1px solid var(--borda); gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-left: 4px; }
.marca span { display: block; }
.btn-menu { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--texto); font: inherit; font-size: .95rem; padding: 8px 6px; cursor: pointer; min-height: 44px; }
svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.topo-aviso { margin-left: auto; background: var(--roxo); color: #fff; font-weight: 700; font-size: .8rem; min-width: 26px; text-align: center; padding: 3px 8px; border-radius: 99px; text-decoration: none; }
.gaveta-fundo { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 20; }
.gaveta-fundo[hidden] { display: none; }
.gaveta { position: fixed; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); background: var(--branco); z-index: 30; transform: translateX(-102%); transition: transform .2s; overflow-y: auto; box-shadow: 2px 0 12px rgba(0,0,0,.15); visibility: hidden; }
body.menu-aberto .gaveta { transform: none; visibility: visible; }
body.menu-aberto { overflow: hidden; }
.gaveta-topo { padding: calc(14px + env(safe-area-inset-top)) 14px 10px; }
.gaveta-topo input { margin: 0; min-height: 44px; border-radius: 99px; border-width: 1px; }
.gaveta ul { list-style: none; margin: 0; padding: 0 0 20px; }
.gaveta li[hidden] { display: none; }
.gaveta a { display: flex; align-items: center; gap: 14px; padding: 14px 18px; color: var(--texto); text-decoration: none; border-bottom: 1px solid #f0eee8; }
.gaveta a span { flex: 1; }
.gaveta a svg { color: var(--suave); flex: none; }
.gaveta a .seta { color: #bbb; }
.gaveta a.on { background: #eef6e0; color: var(--verde-esc); font-weight: 600; }
.gaveta a.on svg { color: var(--verde-esc); }
.badge { background: var(--roxo); color: #fff; font-size: .72rem; min-width: 20px; padding: 1px 7px; border-radius: 99px; text-align: center; }
.conteudo { max-width: 960px; padding: 20px 16px; }
h1 { font-weight: 300; font-size: 1.9rem; color: var(--texto); margin: 6px 0 16px; }
h1 small { font-weight: 300; }
h2 { color: var(--roxo); font-weight: 600; }
.card { padding: 0 0 12px; overflow: hidden; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.card > * { margin-left: 16px; margin-right: 16px; }
.card > h2:first-child, .card > summary:first-child { margin: 0 0 12px; padding: 10px 16px; background: var(--verde-esc); color: #fff; font-size: 1rem; }
.card:nth-of-type(even) > h2:first-child { background: var(--roxo); }
.card > :nth-child(2) { margin-top: 0; }
details.card > summary { margin: 0 0 8px; padding: 10px 16px; background: var(--verde-esc); color: #fff; font-weight: 600; }
details.card:not([open]) { padding-bottom: 0; }
details.card:not([open]) > summary { margin-bottom: 0; }
.card-perigo { border-color: #e8c4c1; }
.btn { border-radius: 99px; min-height: 48px; }
.btn-sec { border-width: 1px; }
.btn-serv { border-radius: 12px; }
input:not([type=checkbox]):not([type=hidden]), select, textarea { border-width: 1px; border-radius: 8px; }
.linha, .res, .item { border-radius: 8px; }
.aviso { border-radius: 8px; }
.login .conteudo { max-width: 420px; }
@media (min-width: 900px) {
  .grade { grid-template-columns: repeat(4, 1fr); }
  .btn { width: auto; min-width: 180px; display: inline-block; }
  form .btn, .acoes .btn, .card .btn { min-width: 0; }
}

.blocos { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.bloco { display: block; background: #3a3a3a; color: #fff; border-radius: 8px; padding: 14px 16px; text-decoration: none; }
.bloco b { display: block; font-size: 2rem; font-weight: 300; text-align: right; }
.bloco span { font-size: .85rem; opacity: .85; }
.bloco-roxo { background: var(--roxo); }
.linha-simples { margin: 8px 0; }
.linha-simples a { color: var(--roxo); }
/* computador: menu fixo na lateral */
@media (min-width: 1000px) {
  .btn-menu { display: none; }
  .gaveta { transform: none; visibility: visible; box-shadow: none; border-right: 1px solid var(--borda); top: var(--alt-topo, 0); width: 250px; }
  .gaveta-fundo { display: none !important; }
  .gaveta-topo { padding-top: 14px; }
  .topo { position: sticky; }
  .conteudo { margin-left: 250px; max-width: none; padding: 24px 32px; }
  .conteudo > * { max-width: 960px; }
  .faixa-teste { position: relative; z-index: 31; }
  .gaveta { top: 96px; }
  body.menu-aberto { overflow: auto; }
}

.filtros { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filtros input { flex: 1 1 160px; margin: 0; }
.filtros .btn { margin: 0; }

/* ficha do pet: abas, histórico, janelas */
.abas { display: flex; gap: 4px; border-bottom: 1px solid var(--borda); margin: 14px 0 12px; overflow-x: auto; }
.aba-bt { background: none; border: 0; border-top: 3px solid transparent; font: inherit; color: #2a7ab5; padding: 10px 14px; cursor: pointer; white-space: nowrap; }
.aba-bt.on { color: var(--texto); border-top-color: var(--roxo); background: var(--branco); border-left: 1px solid var(--borda); border-right: 1px solid var(--borda); }
.aba[hidden] { display: none; }
.filtro-icones { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filtro { background: none; border: 0; padding: 4px; cursor: pointer; opacity: .35; }
.filtro.on { opacity: 1; }
.ic { display: inline-flex; vertical-align: middle; }
.ic-atendimento { color: #3498e0; } .ic-vacina { color: #e8a117; } .ic-receita { color: #8e44ad; } .ic-exame { color: #e74c5e; } .ic-banho { color: #1fa7a0; }
.hist-grid { display: grid; gap: 20px; }
@media (min-width: 900px) { .hist-grid { grid-template-columns: 1fr 1fr; } }
.tl-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; color: inherit; background: var(--branco); border: 1px solid var(--borda); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.tl-item[hidden] { display: none; }
.tl-item:hover { background: #f4f9ea; }
.tl-txt { flex: 1; min-width: 0; }
.tl-txt strong, .tl-txt small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-txt small { color: var(--suave); font-size: .8rem; }
.tl-data { font-size: .8rem; color: var(--suave); white-space: nowrap; }
.hist-novo h2 { margin-top: 0; font-weight: 300; color: var(--texto); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; border-radius: 6px; color: #fff; font: inherit; padding: 16px 8px; cursor: pointer; }
.tile svg { width: 26px; height: 26px; }
.tile-atendimento { background: #3498e0; } .tile-vacina { background: #e8a117; } .tile-receita { background: #8e44ad; } .tile-exame { background: #e74c5e; }
.janela { width: min(560px, 94vw); max-height: 90vh; border: 0; border-radius: 10px; padding: 0 18px 18px; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.janela::backdrop { background: rgba(0,0,0,.45); }
.janela-topo { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--branco); padding: 14px 0 10px; border-bottom: 1px solid var(--borda); margin-bottom: 10px; }
.x { background: #eee; border: 0; border-radius: 99px; width: 34px; height: 34px; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.janela h3 { font-size: .95rem; color: var(--roxo); margin: 14px 0 4px; }
.edicao { background: #fff8e1; border-left: 4px solid #e8b730; border-radius: 6px; padding: 8px 10px; font-size: .88rem; margin: 10px 0; }
.card-edit { border: 1px solid var(--borda); border-radius: 8px; padding: 8px 12px; margin: 12px 0; }
.card-edit summary { cursor: pointer; color: var(--roxo); }

.duas-colunas { display: grid; gap: 0 24px; }
@media (min-width: 900px) {
  .duas-colunas { grid-template-columns: 1fr 1fr; align-items: start; }
  .duas-colunas .coluna h2 { margin-top: 18px; }
}
@media (min-width: 1000px) { .conteudo > .duas-colunas { max-width: 1300px; } }
.pet-link { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
.pet-link:hover { color: var(--roxo); }
.tile-banho { background: #1fa7a0; text-decoration: none; }

/* rodapé dos impressos */
body.receita .rodape { margin-top: 40px; padding-top: 10px; border-top: 2px solid #78ae20; text-align: center; font-family: system-ui, Arial, sans-serif; font-size: .8rem; color: #444; line-height: 1.5; }
@media print { body.receita { padding-bottom: 70px; } body.receita .rodape { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; padding: 8px 20px; background: #fff; } }

/* código de barras e etiquetas */
.barras { display: block; width: 100%; height: 12mm; fill: #000; }
body.etiquetas { background: #fff; color: #000; padding: 12px; }
body.etiquetas .folha { display: grid; grid-template-columns: repeat(3, 63mm); gap: 2mm; }
body.etiquetas .etq { width: 63mm; height: 30mm; padding: 2mm 3mm; box-sizing: border-box; border: 1px dashed #bbb; overflow: hidden; break-inside: avoid; }
body.etiquetas .etq-nome { font-size: 9pt; font-weight: 700; line-height: 1.1; height: 10mm; overflow: hidden; }
body.etiquetas .etq-cod { font-size: 8pt; text-align: center; margin-top: 1mm; }
@media print { body.etiquetas .no-print { display: none; } body.etiquetas .etq { border: 0; } body.etiquetas { padding: 0; } }
.venda-linha[hidden] { display: none; }
body.etiquetas .botao { padding: 10px 18px; font-size: 1rem; margin-bottom: 10px; }

.creditos { text-align: center; font-size: .8rem; color: var(--muted, #6b7280); padding: 18px 12px 28px; }
.creditos a { color: inherit; font-weight: 700; text-decoration: underline; }
@media print { .creditos { display: none; } }
