:root {
  /*
   * Identidade de cada tenant (aba Configurações > Aparência). Setadas em
   * runtime por applyTenantTheme() (public/js/branding.js) a partir de
   * GET /api/branding — nunca declaradas com valor aqui, então os fallbacks
   * abaixo (idênticos ao visual padrão do PapiCore) valem sempre que o
   * JS/API falhar ou ainda não tiver rodado, e a página nunca fica sem
   * estilo. Não usadas em desenvolvedor.html (painel do desenvolvedor não
   * carrega branding.js, então sempre usa a identidade fixa do PapiCore).
   */
  --bg: var(--tenant-background, #0b0d12);
  --bg-soft: var(--tenant-secondary, #151922);
  --card: var(--tenant-surface, #161b26);
  --card-hover: #1c222f;
  --border: var(--tenant-border, #232a36);
  --border-strong: #334050;
  --text: var(--tenant-text, #ffffff);
  --text-soft: #b8bec8;
  --text-muted: var(--tenant-muted, #7d8797);
  --accent: var(--tenant-primary, #ff7a00);
  --accent-hover: var(--tenant-accent, #ff8a2a);
  --accent-soft: rgba(var(--tenant-primary-rgb, 255, 122, 0), 0.14);
  --accent-ink: var(--tenant-ink, #0b0d12);
  --green: var(--tenant-success, #27c469);
  --green-soft: rgba(39, 196, 105, 0.14);
  --red: var(--tenant-danger, #ff4d5a);
  --red-soft: rgba(255, 77, 90, 0.14);
  --amber: #ffb020;
  --blue: #3aa0ff;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

button { font-family: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }

input, select, textarea {
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  width: 100%;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; }

/* ---------- fundo premium (booking) ---------- */

body.booking-app {
  background:
    radial-gradient(900px 520px at -10% 95%, rgba(var(--tenant-primary-rgb, 255, 122, 0), 0.10), transparent 60%),
    radial-gradient(760px 520px at 108% -5%, rgba(var(--tenant-primary-rgb, 255, 122, 0), 0.06), transparent 55%),
    var(--bg);
  animation: pageFade 0.5s ease;
}
@keyframes pageFade { from { opacity: 0; } to { opacity: 1; } }

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.ambient-watermark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(120px, 30vw, 440px);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #ffffff;
  opacity: 0.035;
  white-space: nowrap;
  user-select: none;
}
.ambient-lines {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.014) 0 1px, transparent 1px 140px),
    repeating-linear-gradient(25deg, rgba(255, 255, 255, 0.01) 0 1px, transparent 1px 190px);
}
.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}
.ambient-glow.glow-left {
  left: -220px;
  bottom: -180px;
  width: 560px;
  height: 560px;
  background: rgba(var(--tenant-primary-rgb, 255, 122, 0), 0.12);
}
.ambient-glow.glow-right {
  right: -260px;
  top: 8%;
  width: 480px;
  height: 480px;
  background: rgba(var(--tenant-primary-rgb, 255, 122, 0), 0.07);
}
.ambient-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 100% at 50% 40%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

.site-header,
.container,
.site-footer {
  position: relative;
  z-index: 1;
}

/* ---------- header ---------- */

.site-header {
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 clamp(20px, 4vw, 48px);
  background: rgba(11, 13, 18, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 14px; }
.site-header .brand { cursor: pointer; }
.brand-logo { height: 46px; width: auto; }
.brand-name { font-size: 21px; font-weight: 700; letter-spacing: 0.4px; }
.header-tagline {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.35px;
  border-left: 1px solid var(--border-strong);
  padding-left: 18px;
}
.header-right { display: flex; align-items: center; gap: 18px; }

/* seletor de visualização mobile / desktop */
.view-switch {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
  flex-shrink: 0;
}
.view-switch button {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 7px 13px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.view-switch button:hover { color: var(--text); }
.view-switch button.active {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 4px 16px rgba(var(--tenant-primary-rgb, 255, 122, 0), 0.4);
}

/* ---------- barra de progresso animada ---------- */

.page-progress {
  position: relative;
  z-index: 19;
  height: 2px;
  background: rgba(255, 255, 255, 0.04);
}
.page-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent-hover), var(--accent));
  box-shadow: 0 0 12px rgba(var(--tenant-primary-rgb, 255, 122, 0), 0.8);
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- layout ---------- */

.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 20px clamp(20px, 4vw, 48px) 80px;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 50px;
  background: rgba(255, 255, 255, 0.015);
}
.footer-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 36px clamp(20px, 4vw, 48px) 44px;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 30px;
  align-items: center;
}
.footer-logo { height: 40px; margin-bottom: 12px; }
.footer-brand p { color: var(--text-muted); font-size: 13px; line-height: 1.6; }
.footer-social { display: flex; flex-direction: column; gap: 7px; }
.footer-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.footer-phone { color: var(--text-soft); font-size: 14px; }
.footer-link {
  color: var(--text-soft);
  font-size: 14px;
  text-decoration: none;
  width: fit-content;
  transition: color 0.15s;
}
.footer-link:hover { color: var(--accent); }
.footer-copy { text-align: right; color: var(--text-muted); font-size: 13px; line-height: 1.6; }

/* ---------- progress (etapas) ---------- */

.progress-wrap { margin: 22px 0 8px; overflow-x: auto; }

.progress {
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 720px;
}

.progress li {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.progress li .lbl {
  margin-bottom: 10px;
  text-align: center;
}

/* Wraps just the dot so the connecting line (positioned relative to this
   wrapper) always sits at the dot's vertical center, no matter how tall
   the label above it is. --dot-r is the circle's radius (width / 2): the
   connector starts/ends at the circle's edge, never under it, so it never
   needs a background trick to "hide" under the dot. */
.progress li .dot-wrap {
  --dot-r: 15px;
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}
.progress li .dot-wrap::before {
  content: '';
  position: absolute;
  top: 50%;
  left: calc(50% + var(--dot-r));
  right: calc(-50% + var(--dot-r));
  height: 2px;
  background: var(--border);
  transform: translateY(-50%);
}
.progress li:last-child .dot-wrap::before { display: none; }

.progress li .dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: background 0.25s, border-color 0.25s, color 0.25s, box-shadow 0.25s;
}

.progress li.active { color: var(--text); }
.progress li.active .dot {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 20px rgba(var(--tenant-primary-rgb, 255, 122, 0), 0.5);
}
.progress li.done { color: var(--text-soft); }
.progress li.done .dot {
  background: rgba(var(--tenant-primary-rgb, 255, 122, 0), 0.16);
  border-color: var(--accent);
  color: var(--accent);
}
.progress li.done .dot-wrap::before,
.progress li.active .dot-wrap::before {
  background: linear-gradient(90deg, var(--accent), rgba(var(--tenant-primary-rgb, 255, 122, 0), 0.35));
}

/* ---------- steps ---------- */

.step-head { margin: 22px 0 34px; }
.step[data-step="1"] .step-head { text-align: center; }

.step-title {
  font-size: clamp(30px, 4vw, 40px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.5px;
}
.step[data-step="1"] .step-title {
  font-size: clamp(38px, 6vw, 58px);
  font-weight: 700;
}
.title-highlight { color: var(--accent); }
.step-subtitle { color: var(--text-soft); font-size: 16px; margin-top: 12px; }
.step[data-step="1"] .step-subtitle { font-size: 17px; }
.title-rule {
  display: block;
  width: 58px;
  height: 3px;
  border-radius: 99px;
  background: var(--accent);
  margin: 24px auto 0;
  box-shadow: 0 0 20px rgba(var(--tenant-primary-rgb, 255, 122, 0), 0.55);
}

/* Etapas de formulário ocupam coluna mais estreita para não ficarem alongadas */
.step:not([data-step="1"]) { max-width: 920px; margin: 0 auto; }

.review-section-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 6px;
}
.field label .opt { color: var(--text-muted); font-weight: 400; }
.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s, color 0.2s, filter 0.2s;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-hover), var(--accent) 55%, var(--accent));
  color: var(--accent-ink);
  box-shadow: 0 10px 28px rgba(var(--tenant-primary-rgb, 255, 122, 0), 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 42px rgba(var(--tenant-primary-rgb, 255, 122, 0), 0.45);
  filter: brightness(1.06);
}
.btn-primary:disabled { opacity: 0.6; transform: none; }

.btn-ghost {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-strong);
  color: var(--text-soft);
}
.btn-ghost:hover {
  border-color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  transform: translateY(-1px);
}

.btn-lg { padding: 16px 34px; font-size: 16px; }
.btn-block { width: 100%; }

.nav-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 30px;
}

/* botões das etapas de formulário ficam alinhados à coluna estreita */
.step:not([data-step="1"]) > .nav-row,
#navRow.step-nav {
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- modality cards ---------- */

.modality-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.modality-card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: left;
  border-radius: 24px;
  background: linear-gradient(180deg, #181e2b, #10141c);
  border: 1px solid var(--border);
  overflow: hidden;
  padding: 0;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  animation: cardIn 0.6s ease both;
}
.modality-card:nth-child(1) { animation-delay: 0.08s; }
.modality-card:nth-child(2) { animation-delay: 0.16s; }
.modality-card:nth-child(3) { animation-delay: 0.24s; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

.modality-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(var(--tenant-primary-rgb, 255, 122, 0), 0.16), transparent 55%),
    linear-gradient(180deg, rgba(var(--tenant-primary-rgb, 255, 122, 0), 0.08), rgba(10, 13, 18, 0) 46%);
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.modality-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(var(--tenant-primary-rgb, 255, 122, 0), 0.5);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.5), 0 0 44px rgba(var(--tenant-primary-rgb, 255, 122, 0), 0.09);
}
.modality-card:hover::before { opacity: 1; }

.modality-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 22px 55px rgba(var(--tenant-primary-rgb, 255, 122, 0), 0.16);
  transform: translateY(-4px) scale(1.01);
}

.modality-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  padding: 6px 13px;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(var(--tenant-primary-rgb, 255, 122, 0), 0.4);
}

.modality-media {
  height: 150px;
  display: grid;
  place-items: center;
  position: relative;
  flex-shrink: 0;
}

.modality-icon {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(var(--tenant-primary-rgb, 255, 122, 0), 0.45);
  color: var(--accent);
  box-shadow: 0 0 32px rgba(var(--tenant-primary-rgb, 255, 122, 0), 0.2), inset 0 0 22px rgba(var(--tenant-primary-rgb, 255, 122, 0), 0.05);
  backdrop-filter: blur(8px);
  transition: transform 0.25s ease;
}
.modality-card:hover .modality-icon { transform: scale(1.09); }
.modality-card.selected .modality-icon {
  box-shadow: 0 0 40px rgba(var(--tenant-primary-rgb, 255, 122, 0), 0.35), inset 0 0 22px rgba(var(--tenant-primary-rgb, 255, 122, 0), 0.08);
}

.modality-body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 4px 22px 24px;
  flex: 1;
}
.modality-name { font-size: 21px; font-weight: 700; color: var(--text); }
.modality-desc { font-size: 14px; color: var(--text-soft); line-height: 1.6; flex: 1; }

/* ---------- category options ---------- */

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

.category-option {
  padding: 16px 10px;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 2px solid var(--border);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-soft);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.category-option:hover { border-color: var(--border-strong); }
.category-option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

/* ---------- units ---------- */

.unit-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 22px; }

.unit-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 2px solid var(--border);
  transition: border-color 0.15s, background 0.15s;
}
.unit-card:hover { background: var(--card-hover); }
.unit-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.unit-name { font-weight: 700; font-size: 15px; }
.unit-address { font-size: 13px; color: var(--text-soft); }
.unit-hours { font-size: 12px; color: var(--text-muted); }

/* ---------- calendar ---------- */

.calendar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  max-width: 480px;
}

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cal-title { font-weight: 700; text-transform: capitalize; }
.cal-nav {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 20px;
  display: grid; place-items: center;
}
.cal-nav:hover { border-color: var(--accent); }

.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}
.cal-wd { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-grid span { pointer-events: none; }

.cal-day {
  aspect-ratio: 1;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  display: grid; place-items: center;
  transition: background 0.12s, border-color 0.12s;
}
.cal-day:hover { background: var(--card-hover); border-color: var(--accent); }
.cal-day.selected { background: var(--accent); color: var(--accent-ink); }
.cal-day.disabled { color: var(--text-muted); opacity: 0.45; cursor: not-allowed; }

/* ---------- catalog / services ---------- */

.catalog-section { margin-bottom: 26px; }
.catalog-cat { font-size: 18px; font-weight: 700; margin-bottom: 12px; color: var(--text); }

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

.service-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  padding: 18px;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 2px solid var(--border);
  transition: border-color 0.15s, background 0.15s;
}
.service-card:hover { background: var(--card-hover); }
.service-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.service-name { font-weight: 700; font-size: 15px; }
.service-desc { font-size: 13px; color: var(--text-soft); }
.service-items { font-size: 12px; color: var(--text-muted); }
.service-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 6px; }
.service-duration { font-size: 12px; color: var(--text-muted); }
.service-price { font-size: 16px; font-weight: 700; color: var(--accent); }

/* ---------- slots ---------- */

.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, max-content));
  gap: 10px;
  align-items: stretch;
}

.slot-btn {
  width: fit-content;
  min-width: 104px;
  max-width: 100%;
  height: auto;
  min-height: 48px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 2px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.2px;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.3;
  transition: border-color 0.12s, background 0.12s;
}
.slot-btn:hover { border-color: var(--accent); }
.slot-btn.selected { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.slot-btn.disabled { color: var(--text-muted); opacity: 0.45; cursor: not-allowed; }

.slot-duration-note { color: var(--text-muted); font-size: 14px; margin: 0 0 14px; }

.slot-long-message {
  border: 1px dashed var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.55;
}

.loading { color: var(--text-muted); padding: 24px 0; text-align: center; }
.error-box {
  background: var(--red-soft);
  border: 1px solid rgba(255, 77, 90, 0.35);
  color: #ffb3b9;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}

/* ---------- review ---------- */

.review-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 10px;
}

.review-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
}
.review-line span { color: var(--text-soft); }
.review-line strong {
  text-align: right;
  font-weight: 600;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.review-total { margin-top: 10px; }
.review-line.total { border-bottom: none; padding-top: 14px; }
.review-line.total span { color: var(--text); font-weight: 600; }
.review-line.total strong { font-size: 22px; color: var(--accent); font-weight: 800; }

.review-note { margin-top: 12px; font-size: 13px; color: var(--text-muted); }

.address-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 14px; margin-bottom: 8px; }

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-soft);
  margin: 14px 0;
  cursor: pointer;
  line-height: 1.45;
}
.checkbox input {
  width: 18px; height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ---------- payment ---------- */

.payment-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.payment-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--card);
  border: 2px solid var(--border);
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.payment-card:hover { background: var(--card-hover); border-color: var(--border-strong); }
.payment-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.payment-name { font-size: 16px; font-weight: 700; }
.payment-desc { font-size: 13px; color: var(--text-soft); }

.payment-detail {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.payment-note { font-size: 14px; color: var(--text-soft); margin-bottom: 14px; }
.payment-note.muted { color: var(--text-muted); font-size: 13px; }

.card-total {
  margin: 4px 0 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-soft);
}
.card-total strong { font-size: 20px; color: var(--accent); font-weight: 800; }

.payment-success { text-align: center; padding: 18px 0 6px; }
.payment-success .success-icon { width: 64px; height: 64px; margin-bottom: 14px; }
.payment-success strong { font-size: 18px; color: var(--green); display: block; margin-bottom: 6px; }
.payment-success p { font-size: 14px; color: var(--text-soft); }

.pix-box { display: flex; flex-direction: column; gap: 4px; }
.pix-code-wrap { display: flex; gap: 10px; align-items: stretch; }
.pix-code-input {
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
}
.pix-code-wrap .btn { white-space: nowrap; flex-shrink: 0; }

.qr-box { text-align: center; }
.qr-image {
  display: inline-block;
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 4px 0 10px;
  box-shadow: var(--shadow);
}
.qr-image svg { display: block; width: 240px; height: 240px; }
.qr-image img { display: block; width: 240px; height: 240px; object-fit: contain; }

/* ---------- success ---------- */

.success {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  padding: 40px 0 20px;
  animation: fadeIn 0.35s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.success-icon {
  width: 96px; height: 96px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: var(--green-soft);
  border: 2px solid rgba(39, 196, 105, 0.4);
  display: grid; place-items: center;
}

.success h2 { font-size: 26px; font-weight: 800; margin-bottom: 10px; }
.success-msg { color: var(--text-soft); max-width: 480px; margin: 0 auto 22px; }

.success-code {
  display: inline-block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 28px;
  margin-bottom: 16px;
}
.success-code span { display: block; font-size: 12px; color: var(--text-muted); }
.success-code strong { font-size: 22px; letter-spacing: 1px; color: var(--green); }

.success-note { font-size: 13px; color: var(--text-muted); max-width: 440px; margin: 0 auto 26px; }
.success-actions { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.success-actions .btn { min-width: 320px; }

/* ---------- admin ---------- */

.admin-body { background: var(--bg); }

.hidden { display: none !important; }

/* ---------- login ---------- */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(1200px 600px at 70% -10%, rgba(var(--tenant-primary-rgb, 255, 122, 26), 0.12), transparent 60%), var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
}
.login-card .brand { justify-content: center; margin-bottom: 20px; }
.login-card .brand-logo { height: 52px; }
.login-card h1 { font-size: 22px; font-weight: 800; text-align: center; }
.login-card .sub { text-align: center; color: var(--text-muted); font-size: 14px; margin: 4px 0 22px; }
.login-msg {
  background: var(--red-soft);
  border: 1px solid rgba(255, 77, 90, 0.35);
  color: #ffb3b9;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 14px;
}

/* ---------- topbar ---------- */

.admin-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.admin-topbar strong { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hamburger {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  font-size: 18px;
}

@media (min-width: 901px) {
  .admin-topbar { position: static; }
  .admin-topbar .hamburger { display: none; }
}

/* ---------- loader / toast ---------- */

.loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 16, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.spinner {
  width: 44px; height: 44px;
  border: 4px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  z-index: 120;
  box-shadow: var(--shadow);
  max-width: 90vw;
}
.toast.success { border-color: var(--green); color: #b9f2cd; }
.toast.error { border-color: var(--red); color: #ffc6cb; }

/* ---------- admin layout ---------- */

.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-sidebar .brand {
  flex-direction: column;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.admin-sidebar .brand-logo { height: 56px; }

.admin-nav { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.admin-nav button {
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
}
.admin-nav button:hover { background: var(--card-hover); color: var(--text); }
.admin-nav button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.admin-main { padding: 26px 30px 60px; max-width: 1100px; }

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.admin-header h1 { font-size: 24px; font-weight: 800; }
.admin-header .sub { color: var(--text-muted); font-size: 14px; margin-top: 2px; }

.toolbar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar input, .toolbar select { width: auto; min-width: 180px; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tab {
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.tab:hover { border-color: var(--border-strong); color: var(--text); }
.tab.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tab .count { opacity: 0.75; font-weight: 500; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-pending { background: var(--amber); color: #0b0d12; }
.badge-confirmed { background: var(--green); color: #0b0d12; }
.badge-rejected { background: var(--red); color: #fff; }
.badge-completed { background: var(--blue); color: #0b0d12; }
.badge-cancelled { background: var(--border-strong); color: var(--text-soft); }
.badge-entrada { background: var(--green-soft); color: var(--green); }
.badge-saida { background: var(--red-soft); color: var(--red); }

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}

/* ---------- aparência (logo/favicon + tema de cores) ---------- */

.branding-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.branding-card { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-soft); }
.branding-preview {
  display: flex; align-items: center; justify-content: center;
  height: 110px; margin-bottom: 10px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  background: var(--card); overflow: hidden;
}
.branding-preview img { max-width: 85%; max-height: 85px; object-fit: contain; }
.branding-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.branding-upload { cursor: pointer; }

.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.theme-card {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  font-family: inherit;
  color: inherit;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  border: 2px solid var(--border);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.theme-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.theme-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.theme-current {
  position: absolute; top: 10px; right: 10px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px;
  padding: 3px 8px; border-radius: 999px;
}
.theme-preview {
  height: 74px;
  border-radius: 10px;
  border: 1px solid;
  display: flex; align-items: center; gap: 8px;
  padding: 10px;
  margin-bottom: 10px;
  overflow: hidden;
}
.theme-preview-btn { padding: 6px 12px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.theme-preview-card { flex: 1; align-self: stretch; border-radius: 6px; border: 1px solid; }
.theme-dots { display: flex; gap: 5px; margin-bottom: 8px; }
.theme-dot { width: 15px; height: 15px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.15); flex-shrink: 0; }
.theme-name { font-size: 14px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.theme-selected-mark { font-size: 11px; font-weight: 700; color: var(--accent); }
.theme-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--text-muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
tr:hover td { background: rgba(255, 255, 255, 0.02); }

.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-success { background: var(--green); color: #0b0d12; }
.btn-success:hover { background: #2fd476; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #ff5f6a; }
.btn-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text-soft); }
.btn-outline:hover { background: var(--card-hover); color: var(--text); }

/* ---------- ações de agendamento: botões compactos só com ícone ---------- */

.appointment-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  flex-shrink: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, filter 0.15s, transform 0.15s;
}
.action-btn svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}
.action-btn:active { transform: scale(0.95); }
.action-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.action-btn-success { background: var(--green-soft); color: var(--green); }
.action-btn-success:hover { background: var(--green); color: #0b0d12; }

.action-btn-edit { background: rgba(58, 160, 255, 0.14); color: var(--blue); }
.action-btn-edit:hover { background: var(--blue); color: #0b0d12; }

.action-btn-neutral { background: var(--card-hover); color: var(--text-soft); }
.action-btn-neutral:hover { background: var(--border-strong); color: var(--text); }

.action-btn-warn { background: var(--red-soft); color: var(--red); }
.action-btn-warn:hover { background: var(--red); color: #fff; }

.action-btn-danger { background: var(--red); color: #fff; }
.action-btn-danger:hover { background: #ff5f6a; }

/* ---------- modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 50;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 640px;
  box-shadow: var(--shadow);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-header h3 { font-size: 20px; font-weight: 700; }
.modal-close {
  background: transparent; border: none; color: var(--text-muted);
  font-size: 26px; line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 14px; }
.form-grid .span-2 { grid-column: span 2; }

.checkbox-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.switch-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.switch-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.switch-row span { font-size: 14px; color: var(--text-soft); }

.muted { color: var(--text-muted); font-size: 13px; }
.empty-state { text-align: center; padding: 40px 0; color: var(--text-muted); }
.setup-screen { text-align: center; padding: 48px 16px; max-width: 560px; margin: 0 auto; }
.setup-icon { display: inline-flex; align-items: center; justify-content: center; width: 88px; height: 88px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); margin-bottom: 22px; }
.setup-msg { color: var(--text-muted); font-size: 15px; line-height: 1.6; max-width: 420px; margin: 0 auto 26px; }
.setup-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.setup-banner { background: linear-gradient(135deg, rgba(255, 200, 0, 0.12), rgba(255, 122, 0, 0.08)); border: 1px solid rgba(255, 180, 0, 0.35); border-radius: 12px; padding: 16px 18px; margin-bottom: 18px; }
.setup-banner-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.setup-banner-head span { font-size: 13px; color: var(--text-muted); }
.setup-missing-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.setup-missing-item { font-size: 13px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 180, 0, 0.15); border: 1px solid rgba(255, 180, 0, 0.25); }
.setup-missing-item .linklike { background: none; border: none; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; min-width: 0; }
.stat-card .stat-value { font-size: 26px; font-weight: 800; }
.stat-card .stat-label { font-size: 12px; color: var(--text-muted); overflow-wrap: break-word; }
.stat-card .stat-sub { font-size: 11px; color: var(--text-soft); margin-top: 4px; overflow-wrap: break-word; }

.agenda-col-left .stat-grid { gap: 8px; }
.agenda-col-left .stat-card { padding: 10px 8px; text-align: center; }
.agenda-col-left .stat-card .stat-value { font-size: 20px; }
.agenda-col-left .stat-card .stat-label { font-size: 11px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
.grid-3 .panel { margin-bottom: 0; }

.header-actions { display: flex; gap: 10px; }

/* ---------- agenda ---------- */

.agenda-active .admin-main { max-width: 1500px; }

.agenda-header h1 { display: flex; align-items: center; gap: 10px; }
.agenda-header .agenda-icon { font-size: 22px; }
.agenda-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.agenda-month-select {
  width: auto; min-width: 170px; background: var(--bg-soft); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13px; font-weight: 600;
}
.agenda-nav-btn { width: 38px; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }

/* Visual igual ao .view-switch do topbar, mas com classe própria: o
   listener global do topbar delega cliques por ".view-switch button" e
   reagiria (incorretamente) a estes botões se a classe fosse reutilizada. */
.agenda-mode-switch {
  display: inline-flex; align-items: center; background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border); border-radius: 999px; padding: 4px; gap: 2px; flex-shrink: 0;
}
.agenda-mode-switch button {
  border: none; background: transparent; color: var(--text-muted); font-size: 12px; font-weight: 600;
  line-height: 1; padding: 7px 13px; border-radius: 999px; display: inline-flex; align-items: center;
  justify-content: center; transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.agenda-mode-switch button:hover { color: var(--text); }
.agenda-mode-switch button.active { background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 16px rgba(var(--tenant-primary-rgb, 255, 122, 0), 0.4); }

.agenda-grid { display: grid; grid-template-columns: 38% 1fr; gap: 20px; align-items: start; }
.agenda-col-left { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.agenda-col-right { min-width: 0; }

.agenda-panel-title { text-align: center; font-weight: 700; font-size: 15px; margin-bottom: 14px; text-transform: capitalize; }
.agenda-cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px; }
.agenda-cal-weekdays span { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.agenda-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }

.agenda-cal-day {
  position: relative; aspect-ratio: 1; border-radius: 10px; background: var(--bg-soft);
  border: 1px solid transparent; color: var(--text); font-size: 13px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  transition: background 0.12s, border-color 0.12s;
}
.agenda-cal-day:hover { background: var(--card-hover); border-color: var(--border-strong); }
.agenda-cal-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.agenda-cal-day.is-outside { opacity: 0.35; }
.agenda-cal-day.is-today { border-color: var(--accent); color: var(--accent); }
.agenda-cal-day.is-selected { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.agenda-cal-day.is-selected .agenda-cal-dot { background: var(--accent-ink); }
.agenda-cal-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

.agenda-summary-title, .agenda-upcoming-title, .agenda-daily-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; }

.agenda-upcoming-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.agenda-upcoming-item:last-child { border-bottom: none; }
.agenda-upcoming-time { font-weight: 700; font-size: 14px; min-width: 44px; }
.agenda-upcoming-info { flex: 1; min-width: 0; }
.agenda-upcoming-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-upcoming-service { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-upcoming-foot { text-align: center; margin-top: 10px; }

.agenda-daily-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.agenda-daily-head .agenda-daily-title { margin-bottom: 0; text-transform: capitalize; }
.agenda-daily-count { color: var(--text-muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.agenda-empty-note { color: var(--text-muted); font-size: 13px; margin-bottom: 14px; }
.agenda-fullday-banner {
  background: var(--red-soft); border: 1px solid var(--red); color: var(--text);
  border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; margin-bottom: 14px;
}

.agenda-timeline { position: relative; border-top: 1px solid var(--border); margin-top: 8px; overflow-x: auto; }
.agenda-tick { position: absolute; left: 0; width: 100%; border-top: 1px solid var(--border); }
.agenda-tick-label {
  position: absolute; left: 0; top: -8px; font-size: 11px; color: var(--text-muted); background: var(--card);
  padding-right: 8px; font-weight: 600;
}
.agenda-tick-content { position: absolute; left: 58px; right: 0; top: 0; bottom: 0; }
.agenda-slot, .agenda-lunch-band, .agenda-blocked-band { position: absolute; left: 0; right: 0; border-radius: 8px; }

.agenda-slot-add {
  position: absolute; inset: 2px; border-radius: 8px; border: 1px dashed transparent;
  display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--text-muted);
  opacity: 0; transition: opacity 0.12s, border-color 0.12s, color 0.12s; cursor: pointer; background: transparent;
}
.agenda-slot:hover .agenda-slot-add, .agenda-slot-add:focus-visible {
  opacity: 1; border-color: var(--accent); color: var(--accent); background: var(--accent-soft); outline: none;
}

.agenda-lunch-band {
  z-index: 3; background: var(--bg-soft); color: var(--text-muted); border: 1px dashed var(--border-strong);
  display: flex; align-items: center; padding: 0 12px; font-size: 12px; gap: 6px;
}
.agenda-blocked-band {
  z-index: 3; background: rgba(125, 135, 151, 0.14); color: var(--text-soft); border: 1px solid var(--border-strong);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 6px 12px; gap: 1px; font-size: 12px;
}
.agenda-blocked-band strong { font-size: 13px; color: var(--text); }

.agenda-appt-card {
  position: absolute; border-radius: 10px; padding: 7px 10px; border-left: 4px solid var(--border-strong);
  background: var(--card); box-shadow: var(--shadow); overflow: hidden; z-index: 4; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px; transition: filter 0.12s; text-align: left;
}
.agenda-appt-card:hover, .agenda-appt-card:focus-visible { filter: brightness(1.15); outline: none; }
.agenda-appt-card.status-pending { border-left-color: var(--amber); background: linear-gradient(180deg, rgba(255, 176, 32, 0.16), var(--card) 65%); }
.agenda-appt-card.status-confirmed { border-left-color: var(--green); background: linear-gradient(180deg, rgba(39, 196, 105, 0.16), var(--card) 65%); }
.agenda-appt-card.status-completed { border-left-color: var(--blue); background: linear-gradient(180deg, rgba(58, 160, 255, 0.16), var(--card) 65%); }
.agenda-appt-card.status-cancelled, .agenda-appt-card.status-rejected { border-left-color: var(--red); opacity: 0.7; }

.agenda-appt-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.agenda-appt-name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-appt-sub { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-appt-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

.agenda-skeleton-cal, .agenda-skeleton-line {
  background: var(--bg-soft); border-radius: 8px; animation: agenda-pulse 1.2s ease-in-out infinite;
}
.agenda-skeleton-cal { aspect-ratio: 7 / 6; }
.agenda-skeleton-line { height: 44px; margin-bottom: 8px; }
@keyframes agenda-pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 0.9; } }

.agenda-error { text-align: center; padding: 30px 0; color: var(--text-muted); }
.agenda-error .btn { margin-top: 12px; }

.admin-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 44;
  display: none;
}
.admin-backdrop.show { display: block; }

/* ---------- responsive ---------- */

/* Admin: sidebar vira gaveta (drawer) no mobile */
@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-topbar { display: flex; }
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 268px;
    max-width: 85vw;
    height: 100vh;
    border-right: 1px solid var(--border);
    transform: translateX(-102%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow);
    z-index: 45;
  }
  .admin-sidebar.open { transform: translateX(0); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .agenda-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1080px) {
  .modality-grid { grid-template-columns: repeat(2, 1fr); }
  .modality-card:nth-child(3) { grid-column: span 2; }
  .appointment-actions { gap: 6px; }
}

@media (max-width: 700px) {
  /* ---------- booking ---------- */
  .site-header { height: 74px; padding: 0 16px; }
  .brand-logo { height: 38px; }
  .header-tagline { display: none; }
  .container { padding: 14px 14px 50px; }
  .modality-grid { grid-template-columns: 1fr; }
  .modality-card:nth-child(3) { grid-column: auto; }
  .unit-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .payment-grid { grid-template-columns: 1fr; }
  .pix-code-wrap { flex-direction: column; }
  .pix-code-wrap .btn { width: 100%; }
  .service-grid { grid-template-columns: 1fr; }
  .address-grid { grid-template-columns: 1fr; }
  .field-row { flex-direction: column; gap: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .success-actions .btn { min-width: 100%; }
  .nav-row { flex-direction: column-reverse; }
  .nav-row .btn { width: 100%; }
  .progress-wrap { margin: 14px 0 6px; }
  .progress { min-width: 0; }
  .progress li { flex: 1; padding: 8px 2px; }
  .progress li .lbl { font-size: 10px; margin-bottom: 8px; }
  .progress li .dot-wrap { --dot-r: 11px; }
  .progress li .dot { width: 22px; height: 22px; font-size: 11px; }
  .slot-btn { font-size: 14px; }
  .step-title { font-size: 30px; }
  .step[data-step="1"] .step-title { font-size: 38px; }
  .footer-inner { grid-template-columns: 1fr; gap: 22px; text-align: center; justify-items: center; }
  .footer-copy { text-align: center; }

  /* ---------- admin ---------- */
  .admin-main { padding: 18px 14px 50px; }
  .admin-header { flex-direction: column; align-items: stretch; }
  .admin-header > .btn,
  .admin-header .header-actions .btn { width: 100%; }
  .header-actions { flex-direction: column; }
  .toolbar { flex-direction: column; }
  .toolbar input, .toolbar select { width: 100%; min-width: 0; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; margin-bottom: 16px; }
  .tabs .tab { flex-shrink: 0; }
  .btn-sm { padding: 10px 14px; }
  .stat-grid { gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card .stat-value { font-size: 22px; }
  .grid-3 { grid-template-columns: 1fr; }

  /* ---------- aparência ---------- */
  .branding-grid { grid-template-columns: 1fr; }
  .theme-grid { grid-template-columns: 1fr; }

  /* ---------- agenda ---------- */
  .agenda-controls { width: 100%; }
  .agenda-month-select { flex: 1 1 140px; min-width: 0; }
  .agenda-tick-label, .agenda-slot, .agenda-lunch-band, .agenda-blocked-band { left: 46px; }
  .agenda-appt-card { padding: 6px 8px; }
  .agenda-appt-name, .agenda-appt-sub { font-size: 11px; white-space: normal; line-height: 1.2; }
  .agenda-appt-time { display: none; }
  .agenda-appt-head { flex-wrap: wrap; }

  /* tabelas viram cartões empilhados */
  .table-wrap { overflow: visible; }
  .table-wrap table, .table-wrap thead, .table-wrap tbody,
  .table-wrap tr, .table-wrap th, .table-wrap td { display: block; }
  .table-wrap thead { display: none; }
  .table-wrap tbody { display: grid; gap: 12px; }
  .table-wrap tr {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 16px;
    padding: 14px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
  }
  .table-wrap tr:hover { border-color: var(--border-strong); }
  .table-wrap td { border: none; padding: 0; font-size: 13px; min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
  .table-wrap td::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-muted);
    margin-bottom: 2px;
  }
  .table-wrap td.cell-actions {
    grid-column: 1 / -1;
    border-top: 1px dashed var(--border);
    padding-top: 10px;
    margin-top: 2px;
  }
  .table-wrap td.cell-actions::before { display: none; }
  .table-wrap td.cell-actions .row-actions { justify-content: flex-start; }
  .table-wrap td.cell-actions .row-actions .btn { flex: 1; }
  .table-wrap td.cell-actions .appointment-actions { justify-content: flex-start; flex-wrap: wrap; gap: 6px; }
  .table-wrap td.cell-actions .action-btn { width: 40px; height: 40px; }
  .table-wrap td.cell-actions .action-btn svg { width: 20px; height: 20px; }
  .table-wrap tr:hover td { background: transparent; }
}

/* Modais viram "bottom sheet" em telas pequenas */
@media (max-width: 600px) {
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    padding: 20px 18px 0;
    display: flex;
    flex-direction: column;
  }
  .modal-header { flex-shrink: 0; }
  .modal-body { overflow-y: auto; min-height: 0; padding-bottom: 18px; }
  .modal-actions {
    flex-shrink: 0;
    margin: 0 -18px;
    padding: 14px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    background: var(--bg-soft);
    border-top: 1px solid var(--border);
    border-radius: 0 0 20px 20px;
  }
  .modal-actions .btn { flex: 1; }
}

@media (max-width: 400px) {
  .step-title { font-size: 26px; }
  .step[data-step="1"] .step-title { font-size: 34px; }
  .modal-actions { flex-direction: column; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .qr-image svg { width: 200px; height: 200px; }
  .qr-image img { width: 200px; height: 200px; }
  .view-switch button { padding: 6px 9px; }
  .header-right { gap: 8px; }
}

/* ---------- visualização forçada: mobile ---------- */

html.lock-mobile .site-header { height: 74px; padding: 0 16px; flex-wrap: nowrap; }
html.lock-mobile .modality-grid { grid-template-columns: 1fr; }
html.lock-mobile .modality-card:nth-child(3) { grid-column: auto; }
html.lock-mobile .unit-grid { grid-template-columns: 1fr; }
html.lock-mobile .category-grid { grid-template-columns: repeat(2, 1fr); }
html.lock-mobile .payment-grid { grid-template-columns: 1fr; }
html.lock-mobile .service-grid { grid-template-columns: 1fr; }
html.lock-mobile .address-grid { grid-template-columns: 1fr; }
html.lock-mobile .field-row { flex-direction: column; gap: 0; }
html.lock-mobile .form-grid { grid-template-columns: 1fr; }
html.lock-mobile .form-grid .span-2 { grid-column: span 1; }
html.lock-mobile .branding-grid { grid-template-columns: 1fr; }
html.lock-mobile .theme-grid { grid-template-columns: 1fr; }
html.lock-mobile .nav-row { flex-direction: column-reverse; }
html.lock-mobile .nav-row .btn { width: 100%; }
html.lock-mobile .pix-code-wrap { flex-direction: column; }
html.lock-mobile .pix-code-wrap .btn { width: 100%; }
html.lock-mobile .success-actions .btn { min-width: 100%; }
html.lock-mobile .header-tagline { display: none; }
html.lock-mobile .container { padding: 14px 14px 50px; }
html.lock-mobile .step-title { font-size: 30px; }
html.lock-mobile .progress { min-width: 0; }
html.lock-mobile .progress li { flex: 1; padding: 8px 2px; }
html.lock-mobile .progress li .dot-wrap { --dot-r: 11px; }
html.lock-mobile .progress li .dot { width: 22px; height: 22px; font-size: 11px; }
html.lock-mobile .progress li .lbl { font-size: 10px; margin-bottom: 8px; }
html.lock-mobile .slot-btn { font-size: 14px; }
html.lock-mobile .footer-inner { grid-template-columns: 1fr; gap: 22px; text-align: center; justify-items: center; }
html.lock-mobile .footer-copy { text-align: center; }

html.lock-mobile .admin-layout { grid-template-columns: 1fr; }
html.lock-mobile .admin-topbar { display: flex; }
html.lock-mobile .admin-topbar .hamburger { display: block; }
html.lock-mobile .admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 268px;
  max-width: 85vw;
  height: 100vh;
  border-right: 1px solid var(--border);
  transform: translateX(-102%);
  transition: transform 0.25s ease;
  box-shadow: var(--shadow);
  z-index: 45;
}
html.lock-mobile .admin-sidebar.open { transform: translateX(0); }
html.lock-mobile .admin-backdrop.show { display: block; }
html.lock-mobile .stat-grid { grid-template-columns: repeat(2, 1fr); }
html.lock-mobile .grid-3 { grid-template-columns: 1fr; }
html.lock-mobile .agenda-grid { grid-template-columns: 1fr; }
html.lock-mobile .agenda-controls { width: 100%; }
html.lock-mobile .agenda-tick-label, html.lock-mobile .agenda-slot,
html.lock-mobile .agenda-lunch-band, html.lock-mobile .agenda-blocked-band { left: 46px; }
html.lock-mobile .admin-main { padding: 18px 14px 50px; }
html.lock-mobile .admin-header { flex-direction: column; align-items: stretch; }
html.lock-mobile .admin-header > .btn,
html.lock-mobile .admin-header .header-actions .btn { width: 100%; }
html.lock-mobile .header-actions { flex-direction: column; }
html.lock-mobile .toolbar { flex-direction: column; }
html.lock-mobile .toolbar input, html.lock-mobile .toolbar select { width: 100%; min-width: 0; }
html.lock-mobile .tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; }
html.lock-mobile .btn-sm { padding: 10px 14px; }
html.lock-mobile .table-wrap { overflow: visible; }
html.lock-mobile .table-wrap table, html.lock-mobile .table-wrap thead,
html.lock-mobile .table-wrap tbody, html.lock-mobile .table-wrap tr,
html.lock-mobile .table-wrap th, html.lock-mobile .table-wrap td { display: block; }
html.lock-mobile .table-wrap thead { display: none; }
html.lock-mobile .table-wrap tbody { display: grid; gap: 12px; }
html.lock-mobile .table-wrap tr {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 16px;
  padding: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
html.lock-mobile .table-wrap tr:hover { border-color: var(--border-strong); }
html.lock-mobile .table-wrap td { border: none; padding: 0; font-size: 13px; min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
html.lock-mobile .table-wrap td::before {
  content: attr(data-label);
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
html.lock-mobile .table-wrap td.cell-actions {
  grid-column: 1 / -1;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
  margin-top: 2px;
}
html.lock-mobile .table-wrap td.cell-actions::before { display: none; }
html.lock-mobile .table-wrap td.cell-actions .row-actions { justify-content: flex-start; }
html.lock-mobile .table-wrap td.cell-actions .row-actions .btn { flex: 1; }
html.lock-mobile .table-wrap td.cell-actions .appointment-actions { justify-content: flex-start; flex-wrap: wrap; gap: 6px; }
html.lock-mobile .table-wrap td.cell-actions .action-btn { width: 40px; height: 40px; }
html.lock-mobile .table-wrap td.cell-actions .action-btn svg { width: 20px; height: 20px; }
html.lock-mobile .table-wrap tr:hover td { background: transparent; }
html.lock-mobile .modal-overlay { padding: 0; align-items: flex-end; }
html.lock-mobile .modal {
  max-width: 100%;
  max-height: 92vh;
  border-radius: 20px 20px 0 0;
  padding: 20px 18px 0;
  display: flex;
  flex-direction: column;
}
html.lock-mobile .modal-header { flex-shrink: 0; }
html.lock-mobile .modal-body { overflow-y: auto; min-height: 0; padding-bottom: 18px; }
html.lock-mobile .modal-actions {
  flex-shrink: 0;
  margin: 0 -18px;
  padding: 14px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  border-radius: 0 0 20px 20px;
}
html.lock-mobile .modal-actions .btn { flex: 1; }

/* ---------- visualização forçada: desktop ---------- */

html.lock-desktop .header-tagline { display: block; }
html.lock-desktop .container { padding: 20px clamp(20px, 4vw, 48px) 80px; }
html.lock-desktop .step-title { font-size: clamp(30px, 4vw, 40px); }
html.lock-desktop .modality-grid { grid-template-columns: repeat(3, 1fr); }
html.lock-desktop .modality-card:nth-child(3) { grid-column: auto; }
html.lock-desktop .unit-grid { grid-template-columns: repeat(2, 1fr); }
html.lock-desktop .category-grid { grid-template-columns: repeat(4, 1fr); }
html.lock-desktop .payment-grid { grid-template-columns: repeat(2, 1fr); }
html.lock-desktop .service-grid { grid-template-columns: repeat(2, 1fr); }
html.lock-desktop .address-grid { grid-template-columns: repeat(2, 1fr); }
html.lock-desktop .field-row { flex-direction: row; gap: 14px; }
html.lock-desktop .form-grid { grid-template-columns: repeat(2, 1fr); }
html.lock-desktop .form-grid .span-2 { grid-column: span 2; }
html.lock-desktop .branding-grid { grid-template-columns: repeat(2, 1fr); }
html.lock-desktop .theme-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
html.lock-desktop .nav-row { flex-direction: row; }
html.lock-desktop .nav-row .btn { width: auto; }
html.lock-desktop .pix-code-wrap { flex-direction: row; }
html.lock-desktop .pix-code-wrap .btn { width: auto; }
html.lock-desktop .success-actions .btn { min-width: 320px; }
html.lock-desktop .progress { min-width: 720px; }
html.lock-desktop .progress li .lbl { font-size: 12px; margin-bottom: 10px; }
html.lock-desktop .slot-btn { font-size: 13px; }
html.lock-desktop .footer-inner { grid-template-columns: 1.3fr 1fr 1fr; text-align: left; justify-items: stretch; }
html.lock-desktop .footer-copy { text-align: right; }

html.lock-desktop .admin-layout { grid-template-columns: 240px 1fr; }
html.lock-desktop .admin-topbar { display: flex; }
html.lock-desktop .admin-topbar .hamburger { display: none; }
html.lock-desktop .admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: auto;
  max-width: none;
  transform: none;
  transition: none;
  box-shadow: none;
  z-index: auto;
  overflow-y: auto;
  border-right: 1px solid var(--border);
}
html.lock-desktop .admin-backdrop { display: none; }
html.lock-desktop .stat-grid { grid-template-columns: repeat(4, 1fr); }
html.lock-desktop .grid-3 { grid-template-columns: repeat(3, 1fr); }
html.lock-desktop .agenda-grid { grid-template-columns: 38% 1fr; }
html.lock-desktop .admin-main { padding: 26px 30px 60px; }
html.lock-desktop .admin-header { flex-direction: row; align-items: center; }
html.lock-desktop .admin-header > .btn,
html.lock-desktop .admin-header .header-actions .btn { width: auto; }
html.lock-desktop .header-actions { flex-direction: row; }
html.lock-desktop .toolbar { flex-direction: row; }
html.lock-desktop .toolbar input, html.lock-desktop .toolbar select { width: auto; min-width: 180px; }
html.lock-desktop .tabs { flex-wrap: wrap; overflow: visible; padding-bottom: 0; }
html.lock-desktop .btn-sm { padding: 7px 12px; }
html.lock-desktop .table-wrap { overflow-x: auto; }
html.lock-desktop .table-wrap table { display: revert; }
html.lock-desktop .table-wrap thead { display: revert; }
html.lock-desktop .table-wrap tbody { display: revert; }
html.lock-desktop .table-wrap tr { display: revert; }
html.lock-desktop .table-wrap th { display: revert; }
html.lock-desktop .table-wrap td {
  display: revert;
  border-bottom: 1px solid var(--border);
  padding: 12px 10px;
  font-size: 14px;
}
html.lock-desktop .table-wrap td::before { content: none; display: none; }
html.lock-desktop .table-wrap tr:hover td { background: rgba(255, 255, 255, 0.02); }
html.lock-desktop .table-wrap td.cell-actions .row-actions .btn { flex: none; }
html.lock-desktop .table-wrap td.cell-actions .appointment-actions { flex-wrap: nowrap; justify-content: flex-end; gap: 8px; }
html.lock-desktop .table-wrap td.cell-actions .action-btn { width: 36px; height: 36px; }
html.lock-desktop .table-wrap td.cell-actions .action-btn svg { width: 18px; height: 18px; }
html.lock-desktop .modal-overlay { padding: 40px 16px; align-items: flex-start; }
html.lock-desktop .modal {
  max-width: 640px;
  max-height: none;
  border-radius: var(--radius);
  padding: 24px;
  display: block;
}
html.lock-desktop .modal-header { flex-shrink: auto; }
html.lock-desktop .modal-body { overflow: visible; min-height: 0; padding-bottom: 0; }
html.lock-desktop .modal-actions {
  flex-shrink: auto;
  margin: 0;
  padding: 0;
  background: transparent;
  border-top: none;
  border-radius: 0;
}
html.lock-desktop .modal-actions .btn { flex: none; }
