.nav-tabs, .subtabs {
  display: flex;
  gap: 0.5rem;
  background: var(--surface-subtle);
  padding: 0.25rem;
  border-radius: var(--radius-md);
}

.nav-tab, .subtab {
  border: none;
  background: transparent;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-muted);
  cursor: pointer;
}

.nav-tab.active, .subtab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-subtle);
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.service-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.service-card:hover {
  border-color: #a5b4fc;
}

.service-card.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.service-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.service-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

.calendar-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .calendar-split {
    grid-template-columns: 1fr;
  }
}

.cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  text-align: center;
}

.cal-dow {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  padding-bottom: 0.35rem;
}

.cal-day {
  aspect-ratio: 1;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius-sm);
  font-weight: 500;
  cursor: pointer;
}

.cal-day:hover:not(:disabled) {
  background: var(--surface-subtle);
}

.cal-day.selected {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.cal-day:disabled {
  color: #cbd5e1;
  cursor: not-allowed;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  max-height: 280px;
  overflow-y: auto;
}

.slot-btn {
  padding: 0.5rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.slot-btn.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.slot-btn:disabled {
  background: var(--surface-subtle);
  color: #94a3b8;
  text-decoration: line-through;
  cursor: not-allowed;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
}

.field-error {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th, td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-subtle);
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--surface-subtle);
  color: var(--text-muted);
}

.badge-confirmed {
  background: var(--success-soft);
  color: var(--success);
}

.badge-pending {
  background: #fef3c7;
  color: var(--warning);
}

.badge-cancelled {
  background: var(--danger-soft);
  color: var(--danger);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 50;
}

.modal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 100%;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  max-height: 90vh;
  overflow-y: auto;
}

.toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 60;
}

.toast {
  background: var(--text);
  color: #fff;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  box-shadow: var(--shadow-md);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Admin Weekly Calendar Grid */
.week-nav-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.week-kpis {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.week-cal-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.week-cal-board {
  min-width: 780px;
}

.week-cal-header-row {
  display: grid;
  grid-template-columns: 64px repeat(7, minmax(100px, 1fr));
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
}

.week-corner-cell {
  padding: 0.6rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.week-day-header {
  padding: 0.5rem 0.4rem;
  text-align: center;
  border-right: 1px solid var(--border);
}

.week-day-header:last-child {
  border-right: none;
}

.week-day-header.today {
  background: var(--primary-soft);
  color: var(--primary);
}

.week-day-name {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.week-day-num {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 0.1rem;
}

.week-cal-body-row {
  display: grid;
  grid-template-columns: 64px repeat(7, minmax(100px, 1fr));
}

.week-time-col {
  border-right: 1px solid var(--border);
  background: var(--surface-subtle);
}

.week-time-label {
  padding: 0.25rem 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: right;
  border-bottom: 1px solid var(--border);
}

.week-day-col {
  position: relative;
  border-right: 1px solid var(--border);
}

.week-day-col:last-child {
  border-right: none;
}

.week-day-col.today {
  background: rgba(79, 70, 229, 0.02);
}

.week-hour-slot {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s ease;
}

.week-hour-slot:hover {
  background: var(--primary-soft);
}

.week-hour-slot.closed {
  background: repeating-linear-gradient(
    -45deg,
    #f8fafc,
    #f8fafc 6px,
    #f1f5f9 6px,
    #f1f5f9 12px
  );
}

.week-blockout-overlay {
  position: absolute;
  left: 2px;
  right: 2px;
  background: rgba(220, 38, 38, 0.09);
  border: 1px dashed rgba(220, 38, 38, 0.35);
  color: var(--danger);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.4rem;
  display: flex;
  align-items: center;
  z-index: 2;
  pointer-events: none;
}

.week-event {
  position: absolute;
  left: 3px;
  right: 3px;
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.4rem;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.week-event:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  z-index: 4;
}

.week-event.paid {
  background: var(--success-soft);
  border: 1px solid #a7f3d0;
  border-left: 3px solid var(--success);
  color: #065f46;
}

.week-event.unpaid {
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-left: 3px solid var(--warning);
  color: #92400e;
}

.week-event-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
}

.week-event-pill {
  font-size: 0.65rem;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
}

.week-event-title {
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.week-event-sub {
  font-size: 0.7rem;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}