/* Belestim — identidade Vanessa Lorayne Beauty (creme, nude, serifa elegante) */
@font-face { font-family: 'Playfair'; src: url('/assets/fonts/playfair-display-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Playfair'; src: url('/assets/fonts/playfair-display-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Playfair'; src: url('/assets/fonts/playfair-display-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Playfair'; src: url('/assets/fonts/playfair-display-latin-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Work Sans'; src: url('/assets/fonts/work-sans-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Work Sans'; src: url('/assets/fonts/work-sans-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Work Sans'; src: url('/assets/fonts/work-sans-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Work Sans'; src: url('/assets/fonts/work-sans-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }

/* Paleta: vinho (marca), vinho médio, taupe, creme e cinza claro */
:root {
  --bg: #F4F1EE;
  --surface: #FFFFFF;
  --surface-2: #F3EADF;
  --ink: #2A1A1D;
  --ink-2: #4A3639;
  --muted: #76655F;
  --line: #E3D7CA;
  --nude: #C7B7A3;
  --cream: #E8DAC5;
  --brand: #521A24;
  --brand-2: #6A2A32;
  --accent: #6A2A32;
  --accent-ink: #6A2A32;
  --gold: #B08D5B;
  --ok: #3F7A4B;
  --warn: #A8661B;
  --danger: #A8322D;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(42, 26, 29, .05), 0 6px 20px rgba(42, 26, 29, .06);
  --serif: 'Playfair', Georgia, 'Times New Roman', serif;
  --sans: 'Work Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--accent-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0 0 .4em; letter-spacing: .01em; }
h1 { font-size: 34px; }
h2 { font-size: 26px; }
h3 { font-size: 21px; }
.eyebrow { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- Estrutura ---------- */
#app { min-height: 100vh; min-height: 100dvh; }
.page { max-width: 560px; margin: 0 auto; padding: 20px 18px calc(110px + var(--safe-b)); }
.page.narrow { max-width: 440px; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 14px 18px; max-width: 560px; margin: 0 auto; }
.topbar .title { font-family: var(--serif); font-size: 22px; }
.icon-btn { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 20px; height: 20px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card.tint { background: var(--surface-2); border-color: transparent; box-shadow: none; }
.card + .card { margin-top: 14px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; border: 0; }

/* ---------- Entrada ---------- */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 28px 20px; max-width: 440px; margin: 0 auto; }
.brand-logo { width: 220px; margin: 0 auto 6px; }
.brand-logo.sm { width: 150px; }
.brand-tag { text-align: center; font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--ink-2); margin: 6px 0 22px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 999px; padding: 4px; margin-bottom: 18px; }
.tabs button { border: 0; background: transparent; padding: 10px; border-radius: 999px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- Formulários ---------- */
label.field { display: block; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm);
  padding: 13px 14px; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s; appearance: none;
}
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(169, 120, 90, .18); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.pw { position: relative; }
.pw .input { padding-right: 48px; }
.pw button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; padding: 8px; cursor: pointer; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); margin: 1px 0 0; flex: none; }
.error-box { background: #F7E4DF; color: #7E3526; border-radius: var(--radius-sm); padding: 11px 14px; font-size: 14px; }
.ok-box { background: #E6EEE2; color: #3D5639; border-radius: var(--radius-sm); padding: 11px 14px; font-size: 14px; }
.code-input { letter-spacing: .5em; text-align: center; font-size: 26px; font-weight: 600; }

/* ---------- Botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 999px; padding: 13px 22px; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; transition: transform .05s, opacity .15s, background .15s; min-height: 48px; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--ink); color: var(--surface); }
.btn.primary:hover { background: #3A2D26; }
.btn.secondary { background: var(--surface); border-color: var(--ink); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.accent { background: var(--accent); color: #fff; }
.btn.danger { background: transparent; color: var(--danger); border-color: #E7C3B9; }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 14px; min-height: 36px; font-size: 13px; }
.btn svg { width: 18px; height: 18px; }
.link-btn { background: none; border: 0; color: var(--accent-ink); font-weight: 600; cursor: pointer; padding: 6px 0; text-decoration: underline; text-underline-offset: 3px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 16px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
#g-btn { display: flex; justify-content: center; min-height: 44px; }

/* ---------- Progresso do cadastro ---------- */
.steps { display: flex; gap: 6px; margin: 6px 0 20px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps i.on { background: var(--accent); }

/* ---------- Início da cliente ---------- */
.hello { margin: 8px 0 18px; }
.hello h1 { font-size: 32px; }
.next-card { background: var(--ink); color: var(--surface); border-radius: var(--radius); padding: 22px; }
.next-card .eyebrow { color: var(--nude); }
.next-card h2 { color: var(--surface); }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.quick a, .quick button { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 8px; text-align: center; text-decoration: none; color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.quick svg { width: 24px; height: 24px; color: var(--accent); }
.rating { display: flex; align-items: center; gap: 14px; }
.rating .score { font-family: var(--serif); font-size: 44px; line-height: 1; }
.stars { color: var(--gold); letter-spacing: 2px; }
.banner { display: flex; gap: 14px; align-items: center; }
.banner .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.banner .ico svg { width: 22px; height: 22px; color: var(--accent); }

/* ---------- Navegação inferior (cliente) ---------- */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255, 253, 249, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); display: flex; justify-content: center; padding: 6px 8px calc(6px + var(--safe-b)); z-index: 20; }
.bottom-nav .inner { display: flex; width: 100%; max-width: 560px; }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; }
.bottom-nav a svg { width: 23px; height: 23px; }
.bottom-nav a[aria-current="page"] { color: var(--ink); }

/* ---------- Perfil ---------- */
.avatar { width: 64px; height: 64px; border-radius: 999px; background: var(--surface-2); display: grid; place-items: center; font-family: var(--serif); font-size: 26px; color: var(--accent-ink); overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 38px; height: 38px; font-size: 16px; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 14px 2px; width: 100%; background: none; border: 0; text-align: left; cursor: pointer; text-decoration: none; color: inherit; }
.list-item .chev { color: var(--muted); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; } .kv dd { margin-bottom: 8px; } }
.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.badge.ok { background: #E6EEE2; color: #3D5639; }
.badge.warn { background: #F6EAD3; color: #7A5418; }
.badge.danger { background: #F7E4DF; color: #7E3526; }
.badge.gold { background: #F1E7D3; color: #6E5323; }

/* ---------- Painel ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 22px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.side .brand-logo { width: 150px; margin: 0 0 24px 8px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14px; }
.side nav a svg { width: 20px; height: 20px; color: var(--muted); }
.side nav a[aria-current="page"] { background: var(--surface-2); color: var(--ink); }
.side nav a[aria-current="page"] svg { color: var(--accent); }
.side .me { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 10px; border-top: 1px solid var(--line); }
.main { padding: 28px 32px 60px; max-width: 1180px; width: 100%; }
.main-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.main-head h1 { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.stat .n { font-family: var(--serif); font-size: 40px; line-height: 1.05; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input { max-width: 360px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.t td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #FBF7F2; }
.t-wrap { overflow-x: auto; }
.mobile-nav { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding: 18px 16px calc(96px + var(--safe-b)); }
  .mobile-nav { display: flex; }
  table.t .hide-m { display: none; }
}

/* ---------- Janela modal e avisos ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(43, 33, 28, .42); display: grid; place-items: center; padding: 18px; z-index: 50; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 20px; padding: 22px; width: 100%; max-width: 460px; max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
@media (max-width: 520px) { .modal-back { place-items: end center; padding: 0; } .modal { border-radius: 20px 20px 0 0; padding-bottom: calc(22px + var(--safe-b)); } }
.toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 12px 18px; border-radius: 999px; font-size: 14px; z-index: 60; box-shadow: var(--shadow); animation: fade .2s; max-width: 92vw; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-screen { min-height: 100vh; display: grid; place-items: center; }
.loading-screen img { width: 160px; opacity: .9; }

.steps-list { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps-list li { counter-increment: s; position: relative; padding: 0 0 16px 46px; }
.steps-list li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 32px; height: 32px; border-radius: 999px; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; color: var(--accent-ink); }
.prose h2 { margin-top: 1.2em; }
.prose p, .prose li { color: var(--ink-2); }

/* ---------- Ajustes de ícones e espaçamentos ---------- */
svg:not([width]) { width: 22px; height: 22px; flex: none; }
.hero-ico { width: 64px; height: 64px; border-radius: 999px; background: var(--surface-2); display: grid; place-items: center; margin: 0 auto; color: var(--accent); }
.hero-ico svg { width: 30px; height: 30px; }
.list-item svg { color: var(--accent); }
.avatar svg { width: 28px; height: 28px; color: var(--accent); }
.banner, .banner:hover { text-decoration: none; color: inherit; }
.side .me { text-decoration: none; color: inherit; }
.main > * + * { margin-top: 16px; }
.page > section + section, .page > section + a, .page > a + section { margin-top: 14px; }
input.toggle { appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; flex: none; margin: 0; }
input.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
input.toggle:checked { background: var(--accent); }
input.toggle:checked::after { transform: translateX(18px); }
input.toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.quick { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }

@media (max-width: 520px) { .stats { grid-template-columns: 1fr 1fr; } .stats .stat:last-child { grid-column: span 2; } .stat .n { font-size: 34px; } }

/* ---------- Instalar em um toque ---------- */
.install-sheet { text-align: center; }
.install-ico { width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 10px; display: block; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.install-line { font-size: 1.05rem; line-height: 1.55; margin: 6px 0 16px; }
.install-line .key { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--surface-2, #f3ece4); vertical-align: middle; margin: 0 2px; }
.install-line .key svg { width: 20px; height: 20px; }
.install-arrow { position: fixed; width: 0; height: 0; border-left: 14px solid transparent; border-right: 14px solid transparent; z-index: 51; animation: nudge 1s ease-in-out infinite; }
.install-arrow.down { left: calc(50% - 14px); bottom: calc(6px + var(--safe-b)); border-top: 18px solid #fff; }
.install-arrow.up { right: 14px; top: 6px; border-bottom: 18px solid #fff; }
@keyframes nudge { 50% { transform: translateY(6px); } }
.install-arrow.up { animation-name: nudge-up; }
@keyframes nudge-up { 50% { transform: translateY(-6px); } }
.install-back.arrow-down .install-sheet { margin-bottom: calc(40px + var(--safe-b)); border-radius: 20px; }

/* ---------- Fase 2: agendar (cliente) ---------- */
.stepper { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 18px; }
.stepper li { flex: 1; height: 4px; border-radius: 4px; background: var(--line); font-size: 0; }
.stepper li.done { background: var(--nude); }
.stepper li.on { background: var(--ink); }
.cat + .cat { margin-top: 18px; }
.cat .eyebrow { margin: 0 0 8px; }
.svc-list { display: grid; gap: 8px; }
.svc { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; color: inherit; }
button.svc { cursor: pointer; }
button.svc:hover, .pick:hover { border-color: var(--nude); }
.svc > div { flex: 1; min-width: 0; }
.svc .price { font-weight: 700; font-size: 14px; white-space: nowrap; color: var(--accent-ink); }
.svc .chev svg, .pick .chev svg { color: var(--muted); }
#sq { margin-bottom: 16px; }
.pick-list { display: grid; gap: 8px; }
.pick { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer; color: inherit; }
.pick.sm { padding: 9px 12px; justify-content: space-between; }
.pick .avatar svg { width: 18px; height: 18px; }
.day-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.day { display: grid; justify-items: center; gap: 2px; padding: 12px 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; color: inherit; }
.day:hover { border-color: var(--ink); }
.day .dow { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; }
.day .dn { font-family: var(--serif); font-size: 28px; line-height: 1; }
.day .mo { font-size: 12px; color: var(--muted); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; margin-bottom: 16px; }
.slot-grid.sm { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); margin: 6px 0 0; }
.slot { padding: 12px 0; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 600; cursor: pointer; color: inherit; }
.slot-grid.sm .slot { padding: 7px 0; font-size: 13px; }
.slot:hover, .slot.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.done-ico { width: 56px; height: 56px; margin: 0 auto; border-radius: 999px; background: rgba(255,255,255,.1); display: grid; place-items: center; }
.done-ico svg { width: 28px; height: 28px; color: var(--nude); }
.next-card .btn.ghost { color: var(--surface); border-color: rgba(255,255,255,.3); }
.next-card .btn.secondary { background: transparent; color: var(--surface); border-color: var(--nude); }
.next-card .muted, .next-card .small.muted { color: #CDBDAF; }
.next-card a:not(.btn) { color: var(--nude); }
.next-card.appt + .next-card.appt { margin-top: 12px; }
.mt { margin-top: 26px; }
.eyebrow.pad { margin: 4px 2px 8px; }

/* ---------- Fase 2: agenda (painel) ---------- */
.day-nav { align-items: center; }
.day-nav .input { width: auto; }
.icon-btn.flip svg { transform: rotate(180deg); }
.agenda-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; align-items: start; }
.agenda-col { padding: 14px; }
.agenda-col + .agenda-col { margin-top: 0; }
.slots { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.ag-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; background: var(--surface); padding: 10px 12px; cursor: pointer; color: inherit; }
.ag-item:hover { border-color: var(--nude); border-left-color: var(--accent); }
.ag-item.st-done { border-left-color: var(--ok); opacity: .8; }
.ag-item.st-no_show { border-left-color: var(--warn); opacity: .8; }
.ag-item.st-cancelled { border-left-color: var(--line); opacity: .5; text-decoration: line-through; }
.ag-item.late { background: #FBF4EA; }
.ag-item .tm, .list-item .tm { font-weight: 700; font-size: 14px; display: grid; min-width: 46px; }
.ag-item .tm small { font-weight: 400; color: var(--muted); font-size: 12px; }
.ag-item .who { flex: 1; min-width: 0; display: grid; }
.ag-item .who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-block { display: flex; gap: 12px; padding: 9px 12px; border-radius: 10px; font-size: 13px; color: var(--muted);
  background: repeating-linear-gradient(-45deg, var(--surface-2), var(--surface-2) 6px, #EDE2D6 6px, #EDE2D6 12px); }
.ag-block .tm { font-weight: 600; }
.search-res { display: grid; gap: 6px; margin: 8px 0; }
.picked { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.svc-cat h3 { margin-bottom: 6px; }
.svc-cat + .svc-cat { margin-top: 12px; }
td.nowrap, .nowrap { white-space: nowrap; }
td.right, .right { text-align: right; }
.switch-row { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; }
.switch-row > span { display: grid; gap: 2px; }
.switch-row input, .switch input { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; flex: none; cursor: pointer; transition: background .15s; margin: 0; }
.switch-row input::after, .switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.switch-row input:checked, .switch input:checked { background: var(--ok); }
.switch-row input:checked::after, .switch input:checked::after { transform: translateX(18px); }
.switch-row input:focus-visible, .switch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hours-row { display: grid; grid-template-columns: 130px 1fr; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.hours-row:first-of-type { border-top: 0; }
.hours-ranges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hours-ranges .input { width: 108px; padding: 8px 10px; }
@media (max-width: 520px) { .hours-row { grid-template-columns: 1fr; } .hours-ranges .input { width: 92px; } }
.warn-card { border-color: #EBD3A6; background: #FBF4E7; }
.banner-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 14px; }
.banner-grid .card + .card { margin-top: 0; }
fieldset.field { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
fieldset.field legend { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; padding: 0; }
details summary { cursor: pointer; font-weight: 600; }

/* =================== Visual v2: vinho, creme e mais contraste =================== */
body { font-size: 15px; color: var(--ink); letter-spacing: .005em; }
h1, h2, h3 { font-weight: 500; color: var(--brand); letter-spacing: 0; }
h1 { font-size: 30px; }
h2 { font-size: 24px; }
h3 { font-size: 19px; }
.eyebrow { color: var(--brand-2); letter-spacing: .16em; font-weight: 600; }
.brand-tag { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--brand-2); font-size: 18px; }
a { color: var(--brand-2); }

.card { border-color: var(--line); box-shadow: var(--shadow); }
.card.tint { background: var(--surface-2); }
.input, select.input, textarea.input { border-color: #D9CBBB; }
.input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(106, 42, 50, .14); }
.field > span { color: var(--ink); }

.btn { font-weight: 600; letter-spacing: .01em; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: #64212C; }
.btn.secondary { border-color: var(--brand); color: var(--brand); }
.btn.ghost { border-color: #D9CBBB; color: var(--ink); background: var(--surface); }
.btn.ghost:hover { border-color: var(--brand-2); }
.check input { accent-color: var(--brand); }

.next-card { background: linear-gradient(160deg, #5E1F2A 0%, #451219 100%); box-shadow: 0 10px 30px rgba(82, 26, 36, .25); }
.next-card .eyebrow { color: var(--cream); }
.next-card h2 { color: #fff; }
.next-card .btn.primary { background: var(--cream); color: var(--brand); }
.next-card .btn.secondary { border-color: var(--cream); color: var(--cream); }

.badge { background: var(--surface-2); color: var(--brand-2); }
.badge.ok { background: #E3F0E5; color: #2F5E39; }
.badge.warn { background: #F7EAD5; color: #7E4C10; }
.badge.danger { background: #F6E1DF; color: #8A2622; }

/* Menu lateral em vinho */
.side { background: linear-gradient(180deg, #521A24 0%, #3F1219 100%); border-right: 0; color: #F4EBDD; }
.side nav a { color: #EADCCB; font-weight: 500; }
.side nav a svg { color: #C7B7A3; }
.side nav a:hover { background: rgba(255, 255, 255, .06); }
.side nav a[aria-current="page"] { background: rgba(232, 218, 197, .16); color: #fff; }
.side nav a[aria-current="page"] svg { color: var(--cream); }
.side .me { border-top-color: rgba(255, 255, 255, .12); color: #F4EBDD; }
.side .me .muted { color: #C7B7A3; }
.side .avatar { background: rgba(255, 255, 255, .12); color: var(--cream); }
.main-head h1 { color: var(--brand); }
.stat .n { color: var(--brand); }
.bottom-nav { background: rgba(255, 255, 255, .97); }
.bottom-nav a[aria-current="page"] { color: var(--brand); }
.avatar { background: var(--surface-2); color: var(--brand-2); }
.toast { background: var(--brand); }
.stepper li.on { background: var(--brand); }
.stepper li.done { background: var(--nude); }
.slot:hover, .slot.on { background: var(--brand); border-color: var(--brand); }
.day:hover { border-color: var(--brand); }
.svc .price { color: var(--brand); }
.switch-row input:checked, .switch input:checked { background: var(--brand-2); }
table.t tr.click:hover td { background: #FAF5EF; }

/* =================== Agenda v2 =================== */
.ag-top { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .ag-top { grid-template-columns: 1fr; } }
.cal { padding: 16px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head b { font-family: var(--serif); font-size: 18px; color: var(--brand); text-transform: capitalize; font-weight: 500; }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.sm svg { width: 16px; height: 16px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-w { text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 0; }
.cal-d { position: relative; aspect-ratio: 1; border: 0; border-radius: 10px; background: transparent; cursor: pointer; font-size: 14px; color: var(--ink); display: grid; place-items: center; font-family: inherit; }
.cal-d:hover { background: var(--surface-2); }
.cal-d.empty { cursor: default; }
.cal-d.has span { font-weight: 700; }
.cal-d i { position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 10px; font-weight: 700; line-height: 1; padding: 2px 5px; border-radius: 999px; background: var(--cream); color: var(--brand); }
.cal-d.today { box-shadow: inset 0 0 0 1.5px var(--brand-2); }
.cal-d.sel { background: var(--brand); color: #fff; }
.cal-d.sel i { background: #fff; color: var(--brand); }

.ag-sum { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.sum-card { --c: var(--brand); display: grid; gap: 2px; text-align: left; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); border-top: 4px solid var(--c); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; font-family: inherit; color: var(--ink); }
.sum-card.all { --c: var(--nude); }
.sum-card.on { outline: 2px solid var(--c); outline-offset: 0; }
.sum-l { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.sum-l .dot { width: 10px; height: 10px; border-radius: 999px; background: var(--c); }
.sum-n { font-family: var(--serif); font-size: 34px; line-height: 1.1; color: var(--brand); }
.sum-s { font-size: 12px; color: var(--muted); }
.sum-x { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); }

.ag-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ag-bar svg { width: 16px; height: 16px; }
.flip-i svg { transform: rotate(180deg); }
.ag-board { padding: 0; overflow: hidden; }
.ag-scroll { overflow: auto; max-height: calc(100vh - 160px); }
.ag-grid { display: grid; grid-template-columns: 60px repeat(var(--cols), minmax(190px, 1fr)); min-width: calc(60px + var(--cols) * 190px); position: relative; }
.ag-corner { position: sticky; top: 0; left: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--line); }
.ag-colhead { --c: var(--brand); position: sticky; top: 0; z-index: 3; display: flex; gap: 10px; align-items: center; padding: 12px 14px; background: var(--surface); border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); box-shadow: inset 0 3px 0 var(--c); }
.ag-colhead b { display: block; font-size: 14px; }
.ag-colhead span { font-size: 12px; color: var(--muted); }
.ag-colhead .avatar { background: var(--c); color: #fff; font-family: var(--sans); font-size: 13px; font-weight: 600; }
.ag-times { position: sticky; left: 0; z-index: 2; background: var(--surface); border-right: 1px solid var(--line); }
.ag-times span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; font-weight: 600; color: var(--muted); }
.ag-times span:first-child { transform: none; top: 2px !important; }
.ag-col { --c: var(--brand); position: relative; border-left: 1px solid var(--line); background: var(--surface); cursor: copy; }
.ag-line { position: absolute; left: 0; right: 0; border-top: 1px solid #EEE5DB; }
.ag-line.half { border-top-style: dashed; border-top-color: #F3ECE4; }
.ag-closed { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(-45deg, #F6F2ED, #F6F2ED 6px, #EFE8E0 6px, #EFE8E0 12px); }
.ag-blk { position: absolute; left: 4px; right: 4px; border-radius: 8px; background: repeating-linear-gradient(-45deg, #EADFD3, #EADFD3 6px, #E1D3C4 6px, #E1D3C4 12px); color: var(--ink-2); font-size: 12px; font-weight: 600; padding: 6px 8px; overflow: hidden; }
.ag-ev { position: absolute; left: 4px; right: 4px; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 9px; border: 0; border-left: 4px solid var(--c); border-radius: 8px; text-align: left; cursor: pointer; overflow: hidden; font-family: inherit; color: var(--ink);
  background: color-mix(in srgb, var(--c) 13%, #fff); box-shadow: 0 1px 2px rgba(42, 26, 29, .08); transition: transform .1s, box-shadow .1s; z-index: 1; }
.ag-ev:hover { box-shadow: 0 4px 14px rgba(42, 26, 29, .16); z-index: 2; }
.ag-ev b { font-size: 13px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ag-ev .ev-t { font-size: 11px; font-weight: 700; color: var(--c); }
.ag-ev .ev-s { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ag-ev.tiny { flex-direction: row; align-items: center; gap: 6px; padding: 3px 8px; }
.ag-ev.tiny .ev-s { display: none; }
.ag-ev.st-done { border-left-color: var(--ok); background: #EAF3EC; }
.ag-ev.st-done .ev-t { color: var(--ok); }
.ag-ev.st-no_show { border-left-color: var(--warn); background: #F8EEDF; }
.ag-ev.st-no_show .ev-t { color: var(--warn); }
.ag-ev.st-cancelled { opacity: .45; text-decoration: line-through; background: #F3F0EE; border-left-color: #BDB2AA; }
.ag-now { position: absolute; left: 0; right: 0; height: 2px; background: #C0392B; z-index: 3; pointer-events: none; }
.ag-now::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 999px; background: #C0392B; }
@media (max-width: 700px) {
  .ag-grid { grid-template-columns: 48px repeat(var(--cols), minmax(150px, 1fr)); min-width: calc(48px + var(--cols) * 150px); }
  .ag-sum { grid-template-columns: repeat(2, 1fr); }
  .sum-n { font-size: 28px; }
  .ag-scroll { max-height: none; }
}
.cal-d { aspect-ratio: auto; min-height: 42px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px 0; }
.cal-d i { position: static; transform: none; }
.cal-d:not(.has) { color: var(--muted); }
.sum-n, .stat .n, .rating .score, .day .dn, .cal-d, .ag-times span, .ev-t { font-variant-numeric: lining-nums tabular-nums; }
h1, h2 { font-variant-numeric: lining-nums; }
.shell { grid-template-columns: 248px minmax(0, 1fr); }
.main { min-width: 0; }
@media (max-width: 900px) { .shell { grid-template-columns: minmax(0, 1fr); } }
.next-card .btn.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
@media (max-width: 700px) { .main-head .btn { padding: 11px 16px; font-size: 14px; } .cal-d { min-height: 38px; } }

/* =================== Comandas, caixa e comissões =================== */
.modal.wide { max-width: 640px; }
.grid3 { display: grid; grid-template-columns: 1.4fr .7fr 1fr; gap: 10px; }
.mt-s { margin-top: 18px; margin-bottom: 8px; font-size: 17px; }
.tab-client .warn-card { margin: 0; }
.tab-items .list-item { gap: 10px; }
.add-item { background: var(--surface-2); margin-top: 8px; }
.totals { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.totals .big { font-size: 18px; font-weight: 700; color: var(--brand); }
.sm-in { width: 120px; padding: 7px 10px; text-align: right; }
.pay-row .input { flex: 1; min-width: 120px; }
.due { font-weight: 700; margin: 10px 0; }
.due.neg { color: var(--danger); }
.due.pos { color: var(--ok); }
.tab-actions { margin: 10px 0; }
button.list-item.tab-row { width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 12px 4px; cursor: pointer; font-family: inherit; color: inherit; gap: 10px; }
button.list-item.tab-row:hover { background: #FAF5EF; }
.svc-checks { max-height: 260px; overflow: auto; display: grid; gap: 6px; margin-top: 8px; padding: 4px; }
tr.pending td { color: var(--muted); }
.cash-sum { margin-bottom: 14px; }
.cash-sum .sum-card { cursor: default; }
.quick { margin-top: 10px; }
.quick summary { font-size: 14px; color: var(--brand-2); }
@media (max-width: 520px) { .grid3 { grid-template-columns: 1fr 1fr; } .grid3 label:first-child { grid-column: 1 / -1; } }
