.appointments-app {
  position: relative;
  margin-top: 2rem;
  padding: 1.5rem;
  border: 1px solid #d9d9d9;
  border-radius: 16px;
  background: #f8f8f8;
}

.appointments-global-loading {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.72);
  z-index: 40;
  border-radius: 16px;
}

.appointments-global-loading.is-active {
  display: flex;
}

.appointments-global-loading__box {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid #d5deeb;
  background: #fff;
  color: #0f5f4f;
  font-weight: 700;
}

.appointments-global-loading__spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #b7cad5;
  border-top-color: #0f5f4f;
  border-radius: 50%;
  animation: appointments-spin 0.8s linear infinite;
}

@keyframes appointments-spin {
  to {
    transform: rotate(360deg);
  }
}

.appointments-title {
  margin: 0;
  font-size: 1.8rem;
}

.appointments-subtitle {
  margin: 0.4rem 0 0;
  color: #4d4d4d;
}

.appointments-grid {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.appointments-grid--single {
  grid-template-columns: 1fr;
}

.appointments-card {
  background: #ffffff;
  border: 1px solid #e2e2e2;
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.appointments-card-title {
  margin: 0 0 0.8rem;
  font-size: 1.2rem;
}

.appointments-table {
  margin-bottom: 0;
  width: 100%;
  table-layout: auto;
}

.appointments-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.appointments-table th,
.appointments-table td {
  white-space: nowrap;
}

.appointments-table--admin {
  font-size: 0.95rem;
}

.appointments-table--admin th,
.appointments-table--admin td {
  white-space: normal;
  vertical-align: middle;
}

.appointments-table--admin th:first-child,
.appointments-table--admin td:first-child {
  min-width: 170px;
}

.appointments-table--admin th:nth-child(3),
.appointments-table--admin td:nth-child(3),
.appointments-table--admin th:nth-child(4),
.appointments-table--admin td:nth-child(4),
.appointments-table--admin th:nth-child(5),
.appointments-table--admin td:nth-child(5) {
  word-break: break-word;
}

.appointments-table--admin th:nth-child(4),
.appointments-table--admin td:nth-child(4) {
  min-width: 130px;
  white-space: nowrap;
}

.appointments-table--admin th:nth-child(5),
.appointments-table--admin td:nth-child(5) {
  max-width: 170px;
}

.appointments-table--admin td:last-child .btn {
  margin-bottom: 0.45rem;
}

.appointments-table--admin td:last-child .btn:last-child {
  margin-bottom: 0;
}

.appointments-admin-when {
  display: grid;
  gap: 0.1rem;
  line-height: 1.2;
}

.appointments-admin-when strong {
  font-weight: 700;
  color: #2d3945;
}

.appointments-row--cancelled td {
  background: #fff0f0;
}

.appointments-status {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.appointments-status--pending {
  background: #fff5d4;
  color: #8a6d1f;
}

.appointments-status--confirmed {
  background: #dff6e7;
  color: #1e6b39;
}

.appointments-status--cancelled {
  background: #fbe2e2;
  color: #8a2f2f;
}

.appointments-form-row {
  margin-bottom: 0.9rem;
}

.appointments-form-row label,
.appointments-label {
  font-weight: 600;
  margin-bottom: 0.25rem;
  display: block;
}

.appointments-form-row input,
.appointments-form-row select,
.appointments-form-row textarea {
  width: 100%;
  border: 1px solid #cfcfcf;
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  background: #fff;
}

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

.appointments-booking-step {
  display: none;
}

.appointments-booking-step.is-active {
  display: block;
}

.appointments-stepper {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.9rem;
  font-weight: 700;
}

.appointments-stepper span {
  color: #5f6770;
}

.appointments-stepper .is-active {
  color: #1f6fe5;
}

.appointments-booking-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
  margin-bottom: 0.9rem;
}

.appointments-booking-panel {
  border: 1px solid #d8dfdf;
  border-radius: 12px;
  padding: 0.9rem;
  background: #fff;
}

.appointments-booking-panel-title {
  margin: 0 0 0.8rem;
}

.appointments-booking-summary {
  border: 1px solid #d8dfdf;
  border-radius: 12px;
  background: #f9fafc;
  padding: 0.8rem;
  margin-bottom: 0.9rem;
  display: grid;
  gap: 0.2rem;
}

.appointments-calendar-head {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.appointments-calendar-head strong {
  text-align: center;
  text-transform: capitalize;
}

.appointments-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(34px, 1fr));
  gap: 0.35rem;
}

.appointments-calendar-weekday {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #5c6470;
}

.appointments-calendar-day {
  border: 1px solid #d5deeb;
  background: #fff;
  border-radius: 10px;
  min-height: 36px;
  text-align: center;
  font-weight: 700;
}

.appointments-calendar-day.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.appointments-calendar-day.is-selected {
  border-color: #1f6fe5;
  background: #1f6fe5;
  color: #fff;
}

.appointments-calendar-day.is-empty {
  border: 0;
  background: transparent;
}

.appointments-slots-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 0.55rem;
}

.appointments-radio-row {
  display: flex;
  gap: 1rem;
}

.appointments-radio-row label {
  font-weight: 400;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.appointments-radio-row input {
  width: auto;
}

.appointments-help {
  color: #555;
}

.appointments-scheduler {
  border: 1px solid #d8dfdf;
  border-radius: 12px;
  background: #fff;
  padding: 0.85rem;
  margin-bottom: 1rem;
}

.appointments-scheduler-head {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.appointments-scheduler-title {
  text-align: center;
  font-weight: 600;
}

.appointments-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid #0f5f4f;
  background: #fff;
  color: #0f5f4f;
  font-size: 1.2rem;
  line-height: 1;
}

.appointments-nav-btn:disabled {
  opacity: 0.35;
}

.appointments-days-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 0.7rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

.appointments-day-col {
  min-width: 120px;
}

.appointments-empty {
  color: #666;
  font-style: italic;
}

.appointments-day-head {
  margin-bottom: 0.55rem;
}

.appointments-day-head strong {
  display: block;
}

.appointments-day-head span {
  color: #666;
}

.appointments-day-slots {
  display: grid;
  gap: 0.45rem;
}

.appointments-slot {
  border: 1px solid #cde4de;
  border-radius: 999px;
  background: #d7f4ec;
  color: #0f5f4f;
  padding: 0.45rem 0.5rem;
  font-weight: 700;
  text-align: center;
}

.appointments-slot.is-disabled {
  background: #f2f2f2;
  color: #555;
  text-decoration: line-through;
  cursor: not-allowed;
}

.appointments-slot.is-selected {
  background: #0f5f4f;
  color: #fff;
  border-color: #0f5f4f;
}

.appointments-submit {
  background: #0f5f4f;
  color: #fff;
  border-radius: 10px;
  width: 100%;
  padding: 0.55rem 0.8rem;
}

.appointments-submit.is-loading,
.appointments-action-badge.is-loading,
.btn.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

.appointments-submit--secondary {
  background: #e9f0ee;
  border: 1px solid #b8cbc5;
  color: #0f5f4f;
}

.appointments-feedback {
  min-height: 1.2rem;
  margin: 0;
  font-weight: 600;
}

.appointments-feedback.is-error {
  color: #a12626;
}

.appointments-feedback.is-success {
  color: #156f45;
}

.is-hidden {
  display: none !important;
}

.appointments-link {
  color: #0f5f4f;
  font-weight: 600;
}

.appointments-action-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.appointments-action-badge i {
  font-size: 0.8rem;
}

.appointments-action-badge--calendar {
  background: #e3efff;
  color: #1f4f9e;
}

.appointments-action-badge--cancel {
  background: #fbe2e2;
  color: #8a2f2f;
}

.appointments-action-badge.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.btn.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.appointments-tabs-row {
  margin-top: 1rem;
}

.appointments-tab {
  width: auto;
  border: 1px solid #0f5f4f;
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  background: #fff;
  color: #0f5f4f;
  font-weight: 600;
}

.appointments-tab.is-active {
  background: #0f5f4f;
  color: #fff;
}

.appointments-tab-body {
  display: none;
  margin-top: 0.9rem;
}

.appointments-tab-body.is-active {
  display: block;
}

.appointments-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.appointments-modal.is-open {
  display: flex;
}

.appointments-modal-content {
  width: min(560px, calc(100vw - 2rem));
  background: #fff;
  border-radius: 12px;
  padding: 1rem;
}

.appointments-modal-content textarea {
  width: 100%;
  border: 1px solid #cfcfcf;
  border-radius: 8px;
  padding: 0.5rem;
}

.appointments-modal-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
}

.appointments-admin-edit-form {
  display: grid;
  gap: 0.5rem;
}

.appointments-calendar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  margin-bottom: 0.9rem;
}

.appointments-calendar-actions .appointments-submit {
  width: auto;
}

.appointments-calendar-wrap {
  border: 1px solid #d8dfdf;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.appointments-calendar-wrap iframe {
  width: 100%;
  min-height: 680px;
  border: 0;
}

.appointments-history-more {
  margin-top: 0.9rem;
}

.appointments-dt-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.appointments-dt-toolbar .dataTables_length,
.appointments-dt-toolbar .dataTables_filter {
  margin: 0;
}

.appointments-dt-toolbar .dataTables_filter {
  margin-left: auto;
}

.appointments-dt-status-slot {
  display: flex;
  align-items: center;
}

.appointments-dt-status-inline label {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.875rem;
}

.appointments-dt-status-inline__select {
  min-width: 130px;
  height: calc(1.5em + 0.5rem + 2px);
  padding: 0.25rem 0.5rem;
  border: 1px solid #ced4da;
  border-radius: 0.2rem;
  background: #fff;
}

@media (min-width: 992px) {
  .appointments-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  }

  .appointments-grid.appointments-grid--single {
    grid-template-columns: 1fr !important;
  }

  .appointments-booking-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 576px) {
  .appointments-form-row--inline {
    grid-template-columns: 1fr;
  }

  .appointments-tabs-row .col-4,
  .appointments-tabs-row .col-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .appointments-slots-grid {
    grid-template-columns: repeat(2, minmax(90px, 1fr));
  }
}
