/* Bela Shop — cores do logo: azul-claro e rosa, fundo claro. Pensado primeiro para o celular. */
:root {
  --bg: #f3fafc;
  --card: #fff;
  --ink: #1f3a4a;
  --muted: #5b7380;
  --line: #d6e8ee;
  --blue: #9fd0df;
  --blue-soft: #e3f3f8;
  --blue-deep: #22708a;
  --pink: #f4a3b8;
  --pink-soft: #fde9ef;
  --pink-deep: #c23d66;
  --ok: #2e7d4f;
  --warn: #b4401c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31, 58, 74, .06), 0 4px 14px rgba(31, 58, 74, .06);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--blue-deep); }
h1 { font-size: 1.45rem; margin: 0 0 .75rem; line-height: 1.25; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 .6rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; letter-spacing: .06em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- casca do painel ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1rem;
  padding: .55rem 1rem; padding-top: max(.55rem, env(safe-area-inset-top));
  background: var(--card); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; text-decoration: none; color: var(--ink); }
.brand img { border-radius: 10px; }
.brand b { color: var(--pink-deep); }
.topnav { display: none; gap: .25rem; margin-left: auto; }
.topnav a, .bottomnav a { text-decoration: none; color: var(--muted); font-weight: 600; }
.topnav a { padding: .4rem .8rem; border-radius: 999px; }
.topnav a[aria-current], .topnav a:hover { background: var(--blue-soft); color: var(--blue-deep); }
.logout { margin-left: auto; }
.wrap { max-width: 880px; margin: 0 auto; padding: 1rem 1rem 6rem; }
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex; justify-content: space-around;
  background: var(--card); border-top: 1px solid var(--line); padding: .35rem 0 max(.35rem, env(safe-area-inset-bottom));
}
.bottomnav a { display: flex; flex-direction: column; align-items: center; gap: .1rem; font-size: .75rem; min-width: 64px; padding: .25rem; }
.bottomnav a[aria-current] { color: var(--pink-deep); }
.bottomnav .ico { font-size: 1.3rem; line-height: 1; }
@media (min-width: 760px) {
  .topnav { display: flex; }
  .logout { margin-left: .5rem; }
  .bottomnav { display: none; }
  .wrap { padding-bottom: 2rem; }
}

/* ---------- blocos ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.head h1 { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem 1rem; text-decoration: none; color: var(--ink); }
.stat strong { display: block; font-size: 1.6rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .875rem; }
.stat.alert { border-color: var(--pink); background: var(--pink-soft); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list a.row, .list .row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .7rem .25rem; text-decoration: none; color: var(--ink); }
.list .row small { color: var(--muted); }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: .1rem .55rem; border-radius: 999px; background: var(--blue-soft); color: var(--blue-deep); white-space: nowrap; }
.badge.blank { background: #eef1f3; color: #4f6470; }
.badge.active { background: #e3f4ea; color: var(--ok); }
.badge.disabled, .badge.lost { background: var(--pink-soft); color: var(--pink-deep); }
dl.data { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
dl.data dt { color: var(--muted); }
dl.data dd { margin: 0; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.alert-box { border-radius: 10px; padding: .7rem .9rem; margin-bottom: 1rem; }
.alert-error { background: var(--pink-soft); color: var(--pink-deep); border: 1px solid var(--pink); }
.alert-info { background: var(--blue-soft); color: var(--blue-deep); border: 1px solid var(--blue); }

/* ---------- formulários e botões ---------- */
.field { margin-bottom: .85rem; }
.field label, .label { display: block; font-weight: 600; margin-bottom: .25rem; }
.field-hint { color: var(--muted); font-size: .85rem; margin: .25rem 0 0; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; color: inherit; background: #fff; border: 1px solid #bcd6df; border-radius: 10px; padding: .6rem .75rem; min-height: 44px;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue-deep); }
.grid2 { display: grid; gap: 0 .75rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.check { display: flex; align-items: flex-start; gap: .6rem; margin-bottom: .6rem; font-weight: 400; }
.check input { width: 1.25rem; height: 1.25rem; margin-top: .15rem; accent-color: var(--pink-deep); flex: none; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem .25rem; margin: 0 0 1rem; }
legend { font-weight: 700; padding: 0 .35rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .55rem 1.1rem;
  border-radius: 999px; border: 1px solid transparent; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  background: var(--blue-soft); color: var(--blue-deep);
}
.btn-primary { background: var(--pink-deep); color: #fff; }
.btn-primary:hover { background: #a92f56; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-danger { background: transparent; border-color: var(--pink); color: var(--pink-deep); }
.btn-wide { width: 100%; }
.btn-whats { background: #1f8f4e; color: #fff; }
.btn-maps { background: var(--blue-deep); color: #fff; }
.inline { display: inline; }
.search { display: flex; gap: .5rem; margin-bottom: 1rem; }
.search input { flex: 1; }

/* ---------- login ---------- */
.auth-page { max-width: 420px; margin: 2rem auto; }
.auth-brand { text-align: center; margin-bottom: 1rem; }
.auth-brand img { width: 180px; height: auto; }

/* ---------- QR ---------- */
.qr-preview { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .75rem; display: inline-block; }
.qr-preview svg { width: 180px; height: auto; display: block; }
.code-big { font-size: 1.6rem; font-weight: 800; }

/* ---------- página pública da coleira ---------- */
.public { background: linear-gradient(180deg, var(--blue) 0, var(--blue-soft) 260px, var(--bg) 520px); min-height: 100vh; }
.public .wrap { max-width: 480px; padding: 1.25rem 1rem 2rem; }
.public-logo { display: block; width: 120px; height: auto; margin: 0 auto 1rem; }
.pet-card { text-align: center; padding: 1.5rem 1.25rem; }
.pet-card h1 { font-size: 1.9rem; margin-bottom: .25rem; }
.pet-card .hello { color: var(--pink-deep); font-weight: 700; margin-bottom: .25rem; }
.pet-card .btn { width: 100%; margin-top: .6rem; font-size: 1.05rem; min-height: 52px; }
.lost-banner { background: var(--pink-deep); color: #fff; border-radius: var(--radius); padding: 1rem; text-align: center; font-weight: 700; margin-bottom: 1rem; }
.lost-banner p { margin: .35rem 0 0; font-weight: 400; }
.notes { background: var(--blue-soft); border-radius: 10px; padding: .7rem .9rem; text-align: left; margin-top: 1rem; white-space: pre-line; }
.public-foot { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 1.5rem; }

/* ---------- impressão (folha de QRs e cartõezinhos) ---------- */
.print-only { display: none; }
.sheet-page svg { display: block; width: 210mm; height: 297mm; background: #fff; margin: 0 auto 1rem; box-shadow: var(--shadow); }
.cards { display: grid; grid-template-columns: repeat(2, 85mm); gap: 4mm; justify-content: center; }
.tag-card { width: 85mm; height: 54mm; border: 1px dashed #9bb; border-radius: 3mm; padding: 4mm 5mm; background: #fff; display: flex; flex-direction: column; justify-content: space-between; break-inside: avoid; }
.tag-card-brand { display: flex; align-items: center; gap: 3mm; font-size: 9pt; line-height: 1.25; }
.tag-card-brand img { width: 12mm; height: 12mm; border-radius: 2.5mm; }
.tag-card-brand strong { font-size: 12pt; color: var(--pink-deep); }
.tag-card .act { font-size: 15pt; font-weight: 800; letter-spacing: .12em; }
.tag-card p { margin: 0; font-size: 8.5pt; line-height: 1.3; }
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  .no-print, .topbar, .bottomnav { display: none !important; }
  .print-only { display: block; }
  .wrap { max-width: none; padding: 0; }
  .sheet-page svg { margin: 0; box-shadow: none; break-after: page; }
  .cards { padding: 10mm 0; }
}
.card > h2:first-child { margin-top: 0; }
