/* Cores principais: mude aqui ou pelo painel em Configurações */
:root {
  --primary: #6d28d9;
  --accent: #14b8a6;
  --primary-dark: color-mix(in srgb, var(--primary) 70%, black);
  --primary-soft: color-mix(in srgb, var(--primary) 10%, white);
  --accent-soft: color-mix(in srgb, var(--accent) 15%, white);
  --bg: #f7f7fb;
  --surface: #ffffff;
  --text: #1f2333;
  --muted: #6b7083;
  --border: #e4e5ee;
  --danger: #dc2626;
  --warning: #d97706;
  --success: #059669;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(20, 20, 50, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}
a { color: var(--primary); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }

.container { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .75em 1.4em; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: transform .12s, background .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn-light { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-sm { padding: .4em .8em; font-size: .875rem; border-radius: 8px; }
.btn-danger { background: var(--danger); color: #fff; }
/* Ação principal do atendimento (Iniciar) */
.btn-go { background: #16a34a; color: #fff; box-shadow: 0 4px 12px rgba(22, 163, 74, .3); white-space: nowrap; }
.btn-go:hover { background: #15803d; }

/* Navegação */
.nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.nav .container { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: .55em; font-weight: 800; font-size: 1.25rem; color: var(--text); text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--primary), var(--accent)); display: grid; place-items: center; flex: 0 0 auto; box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 30%, transparent); }
.brand-mark svg { width: 100%; height: 100%; }
.by-vendor { display: block; font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.sidebar .by-vendor { color: rgba(255,255,255,.55); }
.powered { text-align: center; color: var(--muted); font-size: .85rem; margin: 32px 0 16px; }
.powered a { color: inherit; font-weight: 600; text-decoration: none; }
.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a:not(.btn) { color: var(--muted); text-decoration: none; font-weight: 500; }
.nav-links a:not(.btn):hover { color: var(--text); }
@media (max-width: 760px) { .nav-links a:not(.btn) { display: none; } }

/* Hero */
.hero { padding: 88px 0 72px; background: radial-gradient(1200px 500px at 85% -10%, var(--accent-soft), transparent), radial-gradient(900px 500px at -10% 20%, var(--primary-soft), transparent); }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.3rem); letter-spacing: -.02em; }
.hero h1 span { color: var(--primary); }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 540px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0 22px; }
.hero-badges { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: .92rem; }
.hero-badges span::before { content: '✓ '; color: var(--accent); font-weight: 700; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } .hero { padding-top: 56px; } }

.mock { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 20px; border: 1px solid var(--border); }
.mock-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-weight: 700; }
.mock-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 14px; text-align: center; font-size: .8rem; }
.mock-days div { padding: 8px 0; border-radius: 8px; background: var(--bg); }
.mock-days .on { background: var(--primary); color: #fff; }
.mock-slot { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); margin-bottom: 8px; font-size: .92rem; }
.mock-slot b { color: var(--primary); }

/* Seções */
.section { padding: 80px 0; }
.section-title { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-title h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
.section-title p { color: var(--muted); }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.feature .icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 1.3rem; margin-bottom: 14px; }
.feature p { color: var(--muted); margin: 0; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; counter-reset: step; }
.step { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; margin-bottom: 12px; }
.step p { color: var(--muted); margin: 0; }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; align-items: stretch; }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; }
.plan.featured { border: 2px solid var(--primary); box-shadow: var(--shadow); position: relative; }
.plan.featured::before { content: 'Mais escolhido'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; font-size: .75rem; font-weight: 700; padding: 3px 12px; border-radius: 999px; }
.plan .price { font-size: 2.3rem; font-weight: 800; margin: 8px 0 16px; }
.plan .price small { font-size: .95rem; font-weight: 500; color: var(--muted); }
.plan ul { list-style: none; padding: 0; margin: 0 0 24px; flex: 1; }
.plan li { padding: 6px 0; border-bottom: 1px dashed var(--border); }
.plan li::before { content: '✓'; color: var(--accent); font-weight: 700; margin-right: 8px; }

.faq { max-width: 760px; margin: 0 auto; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0 20px; margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 18px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
.faq summary::after { content: '+'; color: var(--primary); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq details p { margin: 0 0 18px; color: var(--muted); }

.cta { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border-radius: 24px; padding: 56px 32px; text-align: center; }
.cta p { opacity: .85; max-width: 560px; margin: 0 auto 26px; }

footer { padding: 36px 0; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--border); margin-top: 80px; }
footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* Formulários */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
input, select, textarea {
  width: 100%; font: inherit; padding: .7em .85em; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--primary) 40%, transparent); border-color: var(--primary); }
.field { margin-bottom: 16px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.muted { color: var(--muted); }
.error { color: var(--danger); font-weight: 500; }
.hidden { display: none !important; }

/* Página de agendamento */
.booking-wrap { max-width: 720px; margin: 40px auto; }
.booking-step { margin-bottom: 26px; }
.booking-step h3 { display: flex; align-items: center; gap: 10px; }
.booking-step h3 .n { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: .9rem; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.choice { text-align: left; padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font: inherit; color: inherit; }
.choice:hover { border-color: var(--primary); }
.choice.selected { border: 2px solid var(--primary); background: var(--primary-soft); padding: 13px; }
.choice small { color: var(--muted); display: block; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.slot { padding: 10px 0; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font: inherit; font-weight: 600; color: inherit; }
.slot:hover { border-color: var(--primary); }
.slot.selected { background: var(--primary); color: #fff; border-color: var(--primary); }
.days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.day { flex: 0 0 auto; width: 70px; padding: 10px 0; text-align: center; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font: inherit; color: inherit; }
.day small { display: block; color: var(--muted); font-size: .75rem; text-transform: uppercase; }
.day b { font-size: 1.2rem; }
.day.selected { background: var(--primary); color: #fff; border-color: var(--primary); }
.day.selected small { color: #fff; opacity: .8; }
.day:disabled { opacity: .4; cursor: not-allowed; }
.success-box { text-align: center; padding: 40px 24px; }
.success-box .check { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 2rem; margin: 0 auto 16px; }

/* Painel */
.admin { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--primary-dark); color: #fff; padding: 22px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.sidebar .brand { color: #fff; margin: 0 8px 28px; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar nav button { text-align: left; background: none; border: 0; color: rgba(255,255,255,.75); font: inherit; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.sidebar nav button:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar nav button.active { background: rgba(255,255,255,.16); color: #fff; font-weight: 600; }
.main { padding: 28px; min-width: 0; }
.main-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; gap: 12px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.stat .v { font-size: 1.7rem; font-weight: 800; }
.stat .l { color: var(--muted); font-size: .88rem; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; background: var(--bg); }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.badge.agendado { background: #eef2ff; color: #4338ca; }
.badge.confirmado { background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 70%, black); }
.badge.concluido { background: #ecfdf5; color: var(--success); }
.badge.cancelado { background: #f3f4f6; color: #6b7280; }
.badge.faltou { background: #fef2f2; color: var(--danger); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: end; }
.toolbar > * { width: auto; }
.bar { height: 10px; border-radius: 6px; background: var(--primary); min-width: 2px; }
.color-row { display: flex; gap: 10px; align-items: center; }
.color-row input[type=color] { width: 52px; height: 42px; padding: 4px; }
.hours-table input { min-width: 96px; }

.modal-bg { position: fixed; inset: 0; background: rgba(15, 15, 35, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border-radius: var(--radius); padding: 24px; width: min(520px, 100%); max-height: 90vh; overflow: auto; }
.modal h3 { margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

.toast { position: fixed; bottom: 20px; right: 20px; background: var(--text); color: #fff; padding: 12px 18px; border-radius: 10px; z-index: 60; box-shadow: var(--shadow); }
.toast.err { background: var(--danger); }

.side-user { color: rgba(255,255,255,.6); padding: 12px 12px 0; display: block; overflow-wrap: anywhere; }
.banner { background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.link-box { display: flex; gap: 8px; align-items: center; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; overflow-wrap: anywhere; }
.link-box code { flex: 1; }
/* Foto do profissional */
.avatar { display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 50%; object-fit: cover; background: var(--primary-soft); color: var(--primary); font-weight: 700; line-height: 1; vertical-align: middle; }
.avatar-any { background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 70%, black); font-size: 1.2rem; }
.prof-chip { display: inline-flex; align-items: center; gap: 8px; }
.photo-field { display: flex; align-items: center; gap: 16px; }
.photo-field > span { flex: 0 0 auto; display: inline-flex; }
.photo-field > div { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.photo-field label.btn { margin: 0; }
.photo-field small { flex-basis: 100%; }
.choice-prof { display: flex; align-items: center; gap: 12px; }
.check-label { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.check-label input { width: auto; }

.legal { max-width: 760px; padding: 40px 0; }
.legal h2 { font-size: 1.2rem; margin-top: 28px; }
.legal p, .legal li { color: #383c4d; }
.legal mark { background: #fef3c7; padding: 0 4px; border-radius: 4px; }

.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(800px 400px at 80% 0%, var(--accent-soft), transparent), var(--bg); }
.auth-wrap .card { width: min(400px, 100%); }

.tabbar { display: none; }
.sheet-list { display: flex; flex-direction: column; margin: 0 -4px; }
.sheet-list button { display: flex; justify-content: space-between; align-items: center; background: none; border: 0; border-bottom: 1px solid var(--border); font: inherit; font-weight: 500; color: var(--text); text-align: left; padding: 15px 4px; cursor: pointer; }
.sheet-list button span { color: var(--muted); font-size: 1.3rem; line-height: 1; }
.sheet-list .sheet-danger { color: var(--danger); border-bottom: 0; }

/* ---------- Celular: painel ---------- */
@media (max-width: 860px) {
  input, select, textarea { font-size: 16px; } /* evita o zoom automático do iPhone */

  .admin { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 15; height: auto; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); box-shadow: 0 2px 12px rgba(0,0,0,.12); }
  .sidebar .brand { margin: 0; font-size: 1.05rem; }
  .sidebar .brand-mark { width: 30px; height: 30px; border-radius: 8px; }
  .sidebar nav, .side-user { display: none; }

  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px);
    border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; font: inherit; font-size: .7rem; font-weight: 500; color: var(--muted); padding: 8px 0 7px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .tabbar svg { width: 23px; height: 23px; }
  .tabbar button.active { color: var(--primary); font-weight: 700; }

  .main { padding: 16px 14px calc(150px + env(safe-area-inset-bottom)); }
  .main h1 { font-size: 1.45rem; margin-bottom: .2em; }
  .main h2 { font-size: 1.1rem; margin-top: 8px; }
  .main-head { margin-bottom: 16px; }
  .main-head .muted { font-size: .9rem; margin: 0; }
  /* Botão "+ Novo …" vira botão flutuante acima da barra inferior */
  .main-head > .btn-primary {
    position: fixed; right: 16px; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 19;
    border-radius: 999px; padding: .85em 1.3em; box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 45%, transparent);
  }

  .stats { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
  .stat { padding: 14px; }
  .stat .v { font-size: 1.35rem; }
  .stat .l { font-size: .8rem; }
  .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }

  .card { padding: 18px 16px; }
  .banner { font-size: .9rem; padding: 12px 14px; }
  .banner .btn { width: 100%; }
  .link-box { flex-wrap: wrap; }
  .link-box code { flex-basis: 100%; font-size: .85rem; }
  .link-box .btn { flex: 1; }

  .toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .toolbar > * { width: 100%; min-width: 0 !important; }
  .toolbar > .btn, .toolbar > input, .toolbar > div:only-child { grid-column: 1 / -1; }

  /* Tabelas viram cartões (o nome da coluna vem de data-label, posto pelo painel.js) */
  .table-wrap { background: none; border: 0; border-radius: 0; overflow: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
  .table-wrap td { display: flow-root; border: 0; padding: 5px 0; white-space: normal; text-align: right; overflow-wrap: anywhere; }
  .table-wrap td::before { content: attr(data-label); float: left; margin-right: 12px; color: var(--muted); font-size: .8rem; font-weight: 600; padding-top: 2px; }
  .table-wrap td:empty { display: none; }
  .table-wrap td:first-child { text-align: left; font-weight: 600; font-size: 1.02rem; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
  .table-wrap td[data-label=""], .table-wrap td[colspan] { text-align: left; }
  .table-wrap td:first-child::before, .table-wrap td[data-label=""]::before { display: none; }
  .table-wrap td[data-label=""]:last-child:not(:first-child) { padding-top: 10px; }
  .table-wrap td[data-label=""] .btn { flex: 1; }
  .table-wrap td input:not([type=checkbox]), .table-wrap td select { width: auto; max-width: 62%; }
  .hours-table input { min-width: 0; }
  .table-wrap td:first-child .prof-chip { gap: 12px; }
  /* Horários: abre/fecha e intervalo lado a lado */
  .hours-table tr { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
  .hours-table td { text-align: left; }
  .hours-table td:first-child { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
  .hours-table td::before { float: none; display: block; margin: 0 0 4px; }
  .hours-table td:nth-child(2) { grid-column: 1 / -1; text-align: right; }
  .hours-table td:nth-child(2)::before { float: left; margin: 0; }
  .hours-table td:nth-child(2) input { width: 22px; height: 22px; }
  .hours-table td input:not([type=checkbox]) { width: 100%; max-width: none; }
  #hoursForm > .btn { width: 100%; }

  /* Cartão de agendamento: hora em destaque à esquerda */
  .table-wrap tr.appt { display: grid; grid-template-columns: 62px 1fr; column-gap: 12px; align-items: start;
    grid-template-areas: "date date" "time client" "time service" "time prof" ". notes" "status status" "wa wa"; }
  .table-wrap tr.appt td { text-align: left; padding: 2px 0; border: 0; margin: 0; font-size: .95rem; font-weight: 400; }
  .table-wrap tr.appt td::before { display: none; }
  .table-wrap tr.appt .c-date { grid-area: date; font-size: .8rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .04em; padding-bottom: 6px; }
  .table-wrap tr.appt .c-time { grid-area: time; font-size: 1.2rem; line-height: 1.3; }
  .table-wrap tr.appt .c-client { grid-area: client; font-weight: 600; }
  .table-wrap tr.appt .c-service { grid-area: service; }
  .table-wrap tr.appt .c-prof { grid-area: prof; color: var(--muted); font-size: .88rem; }
  .table-wrap tr.appt .c-notes { grid-area: notes; color: var(--muted); font-style: italic; }
  .table-wrap tr.appt .c-status { grid-area: status; padding-top: 10px; }
  .table-wrap tr.appt .c-wa { grid-area: wa; padding-top: 10px; }
  .table-wrap tr.appt .c-status select { width: 100% !important; max-width: none; }
  .table-wrap tr.appt .c-status .btn-go, .table-wrap tr.appt .c-status [data-finish] { flex: 1; width: 100%; padding: .85em; }
  .table-wrap tr.appt .c-wa > div { flex-wrap: wrap; }
  .table-wrap tr.appt .c-wa .btn { flex: 1; padding: .6em; }
  .table-wrap tr.appt .c-wa small { flex-basis: 100%; }

  /* Formulários em janela viram painel que sobe de baixo */
  .modal-bg { place-items: end stretch; padding: 0; }
  .modal { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; padding: 26px 16px 0; animation: sheet-up .22s ease-out; }
  .modal::before { content: ''; position: absolute; left: 50%; transform: translate(-50%, -16px); width: 40px; height: 4px; border-radius: 4px; background: var(--border); }
  .modal { position: relative; }
  .modal-actions { position: sticky; bottom: 0; background: var(--surface); margin: 8px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); flex-wrap: wrap; }
  .modal-actions .btn { flex: 1; }
  .modal > :last-child:not(form) { margin-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .modal .table-wrap tr { padding: 10px 12px; }

  .toast { left: 16px; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); text-align: center; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }

/* ---------- Celular: site e página de agendamento ---------- */
@media (max-width: 600px) {
  .nav .container { height: 58px; }
  .brand { font-size: 1.1rem; }
  .hero { padding: 40px 0 48px; }
  .hero-actions .btn { flex: 1; }
  .section { padding: 56px 0; }
  .cta { padding: 40px 20px; border-radius: 18px; }

  .booking-wrap { margin: 20px auto 40px; }
  .booking-wrap h1 { font-size: 1.6rem; }
  .booking-step { margin-bottom: 22px; }
  .choice-grid { grid-template-columns: 1fr; }
  .choice { padding: 15px 16px; }
  .choice.selected { padding: 14px 15px; }
  .slots { grid-template-columns: repeat(4, 1fr); }
  .slot { padding: 12px 0; }
  .days { scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; }
  .days::-webkit-scrollbar { display: none; }
  .day { scroll-snap-align: start; width: 64px; }
  #confirm { width: 100%; padding: .95em; }
  .success-box .btn { width: 100%; }
}

/* ---------- Convite para o app (página /agendar) ---------- */
.app-promo { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; box-shadow: var(--shadow); }
.app-promo-icon img { border-radius: 10px; display: block; }
.app-promo > span:nth-child(2) { flex: 1; line-height: 1.3; }
.app-promo small { display: block; color: var(--muted); font-size: .85rem; }
.app-promo-go { background: var(--primary); color: #fff; font-weight: 700; font-size: .85rem; padding: .45em 1em; border-radius: 999px; }
.app-done { background: var(--primary-soft); border-radius: 12px; padding: 16px; margin: 18px 0 8px; }
.app-done p { margin: 4px 0 12px; }

/* ---------- App do cliente (/app/<slug>) ---------- */
.capp { min-height: 100vh; }
.capp-head { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 10px; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); background: var(--primary-dark); color: #fff; font-size: 1.05rem; }
.capp-head .brand-mark { width: 30px; height: 30px; border-radius: 8px; }
.capp-main { width: min(560px, 100%); margin: 0 auto; padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
.capp-main h2 { font-size: 1.2rem; margin-top: 6px; }
.capp-hero { padding: 8px 0 14px; }
.capp-hero h1 { font-size: 1.7rem; margin-bottom: .2em; }
.capp-big { width: 100%; padding: .95em; margin-bottom: 10px; }
.capp-note { font-size: .88rem; text-align: center; }
.capp-back { background: none; border: 0; font: inherit; color: var(--primary); font-weight: 600; padding: 4px 0 12px; cursor: pointer; }
.capp-danger { color: var(--danger); }
.capp-empty { text-align: center; margin-bottom: 14px; }
.capp-appt { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.capp-appt.past { opacity: .75; }
.capp-appt-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; color: var(--primary); }
.capp-appt-top > span:first-child::first-letter { text-transform: uppercase; }
.capp-appt-main { display: flex; align-items: center; gap: 14px; }
.capp-time { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.capp-appt-main div { display: flex; flex-direction: column; line-height: 1.35; }
.capp-appt-main small { font-size: .85rem; }
.capp-appt .prof-chip { font-size: .9rem; color: var(--muted); padding-top: 10px; border-top: 1px solid var(--border); }
.capp-history { margin-top: 18px; }
.capp-history summary { cursor: pointer; font-weight: 600; padding: 10px 0; color: var(--muted); }
.capp-install { display: flex; align-items: center; gap: 12px; margin: 12px 16px 0; padding: 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.capp-install img { border-radius: 10px; flex: 0 0 auto; }
.capp-install > div { flex: 1; line-height: 1.3; }
.capp-install small { display: block; color: var(--muted); font-size: .85rem; }
.capp-share { display: inline-grid; place-items: center; width: 20px; height: 20px; border: 1.5px solid currentColor; border-radius: 5px; font-size: .7rem; vertical-align: -3px; }
.capp-x { background: none; border: 0; font-size: 1.5rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.capp-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.capp-tabs.hidden { display: none; }
.capp-tabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; font: inherit; font-size: .72rem; font-weight: 500; color: var(--muted); padding: 9px 0 8px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.capp-tabs svg { width: 24px; height: 24px; }
.capp-tabs button.active { color: var(--primary); font-weight: 700; }
.capp .toast { left: 16px; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); text-align: center; }
.capp .choice-grid { grid-template-columns: 1fr; }
.capp .slots { grid-template-columns: repeat(4, 1fr); }
.capp .days { scrollbar-width: none; }
.capp #confirm { width: 100%; padding: .95em; }
.capp-center { text-align: center; }
.capp-logo { border-radius: 22px; box-shadow: var(--shadow); margin: 8px auto 14px; display: block; }
.capp-center h1 { font-size: 1.55rem; }
.capp-pending { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.capp-dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; display: inline-block; }
.capp-company { display: flex; align-items: center; gap: 12px; width: 100%; margin-bottom: 10px; padding: 16px; }
.capp-company b { flex: 1; }
.capp-go { color: var(--muted); font-size: 1.4rem; line-height: 1; }
.capp-company-head { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 18px; }
.capp-company-head div { display: flex; flex-direction: column; line-height: 1.3; }
.capp-company-head small { font-size: .82rem; }
.capp-mycompany { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.capp-mycompany-head { display: flex; align-items: center; gap: 10px; font-size: 1.02rem; }
.capp-mycompany-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.capp-small { font-size: .85rem; margin: 8px 0 0; }
.capp-result { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.capp-result b { flex: 1; }
.capp-help { margin-top: 14px; }
.capp-help summary { cursor: pointer; color: var(--primary); font-weight: 600; text-align: center; padding: 6px 0; }
.capp-appt-actions { padding-top: 10px; border-top: 1px solid var(--border); }
.capp-cancel { color: var(--danger); width: 100%; }

/* Site: faixa do app para clientes */
.app-band { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 36px; box-shadow: var(--shadow); }
.app-band h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.app-band-how { font-size: .9rem; margin: 0; }
.app-band-qr { text-align: center; }
.app-band-qr #appQr { background: #fff; padding: 10px; border-radius: 12px; border: 1px solid var(--border); display: inline-block; }
.app-band-qr #appQr img, .app-band-qr #appQr canvas { display: block; }
@media (max-width: 760px) { .app-band { grid-template-columns: 1fr; padding: 24px 20px; } .app-band-qr { display: none; } }
