/* =====================================================================
   Design system da Agenda (marca Tuca: marrom #3b2219 e creme #f6f0e4)
   Guia visual com todos os tokens e componentes: /design-system.html
   ===================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  /* Marca (não mudar: cores do estúdio) */
  --brand-brown: #3b2219;
  --brand-cream: #f6f0e4;

  /* Superfícies e texto */
  --bg: #f6f0e4;
  --surface: #fffbf3;
  --surface-2: #efe5d3;
  --ink: #1e110c;
  --muted: #7a6052;
  --line: #e4d6c1;

  /* Destaque (os nomes "rose" ficaram por compatibilidade com o JS) */
  --rose: #1e110c;
  --rose-dark: #120a07;
  --rose-soft: #eadcc6;
  --on-accent: #f6f0e4;
  --accent-glow: rgba(59, 34, 25, .28);

  /* Estados */
  --ok: #2f7a55;      --ok-soft: #e1efe2;
  --warn: #9a6512;    --warn-soft: #f6e7c8;
  --danger: #b0453a;  --danger-soft: #f6dfd8;
  --info: #3f5f8f;    --info-soft: #e4e9f1;
  --neutral: #7a6a60; --neutral-soft: #ece3d6;
  --disabled: #cdbfae;
  --wa: #1fa855;

  /* Camadas */
  --topbar: rgba(246, 240, 228, .78);
  --overlay: rgba(30, 17, 12, .42);
  --skel-a: #efe6d6;
  --skel-b: #f8f2e8;
  --texture-dot: rgba(59, 34, 25, .07);
  --glow-1: rgba(214, 170, 122, .32);
  --glow-2: rgba(59, 34, 25, .08);

  /* Tipografia */
  --font-display: "Bricolage Grotesque", "Plus Jakarta Sans", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --text-xs: .75rem;    /* 12px: selos, metadados */
  --text-sm: .875rem;   /* 14px: apoio */
  --text-md: 1rem;      /* 16px: corpo */
  --text-lg: 1.125rem;  /* 18px: título de cartão */
  --text-xl: 1.5rem;    /* 24px: título de página */
  --text-2xl: 2rem;     /* 32px: destaque */
  --leading-tight: 1.15;
  --leading-body: 1.55;

  /* Espaço: escala de 4px */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-12: 48px;

  /* Forma e profundidade */
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-full: 999px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 1px 2px rgba(59, 34, 25, .04), 0 12px 32px -16px rgba(59, 34, 25, .22);
  --shadow-lift: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 2px 4px rgba(59, 34, 25, .05), 0 20px 40px -18px rgba(59, 34, 25, .32);

  /* Movimento */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --dur-fast: .14s;
  --dur: .28s;
  --dur-slow: .6s;

  --nav-h: 64px;
  color-scheme: light;
}

/* Tema escuro: marrom quase preto com creme */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070403; --surface: #120b08; --surface-2: #1c120e; --ink: #f6f0e4; --muted: #c7b4a2; --line: #2a1d16;
    --rose: #f6f0e4; --rose-dark: #fffaf0; --rose-soft: #23170f; --on-accent: #070403; --accent-glow: rgba(246, 240, 228, .16);
    --ok: #8fd3ad; --ok-soft: #10241a; --warn: #e9bb6b; --warn-soft: #2a1e0d; --danger: #f08d80; --danger-soft: #2c1310;
    --info: #a9c1e8; --info-soft: #151a26; --neutral: #c0aea0; --neutral-soft: #1e140f; --disabled: #3d2d25;
    --topbar: rgba(7, 4, 3, .72); --overlay: rgba(0, 0, 0, .6); --skel-a: #140d0a; --skel-b: #1d1410;
    --texture-dot: rgba(246, 240, 228, .05); --glow-1: rgba(120, 72, 44, .3); --glow-2: rgba(246, 240, 228, .04);
    --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 1px 2px rgba(0, 0, 0, .3), 0 14px 32px -16px rgba(0, 0, 0, .7);
    --shadow-lift: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 2px 4px rgba(0, 0, 0, .3), 0 22px 44px -18px rgba(0, 0, 0, .85);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #070403; --surface: #120b08; --surface-2: #1c120e; --ink: #f6f0e4; --muted: #c7b4a2; --line: #2a1d16;
  --rose: #f6f0e4; --rose-dark: #fffaf0; --rose-soft: #23170f; --on-accent: #070403; --accent-glow: rgba(246, 240, 228, .16);
  --ok: #8fd3ad; --ok-soft: #10241a; --warn: #e9bb6b; --warn-soft: #2a1e0d; --danger: #f08d80; --danger-soft: #2c1310;
  --info: #a9c1e8; --info-soft: #151a26; --neutral: #c0aea0; --neutral-soft: #1e140f; --disabled: #3d2d25;
  --topbar: rgba(7, 4, 3, .72); --overlay: rgba(0, 0, 0, .6); --skel-a: #140d0a; --skel-b: #1d1410;
  --texture-dot: rgba(246, 240, 228, .05); --glow-1: rgba(120, 72, 44, .3); --glow-2: rgba(246, 240, 228, .04);
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 1px 2px rgba(0, 0, 0, .3), 0 14px 32px -16px rgba(0, 0, 0, .7);
  --shadow-lift: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 2px 4px rgba(0, 0, 0, .3), 0 22px 44px -18px rgba(0, 0, 0, .85);
  color-scheme: dark;
}

/* ---------- 2. Base ---------- */
* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  /* Textura: brilho quente no topo + grade de pontos bem sutil */
  background:
    radial-gradient(120% 60% at 100% 0%, var(--glow-1), transparent 60%),
    radial-gradient(90% 50% at 0% 100%, var(--glow-2), transparent 60%),
    radial-gradient(var(--texture-dot) 1px, transparent 1.2px) 0 0 / 20px 20px,
    var(--bg);
  min-height: 100%;
}
body {
  margin: 0;
  font: var(--text-md)/var(--leading-body) var(--font-body);
  color: var(--ink);
  background: transparent;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + var(--space-8));
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--rose-dark); text-underline-offset: 3px; text-decoration-thickness: 1px; }
h1, h2, h3 { margin: 0 0 var(--space-3); line-height: var(--leading-tight); font-family: var(--font-display); letter-spacing: -.02em; }
h1 { font-size: var(--text-2xl); font-weight: 700; }
h2 { font-size: var(--text-xl); font-weight: 700; }
h3 { font-size: var(--text-lg); font-weight: 600; }
h3::first-letter { text-transform: uppercase; }
p { margin: 0 0 var(--space-3); }
::selection { background: var(--ink); color: var(--bg); }

.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  min-height: 60px;
  padding: calc(env(safe-area-inset-top) + var(--space-3)) max(var(--space-4), env(safe-area-inset-right, 0px)) var(--space-3) max(var(--space-4), env(safe-area-inset-left, 0px));
  background: var(--topbar);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; letter-spacing: -.01em;
}
#studio-name { display: flex; align-items: center; gap: var(--space-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#studio-name::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--ink); transform: rotate(45deg); }
main { max-width: 560px; margin: 0 auto; padding-block: var(--space-6); padding-left: max(var(--space-4), env(safe-area-inset-left, 0px)); padding-right: max(var(--space-4), env(safe-area-inset-right, 0px)); }

/* Revelação escalonada ao abrir cada tela */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
#app > * { animation: rise var(--dur-slow) var(--ease-out) backwards; }
#app > *:nth-child(2) { animation-delay: .05s; }
#app > *:nth-child(3) { animation-delay: .1s; }
#app > *:nth-child(4) { animation-delay: .15s; }
#app > *:nth-child(n+5) { animation-delay: .2s; }
.list > .card { animation: rise var(--dur-slow) var(--ease-out) backwards; }
.list > .card:nth-child(2) { animation-delay: .06s; }
.list > .card:nth-child(3) { animation-delay: .12s; }
.list > .card:nth-child(4) { animation-delay: .18s; }
.list > .card:nth-child(n+5) { animation-delay: .24s; }
.times > .time { animation: rise var(--dur) var(--ease-out) backwards; }
.times > .time:nth-child(2) { animation-delay: .03s; }
.times > .time:nth-child(3) { animation-delay: .06s; }
.times > .time:nth-child(4) { animation-delay: .09s; }
.times > .time:nth-child(n+5) { animation-delay: .12s; }

/* ---------- 3. Navegação inferior (flutuante, em vidro) ---------- */
.bottom-nav {
  position: fixed; z-index: 20;
  left: var(--space-4); right: var(--space-4); bottom: calc(var(--space-3) + env(safe-area-inset-bottom));
  max-width: 400px; margin: 0 auto;
  display: flex; gap: var(--space-1); padding: var(--space-1);
  height: var(--nav-h);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lift);
}
.bottom-nav[hidden] { display: none; }
.bottom-nav a {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  border-radius: var(--radius-full);
  color: var(--muted); text-decoration: none; font-size: var(--text-sm); font-weight: 600;
  transition: background var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
.bottom-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bottom-nav a.active { background: var(--rose); color: var(--on-accent); }

/* ---------- 4. Componentes ---------- */
.card {
  display: block;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-3);
  box-shadow: var(--shadow);
  color: inherit; text-decoration: none;
}
.card.compact { padding: var(--space-3) var(--space-4); }
.muted { color: var(--muted); }
.small { font-size: var(--text-sm); }
.center { text-align: center; }
.right { text-align: right; }
.stack { display: flex; flex-direction: column; gap: var(--space-3); }
.row { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
.row-end { display: flex; justify-content: flex-end; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-4); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.section-title { margin-top: var(--space-6); }
.back { display: inline-flex; align-items: center; gap: var(--space-1); margin-bottom: var(--space-3); color: var(--muted); text-decoration: none; font-size: var(--text-sm); font-weight: 600; transition: color var(--dur-fast); }
.back:hover { color: var(--ink); }
.empty { text-align: center; color: var(--muted); padding: var(--space-6) var(--space-2); }
.empty .btn { margin-top: var(--space-3); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.toolbar h2 { margin: 0; }

/* Etapas do agendamento */
.stepper { list-style: none; display: flex; gap: var(--space-2); margin: 0 0 var(--space-5); padding: 0; }
.stepper li { flex: 1; display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.stepper li span { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 50%; border: 1px solid var(--line); font-size: 11px; font-variant-numeric: tabular-nums; }
.stepper li::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.stepper li:last-child { flex: none; }
.stepper li:last-child::after { display: none; }
.stepper li.current { color: var(--ink); }
.stepper li.current span { background: var(--rose); border-color: var(--rose); color: var(--on-accent); box-shadow: 0 0 0 4px var(--rose-soft); }
.stepper li.done span { background: var(--rose-soft); border-color: transparent; color: var(--ink); }
.stepper li.done::after { background: var(--ink); opacity: .35; }
.modal .stepper { margin-bottom: var(--space-4); }

.page-intro { margin-bottom: var(--space-5); }
.page-intro h2 { font-size: var(--text-2xl); margin-bottom: var(--space-2); }
.page-intro p { margin: 0; max-width: 34ch; }
.book-head { margin-bottom: var(--space-4); }
.book-head h2 { margin-bottom: var(--space-1); }
.book-head p { margin: 0; font-variant-numeric: tabular-nums; }

/* Botões */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 48px; padding: 0 var(--space-5);
  border: 1px solid transparent; border-radius: var(--radius-full);
  font: inherit; font-size: .95rem; font-weight: 700; letter-spacing: -.005em; text-decoration: none; cursor: pointer;
  background: var(--surface); color: var(--ink);
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), border-color var(--dur);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn-block { width: 100%; }
.btn-small { min-height: 36px; padding: 0 var(--space-4); font-size: var(--text-sm); }
.btn-primary { background: var(--rose); color: var(--on-accent); box-shadow: 0 10px 24px -12px var(--accent-glow); }
.btn-primary:hover { background: var(--rose-dark); box-shadow: 0 14px 28px -12px var(--accent-glow); }
.btn-ghost { border-color: var(--line); background: transparent; }
.btn-ghost:hover { background: var(--surface); border-color: var(--muted); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost-danger { border-color: var(--danger-soft); color: var(--danger); background: transparent; }
.btn-ghost-danger:hover { background: var(--danger-soft); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-google { border-color: var(--line); min-height: 56px; font-size: var(--text-md); box-shadow: var(--shadow); }
.link { background: none; border: 0; color: var(--rose-dark); font: inherit; font-size: var(--text-sm); font-weight: 600; cursor: pointer; padding: var(--space-1); text-decoration: underline; text-underline-offset: 3px; }
.link:disabled { color: var(--muted); text-decoration: none; cursor: default; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent;
  font-size: 1.25rem; line-height: 1; cursor: pointer; color: var(--ink);
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.icon-btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--muted); }
.icon-btn:disabled { opacity: .3; cursor: default; }

/* Formulários */
label { display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--text-sm); font-weight: 600; }
input, select, textarea {
  width: 100%; min-height: 48px; padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit; font-size: 16px; font-weight: 500; color: var(--ink); background: var(--surface);
  transition: border-color var(--dur-fast), box-shadow var(--dur);
}
input::placeholder, textarea::placeholder { color: var(--disabled); }
textarea { min-height: 80px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--muted) 50%, var(--line)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px var(--rose-soft); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
input:disabled { background: var(--surface-2); color: var(--muted); }
label.check { flex-direction: row; align-items: flex-start; gap: var(--space-3); font-weight: 500; line-height: 1.45; }
label.check input { width: 20px; height: 20px; min-height: 0; margin-top: 1px; accent-color: var(--rose); flex: none; box-shadow: none; }
[hidden] { display: none !important; }

.segmented { display: flex; background: var(--surface-2); border-radius: var(--radius-full); padding: var(--space-1); }
.segmented button {
  flex: 1; border: 0; background: none; padding: var(--space-2) var(--space-4); border-radius: var(--radius-full);
  font: inherit; font-weight: 600; font-size: var(--text-sm); color: var(--muted); cursor: pointer;
  transition: background var(--dur) var(--ease-out), color var(--dur);
}
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.pill { display: inline-flex; align-items: center; gap: var(--space-1); padding: var(--space-1) var(--space-3); border-radius: var(--radius-full); background: var(--surface-2); color: var(--muted); font-size: var(--text-xs); font-weight: 600; font-variant-numeric: tabular-nums; }
.pill-off { background: var(--neutral-soft); color: var(--neutral); }
.badge { align-self: flex-start; padding: 2px var(--space-2); border-radius: var(--radius-full); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.badge-confirmado { background: var(--ok-soft); color: var(--ok); }
.badge-concluido { background: var(--info-soft); color: var(--info); }
.badge-cancelado { background: var(--neutral-soft); color: var(--neutral); }
.badge-faltou { background: var(--warn-soft); color: var(--warn); }

/* ---------- Login ---------- */
.login { display: flex; flex-direction: column; gap: var(--space-4); padding-top: var(--space-6); }
.login-hero { text-align: center; margin-bottom: var(--space-2); }
.login-hero p { max-width: 32ch; margin-inline: auto; }
.login-logo { width: 88px; height: 88px; border-radius: 28px; box-shadow: var(--shadow-lift); margin-bottom: var(--space-4); }
.divider { display: flex; align-items: center; gap: var(--space-3); color: var(--muted); font-size: var(--text-sm); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Serviços ---------- */
.service { cursor: pointer; transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), border-color var(--dur); }
.service:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--line); }
a.service:active { transform: scale(.99); }
.service-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); margin-bottom: var(--space-1); }
.service-top strong { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; letter-spacing: -.015em; line-height: 1.25; }
.service p { margin: var(--space-1) 0 0; font-size: var(--text-sm); line-height: 1.55; }
.service-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); margin-top: var(--space-4); }
.service-go { font-size: var(--text-sm); font-weight: 700; color: var(--ink); opacity: .45; transition: opacity var(--dur), transform var(--dur) var(--ease-out); }
.service:hover .service-go { opacity: 1; transform: translateX(3px); }
.price { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.service.inactive { opacity: .55; }

/* ---------- Calendário (cliente) ---------- */
.calendar { padding: var(--space-4); }
.calendar .cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-4); }
.calendar .cal-head strong { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; letter-spacing: -.01em; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--space-1); text-align: center; }
.cal-grid.weekdays { font-size: var(--text-xs); color: var(--muted); font-weight: 600; margin-bottom: var(--space-2); letter-spacing: .04em; }
.day {
  position: relative; aspect-ratio: 1; border: 0; border-radius: var(--radius);
  background: transparent; color: var(--ink);
  font: inherit; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}
.day:not(:disabled)::after { content: ""; position: absolute; left: 50%; bottom: 18%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; opacity: .35; }
.day:hover:not(:disabled):not(.selected) { background: var(--surface-2); }
.day:active:not(:disabled) { transform: scale(.94); }
.day:disabled { background: none; color: var(--disabled); font-weight: 400; cursor: default; }
.day.today:not(.selected) { box-shadow: inset 0 0 0 1.5px var(--line); }
.day.selected { background: var(--rose); color: var(--on-accent); box-shadow: 0 8px 18px -8px var(--accent-glow); }
.day.selected::after { opacity: .8; }

#times h3 { margin-top: var(--space-6); }
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: var(--space-2); margin-bottom: var(--space-4); }
.time {
  min-height: 48px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}
.time:hover { border-color: var(--ink); }
.time:active { background: var(--rose); color: var(--on-accent); border-color: var(--rose); transform: scale(.97); }
.times-wrap { margin-top: var(--space-3); max-height: 40vh; overflow-y: auto; }

/* ---------- Agendamentos ---------- */
.booking { display: flex; gap: var(--space-4); }
.booking-when {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 64px; padding: var(--space-2) var(--space-1); border-radius: var(--radius); background: var(--rose-soft); color: var(--rose-dark);
  font-variant-numeric: tabular-nums;
}
.booking-when strong { font-family: var(--font-display); font-size: var(--text-lg); }
.booking-when span { font-size: var(--text-xs); }
.booking-info { display: flex; flex-direction: column; gap: var(--space-1); flex: 1; min-width: 0; }
.booking-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-2); }
.booking.status-cancelado { opacity: .55; }
.booking.status-cancelado .booking-when { background: var(--neutral-soft); color: var(--neutral); }
.day-group { margin-bottom: var(--space-2); }
.block-row { padding: var(--space-3) var(--space-4); margin-bottom: var(--space-2); border-radius: var(--radius); background: var(--surface-2); color: var(--muted); font-size: var(--text-sm); }
.date-nav { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); text-align: center; }
.date-nav strong::first-letter { text-transform: uppercase; }

/* ---------- Horário de trabalho ---------- */
.switch-row { flex-direction: row; justify-content: space-between; align-items: center; cursor: pointer; }
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; min-height: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: var(--radius-full); background: var(--line); transition: background var(--dur) var(--ease-out); }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform var(--dur) var(--ease-out); }
.switch input:checked + span { background: var(--rose); }
.switch input:checked + span::after { transform: translateX(20px); }
.hours { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin-top: var(--space-3); }
.weekday.closed .hours { display: none; }
.weekday.closed { background: var(--surface-2); box-shadow: none; }
.sticky-save { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + var(--space-6)); box-shadow: 0 10px 28px -8px var(--accent-glow); }

/* ---------- Sucesso ---------- */
.success { text-align: center; display: flex; flex-direction: column; gap: var(--space-3); padding-top: var(--space-4); }
.check-circle {
  width: 80px; height: 80px; margin: 0 auto var(--space-2); border-radius: 50%;
  display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); font-size: 2rem; font-weight: 700;
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--ok-soft) 50%, transparent);
  animation: pop .5s var(--ease-out) both;
}
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.success p::first-letter { text-transform: uppercase; }

/* ---------- Modal e toast ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade var(--dur) both;
}
.modal {
  position: relative;
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--space-8) var(--space-5) calc(var(--space-5) + env(safe-area-inset-bottom));
  animation: up var(--dur) var(--ease-out) both;
  box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, .3);
}
.modal::before { content: ""; position: absolute; top: var(--space-3); left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--line); }
@media (min-width: 600px) {
  .modal-backdrop { align-items: center; }
  .modal { border-radius: var(--radius-lg); padding-top: var(--space-6); }
  .modal::before { display: none; }
}
.modal-text { font-size: var(--text-md); }
.summary { display: grid; grid-template-columns: auto 1fr; gap: var(--space-2) var(--space-4); margin: var(--space-4) 0; padding: var(--space-4); border-radius: var(--radius); background: var(--surface-2); }
.summary dt { color: var(--muted); font-size: var(--text-sm); }
.summary dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.summary dd::first-letter { text-transform: uppercase; }
.deposit-note { padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--warn-soft); color: var(--ink); margin-bottom: var(--space-4); }
.deposit-note strong { color: var(--ink); font-weight: 800; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(32px); opacity: 0; } }

.toast {
  position: fixed; left: 50%; z-index: 100;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + var(--space-6));
  transform: translate(-50%, 20px); opacity: 0;
  max-width: calc(100% - var(--space-8)); padding: var(--space-3) var(--space-5); border-radius: var(--radius-full);
  background: var(--ink); color: var(--bg); font-size: var(--text-sm); font-weight: 600; box-shadow: var(--shadow-lift);
  transition: transform var(--dur) var(--ease-out), opacity var(--dur);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast-err { background: var(--danger); color: #fff; }

/* ---------- Carregamento ---------- */
.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.spinner.dark { border-color: var(--rose-soft); border-top-color: var(--rose); width: 28px; height: 28px; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { height: 96px; border-radius: var(--radius-lg); margin-bottom: var(--space-3); background: linear-gradient(90deg, var(--skel-a) 25%, var(--skel-b) 50%, var(--skel-a) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skeleton.tall { height: 320px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Barra da demonstração ---------- */
.demo-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3);
  padding-block: var(--space-2); padding-left: max(var(--space-4), env(safe-area-inset-left, 0px)); padding-right: max(var(--space-4), env(safe-area-inset-right, 0px));
  background: var(--ink); color: var(--bg); font-size: var(--text-xs); font-weight: 600;
}
.demo-actions { display: flex; gap: var(--space-2); }
.demo-bar button {
  border: 1px solid currentColor; background: none; color: inherit; border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-3); font: inherit; font-weight: 600; cursor: pointer; opacity: .75;
}
.demo-bar button.active { background: var(--bg); color: var(--ink); opacity: 1; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 11; background: var(--topbar); }

/* ---------- Confirmação por SMS ---------- */
.verified { color: var(--ok); font-weight: 600; margin: 0; }
.code-input { font-size: 1.6rem; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }
.footer-links { margin-top: var(--space-8); }
.footer-links a { color: var(--muted); }
#contact-box { margin-top: var(--space-1); }

/* ---------- WhatsApp ---------- */
.wa-status { font-weight: 600; }
.wa-status.ok { color: var(--ok); }
.wa-status.err { color: var(--danger); }
.wa-preview { display: flex; flex-direction: column; gap: var(--space-3); text-align: left; }
.wa-preview p { margin: 0; }
.wa-preview .btn { align-self: flex-start; }
.wa-bubble {
  padding: var(--space-3); border-radius: 4px var(--radius) var(--radius) var(--radius);
  background: var(--ok-soft); color: var(--ink); font-size: var(--text-sm); overflow-wrap: anywhere;
}

/* ---------- Sinal por Pix ---------- */
.badge-aguardando_pagamento { background: var(--warn-soft); color: var(--warn); }
.badge-expirado { background: var(--neutral-soft); color: var(--neutral); }
.booking.status-expirado { opacity: .55; }
.booking.status-aguardando_pagamento .booking-when { background: var(--warn-soft); color: var(--warn); }
.pay-line { color: var(--warn); font-weight: 600; }
.paid { color: var(--ok); font-weight: 600; }
.check-circle.pending { background: var(--warn-soft); color: var(--warn); font-size: 1.8rem; box-shadow: 0 0 0 8px color-mix(in srgb, var(--warn-soft) 50%, transparent); }
.pay-card { display: flex; flex-direction: column; gap: var(--space-3); text-align: left; }
.pay-card .summary { margin: 0; }
.pay-card .summary dd { overflow-wrap: anywhere; }
.deposit { font-family: var(--font-display); font-size: var(--text-xl); color: var(--ink); font-variant-numeric: tabular-nums; }
.countdown { margin: 0; color: var(--warn); }
.countdown strong { font-variant-numeric: tabular-nums; }
#pix-code { font: .8rem/1.4 ui-monospace, "SFMono-Regular", Consolas, monospace; resize: none; overflow-wrap: anywhere; }
.refund-note { margin: 0; text-align: left; background: var(--surface-2); box-shadow: none; }

/* ---------- Pix enviado no WhatsApp ---------- */
.wa-sent { display: flex; gap: var(--space-3); align-items: center; padding: var(--space-3); border-radius: var(--radius); background: var(--ok-soft); text-align: left; }
.wa-sent svg { width: 32px; height: 32px; flex: none; fill: none; stroke: var(--wa); stroke-width: 1.8; stroke-linejoin: round; }
.steps { margin: 0; padding-left: var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); text-align: left; }

/* Pix na tela do agendamento */
.pix-qr { background: #fff; border-radius: var(--radius); padding: var(--space-3); width: 220px; max-width: 100%; margin: var(--space-4) auto var(--space-2); box-shadow: var(--shadow); }
.pix-qr svg { display: block; width: 100%; height: auto; }
.pix-code { width: 100%; height: 92px; margin: var(--space-3) 0; padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); color: var(--ink); font: 12px/1.4 ui-monospace, monospace; word-break: break-all; resize: none; }

/* Área do responsável: lista da equipe */
.team { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.team li { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border: 1px solid var(--line); border-radius: var(--radius); overflow-wrap: anywhere; }

/* ---------- Painel (responsável e equipe) ---------- */
body.painel main { max-width: 1120px; padding-bottom: calc(var(--nav-h) + var(--space-6)); }
.side-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.side-nav[hidden] { display: none; }
.side-nav a, .side-nav button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font: inherit; font-size: var(--text-xs); font-weight: 600;
  background: none; border: 0; cursor: pointer;
}
.side-nav svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side-nav a.active { color: var(--rose); }
.side-nav .nav-brand, .side-nav .nav-group, .side-nav .nav-desk, .side-nav .nav-foot { display: none; }

@media (min-width: 900px) {
  body.painel { padding-left: 256px; }
  body.painel .topbar { display: none; }
  body.painel main { padding-top: var(--space-8); padding-bottom: var(--space-10); }
  .side-nav {
    top: 0; right: auto; width: 256px; height: auto; flex-direction: column; justify-content: flex-start;
    gap: 2px; padding: var(--space-6) var(--space-3) var(--space-4); border-top: 0; border-right: 1px solid var(--line); overflow-y: auto;
  }
  .side-nav .nav-brand { display: flex; flex-direction: column; gap: 2px; padding: var(--space-1) var(--space-3) var(--space-5); }
  .side-nav .nav-brand strong { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700; letter-spacing: -.02em; line-height: var(--leading-tight); color: var(--ink); overflow-wrap: anywhere; }
  .side-nav .nav-brand span { font-size: var(--text-xs); color: var(--muted); }
  .side-nav .nav-group { display: block; padding: var(--space-4) var(--space-3) var(--space-2); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .side-nav .nav-desk { display: flex; }
  .side-nav .nav-mob { display: none; }
  .side-nav a, .side-nav button { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: var(--space-3); padding: 10px var(--space-3); border-radius: var(--radius); font-size: var(--text-sm); color: var(--ink); transition: background var(--dur-fast); }
  .side-nav svg { width: 20px; height: 20px; color: var(--muted); }
  .side-nav a:hover, .side-nav button:hover { background: var(--surface-2); }
  .side-nav a.active { background: var(--rose); color: var(--on-accent); }
  .side-nav a.active svg { color: var(--on-accent); }
  .side-nav .nav-foot { display: flex; flex-direction: column; gap: 2px; margin-top: auto; padding-top: var(--space-4); border-top: 1px solid var(--line); }
  .side-nav .nav-user { padding: var(--space-1) var(--space-3) var(--space-2); font-size: var(--text-xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

.page-desc { margin: var(--space-1) 0 0; }
.field-hint { display: block; font-size: var(--text-xs); color: var(--muted); font-weight: 500; margin-top: var(--space-1); }
.choice { display: flex; flex-direction: column; gap: var(--space-2); }
.choice-item { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; transition: border-color var(--dur-fast), background var(--dur-fast); }
.choice-item:has(input:checked) { border-color: var(--rose); background: var(--rose-soft); }
.choice-item input { margin-top: 3px; accent-color: var(--rose); }
.choice-item > span { display: flex; flex-direction: column; gap: 2px; }

.settings-grid { display: grid; gap: var(--space-3); margin-bottom: var(--space-3); }
@media (min-width: 700px) { .settings-grid { grid-template-columns: 1fr 1fr; } }
.settings-item { display: flex; align-items: center; gap: var(--space-4); margin: 0; transition: transform var(--dur) var(--ease-out), box-shadow var(--dur); }
.settings-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.settings-item > span:nth-child(2) { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.settings-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius); background: var(--rose-soft); color: var(--rose); flex: none; }
.settings-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.settings-go { color: var(--muted); font-size: 1.4rem; transition: transform var(--dur) var(--ease-out); }
.settings-item:hover .settings-go { transform: translateX(3px); }
.settings-account .row { gap: var(--space-2); flex-wrap: wrap; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-4); margin-bottom: var(--space-4); }
.page-head h2 { margin: 0; }
.date-nav.compact { margin: 0; gap: var(--space-2); }
.date-nav.compact strong { min-width: 150px; text-align: center; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); margin-bottom: var(--space-3); }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stats .card { margin: 0; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: var(--text-sm); color: var(--muted); font-weight: 500; }
.stat-value { font-family: var(--font-display); font-size: clamp(1.25rem, 4.6vw, 1.75rem); font-weight: 700; letter-spacing: -.02em; white-space: nowrap; line-height: 1.2; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-hint { font-size: var(--text-xs); color: var(--muted); }

ul.today { list-style: none; margin: 0 0 var(--space-2); padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
ul.today li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--line); }
ul.today li:last-child { border-bottom: 0; }

.grid-charts { display: grid; gap: var(--space-3); }
@media (min-width: 900px) { .grid-charts { grid-template-columns: 1fr 1fr; } }
.chart { margin: 0; }
.chart figcaption { display: flex; flex-direction: column; margin-bottom: var(--space-3); }
.vbars { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: var(--space-2); align-items: end; height: 180px; }
.vbar { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; outline: none; }
.vbar-fill { width: 100%; max-width: 28px; min-height: 2px; background: var(--rose); border-radius: 6px 6px 2px 2px; opacity: .35; transition: opacity var(--dur); }
.vbar.current .vbar-fill, .vbar:hover .vbar-fill, .vbar:focus-visible .vbar-fill { opacity: 1; }
.vbar-value { font-size: var(--text-xs); color: var(--ink); margin-bottom: var(--space-1); font-variant-numeric: tabular-nums; }
.vbar-label { font-size: 11px; color: var(--muted); margin-top: var(--space-2); white-space: nowrap; }
.hbars { display: flex; flex-direction: column; gap: var(--space-3); }
.hbar { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) auto; align-items: center; gap: var(--space-3); }
.hbar-label { font-size: var(--text-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 8px; border-radius: var(--radius-full); background: var(--surface-2); overflow: hidden; }
.hbar-fill { display: block; height: 100%; background: var(--rose); border-radius: var(--radius-full); }
.hbar-value { font-size: var(--text-sm); font-variant-numeric: tabular-nums; }

/* Calendário do painel */
.cal-layout { display: grid; gap: var(--space-3); }
@media (min-width: 900px) { .cal-layout { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; } .cal-day { position: sticky; top: 72px; } }
.cal-card { margin: 0; padding: var(--space-3); }
.cal-head, .cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-1); }
.cal-head span { text-align: center; font-size: var(--text-xs); color: var(--muted); font-weight: 600; padding-bottom: var(--space-2); }
.cal-cell {
  position: relative; aspect-ratio: 1; min-height: 44px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--ink); font: inherit; cursor: pointer; padding: var(--space-1);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.cal-cell:hover { border-color: var(--muted); }
.cal-cell.out { opacity: .4; }
.cal-cell.closed { background: transparent; border-color: var(--line); border-style: dashed; }
.cal-cell.today .cal-num { color: var(--rose); font-weight: 800; }
.cal-cell.sel { border-color: var(--rose); box-shadow: inset 0 0 0 1px var(--rose); background: var(--surface); }
.cal-num { font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.cal-count { font-size: .95rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.cal-dots { display: flex; gap: 3px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: middle; }
.dot-ok { background: var(--ok); }
.dot-wait { background: var(--warn); }
.cal-legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: var(--space-3) 0 0; }
@media (max-width: 420px) { .cal-count { font-size: .8rem; } .cal-cell { aspect-ratio: auto; min-height: 54px; border-radius: 6px; padding: 3px 2px; } }
.choice .choice-item { flex-direction: row; align-items: flex-start; font-weight: 400; }
.choice .choice-item input[type="radio"] { width: 18px; height: 18px; min-height: 0; flex: none; margin: 3px 0 0; padding: 0; border: 0; appearance: auto; -webkit-appearance: radio; box-shadow: none; }
.card > .section-title:first-child, .card > h3:first-child { margin-top: 0; }

/* ---------- Tuca (mascote) ---------- */
.boot {
  position: fixed; inset: 0; z-index: 100; min-height: 0;
  display: grid; place-items: center; background: var(--bg); transition: opacity var(--dur) ease;
}
.boot.out { opacity: 0; pointer-events: none; }
.boot img { width: 132px; height: auto; }
.tuca { display: block; height: auto; margin: 0 auto var(--space-2); }
.tuca-404 { max-width: 100%; background: #f6f0e4; border-radius: var(--radius); padding: 6px 10px; }

/* Ícone de tema (automático, claro, escuro) */
.theme-btn {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer;
  transition: background var(--dur-fast), border-color var(--dur-fast), transform var(--dur) var(--ease-out);
}
.theme-btn svg, [data-theme-toggle] svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn:hover { background: var(--surface); border-color: var(--muted); transform: rotate(15deg); }

/* ---------- Acessibilidade de movimento ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
