:root {
  --bg: #0d0d0d;
  --card: #1a1a1a;
  --card2: #232220;
  --line: #34301f;
  --gold1: #b8862f;
  --gold2: #e9c46a;
  --gold3: #f6e3a1;
  --nude: #e8c4b8;
  --text: #f6f1e7;
  --muted: #a89f8d;
  --ok: #7fd6a0;
  --bad: #f08a8a;
  --warn: #f0c36a;
  --gold-grad: linear-gradient(135deg, #b8862f 0%, #e9c46a 55%, #f6e3a1 100%);
  --radius: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 16px; line-height: 1.45; }
body { min-height: 100vh; min-height: 100dvh; padding-top: var(--safe-t); }
h1, h2, h3 { font-family: 'Playfair Display', Georgia, serif; font-weight: 600; margin: 0 0 .4em; letter-spacing: .2px; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; }
a { color: var(--gold2); }
button { font-family: inherit; }
.gold-text { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.script { font-family: 'Great Vibes', cursive; font-weight: 400; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
.hidden { display: none !important; }

#app { max-width: 640px; margin: 0 auto; padding: 0 16px calc(96px + var(--safe-b)); }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 0 10px; }
.brand { display: flex; align-items: baseline; gap: 6px; text-decoration: none; color: var(--text); }
.brand small { font-size: .62rem; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); }
.brand b { font-family: 'Playfair Display', serif; font-size: 1.25rem; }
.brand i { font-family: 'Great Vibes', cursive; font-style: normal; font-size: 1.6rem; color: var(--gold2); }
.icon-btn { background: var(--card); border: 1px solid var(--line); color: var(--gold2); border-radius: 12px; min-width: 44px; min-height: 44px; font-size: 1rem; cursor: pointer; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 14px; }
.card.gold { border-color: var(--gold1); box-shadow: 0 0 0 1px rgba(233,196,106,.12) inset; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 22px; border-radius: 14px; border: 1px solid var(--gold1); background: transparent; color: var(--gold2); font-weight: 600; font-size: 1rem; cursor: pointer; text-decoration: none; text-align: center; width: 100%; }
.btn.primary { background: var(--gold-grad); color: #1a1405; border-color: transparent; box-shadow: 0 6px 20px rgba(184,134,47,.28); }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: .9rem; width: auto; border-radius: 12px; }
.btn.danger { border-color: #7a3a3a; color: var(--bad); }
.btn.ok { border-color: #2f6a47; color: var(--ok); }
.btn.wa { border-color: #25a361; color: #5be39a; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; min-width: 120px; }

label.f { display: block; font-size: .8rem; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); margin: 12px 0 6px; }
input, select, textarea { width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #121212; color: var(--text); font-size: 16px; font-family: inherit; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold1); border-color: var(--gold1); }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; min-height: 0; accent-color: var(--gold1); flex: none; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: .92rem; color: var(--text); padding: 6px 0; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 600; letter-spacing: .4px; border: 1px solid var(--line); color: var(--muted); }
.badge.agendado { color: var(--warn); border-color: #6a5522; }
.badge.confirmado { color: var(--ok); border-color: #2f6a47; }
.badge.concluido { color: var(--gold2); border-color: var(--gold1); }
.badge.faltou, .badge.cancelado { color: var(--bad); border-color: #7a3a3a; }

.avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: var(--card2); border: 1.5px solid var(--gold1); flex: none; display: flex; align-items: center; justify-content: center; color: var(--gold2); font-family: 'Playfair Display', serif; font-size: 1.2rem; overflow: hidden; }
.avatar.lg { width: 92px; height: 92px; font-size: 2rem; }

.hero { text-align: center; padding: 6px 0 4px; }
.hero-photo { width: min(78vw, 340px); aspect-ratio: 1; border-radius: 28px; object-fit: cover; border: 1px solid var(--gold1); box-shadow: 0 14px 50px rgba(184,134,47,.22); }
.hero h1 { margin-top: 16px; }
.tagline { color: var(--muted); letter-spacing: 2px; text-transform: uppercase; font-size: .72rem; }
.divider-gold { height: 1px; background: var(--gold-grad); opacity: .5; border: 0; margin: 14px 0; }

.svc { display: flex; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); margin-bottom: 10px; cursor: pointer; }
.svc.on { border-color: var(--gold2); background: #211d12; box-shadow: 0 0 0 1px var(--gold1) inset; }
.svc .name { font-weight: 600; font-size: 1.05rem; }
.price { font-weight: 700; color: var(--gold2); white-space: nowrap; }
.sticky-bar { position: sticky; bottom: calc(76px + var(--safe-b)); background: rgba(13,13,13,.94); backdrop-filter: blur(8px); border: 1px solid var(--gold1); border-radius: 16px; padding: 12px; margin-top: 14px; z-index: 5; }

.steps { display: flex; gap: 6px; margin: 4px 0 16px; }
.steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps span.on { background: var(--gold-grad); }

.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-head b { font-family: 'Playfair Display', serif; font-size: 1.15rem; }
.cal-head b::first-letter { text-transform: uppercase; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow { text-align: center; font-size: .68rem; color: var(--muted); text-transform: uppercase; padding: 4px 0; }
.cal button { aspect-ratio: 1; border-radius: 12px; border: 1px solid transparent; background: transparent; color: #5b5546; font-size: .95rem; font-family: inherit; }
.cal button.free { color: var(--text); background: var(--card2); border-color: var(--line); cursor: pointer; font-weight: 600; }
.cal button.sel { background: var(--gold-grad); color: #1a1405; border-color: transparent; }
.cal button.today { outline: 1px dashed var(--gold1); }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.slot { min-height: 48px; border-radius: 12px; border: 1px solid var(--gold1); background: transparent; color: var(--gold2); font-weight: 600; font-size: 1rem; cursor: pointer; font-family: inherit; }
.slot.sel { background: var(--gold-grad); color: #1a1405; border-color: transparent; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(18,18,18,.97); backdrop-filter: blur(10px); border-top: 1px solid var(--line); display: flex; justify-content: center; padding-bottom: var(--safe-b); z-index: 20; }
.tabbar nav { display: flex; width: 100%; max-width: 640px; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 0 8px; text-decoration: none; color: var(--muted); font-size: .68rem; letter-spacing: .5px; text-transform: uppercase; min-height: 60px; }
.tabbar a .ic { font-size: 1.35rem; line-height: 1; }
.tabbar a.on { color: var(--gold2); }

.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.72); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: #151515; border: 1px solid var(--gold1); border-radius: 22px 22px 0 0; width: 100%; max-width: 640px; max-height: 92dvh; overflow: auto; padding: 18px 16px calc(22px + var(--safe-b)); }
@media (min-width: 700px) { .modal-back { align-items: center; } .modal { border-radius: 22px; } }
.toast { position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); transform: translateX(-50%); background: #262218; color: var(--text); border: 1px solid var(--gold1); padding: 12px 18px; border-radius: 14px; z-index: 80; max-width: 90vw; font-size: .95rem; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.toast.err { border-color: #a24a4a; color: #ffd0d0; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin: 6px 0 10px; }
.chip { flex: none; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-family: inherit; font-size: .88rem; cursor: pointer; }
.chip.on { border-color: var(--gold2); color: var(--gold2); background: #211d12; }

.appt { border-left: 3px solid var(--gold1); }
.appt.cancelado, .appt.faltou { opacity: .65; border-left-color: #7a3a3a; }
.appt.concluido { border-left-color: var(--ok); }
.time-big { font-family: 'Playfair Display', serif; font-size: 1.35rem; color: var(--gold2); min-width: 64px; }
.stat { background: var(--card2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-align: center; }
.stat b { display: block; font-family: 'Playfair Display', serif; font-size: 1.3rem; color: var(--gold2); }
.bar { height: 10px; border-radius: 6px; background: var(--gold-grad); min-width: 3px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.menu-item { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; margin-bottom: 10px; text-decoration: none; color: var(--text); font-weight: 600; }
.menu-item .ic { font-size: 1.4rem; }
.vars { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.vars code { background: #2a2515; color: var(--gold3); padding: 3px 8px; border-radius: 8px; font-size: .78rem; cursor: pointer; }
.qr { background: #fff; padding: 10px; border-radius: 14px; width: min(78vw, 300px); display: block; margin: 12px auto; }
.loyalty-dots { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.loyalty-dots i { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--gold1); display: inline-block; }
.loyalty-dots i.on { background: var(--gold-grad); border-color: transparent; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--gold2); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.success { text-align: center; padding: 18px 0; }
.success .check-ic { width: 76px; height: 76px; border-radius: 50%; background: var(--gold-grad); color: #1a1405; font-size: 2.4rem; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.err-text { color: var(--bad); font-size: .9rem; margin: 8px 0 0; min-height: 1.2em; }
