.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

h1, h2, h3 {
  font-family: var(--font-heading);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 0.6rem 1.05rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

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

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

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

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

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

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

.btn-danger:hover:not(:disabled) {
  background: #fee2e2;
}

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

.stepper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.step-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.step-pill.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.step-pill.done {
  border-color: #bbf7d0;
  background: var(--success-soft);
  color: var(--success);
}

.wizard-layout {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 1.5rem;
  align-items: start;
}

.wizard-summary-sticky {
  position: sticky;
  top: 5rem;
}

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

.service-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  background: var(--surface);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.service-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.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.85rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

.service-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1rem;
}

.service-list-row {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.service-list-row:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

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

.calendar-grid-wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

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

.cal-weekdays,
.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.cal-weekdays span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.25rem 0;
}

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

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

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

.cal-day:disabled {
  color: var(--text-light);
  background: transparent;
  cursor: not-allowed;
  text-decoration: line-through;
}

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

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

.slot-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

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

.slot-btn:disabled {
  opacity: 0.4;
  text-decoration: line-through;
  cursor: not-allowed;
}

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

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

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

.field input,
.field select,
.field textarea {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--text);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--primary-soft);
  border-color: var(--primary);
}

.field-error {
  font-size: 0.78rem;
  color: var(--danger);
}

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

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.subtabs {
  display: flex;
  gap: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.3rem;
  border-radius: var(--radius-md);
}

.subtabs-scroll {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.subtab {
  border: none;
  background: transparent;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}

.subtab.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.subview {
  display: none;
}

.subview.active {
  display: block;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.toolbar-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.toolbar input,
.toolbar select {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.65rem;
  font-size: 0.85rem;
  background: var(--surface);
  color: var(--text);
}

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

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

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

th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  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;
}

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

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

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

.hours-row {
  display: grid;
  grid-template-columns: 130px 90px 1fr 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.theme-editor-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.theme-preview-frame {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-md);
}

.theme-preview-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.theme-preview-body {
  padding: 1.15rem;
  display: grid;
  gap: 0.85rem;
}

.color-swatch-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
}

.color-swatch-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.color-swatch-btn:hover {
  transform: scale(1.08);
}

.color-swatch-btn.active {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--surface);
}

.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: 40;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  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: 50;
}

.toast {
  background: #0f172a;
  color: #fff;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  box-shadow: var(--shadow-md);
}

.hidden {
  display: none !important;
}

@media (max-width: 860px) {
  .wizard-layout,
  .calendar-grid-wrap,
  .theme-editor-split {
    grid-template-columns: 1fr;
  }

  .wizard-summary-sticky {
    position: static;
  }

  .stepper {
    grid-template-columns: 1fr;
  }

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

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

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

.week-cal-grid {
  display: grid;
  grid-template-columns: 60px repeat(7, minmax(125px, 1fr));
  min-width: 935px;
}

.week-cal-corner {
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  position: sticky;
  left: 0;
  z-index: 4;
}

.week-cal-day-head {
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 0.55rem 0.5rem;
  text-align: center;
}

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

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

.week-cal-day-name {
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.week-cal-day-head.is-today .week-cal-day-name {
  color: var(--primary);
}

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

.week-cal-time-col {
  position: relative;
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky;
  left: 0;
  z-index: 3;
}

.week-cal-time-label {
  position: absolute;
  left: 0;
  right: 6px;
  transform: translateY(-50%);
  text-align: right;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
}

.week-cal-day-col {
  position: relative;
  border-right: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}

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

.week-cal-day-col.is-closed {
  background: repeating-linear-gradient(
    -45deg,
    var(--surface-subtle),
    var(--surface-subtle) 6px,
    var(--bg) 6px,
    var(--bg) 12px
  );
}

.week-cal-hour-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid var(--border);
  pointer-events: none;
}

.week-cal-half-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed var(--border);
  opacity: 0.65;
  pointer-events: none;
}

.week-cal-closed-region {
  position: absolute;
  left: 0;
  right: 0;
  background: rgba(148, 163, 184, 0.14);
  pointer-events: none;
}

.week-cal-blockout {
  position: absolute;
  left: 2px;
  right: 2px;
  background: var(--warning-soft);
  border-left: 3px solid var(--warning);
  color: var(--warning);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 4px;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

.week-cal-event {
  position: absolute;
  background: var(--primary-soft);
  border-left: 3px solid var(--primary);
  color: var(--text);
  border-radius: 5px;
  padding: 3px 6px;
  font-size: 0.75rem;
  line-height: 1.25;
  overflow: hidden;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.week-cal-event:hover {
  z-index: 5;
  box-shadow: var(--shadow-md);
}

.week-cal-event.is-paid {
  background: var(--success-soft);
  border-left-color: var(--success);
}

.week-cal-event-time {
  font-weight: 700;
  font-size: 0.7rem;
  color: var(--primary);
  white-space: nowrap;
}

.week-cal-event.is-paid .week-cal-event-time {
  color: var(--success);
}

.week-cal-event-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.week-cal-event-sub {
  color: var(--text-muted);
  font-size: 0.68rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.week-cal-now-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 2px solid var(--danger);
  z-index: 4;
  pointer-events: none;
}

.week-cal-now-line::before {
  content: '';
  position: absolute;
  left: -4px;
  top: -4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
}