:root {
  --fig: #5e3a6c;
  --fig-dark: #43264e;
  --fig-light: #f4eef7;
  --gold: #c9a227;
  --gold-light: #fbf6e6;
  --gold-dark: #a68216;
  --bg: #faf8fb;
  --surface: #ffffff;
  --text: #271e2b;
  --muted: #6e6273;
  --border: #e6dce9;
  --success: #1f8b4c;
  --warning: #d97706;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(94, 58, 108, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding-bottom: 40px;
}

h1, h2, h3 {
  font-family: 'Cormorant Garamond', serif;
  color: var(--fig-dark);
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

.topbar {
  background: linear-gradient(135deg, var(--fig-dark), var(--fig));
  color: #fff;
  padding: 16px 0;
  border-bottom: 3px solid var(--gold);
  box-shadow: var(--shadow);
}

.topbar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  background: #fff;
}

.logo-fallback {
  display: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--fig-dark);
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  font-size: 1.3rem;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

.topbar h1 {
  color: #fff;
  font-size: 1.45rem;
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.82rem;
  color: #e9d8f0;
}

.main-content {
  margin-top: 24px;
}

.stepper {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  background: var(--surface);
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  gap: 6px;
}

.step {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.step span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--fig-light);
  color: var(--fig);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.step.active {
  color: var(--fig-dark);
  font-weight: 700;
}

.step.active span {
  background: var(--gold);
  color: #fff;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.card-header {
  margin-bottom: 18px;
}

.card-header h2, .card-header-flex h2 {
  font-size: 1.65rem;
}

.card-header p {
  color: var(--muted);
  font-size: 0.9rem;
}

.card-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.highlight-text {
  color: var(--gold-dark);
  font-weight: 600;
  font-size: 0.92rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.service-item {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #fff;
}

.service-item:hover {
  border-color: var(--gold);
  background: var(--gold-light);
  transform: translateY(-2px);
}

.service-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--fig-dark);
  margin-bottom: 6px;
}

.service-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.service-price {
  font-weight: 700;
  color: var(--fig);
  font-size: 1.05rem;
}

.service-duration {
  font-size: 0.8rem;
  background: var(--fig-light);
  color: var(--fig-dark);
  padding: 3px 8px;
  border-radius: 20px;
  font-weight: 600;
}

.calendar-wrapper {
  background: var(--fig-light);
  padding: 16px;
  border-radius: 12px;
}

.calendar-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.calendar-nav h3 {
  font-size: 1.35rem;
  text-transform: capitalize;
}

.calendar-weekdays, .calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  text-align: center;
}

.calendar-weekdays span {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--fig);
  padding-bottom: 6px;
}

.cal-day {
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1px solid transparent;
  background: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.cal-day:hover:not(.disabled):not(.empty) {
  border-color: var(--gold);
  background: var(--gold-light);
}

.cal-day.selected {
  background: var(--fig);
  color: #fff;
  border-color: var(--gold);
}

.cal-day.disabled {
  background: transparent;
  color: #bcb2c0;
  cursor: not-allowed;
  text-decoration: line-through;
}

.cal-day.empty {
  background: transparent;
  cursor: default;
}

.slots-section {
  margin-top: 20px;
}

.slots-section h3 {
  margin-bottom: 12px;
  font-size: 1.3rem;
}

.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
}

.slot-btn {
  padding: 10px 8px;
  border-radius: 10px;
  border: 1.5px solid var(--fig);
  background: #fff;
  color: var(--fig-dark);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: 0.15s;
}

.slot-btn:hover {
  background: var(--fig);
  color: #fff;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-weight: 600;
  font-size: 0.9rem;
}

input, select, textarea {
  padding: 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  font-family: inherit;
  font-size: 0.95rem;
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--fig);
}

.payment-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.radio-card {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.radio-card input {
  width: auto;
  margin-top: 4px;
}

.radio-card.selected {
  border-color: var(--gold);
  background: var(--gold-light);
}

.price-tag {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--fig-dark);
  margin: 4px 0;
}

.radio-card small {
  color: var(--muted);
  font-size: 0.78rem;
  display: block;
}

.policy-box {
  background: #fff8eb;
  border-left: 4px solid var(--gold);
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
}

.badge-gold {
  display: inline-block;
  background: var(--gold-light);
  color: var(--gold-dark);
  border: 1px solid var(--gold);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.pix-box {
  background: var(--fig-light);
  border-radius: 14px;
  padding: 20px;
  margin: 18px 0;
  border: 1px solid var(--border);
}

.qr-wrapper {
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 14px;
  border: 2px solid var(--gold);
}

.pix-details {
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.pix-amount {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fig-dark);
}

.copy-group {
  display: flex;
  gap: 8px;
}

.copy-group input {
  background: #fff;
  font-size: 0.8rem;
  color: var(--muted);
}

.copy-feedback {
  display: block;
  margin-top: 8px;
  color: var(--success);
  font-weight: 600;
  font-size: 0.85rem;
}

.whatsapp-action-box {
  background: #ecfdf3;
  border: 1.5px solid #a7f3d0;
  padding: 16px;
  border-radius: 12px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--fig), var(--fig-dark));
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
}

.btn-gold {
  background: var(--gold);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.btn-whatsapp {
  display: inline-block;
  margin-top: 12px;
  background: #25d366;
  color: #fff;
  text-decoration: none;
  padding: 14px 22px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--fig);
  color: var(--fig);
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
}

.card .btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}

.btn-icon {
  background: #fff;
  border: 1px solid var(--border);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
}

.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-lg { padding: 15px; font-size: 1.05rem; }

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.tab-btn {
  background: #fff;
  border: 1px solid var(--border);
  padding: 9px 14px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.tab-btn.active {
  background: var(--fig);
  color: #fff;
  border-color: var(--fig);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  background: #fff;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.filter-bar label {
  font-size: 0.82rem;
  font-weight: 600;
}

.admin-cards-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.booking-card {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 5px solid var(--fig);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.booking-card.status-aguardando_sinal { border-left-color: var(--warning); background: #fffdf7; }
.booking-card.status-confirmado { border-left-color: var(--fig); }
.booking-card.status-concluido { border-left-color: var(--success); }
.booking-card.status-cancelado { border-left-color: var(--danger); opacity: 0.65; }

.status-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.badge-aguardando_sinal { background: #fef3c7; color: #92400e; }
.badge-confirmado { background: var(--fig-light); color: var(--fig-dark); }
.badge-concluido { background: #dcfce7; color: #166534; }
.badge-cancelado { background: #fee2e2; color: #991b1b; }

.booking-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.kpi-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.kpi-card span {
  font-size: 0.8rem;
  color: var(--muted);
  display: block;
}

.kpi-card strong {
  font-size: 1.35rem;
  color: var(--fig-dark);
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 12px;
  align-items: end;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(25, 15, 30, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 999;
}

.modal-content {
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.pin-input {
  text-align: center;
  font-size: 1.6rem;
  letter-spacing: 8px;
  margin: 14px 0;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}

.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 18px; }
.error-text { color: var(--danger); font-size: 0.85rem; }

@media (max-width: 600px) {
  .payment-options, .kpi-grid { grid-template-columns: 1fr; }
  .stepper { font-size: 0.72rem; }
  .copy-group { flex-direction: column; }
}