/* ═══════════════════════════════════════════════════════
   MCD Pets — mobile-first.
   Desenhado pro polegar: alvos de toque grandes, navegação
   embaixo, nada de tabela larga. No desktop, o conteúdo só
   ganha uma margem maior e para de crescer.
   ═══════════════════════════════════════════════════════ */
:root {
  --bg:      #0f1211;
  --surface: #171b1a;
  --border:  #262c2b;
  --text:    #e8eceb;
  --muted:   #7d8886;
  --accent:  #2f9e8f;   /* sobrescrito em runtime pela cor da loja */
  --ok:      #4caf78;
  --danger:  #e05555;
  --warn:    #e09a30;
  --nav-h:   64px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}

/* ── Topo ─────────────────────────────────────────────── */
.topo {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topo h1 { margin: 0; font-size: 17px; font-weight: 600; }
.topo .loja { color: var(--muted); font-size: 13px; }

/* ── Conteúdo ─────────────────────────────────────────── */
main { max-width: 720px; margin: 0 auto; padding: 16px; }

.grade {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  min-height: 96px;
}
.card:active { transform: scale(.98); }
.card .icone { font-size: 24px; }
.card .titulo { font-weight: 600; }
.card .sub { color: var(--muted); font-size: 12px; }
.card[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* ── Formulários ──────────────────────────────────────── */
.form { max-width: 400px; margin: 8vh auto; padding: 24px 20px; }
.form h1 { margin: 0 0 4px; font-size: 22px; }
.form p.sub { margin: 0 0 24px; color: var(--muted); font-size: 14px; }

label { display: block; margin: 14px 0 6px; font-size: 13px; color: var(--muted); }

input, select, textarea {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px;            /* 16px evita o zoom automático do iOS */
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

button, .btn {
  display: block; width: 100%;
  margin-top: 20px; padding: 14px;
  font: inherit; font-weight: 600;
  color: #06110f;
  background: var(--accent);
  border: 0; border-radius: 10px;
  cursor: pointer;
}
button:disabled { opacity: .5; cursor: default; }

.link { display: block; margin-top: 18px; text-align: center;
        color: var(--muted); font-size: 14px; }
.link a { color: var(--accent); }

.erro {
  display: none;
  margin-top: 16px; padding: 11px 13px;
  font-size: 14px;
  color: #ffd7d7;
  background: rgba(224, 85, 85, .12);
  border: 1px solid rgba(224, 85, 85, .35);
  border-radius: 10px;
}
.erro.on { display: block; }

/* ── Navegação inferior ───────────────────────────────── */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex;
  height: var(--nav-h);
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.nav a {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  color: var(--muted);
  font-size: 11px;
  text-decoration: none;
}
.nav a .icone { font-size: 19px; }
.nav a.ativo { color: var(--accent); }

.vazio { padding: 40px 16px; text-align: center; color: var(--muted); }

/* ── Grade da agenda ──────────────────────────────────── */
/* Uma linha por horário: a hora na canhoto, os banhos daquele
   horário à direita. Rola vertical no celular, sem tabela. */
.slot { display: flex; gap: 12px; padding: 10px 0;
        border-bottom: 1px solid var(--border); }
.slot-hora { width: 48px; flex: none; padding-top: 4px;
             color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.slot-corpo { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.bloco {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.bloco:active { transform: scale(.99); }
.bloco .titulo { font-weight: 600; font-size: 15px; }
.bloco .sub { color: var(--muted); font-size: 12px;
              white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* A foto do pet no bloco: quem trabalha na tosa reconhece o cachorro
   pela cara, não pelo nome. */
.foto { width: 44px; height: 44px; flex: none;
        object-fit: cover; border-radius: 50%; background: var(--bg); }
.sem-foto { display: flex; align-items: center; justify-content: center;
            font-size: 20px; }

.tag { flex: none; padding: 3px 8px; border-radius: 20px;
       background: var(--bg); color: var(--muted);
       font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }

.slot-livre {
  width: 100%; margin: 0; padding: 9px;
  color: var(--muted);
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 10px;
  font-size: 13px; font-weight: 400;
}
.slot-livre:active { border-color: var(--accent); color: var(--accent); }

.btn-icone {
  width: auto; margin: 0; padding: 7px 11px;
  font-size: 13px; font-weight: 500;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* ── Linhas de ajuste (dia da semana / preço por porte) ── */
.linha-dia, .linha-preco {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.linha-dia input[type="time"],
.linha-preco input[type="number"] {
  width: 92px; flex: none; padding: 8px; font-size: 14px;
}

/* ── Fluxo de caixa ───────────────────────────────────── */
/* Uma barra por dia, altura proporcional. Sem biblioteca de gráfico:
   200 KB de JS pra desenhar 30 retângulos não se paga. */
.fluxo {
  display: flex; align-items: flex-end; gap: 2px;
  height: 110px; padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-x: auto;
}
.fluxo-col { flex: 1; min-width: 4px; height: 100%;
             display: flex; align-items: flex-end; }
.fluxo-barra { width: 100%; min-height: 2px; border-radius: 2px; }

.preview-foto {
  display: block;
  width: 100px; height: 100px;
  margin-top: 10px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.btn-cobrar {
  width: auto; flex: none; margin: 0; padding: 7px 10px;
  font-size: 13px; font-weight: 600;
  color: #06110f; background: var(--accent);
  border: 0; border-radius: 8px;
}

.linha-mov {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

/* ── Modal ────────────────────────────────────────────── */
.modal {
  display: none;
  position: fixed; inset: 0; z-index: 30;
  align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, .6);
}
.modal.on { display: flex; }
.modal-box {
  width: 100%; max-width: 480px;
  max-height: 85vh; overflow-y: auto;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-radius: 18px 18px 0 0;
}
.modal-box h2 { margin: 0 0 6px; font-size: 18px; }
@media (min-width: 600px) {
  .modal { align-items: center; }
  .modal-box { border-radius: 18px; }
}
