/* ==============================================
   สายด่วนสุขภาพจิต 1323 — pages.css
   (extends style.css — must load after it)
   ============================================== */

/* ============================================================
   PAGE SHELL  –  ใช้ร่วมกันทุกหน้า sub-page
   ============================================================ */
.page-header {
  background: linear-gradient(
    135deg,
    var(--teal-dark) 0%,
    var(--teal-mid) 100%
  );
  padding: 32px 0 28px;
}
.page-header .container {
  display: flex;
  align-items: center;
  gap: 12px;
}
.page-header-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.page-header-text h1 {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  color: var(--white);
  margin-bottom: 2px;
}
.page-header-text p {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.65);
  font-family: "Sarabun", sans-serif;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 8px;
}
.breadcrumb a {
  color: rgba(255, 255, 255, 0.7);
  transition: color var(--transition);
}
.breadcrumb a:hover {
  color: var(--orange);
}
.breadcrumb-sep {
  font-size: 0.7rem;
}

.page-body {
  padding: 40px 0 72px;
}

/* ============================================================
   FORM CARD  –  ลงทะเบียน & เข้าสู่ระบบ
   ============================================================ */
.form-wrap {
  max-width: 680px;
  margin: 0 auto;
}
.form-wrap.narrow {
  max-width: 460px;
}

.form-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.form-card-header {
  background: linear-gradient(135deg, var(--teal-dark), var(--teal-mid));
  padding: 28px 32px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.form-card-header-icon {
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.form-card-header h2 {
  color: var(--white);
  font-size: 1.3rem;
  margin-bottom: 2px;
}
.form-card-header p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}

.form-body {
  padding: 32px;
}

/* Field groups */
.form-section-title {
  font-family: "Kanit", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal-light);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-200);
}
.form-row {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}
.form-row.cols-2 {
  grid-template-columns: 1fr 1fr;
}
.form-row.cols-3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.form-row.cols-1 {
  grid-template-columns: 1fr;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-700);
  font-family: "Sarabun", sans-serif;
  display: flex;
  align-items: center;
  gap: 4px;
}
.form-label .required {
  color: var(--coral);
  font-size: 0.7rem;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: "Sarabun", sans-serif;
  font-size: 0.95rem;
  color: var(--text-body);
  background: var(--white);
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
  outline: none;
  -webkit-appearance: none;
}
.form-control:focus {
  border-color: var(--teal-light);
  box-shadow: 0 0 0 3px rgba(46, 139, 165, 0.12);
}
.form-control:disabled {
  background: var(--gray-100);
  cursor: not-allowed;
  color: var(--gray-500);
}
.form-control.has-error {
  border-color: var(--coral);
}
.form-hint {
  font-size: 0.78rem;
  color: var(--gray-500);
}
.form-error {
  font-size: 0.78rem;
  color: var(--coral);
  display: none;
}
.form-control.has-error + .form-error {
  display: block;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B8A9A' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.input-group {
  position: relative;
}
.input-group .form-control {
  padding-left: 40px;
}
.input-group .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  pointer-events: none;
  color: var(--gray-500);
}
.input-group .input-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-500);
  font-size: 1rem;
  padding: 2px;
  transition: color var(--transition);
}
.input-group .input-toggle:hover {
  color: var(--teal-mid);
}

/* Checkbox / Radio */
.check-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--gray-700);
}
.check-item input[type="checkbox"],
.check-item input[type="radio"] {
  display: none;
}
.check-box {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 1.5px solid var(--gray-200);
  border-radius: 4px;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  background: var(--white);
}
.check-item input:checked ~ .check-box {
  background: var(--teal-mid);
  border-color: var(--teal-mid);
}
.check-item input:checked ~ .check-box::after {
  content: "✓";
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
}
.radio-box {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 1.5px solid var(--gray-200);
  border-radius: 50%;
  margin-top: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.check-item input:checked ~ .radio-box {
  border-color: var(--teal-mid);
}
.check-item input:checked ~ .radio-box::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal-mid);
}

/* PDPA consent box */
.consent-box {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--gray-500);
  line-height: 1.7;
  max-height: 120px;
  overflow-y: auto;
  margin-bottom: 12px;
}

/* Steps indicator */
.form-steps {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 20px 32px;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
}
.step-item {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 10px;
}
.step-item:last-child {
  flex: 0;
}
.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Kanit", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
  border: 2px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-500);
  transition: all var(--transition);
}
.step-item.active .step-dot {
  background: var(--teal-mid);
  border-color: var(--teal-mid);
  color: var(--white);
}
.step-item.done .step-dot {
  background: var(--sage);
  border-color: var(--sage);
  color: var(--white);
}
.step-item.done .step-dot::after {
  content: "✓";
}
.step-label {
  font-size: 0.78rem;
  color: var(--gray-500);
  font-family: "Sarabun", sans-serif;
  font-weight: 500;
  white-space: nowrap;
}
.step-item.active .step-label {
  color: var(--teal-mid);
  font-weight: 700;
}
.step-item.done .step-label {
  color: var(--sage-dark);
}
.step-line {
  flex: 1;
  height: 2px;
  background: var(--gray-200);
  margin: 0 4px;
  border-radius: 2px;
  transition: background var(--transition);
}
.step-line.done {
  background: var(--sage);
}

/* Form footer */
.form-footer {
  padding: 20px 32px;
  background: var(--gray-100);
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--teal-mid);
  color: var(--white);
  font-family: "Kanit", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  padding: 11px 28px;
  border-radius: var(--radius-xl);
  border: none;
  cursor: pointer;
  transition:
    background var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
  box-shadow: 0 4px 14px rgba(26, 92, 122, 0.35);
}
.btn-submit:hover {
  background: var(--teal-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 92, 122, 0.45);
}
.btn-submit.orange {
  background: var(--orange);
  box-shadow: 0 4px 14px rgba(245, 166, 35, 0.4);
}
.btn-submit.orange:hover {
  background: var(--orange-dark);
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  color: var(--gray-500);
  font-family: "Sarabun", sans-serif;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--gray-200);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-secondary:hover {
  background: var(--white);
  border-color: var(--gray-500);
  color: var(--gray-700);
}

/* Login extras */
.login-extras {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.login-extras a {
  color: var(--teal-light);
  transition: color var(--transition);
}
.login-extras a:hover {
  color: var(--teal-dark);
}

.divider-or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gray-500);
  font-size: 0.82rem;
  margin: 20px 0;
}
.divider-or::before,
.divider-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

.social-login {
  display: flex;
  gap: 10px;
}
.btn-social {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  cursor: pointer;
  font-family: "Sarabun", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-700);
  transition: all var(--transition);
}
.btn-social:hover {
  background: var(--gray-100);
  border-color: var(--gray-500);
}
.btn-social.thaid {
  border-color: #0073b7;
  color: #0073b7;
}
.btn-social.thaid:hover {
  background: rgba(0, 115, 183, 0.06);
}

.register-link {
  text-align: center;
  padding: 16px;
  font-size: 0.88rem;
  color: var(--gray-500);
  border-top: 1px solid var(--gray-200);
}
.register-link a {
  color: var(--teal-mid);
  font-weight: 600;
  transition: color var(--transition);
}
.register-link a:hover {
  color: var(--teal-dark);
}

/* ============================================================
   CALENDAR PAGE
   ============================================================ */
.calendar-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}
.calendar-main {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.calendar-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Calendar header */
.cal-header {
  background: linear-gradient(135deg, var(--teal-dark), var(--teal-mid));
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cal-header-center {
  text-align: center;
}
.cal-month-year {
  font-family: "Kanit", sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--white);
}
.cal-subtitle {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
}
.cal-nav {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1rem;
  transition: background var(--transition);
}
.cal-nav:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* Legend */
.cal-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 24px;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.78rem;
  color: var(--gray-500);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-dot.available {
  background: var(--sage);
}
.legend-dot.full {
  background: var(--coral);
}
.legend-dot.partial {
  background: var(--orange);
}
.legend-dot.today {
  background: var(--teal-light);
}
.legend-dot.closed {
  background: var(--gray-200);
}

/* Day headers */
.cal-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
}
.cal-day-name {
  text-align: center;
  padding: 10px 4px;
  font-family: "Kanit", sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-500);
  letter-spacing: 0.04em;
}
.cal-day-name.sun {
  color: var(--coral);
}
.cal-day-name.sat {
  color: var(--coral);
}

/* Calendar grid */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
}
.cal-cell {
  text-align: center;
  min-height: 80px;
  padding: 8px 6px 6px;
  border-right: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
  position: relative;
  cursor: pointer;
  transition: background var(--transition);
}
.cal-cell:nth-child(7n) {
  border-right: none;
}
.cal-cell:hover:not(.empty):not(.closed-day) {
  background: rgba(46, 139, 165, 0.06);
}

.cal-cell.empty {
  cursor: default;
  background: var(--gray-100);
  opacity: 0.4;
}
.cal-cell.closed-day {
  cursor: not-allowed;
}
.cal-cell.closed-day .cal-date {
  color: var(--gray-200);
}

.cal-date {
  text-align: center;
  font-family: "Kanit", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-700);
  line-height: 1;
  margin-bottom: 4px;
}
.cal-cell.is-today .cal-date {
  background: var(--teal-light);
  color: var(--white);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}
.cal-cell.selected {
  background: rgba(26, 92, 122, 0.08);
  outline: 2px solid var(--teal-mid);
  outline-offset: -2px;
  border-radius: 4px;
}
.cal-cell.selected .cal-date {
  color: var(--teal-mid);
}

.cal-cell.sun-col .cal-date {
  color: var(--coral);
}
.cal-cell.sat-col .cal-date {
  color: var(--coral);
}

/* Slot badges */
.slot-badges {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}
.slot-badge {
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: "Kanit", sans-serif;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}
.slot-badge.available {
  background: rgba(125, 184, 122, 0.18);
  color: var(--sage-dark);
}
.slot-badge.full {
  background: rgba(232, 97, 74, 0.12);
  color: var(--coral);
}
.slot-badge.partial {
  background: rgba(245, 166, 35, 0.15);
  color: var(--orange-dark);
}

/* Today marker dot */
.today-marker {
  position: absolute;
  bottom: 5px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal-light);
}

/* Sidebar cards */
.sidebar-card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.sidebar-card-header {
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-card-header h3 {
  font-family: "Kanit", sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--teal-dark);
}
.sidebar-card-body {
  padding: 16px 18px;
}

/* Time slots */
.time-slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.time-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-200);
  cursor: pointer;
  transition: all var(--transition);
}
.time-slot:hover:not(.full) {
  border-color: var(--teal-light);
  background: rgba(46, 139, 165, 0.05);
}
.time-slot.selected {
  border-color: var(--teal-mid);
  background: rgba(26, 92, 122, 0.07);
}
.time-slot.full {
  opacity: 0.5;
  cursor: not-allowed;
}
.time-slot-time {
  font-family: "Kanit", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--teal-dark);
}
.time-slot-info {
  text-align: right;
}
.time-slot-avail {
  font-size: 0.75rem;
  color: var(--sage-dark);
  font-weight: 600;
}
.time-slot-avail.warn {
  color: var(--orange-dark);
}
.time-slot-avail.full {
  color: var(--coral);
}
.time-slot-label {
  font-size: 0.7rem;
  color: var(--gray-500);
}

/* Selected info card */
.selected-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.selected-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.selected-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.selected-text {
  font-size: 0.88rem;
}
.selected-text strong {
  font-family: "Kanit", sans-serif;
  color: var(--teal-dark);
  display: block;
  font-size: 0.92rem;
}
.selected-text span {
  color: var(--gray-500);
  font-size: 0.82rem;
}
.confirm-btn {
  width: 100%;
  margin-top: 4px;
  justify-content: center;
}

/* ── Responsive pages ── */
@media (max-width: 960px) {
  .calendar-layout {
    grid-template-columns: 1fr;
  }
  .calendar-main {
    order: 0;
  }
  .calendar-sidebar {
    order: 1;
  }
  .time-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .form-row.cols-2,
  .form-row.cols-3 {
    grid-template-columns: 1fr;
  }
  .form-body {
    padding: 20px;
  }
  .form-footer {
    padding: 16px 20px;
    flex-direction: column;
    align-items: stretch;
  }
  .form-footer .btn-submit {
    text-align: center;
    justify-content: center;
  }
  .form-steps {
    padding: 14px 16px;
  }
  .step-label {
    display: none;
  }
  .cal-cell {
    min-height: 56px;
    padding: 5px 3px;
  }
  .slot-badges {
    display: none;
  }
  .cal-day-name {
    font-size: 0.7rem;
    padding: 8px 2px;
  }
  .time-slots {
    grid-template-columns: 1fr;
  }
  .social-login {
    flex-direction: column;
  }
}

/* ==============================================
   สายด่วนสุขภาพจิต 1323 — pages.css
   (extends style.css — must load after it)
   ============================================== */

/* ============================================================
   PAGE SHELL  –  ใช้ร่วมกันทุกหน้า sub-page
   ============================================================ */
.page-header {
  background: linear-gradient(
    135deg,
    var(--teal-dark) 0%,
    var(--teal-mid) 100%
  );
  padding: 32px 0 28px;
}
.page-header .container {
  display: flex;
  align-items: center;
  gap: 12px;
}
.page-header-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.page-header-text h1 {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  color: var(--white);
  margin-bottom: 2px;
}
.page-header-text p {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.65);
  font-family: "Sarabun", sans-serif;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 8px;
}
.breadcrumb a {
  color: rgba(255, 255, 255, 0.7);
  transition: color var(--transition);
}
.breadcrumb a:hover {
  color: var(--orange);
}
.breadcrumb-sep {
  font-size: 0.7rem;
}

.page-body {
  padding: 40px 0 72px;
}

/* ============================================================
   FORM CARD  –  ลงทะเบียน & เข้าสู่ระบบ
   ============================================================ */
.form-wrap {
  max-width: 680px;
  margin: 0 auto;
}
.form-wrap.narrow {
  max-width: 460px;
}

.form-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.form-card-header {
  background: linear-gradient(135deg, var(--teal-dark), var(--teal-mid));
  padding: 28px 32px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.form-card-header-icon {
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.form-card-header h2 {
  color: var(--white);
  font-size: 1.3rem;
  margin-bottom: 2px;
}
.form-card-header p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}

.form-body {
  padding: 32px;
}

/* Field groups */
.form-section-title {
  font-family: "Kanit", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal-light);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-200);
}
.form-row {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}
.form-row.cols-2 {
  grid-template-columns: 1fr 1fr;
}
.form-row.cols-3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.form-row.cols-1 {
  grid-template-columns: 1fr;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-700);
  font-family: "Sarabun", sans-serif;
  display: flex;
  align-items: center;
  gap: 4px;
}
.form-label .required {
  color: var(--coral);
  font-size: 0.7rem;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: "Sarabun", sans-serif;
  font-size: 0.95rem;
  color: var(--text-body);
  background: var(--white);
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
  outline: none;
  -webkit-appearance: none;
}
.form-control:focus {
  border-color: var(--teal-light);
  box-shadow: 0 0 0 3px rgba(46, 139, 165, 0.12);
}
.form-control:disabled {
  background: var(--gray-100);
  cursor: not-allowed;
  color: var(--gray-500);
}
.form-control.has-error {
  border-color: var(--coral);
}
.form-hint {
  font-size: 0.78rem;
  color: var(--gray-500);
}
.form-error {
  font-size: 0.78rem;
  color: var(--coral);
  display: none;
}
.form-control.has-error + .form-error {
  display: block;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B8A9A' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.input-group {
  position: relative;
}
.input-group .form-control {
  padding-left: 40px;
}
.input-group .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  pointer-events: none;
  color: var(--gray-500);
}
.input-group .input-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-500);
  font-size: 1rem;
  padding: 2px;
  transition: color var(--transition);
}
.input-group .input-toggle:hover {
  color: var(--teal-mid);
}

/* Checkbox / Radio */
.check-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--gray-700);
}
.check-item input[type="checkbox"],
.check-item input[type="radio"] {
  display: none;
}
.check-box {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 1.5px solid var(--gray-200);
  border-radius: 4px;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  background: var(--white);
}
.check-item input:checked ~ .check-box {
  background: var(--teal-mid);
  border-color: var(--teal-mid);
}
.check-item input:checked ~ .check-box::after {
  content: "✓";
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
}
.radio-box {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 1.5px solid var(--gray-200);
  border-radius: 50%;
  margin-top: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.check-item input:checked ~ .radio-box {
  border-color: var(--teal-mid);
}
.check-item input:checked ~ .radio-box::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal-mid);
}

/* PDPA consent box */
.consent-box {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--gray-500);
  line-height: 1.7;
  max-height: 120px;
  overflow-y: auto;
  margin-bottom: 12px;
}

/* Steps indicator */
.form-steps {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 20px 32px;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
}
.step-item {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 10px;
}
.step-item:last-child {
  flex: 0;
}
.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Kanit", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
  border: 2px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-500);
  transition: all var(--transition);
}
.step-item.active .step-dot {
  background: var(--teal-mid);
  border-color: var(--teal-mid);
  color: var(--white);
}
.step-item.done .step-dot {
  background: var(--sage);
  border-color: var(--sage);
  color: var(--white);
}
.step-item.done .step-dot::after {
  content: "✓";
}
.step-label {
  font-size: 0.78rem;
  color: var(--gray-500);
  font-family: "Sarabun", sans-serif;
  font-weight: 500;
  white-space: nowrap;
}
.step-item.active .step-label {
  color: var(--teal-mid);
  font-weight: 700;
}
.step-item.done .step-label {
  color: var(--sage-dark);
}
.step-line {
  flex: 1;
  height: 2px;
  background: var(--gray-200);
  margin: 0 4px;
  border-radius: 2px;
  transition: background var(--transition);
}
.step-line.done {
  background: var(--sage);
}

/* Form footer */
.form-footer {
  padding: 20px 32px;
  background: var(--gray-100);
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--teal-mid);
  color: var(--white);
  font-family: "Kanit", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  padding: 11px 28px;
  border-radius: var(--radius-xl);
  border: none;
  cursor: pointer;
  transition:
    background var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
  box-shadow: 0 4px 14px rgba(26, 92, 122, 0.35);
}
.btn-submit:hover {
  background: var(--teal-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 92, 122, 0.45);
}
.btn-submit.orange {
  background: var(--orange);
  box-shadow: 0 4px 14px rgba(245, 166, 35, 0.4);
}
.btn-submit.orange:hover {
  background: var(--orange-dark);
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  color: var(--gray-500);
  font-family: "Sarabun", sans-serif;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--gray-200);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-secondary:hover {
  background: var(--white);
  border-color: var(--gray-500);
  color: var(--gray-700);
}

/* Login extras */
.login-extras {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.login-extras a {
  color: var(--teal-light);
  transition: color var(--transition);
}
.login-extras a:hover {
  color: var(--teal-dark);
}

.divider-or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gray-500);
  font-size: 0.82rem;
  margin: 20px 0;
}
.divider-or::before,
.divider-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

.social-login {
  display: flex;
  gap: 10px;
}
.btn-social {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  cursor: pointer;
  font-family: "Sarabun", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-700);
  transition: all var(--transition);
}
.btn-social:hover {
  background: var(--gray-100);
  border-color: var(--gray-500);
}
.btn-social.thaid {
  border-color: #0073b7;
  color: #0073b7;
}
.btn-social.thaid:hover {
  background: rgba(0, 115, 183, 0.06);
}

.register-link {
  text-align: center;
  padding: 16px;
  font-size: 0.88rem;
  color: var(--gray-500);
  border-top: 1px solid var(--gray-200);
}
.register-link a {
  color: var(--teal-mid);
  font-weight: 600;
  transition: color var(--transition);
}
.register-link a:hover {
  color: var(--teal-dark);
}

/* ============================================================
   CALENDAR PAGE
   ============================================================ */
.calendar-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}
.calendar-main {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.calendar-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Calendar header */
.cal-header {
  background: linear-gradient(135deg, var(--teal-dark), var(--teal-mid));
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cal-header-center {
  text-align: center;
}
.cal-month-year {
  font-family: "Kanit", sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--white);
}
.cal-subtitle {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
}
.cal-nav {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1rem;
  transition: background var(--transition);
}
.cal-nav:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* Legend */
.cal-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 24px;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.78rem;
  color: var(--gray-500);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-dot.available {
  background: var(--sage);
}
.legend-dot.full {
  background: var(--coral);
}
.legend-dot.partial {
  background: var(--orange);
}
.legend-dot.today {
  background: var(--teal-light);
}
.legend-dot.closed {
  background: var(--gray-200);
}

/* Day headers */
.cal-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
}
.cal-day-name {
  text-align: center;
  padding: 10px 4px;
  font-family: "Kanit", sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-500);
  letter-spacing: 0.04em;
}
.cal-day-name.sun {
  color: var(--coral);
}
.cal-day-name.sat {
  color: var(--teal-light);
}

/* Calendar grid */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
}
.cal-cell {
  min-height: 80px;
  padding: 8px 6px 6px;
  border-right: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
  position: relative;
  cursor: pointer;
  transition: background var(--transition);
}
.cal-cell:nth-child(7n) {
  border-right: none;
}
.cal-cell:hover:not(.empty):not(.closed-day) {
  background: rgba(46, 139, 165, 0.06);
}

.cal-cell.empty {
  cursor: default;
  background: var(--gray-100);
  opacity: 0.4;
}
.cal-cell.closed-day {
  cursor: not-allowed;
}
.cal-cell.closed-day .cal-date {
  color: var(--gray-200);
}

.cal-date {
  font-family: "Kanit", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-700);
  line-height: 1;
  margin-bottom: 4px;
}
.cal-cell.is-today .cal-date {
  background: var(--teal-light);
  color: var(--white);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}
.cal-cell.selected {
  background: rgba(26, 92, 122, 0.08);
  outline: 2px solid var(--teal-mid);
  outline-offset: -2px;
  border-radius: 4px;
}
.cal-cell.selected .cal-date {
  color: var(--teal-mid);
}

.cal-cell.sun-col .cal-date {
  color: var(--coral);
}
.cal-cell.sat-col .cal-date {
  color: var(--teal-light);
}

/* Slot badges */
.slot-badges {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}
.slot-badge {
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: "Kanit", sans-serif;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}
.slot-badge.available {
  background: rgba(125, 184, 122, 0.18);
  color: var(--sage-dark);
}
.slot-badge.full {
  background: rgba(232, 97, 74, 0.12);
  color: var(--coral);
}
.slot-badge.partial {
  background: rgba(245, 166, 35, 0.15);
  color: var(--orange-dark);
}

/* Today marker dot */
.today-marker {
  position: absolute;
  bottom: 5px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal-light);
}

/* Sidebar cards */
.sidebar-card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.sidebar-card-header {
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-card-header h3 {
  font-family: "Kanit", sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--teal-dark);
}
.sidebar-card-body {
  padding: 16px 18px;
}

/* Time slots */
.time-slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.time-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-200);
  cursor: pointer;
  transition: all var(--transition);
}
.time-slot:hover:not(.full) {
  border-color: var(--teal-light);
  background: rgba(46, 139, 165, 0.05);
}
.time-slot.selected {
  border-color: var(--teal-mid);
  background: rgba(26, 92, 122, 0.07);
}
.time-slot.full {
  opacity: 0.5;
  cursor: not-allowed;
}
.time-slot-time {
  font-family: "Kanit", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--teal-dark);
}
.time-slot-info {
  text-align: right;
}
.time-slot-avail {
  font-size: 0.75rem;
  color: var(--sage-dark);
  font-weight: 600;
}
.time-slot-avail.warn {
  color: var(--orange-dark);
}
.time-slot-avail.full {
  color: var(--coral);
}
.time-slot-label {
  font-size: 0.7rem;
  color: var(--gray-500);
}

/* Selected info card */
.selected-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.selected-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.selected-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.selected-text {
  font-size: 0.88rem;
}
.selected-text strong {
  font-family: "Kanit", sans-serif;
  color: var(--teal-dark);
  display: block;
  font-size: 0.92rem;
}
.selected-text span {
  color: var(--gray-500);
  font-size: 0.82rem;
}
.confirm-btn {
  width: 100%;
  margin-top: 4px;
  justify-content: center;
}

/* ── Responsive pages ── */
@media (max-width: 960px) {
  .calendar-layout {
    grid-template-columns: 1fr;
  }
  .calendar-sidebar {
    order: -1;
  }
  .time-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .form-row.cols-2,
  .form-row.cols-3 {
    grid-template-columns: 1fr;
  }
  .form-body {
    padding: 20px;
  }
  .form-footer {
    padding: 16px 20px;
    flex-direction: column;
    align-items: stretch;
  }
  .form-footer .btn-submit {
    text-align: center;
    justify-content: center;
  }
  .form-steps {
    padding: 14px 16px;
  }
  .step-label {
    display: none;
  }
  .cal-cell {
    min-height: 56px;
    padding: 5px 3px;
  }
  .slot-badges {
    display: none;
  }
  .cal-day-name {
    font-size: 0.7rem;
    padding: 8px 2px;
  }
  .time-slots {
    grid-template-columns: 1fr;
  }
  .social-login {
    flex-direction: column;
  }
}

/* ============================================================
   ALERT MESSAGES
   ============================================================ */
.form-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: "Sarabun", sans-serif;
  line-height: 1.55;
  margin: 0 32px 0;
}
.form-alert::before {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.form-alert.success {
  background: rgba(125, 184, 122, 0.12);
  border: 1px solid rgba(125, 184, 122, 0.35);
  color: var(--sage-dark);
}
.form-alert.success::before {
  content: "✅";
}
.form-alert.error {
  background: rgba(232, 97, 74, 0.08);
  border: 1px solid rgba(232, 97, 74, 0.28);
  color: #c0392b;
}
.form-alert.error::before {
  content: "❌";
}
.form-alert.warning {
  background: rgba(245, 166, 35, 0.1);
  border: 1px solid rgba(245, 166, 35, 0.35);
  color: var(--orange-dark);
}
.form-alert.warning::before {
  content: "⚠️";
}

/* ============================================================
   CLOSED-DATE LIST CARD
   ============================================================ */
.list-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-top: 24px;
}
.list-card-header {
  background: linear-gradient(135deg, var(--teal-dark), var(--teal-mid));
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.list-card-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.list-card-header-icon {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.list-card-header h3 {
  font-family: "Kanit", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 1px;
}
.list-card-header p {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
}
.list-count-badge {
  background: rgba(255, 255, 255, 0.18);
  color: var(--white);
  font-family: "Kanit", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Filter bar */
.list-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
  flex-wrap: wrap;
}
.list-search {
  flex: 1;
  min-width: 160px;
  position: relative;
}
.list-search input {
  width: 100%;
  padding: 7px 12px 7px 34px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-xl);
  font-family: "Sarabun", sans-serif;
  font-size: 0.85rem;
  color: var(--text-body);
  background: var(--white);
  outline: none;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}
.list-search input:focus {
  border-color: var(--teal-light);
  box-shadow: 0 0 0 3px rgba(46, 139, 165, 0.1);
}
.list-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  pointer-events: none;
  color: var(--gray-500);
}
.list-filter-select {
  padding: 7px 30px 7px 10px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-xl);
  font-family: "Sarabun", sans-serif;
  font-size: 0.85rem;
  color: var(--text-body);
  background: var(--white)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236B8A9A' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat right 10px center;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}
.list-filter-select:focus {
  border-color: var(--teal-light);
}

/* Table */
.closed-date-table {
  width: 100%;
  border-collapse: collapse;
}
.closed-date-table thead tr {
  background: var(--gray-100);
  border-bottom: 2px solid var(--gray-200);
}
.closed-date-table th {
  padding: 11px 20px;
  text-align: left;
  font-family: "Kanit", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-500);
  white-space: nowrap;
}
.closed-date-table th.th-center {
  text-align: center;
}
.closed-date-table tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--transition);
}
.closed-date-table tbody tr:last-child {
  border-bottom: none;
}
.closed-date-table tbody tr:hover {
  background: rgba(46, 139, 165, 0.04);
}
.closed-date-table td {
  padding: 13px 20px;
  font-size: 0.9rem;
  color: var(--text-body);
  vertical-align: middle;
}
.closed-date-table td.td-center {
  text-align: center;
}

/* Date cell */
.date-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.date-icon-wrap {
  width: 38px;
  height: 38px;
  background: rgba(232, 97, 74, 0.08);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.date-main {
  font-family: "Kanit", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--teal-dark);
  line-height: 1.2;
}
.date-sub {
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* Reason cell */
.reason-text {
  color: var(--gray-700);
  font-size: 0.88rem;
}
.reason-empty {
  color: var(--gray-200);
  font-size: 0.82rem;
  font-style: italic;
}

/* Status badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-family: "Kanit", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.status-badge.upcoming {
  background: rgba(245, 166, 35, 0.12);
  color: var(--orange-dark);
}
.status-badge.past {
  background: var(--gray-100);
  color: var(--gray-500);
}
.status-badge.today {
  background: rgba(232, 97, 74, 0.1);
  color: var(--coral);
}

/* Delete button */
.btn-delete {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border: 1.5px solid rgba(232, 97, 74, 0.35);
  border-radius: var(--radius-xl);
  background: transparent;
  color: var(--coral);
  font-family: "Sarabun", sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-delete:hover {
  background: var(--coral);
  border-color: var(--coral);
  color: var(--white);
  box-shadow: 0 3px 10px rgba(232, 97, 74, 0.3);
}
.btn-delete:active {
  transform: scale(0.97);
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 52px 24px;
  gap: 12px;
  text-align: center;
}
.empty-state-icon {
  font-size: 3rem;
  opacity: 0.35;
}
.empty-state h4 {
  font-family: "Kanit", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-500);
}
.empty-state p {
  font-size: 0.85rem;
  color: var(--gray-200);
}

/* Table footer / pagination */
.list-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--gray-100);
  border-top: 1px solid var(--gray-200);
  font-size: 0.82rem;
  color: var(--gray-500);
  flex-wrap: wrap;
  gap: 8px;
}
.list-pagination {
  display: flex;
  gap: 4px;
}
.page-btn {
  width: 30px;
  height: 30px;
  border: 1.5px solid var(--gray-200);
  border-radius: 6px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-family: "Kanit", sans-serif;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--gray-700);
}
.page-btn:hover {
  border-color: var(--teal-light);
  color: var(--teal-mid);
}
.page-btn.active {
  background: var(--teal-mid);
  border-color: var(--teal-mid);
  color: var(--white);
}
.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Delete confirm modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 59, 79, 0.45);
  backdrop-filter: blur(3px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px 28px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.22s ease;
}
.modal-overlay.open .modal-box {
  transform: translateY(0) scale(1);
}
.modal-icon {
  font-size: 2.8rem;
  margin-bottom: 12px;
}
.modal-box h3 {
  font-family: "Kanit", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: 8px;
}
.modal-box p {
  font-size: 0.9rem;
  color: var(--gray-500);
  line-height: 1.6;
  margin-bottom: 20px;
}
.modal-date-chip {
  display: inline-block;
  background: rgba(232, 97, 74, 0.1);
  color: var(--coral);
  font-family: "Kanit", sans-serif;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 99px;
  font-size: 0.9rem;
  margin-bottom: 20px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.btn-confirm-delete {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  background: var(--coral);
  color: var(--white);
  border: none;
  border-radius: var(--radius-xl);
  font-family: "Kanit", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(232, 97, 74, 0.35);
  transition: all var(--transition);
}
.btn-confirm-delete:hover {
  background: #d0432e;
  transform: translateY(-1px);
}
.btn-cancel-modal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  background: none;
  color: var(--gray-500);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-xl);
  font-family: "Sarabun", sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-cancel-modal:hover {
  background: var(--gray-100);
  border-color: var(--gray-500);
  color: var(--gray-700);
}

/* Responsive table → card layout on mobile */
@media (max-width: 640px) {
  .closed-date-table thead {
    display: none;
  }
  .closed-date-table,
  .closed-date-table tbody,
  .closed-date-table tr,
  .closed-date-table td {
    display: block;
    width: 100%;
  }
  .closed-date-table tbody tr {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    position: relative;
  }
  .closed-date-table td {
    padding: 3px 0;
    border: none;
  }
  .closed-date-table td.td-center {
    text-align: left;
  }
  .closed-date-table td[data-label]::before {
    content: attr(data-label) ": ";
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 2px;
  }
  .btn-delete {
    margin-top: 10px;
    width: 100%;
    justify-content: center;
  }
  .list-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .list-search {
    min-width: unset;
  }
  .form-alert {
    margin: 0 20px 0;
  }
}

/* ==============================================
   สายด่วนสุขภาพจิต 1323 — pages.css
   (extends style.css — must load after it)
   ============================================== */

/* ============================================================
   PAGE SHELL  –  ใช้ร่วมกันทุกหน้า sub-page
   ============================================================ */
.page-header {
  background: linear-gradient(
    135deg,
    var(--teal-dark) 0%,
    var(--teal-mid) 100%
  );
  padding: 32px 0 28px;
}
.page-header .container {
  display: flex;
  align-items: center;
  gap: 12px;
}
.page-header-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.page-header-text h1 {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  color: var(--white);
  margin-bottom: 2px;
}
.page-header-text p {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.65);
  font-family: "Sarabun", sans-serif;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 8px;
}
.breadcrumb a {
  color: rgba(255, 255, 255, 0.7);
  transition: color var(--transition);
}
.breadcrumb a:hover {
  color: var(--orange);
}
.breadcrumb-sep {
  font-size: 0.7rem;
}

.page-body {
  padding: 40px 0 72px;
}

/* ============================================================
   FORM CARD  –  ลงทะเบียน & เข้าสู่ระบบ
   ============================================================ */
.form-wrap {
  max-width: 680px;
  margin: 0 auto;
}
.form-wrap.narrow {
  max-width: 460px;
}

.form-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.form-card-header {
  background: linear-gradient(135deg, var(--teal-dark), var(--teal-mid));
  padding: 28px 32px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.form-card-header-icon {
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.form-card-header h2 {
  color: var(--white);
  font-size: 1.3rem;
  margin-bottom: 2px;
}
.form-card-header p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}

.form-body {
  padding: 32px;
}

/* Field groups */
.form-section-title {
  font-family: "Kanit", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal-light);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-200);
}
.form-row {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}
.form-row.cols-2 {
  grid-template-columns: 1fr 1fr;
}
.form-row.cols-3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.form-row.cols-1 {
  grid-template-columns: 1fr;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-700);
  font-family: "Sarabun", sans-serif;
  display: flex;
  align-items: center;
  gap: 4px;
}
.form-label .required {
  color: var(--coral);
  font-size: 0.7rem;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: "Sarabun", sans-serif;
  font-size: 0.95rem;
  color: var(--text-body);
  background: var(--white);
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
  outline: none;
  -webkit-appearance: none;
}
.form-control:focus {
  border-color: var(--teal-light);
  box-shadow: 0 0 0 3px rgba(46, 139, 165, 0.12);
}
.form-control:disabled {
  background: var(--gray-100);
  cursor: not-allowed;
  color: var(--gray-500);
}
.form-control.has-error {
  border-color: var(--coral);
}
.form-hint {
  font-size: 0.78rem;
  color: var(--gray-500);
}
.form-error {
  font-size: 0.78rem;
  color: var(--coral);
  display: none;
}
.form-control.has-error + .form-error {
  display: block;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B8A9A' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.input-group {
  position: relative;
}
.input-group .form-control {
  padding-left: 40px;
}
.input-group .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  pointer-events: none;
  color: var(--gray-500);
}
.input-group .input-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-500);
  font-size: 1rem;
  padding: 2px;
  transition: color var(--transition);
}
.input-group .input-toggle:hover {
  color: var(--teal-mid);
}

/* Checkbox / Radio */
.check-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--gray-700);
}
.check-item input[type="checkbox"],
.check-item input[type="radio"] {
  display: none;
}
.check-box {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 1.5px solid var(--gray-200);
  border-radius: 4px;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  background: var(--white);
}
.check-item input:checked ~ .check-box {
  background: var(--teal-mid);
  border-color: var(--teal-mid);
}
.check-item input:checked ~ .check-box::after {
  content: "✓";
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
}
.radio-box {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 1.5px solid var(--gray-200);
  border-radius: 50%;
  margin-top: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.check-item input:checked ~ .radio-box {
  border-color: var(--teal-mid);
}
.check-item input:checked ~ .radio-box::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal-mid);
}

/* PDPA consent box */
.consent-box {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--gray-500);
  line-height: 1.7;
  max-height: 120px;
  overflow-y: auto;
  margin-bottom: 12px;
}

/* Steps indicator */
.form-steps {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 20px 32px;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
}
.step-item {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 10px;
}
.step-item:last-child {
  flex: 0;
}
.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Kanit", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
  border: 2px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-500);
  transition: all var(--transition);
}
.step-item.active .step-dot {
  background: var(--teal-mid);
  border-color: var(--teal-mid);
  color: var(--white);
}
.step-item.done .step-dot {
  background: var(--sage);
  border-color: var(--sage);
  color: var(--white);
}
.step-item.done .step-dot::after {
  content: "✓";
}
.step-label {
  font-size: 0.78rem;
  color: var(--gray-500);
  font-family: "Sarabun", sans-serif;
  font-weight: 500;
  white-space: nowrap;
}
.step-item.active .step-label {
  color: var(--teal-mid);
  font-weight: 700;
}
.step-item.done .step-label {
  color: var(--sage-dark);
}
.step-line {
  flex: 1;
  height: 2px;
  background: var(--gray-200);
  margin: 0 4px;
  border-radius: 2px;
  transition: background var(--transition);
}
.step-line.done {
  background: var(--sage);
}

/* Form footer */
.form-footer {
  padding: 20px 32px;
  background: var(--gray-100);
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--teal-mid);
  color: var(--white);
  font-family: "Kanit", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  padding: 11px 28px;
  border-radius: var(--radius-xl);
  border: none;
  cursor: pointer;
  transition:
    background var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
  box-shadow: 0 4px 14px rgba(26, 92, 122, 0.35);
}
.btn-submit:hover {
  background: var(--teal-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 92, 122, 0.45);
}
.btn-submit.orange {
  background: var(--orange);
  box-shadow: 0 4px 14px rgba(245, 166, 35, 0.4);
}
.btn-submit.orange:hover {
  background: var(--orange-dark);
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  color: var(--gray-500);
  font-family: "Sarabun", sans-serif;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--gray-200);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-secondary:hover {
  background: var(--white);
  border-color: var(--gray-500);
  color: var(--gray-700);
}

/* Login extras */
.login-extras {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.login-extras a {
  color: var(--teal-light);
  transition: color var(--transition);
}
.login-extras a:hover {
  color: var(--teal-dark);
}

.divider-or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gray-500);
  font-size: 0.82rem;
  margin: 20px 0;
}
.divider-or::before,
.divider-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

.social-login {
  display: flex;
  gap: 10px;
}
.btn-social {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  cursor: pointer;
  font-family: "Sarabun", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-700);
  transition: all var(--transition);
}
.btn-social:hover {
  background: var(--gray-100);
  border-color: var(--gray-500);
}
.btn-social.thaid {
  border-color: #0073b7;
  color: #0073b7;
}
.btn-social.thaid:hover {
  background: rgba(0, 115, 183, 0.06);
}

.register-link {
  text-align: center;
  padding: 16px;
  font-size: 0.88rem;
  color: var(--gray-500);
  border-top: 1px solid var(--gray-200);
}
.register-link a {
  color: var(--teal-mid);
  font-weight: 600;
  transition: color var(--transition);
}
.register-link a:hover {
  color: var(--teal-dark);
}

/* ============================================================
   CALENDAR PAGE
   ============================================================ */
.calendar-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}
.calendar-main {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.calendar-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Calendar header */
.cal-header {
  background: linear-gradient(135deg, var(--teal-dark), var(--teal-mid));
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cal-header-center {
  text-align: center;
}
.cal-month-year {
  font-family: "Kanit", sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--white);
}
.cal-subtitle {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
}
.cal-nav {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1rem;
  transition: background var(--transition);
}
.cal-nav:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* Legend */
.cal-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 24px;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.78rem;
  color: var(--gray-500);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-dot.available {
  background: var(--sage);
}
.legend-dot.full {
  background: var(--coral);
}
.legend-dot.partial {
  background: var(--orange);
}
.legend-dot.today {
  background: var(--teal-light);
}
.legend-dot.closed {
  background: var(--gray-200);
}

/* Day headers */
.cal-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
}
.cal-day-name {
  text-align: center;
  padding: 10px 4px;
  font-family: "Kanit", sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-500);
  letter-spacing: 0.04em;
}
.cal-day-name.sun {
  color: var(--coral);
}
.cal-day-name.sat {
  color: var(--teal-light);
}

/* Calendar grid */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
}
.cal-cell {
  min-height: 80px;
  padding: 8px 6px 6px;
  border-right: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
  position: relative;
  cursor: pointer;
  transition: background var(--transition);
}
.cal-cell:nth-child(7n) {
  border-right: none;
}
.cal-cell:hover:not(.empty):not(.closed-day) {
  background: rgba(46, 139, 165, 0.06);
}

.cal-cell.empty {
  cursor: default;
  background: var(--gray-100);
  opacity: 0.4;
}
.cal-cell.closed-day {
  cursor: not-allowed;
}
.cal-cell.closed-day .cal-date {
  color: var(--gray-200);
}

.cal-date {
  font-family: "Kanit", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-700);
  line-height: 1;
  margin-bottom: 4px;
}
.cal-cell.is-today .cal-date {
  background: var(--teal-light);
  color: var(--white);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}
.cal-cell.selected {
  background: rgba(26, 92, 122, 0.08);
  outline: 2px solid var(--teal-mid);
  outline-offset: -2px;
  border-radius: 4px;
}
.cal-cell.selected .cal-date {
  color: var(--teal-mid);
}

.cal-cell.sun-col .cal-date {
  color: var(--coral);
}
.cal-cell.sat-col .cal-date {
  color: var(--teal-light);
}

/* Slot badges */
.slot-badges {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}
.slot-badge {
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: "Kanit", sans-serif;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}
.slot-badge.available {
  background: rgba(125, 184, 122, 0.18);
  color: var(--sage-dark);
}
.slot-badge.full {
  background: rgba(232, 97, 74, 0.12);
  color: var(--coral);
}
.slot-badge.partial {
  background: rgba(245, 166, 35, 0.15);
  color: var(--orange-dark);
}

/* Today marker dot */
.today-marker {
  position: absolute;
  bottom: 5px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal-light);
}

/* Sidebar cards */
.sidebar-card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.sidebar-card-header {
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-card-header h3 {
  font-family: "Kanit", sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--teal-dark);
}
.sidebar-card-body {
  padding: 16px 18px;
}

/* Time slots */
.time-slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.time-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-200);
  cursor: pointer;
  transition: all var(--transition);
}
.time-slot:hover:not(.full) {
  border-color: var(--teal-light);
  background: rgba(46, 139, 165, 0.05);
}
.time-slot.selected {
  border-color: var(--teal-mid);
  background: rgba(26, 92, 122, 0.07);
}
.time-slot.full {
  opacity: 0.5;
  cursor: not-allowed;
}
.time-slot-time {
  font-family: "Kanit", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--teal-dark);
}
.time-slot-info {
  text-align: right;
}
.time-slot-avail {
  font-size: 0.75rem;
  color: var(--sage-dark);
  font-weight: 600;
}
.time-slot-avail.warn {
  color: var(--orange-dark);
}
.time-slot-avail.full {
  color: var(--coral);
}
.time-slot-label {
  font-size: 0.7rem;
  color: var(--gray-500);
}

/* Selected info card */
.selected-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.selected-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.selected-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.selected-text {
  font-size: 0.88rem;
}
.selected-text strong {
  font-family: "Kanit", sans-serif;
  color: var(--teal-dark);
  display: block;
  font-size: 0.92rem;
}
.selected-text span {
  color: var(--gray-500);
  font-size: 0.82rem;
}
.confirm-btn {
  width: 100%;
  margin-top: 4px;
  justify-content: center;
}

/* ── Responsive pages ── */
@media (max-width: 960px) {
  .calendar-layout {
    grid-template-columns: 1fr;
  }
  .calendar-sidebar {
    order: -1;
  }
  .time-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .form-row.cols-2,
  .form-row.cols-3 {
    grid-template-columns: 1fr;
  }
  .form-body {
    padding: 20px;
  }
  .form-footer {
    padding: 16px 20px;
    flex-direction: column;
    align-items: stretch;
  }
  .form-footer .btn-submit {
    text-align: center;
    justify-content: center;
  }
  .form-steps {
    padding: 14px 16px;
  }
  .step-label {
    display: none;
  }
  .cal-cell {
    min-height: 56px;
    padding: 5px 3px;
  }
  .slot-badges {
    display: none;
  }
  .cal-day-name {
    font-size: 0.7rem;
    padding: 8px 2px;
  }
  .time-slots {
    grid-template-columns: 1fr;
  }
  .social-login {
    flex-direction: column;
  }
}

/* ============================================================
   ALERT MESSAGES
   ============================================================ */
.form-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: "Sarabun", sans-serif;
  line-height: 1.55;
  margin: 0 32px 0;
}
.form-alert::before {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.form-alert.success {
  background: rgba(125, 184, 122, 0.12);
  border: 1px solid rgba(125, 184, 122, 0.35);
  color: var(--sage-dark);
}
.form-alert.success::before {
  content: "✅";
}
.form-alert.error {
  background: rgba(232, 97, 74, 0.08);
  border: 1px solid rgba(232, 97, 74, 0.28);
  color: #c0392b;
}
.form-alert.error::before {
  content: "❌";
}
.form-alert.warning {
  background: rgba(245, 166, 35, 0.1);
  border: 1px solid rgba(245, 166, 35, 0.35);
  color: var(--orange-dark);
}
.form-alert.warning::before {
  content: "⚠️";
}

/* ============================================================
   CLOSED-DATE LIST CARD
   ============================================================ */
.list-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-top: 24px;
}
.list-card-header {
  background: linear-gradient(135deg, var(--teal-dark), var(--teal-mid));
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.list-card-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.list-card-header-icon {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.list-card-header h3 {
  font-family: "Kanit", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 1px;
}
.list-card-header p {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
}
.list-count-badge {
  background: rgba(255, 255, 255, 0.18);
  color: var(--white);
  font-family: "Kanit", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Filter bar */
.list-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
  flex-wrap: wrap;
}
.list-search {
  flex: 1;
  min-width: 160px;
  position: relative;
}
.list-search input {
  width: 100%;
  padding: 7px 12px 7px 34px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-xl);
  font-family: "Sarabun", sans-serif;
  font-size: 0.85rem;
  color: var(--text-body);
  background: var(--white);
  outline: none;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}
.list-search input:focus {
  border-color: var(--teal-light);
  box-shadow: 0 0 0 3px rgba(46, 139, 165, 0.1);
}
.list-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  pointer-events: none;
  color: var(--gray-500);
}
.list-filter-select {
  padding: 7px 30px 7px 10px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-xl);
  font-family: "Sarabun", sans-serif;
  font-size: 0.85rem;
  color: var(--text-body);
  background: var(--white)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236B8A9A' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat right 10px center;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}
.list-filter-select:focus {
  border-color: var(--teal-light);
}

/* Table */
.closed-date-table {
  width: 100%;
  border-collapse: collapse;
}
.closed-date-table thead tr {
  background: var(--gray-100);
  border-bottom: 2px solid var(--gray-200);
}
.closed-date-table th {
  padding: 11px 20px;
  text-align: left;
  font-family: "Kanit", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-500);
  white-space: nowrap;
}
.closed-date-table th.th-center {
  text-align: center;
}
.closed-date-table tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--transition);
}
.closed-date-table tbody tr:last-child {
  border-bottom: none;
}
.closed-date-table tbody tr:hover {
  background: rgba(46, 139, 165, 0.04);
}
.closed-date-table td {
  padding: 13px 20px;
  font-size: 0.9rem;
  color: var(--text-body);
  vertical-align: middle;
}
.closed-date-table td.td-center {
  text-align: center;
}

/* Date cell */
.date-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.date-icon-wrap {
  width: 38px;
  height: 38px;
  background: rgba(232, 97, 74, 0.08);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.date-main {
  font-family: "Kanit", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--teal-dark);
  line-height: 1.2;
}
.date-sub {
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* Reason cell */
.reason-text {
  color: var(--gray-700);
  font-size: 0.88rem;
}
.reason-empty {
  color: var(--gray-200);
  font-size: 0.82rem;
  font-style: italic;
}

/* Status badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-family: "Kanit", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.status-badge.upcoming {
  background: rgba(245, 166, 35, 0.12);
  color: var(--orange-dark);
}
.status-badge.past {
  background: var(--gray-100);
  color: var(--gray-500);
}
.status-badge.today {
  background: rgba(232, 97, 74, 0.1);
  color: var(--coral);
}

/* Delete button */
.btn-delete {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border: 1.5px solid rgba(232, 97, 74, 0.35);
  border-radius: var(--radius-xl);
  background: transparent;
  color: var(--coral);
  font-family: "Sarabun", sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-delete:hover {
  background: var(--coral);
  border-color: var(--coral);
  color: var(--white);
  box-shadow: 0 3px 10px rgba(232, 97, 74, 0.3);
}
.btn-delete:active {
  transform: scale(0.97);
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 52px 24px;
  gap: 12px;
  text-align: center;
}
.empty-state-icon {
  font-size: 3rem;
  opacity: 0.35;
}
.empty-state h4 {
  font-family: "Kanit", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-500);
}
.empty-state p {
  font-size: 0.85rem;
  color: var(--gray-200);
}

/* Table footer / pagination */
.list-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--gray-100);
  border-top: 1px solid var(--gray-200);
  font-size: 0.82rem;
  color: var(--gray-500);
  flex-wrap: wrap;
  gap: 8px;
}
.list-pagination {
  display: flex;
  gap: 4px;
}
.page-btn {
  width: 30px;
  height: 30px;
  border: 1.5px solid var(--gray-200);
  border-radius: 6px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-family: "Kanit", sans-serif;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--gray-700);
}
.page-btn:hover {
  border-color: var(--teal-light);
  color: var(--teal-mid);
}
.page-btn.active {
  background: var(--teal-mid);
  border-color: var(--teal-mid);
  color: var(--white);
}
.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Delete confirm modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 59, 79, 0.45);
  backdrop-filter: blur(3px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px 28px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.22s ease;
}
.modal-overlay.open .modal-box {
  transform: translateY(0) scale(1);
}
.modal-icon {
  font-size: 2.8rem;
  margin-bottom: 12px;
}
.modal-box h3 {
  font-family: "Kanit", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: 8px;
}
.modal-box p {
  font-size: 0.9rem;
  color: var(--gray-500);
  line-height: 1.6;
  margin-bottom: 20px;
}
.modal-date-chip {
  display: inline-block;
  background: rgba(232, 97, 74, 0.1);
  color: var(--coral);
  font-family: "Kanit", sans-serif;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 99px;
  font-size: 0.9rem;
  margin-bottom: 20px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.btn-confirm-delete {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  background: var(--coral);
  color: var(--white);
  border: none;
  border-radius: var(--radius-xl);
  font-family: "Kanit", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(232, 97, 74, 0.35);
  transition: all var(--transition);
}
.btn-confirm-delete:hover {
  background: #d0432e;
  transform: translateY(-1px);
}
.btn-cancel-modal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  background: none;
  color: var(--gray-500);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-xl);
  font-family: "Sarabun", sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-cancel-modal:hover {
  background: var(--gray-100);
  border-color: var(--gray-500);
  color: var(--gray-700);
}

/* Responsive table → card layout on mobile */
@media (max-width: 640px) {
  .closed-date-table thead {
    display: none;
  }
  .closed-date-table,
  .closed-date-table tbody,
  .closed-date-table tr,
  .closed-date-table td {
    display: block;
    width: 100%;
  }
  .closed-date-table tbody tr {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    position: relative;
  }
  .closed-date-table td {
    padding: 3px 0;
    border: none;
  }
  .closed-date-table td.td-center {
    text-align: left;
  }
  .closed-date-table td[data-label]::before {
    content: attr(data-label) ": ";
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 2px;
  }
  .btn-delete {
    margin-top: 10px;
    width: 100%;
    justify-content: center;
  }
  .list-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .list-search {
    min-width: unset;
  }
  .form-alert {
    margin: 0 20px 0;
  }
}

/* ============================================================
   REPORT PAGE — report.php
   ============================================================ */

/* ── Layout ── */
.report-grid {
  display: grid;
  gap: 20px;
}

/* ── KPI Cards ── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.kpi-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 20px 20px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition:
    box-shadow var(--transition),
    transform var(--transition);
  border-top: 3px solid transparent;
}
.kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.kpi-card.kpi-total {
  border-top-color: var(--teal-light);
}
.kpi-card.kpi-confirmed {
  border-top-color: var(--sage);
}
.kpi-card.kpi-pending {
  border-top-color: var(--orange);
}
.kpi-card.kpi-cancelled {
  border-top-color: var(--coral);
}
.kpi-card.kpi-completed {
  border-top-color: #8b5cf6;
}

.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.kpi-card.kpi-total .kpi-icon {
  background: rgba(46, 139, 165, 0.1);
}
.kpi-card.kpi-confirmed .kpi-icon {
  background: rgba(125, 184, 122, 0.12);
}
.kpi-card.kpi-pending .kpi-icon {
  background: rgba(245, 166, 35, 0.12);
}
.kpi-card.kpi-cancelled .kpi-icon {
  background: rgba(232, 97, 74, 0.1);
}
.kpi-card.kpi-completed .kpi-icon {
  background: rgba(139, 92, 246, 0.1);
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-500);
  font-family: "Kanit", sans-serif;
}
.kpi-value {
  font-family: "Kanit", sans-serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--teal-dark);
}
.kpi-card.kpi-confirmed .kpi-value {
  color: var(--sage-dark);
}
.kpi-card.kpi-pending .kpi-value {
  color: var(--orange-dark);
}
.kpi-card.kpi-cancelled .kpi-value {
  color: var(--coral);
}
.kpi-card.kpi-completed .kpi-value {
  color: #7c3aed;
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 4px;
}
.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
}
.kpi-trend.up {
  background: rgba(125, 184, 122, 0.15);
  color: var(--sage-dark);
}
.kpi-trend.down {
  background: rgba(232, 97, 74, 0.1);
  color: var(--coral);
}
.kpi-bg-icon {
  position: absolute;
  right: -8px;
  bottom: -8px;
  font-size: 4rem;
  opacity: 0.04;
  pointer-events: none;
  line-height: 1;
}

/* ── Panel / Section cards ── */
.report-panel {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.report-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  gap: 10px;
  flex-wrap: wrap;
}
.report-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.report-panel-title h3 {
  font-family: "Kanit", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--teal-dark);
}
.report-panel-icon {
  width: 32px;
  height: 32px;
  background: rgba(46, 139, 165, 0.1);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}
.report-panel-body {
  padding: 20px;
}
.report-panel-body.no-pad {
  padding: 0;
}

/* ── Two-col layout ── */
.report-cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.report-cols-3-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

/* ── Filter bar ── */
.report-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
  flex-wrap: wrap;
}
.report-filter-bar .form-label {
  font-size: 0.8rem;
  white-space: nowrap;
  margin-bottom: 0;
}
.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-group .form-control {
  padding: 6px 32px 6px 10px;
  font-size: 0.85rem;
  height: 34px;
}
.btn-filter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 16px;
  border-radius: var(--radius-xl);
  border: none;
  font-family: "Sarabun", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-filter.primary {
  background: var(--teal-mid);
  color: var(--white);
}
.btn-filter.primary:hover {
  background: var(--teal-dark);
}
.btn-filter.ghost {
  background: var(--white);
  color: var(--gray-700);
  border: 1.5px solid var(--gray-200);
}
.btn-filter.ghost:hover {
  border-color: var(--gray-500);
}
.btn-filter.export {
  background: var(--sage);
  color: var(--white);
}
.btn-filter.export:hover {
  background: var(--sage-dark);
}

/* ── Main appointments table ── */
.appt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.appt-table thead tr {
  background: var(--gray-100);
  border-bottom: 2px solid var(--gray-200);
}
.appt-table th {
  padding: 10px 14px;
  text-align: left;
  font-family: "Kanit", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--gray-500);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.appt-table th.sort-asc::after {
  content: " ↑";
  color: var(--teal-light);
}
.appt-table th.sort-desc::after {
  content: " ↓";
  color: var(--teal-light);
}
.appt-table th.no-sort {
  cursor: default;
}

.appt-table tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--transition);
}
.appt-table tbody tr:last-child {
  border-bottom: none;
}
.appt-table tbody tr:hover {
  background: rgba(46, 139, 165, 0.04);
}
.appt-table td {
  padding: 12px 14px;
  vertical-align: middle;
  color: var(--text-body);
}

/* Name cell */
.name-cell {
  display: flex;
  align-items: center;
  gap: 9px;
}
.name-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-light), var(--teal-mid));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Kanit", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}
.name-main {
  font-weight: 600;
  color: var(--teal-dark);
  font-size: 0.88rem;
  line-height: 1.2;
}
.name-id {
  font-size: 0.72rem;
  color: var(--gray-500);
  font-family: monospace;
  letter-spacing: 0.03em;
}

/* Date/time cell */
.datetime-cell .dt-date {
  font-family: "Kanit", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--teal-dark);
}
.datetime-cell .dt-time {
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* Channel badge */
.channel-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: "Kanit", sans-serif;
  white-space: nowrap;
}
.channel-badge.phone {
  background: rgba(46, 139, 165, 0.1);
  color: var(--teal-mid);
}
.channel-badge.online {
  background: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
}
.channel-badge.walk {
  background: rgba(125, 184, 122, 0.12);
  color: var(--sage-dark);
}

/* Status badge — large table version */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-family: "Kanit", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-pill.pending {
  background: rgba(245, 166, 35, 0.12);
  color: var(--orange-dark);
}
.status-pill.pending::before {
  background: var(--orange);
}
.status-pill.confirmed {
  background: rgba(46, 139, 165, 0.1);
  color: var(--teal-mid);
}
.status-pill.confirmed::before {
  background: var(--teal-light);
}
.status-pill.completed {
  background: rgba(125, 184, 122, 0.12);
  color: var(--sage-dark);
}
.status-pill.completed::before {
  background: var(--sage);
}
.status-pill.cancelled {
  background: rgba(232, 97, 74, 0.1);
  color: var(--coral);
}
.status-pill.cancelled::before {
  background: var(--coral);
}
.status-pill.no_show {
  background: rgba(107, 138, 154, 0.1);
  color: var(--gray-500);
}
.status-pill.no_show::before {
  background: var(--gray-500);
}

/* Action btn in table */
.btn-view {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--teal-mid);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-view:hover {
  background: var(--teal-mid);
  color: var(--white);
  border-color: var(--teal-mid);
}

/* ── Bar chart (CSS-only) ── */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bar-label {
  width: 76px;
  font-size: 0.78rem;
  color: var(--gray-700);
  text-align: right;
  flex-shrink: 0;
  font-family: "Sarabun", sans-serif;
}
.bar-track {
  flex: 1;
  height: 20px;
  background: var(--gray-100);
  border-radius: 99px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 4px;
}
.bar-fill.teal {
  background: linear-gradient(90deg, var(--teal-light), var(--teal-mid));
}
.bar-fill.orange {
  background: linear-gradient(90deg, #fbd288, var(--orange));
}
.bar-fill.coral {
  background: linear-gradient(90deg, #f9a090, var(--coral));
}
.bar-fill.sage {
  background: linear-gradient(90deg, #a8d5a5, var(--sage-dark));
}
.bar-fill.purple {
  background: linear-gradient(90deg, #c4b5fd, #7c3aed);
}
.bar-value {
  width: 32px;
  font-family: "Kanit", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gray-700);
  text-align: right;
  flex-shrink: 0;
}

/* ── Donut chart (CSS-only) ── */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.donut-svg-wrap {
  position: relative;
  flex-shrink: 0;
}
.donut-center-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.donut-center-num {
  font-family: "Kanit", sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--teal-dark);
  line-height: 1;
}
.donut-center-sub {
  font-size: 0.72rem;
  color: var(--gray-500);
}
.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
  min-width: 130px;
}
.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}
.donut-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.donut-legend-label {
  color: var(--gray-700);
  flex: 1;
}
.donut-legend-val {
  font-family: "Kanit", sans-serif;
  font-weight: 700;
  color: var(--teal-dark);
}
.donut-legend-pct {
  font-size: 0.72rem;
  color: var(--gray-500);
}

/* ── Weekly sparkline bars ── */
.spark-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 80px;
  padding-bottom: 4px;
}
.spark-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 1;
}
.spark-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--teal-light), var(--teal-mid));
  transition: height 0.5s ease;
  min-height: 4px;
  cursor: pointer;
  position: relative;
}
.spark-bar:hover {
  opacity: 0.8;
}
.spark-bar[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 105%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--teal-dark);
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  font-family: "Kanit", sans-serif;
}
.spark-label {
  font-size: 0.65rem;
  color: var(--gray-500);
  font-family: "Kanit", sans-serif;
  white-space: nowrap;
}
.spark-divider {
  height: 1px;
  background: var(--gray-100);
  margin: 0 -20px 12px;
}

/* ── Mini summary list ── */
.mini-list {
  display: flex;
  flex-direction: column;
}
.mini-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--gray-100);
}
.mini-list-item:last-child {
  border-bottom: none;
}
.mini-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.mini-info {
  flex: 1;
  min-width: 0;
}
.mini-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--teal-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-sub {
  font-size: 0.75rem;
  color: var(--gray-500);
}
.mini-val {
  font-family: "Kanit", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--teal-dark);
  flex-shrink: 0;
}

/* ── Detail modal ── */
.detail-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 59, 79, 0.4);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.detail-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.detail-modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.22s ease;
}
.detail-modal-overlay.open .detail-modal {
  transform: none;
}
.detail-modal-header {
  background: linear-gradient(135deg, var(--teal-dark), var(--teal-mid));
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.detail-modal-header h3 {
  color: var(--white);
  font-family: "Kanit", sans-serif;
  font-size: 1.05rem;
}
.modal-close-btn {
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  color: var(--white);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}
.detail-modal-body {
  padding: 20px 24px;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
}
.detail-field {
}
.detail-field-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 3px;
  font-family: "Kanit", sans-serif;
}
.detail-field-value {
  font-size: 0.92rem;
  color: var(--text-body);
  font-family: "Sarabun", sans-serif;
}
.detail-field.full {
  grid-column: 1/-1;
}
.detail-note {
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.88rem;
  color: var(--gray-700);
  line-height: 1.6;
}

/* ── Pagination (reuse from list) ── */
.report-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--gray-100);
  border-top: 1px solid var(--gray-200);
  font-size: 0.82rem;
  color: var(--gray-500);
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .kpi-row {
    grid-template-columns: repeat(3, 1fr);
  }
  .report-cols-3-1 {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 768px) {
  .kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .report-cols-2 {
    grid-template-columns: 1fr;
  }
  .report-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-group {
    flex-wrap: wrap;
  }
}
@media (max-width: 480px) {
  .kpi-row {
    grid-template-columns: 1fr 1fr;
  }
  .kpi-value {
    font-size: 1.6rem;
  }
  /* Responsive table → card */
  .appt-table thead {
    display: none;
  }
  .appt-table,
  .appt-table tbody,
  .appt-table tr,
  .appt-table td {
    display: block;
    width: 100%;
  }
  .appt-table tbody tr {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
  }
  .appt-table td {
    padding: 3px 0;
    border: none;
  }
  .appt-table td[data-label]::before {
    content: attr(data-label) ": ";
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 2px;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .detail-field.full {
    grid-column: 1;
  }
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.calendar-left-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.calendar-main {
  width: 100%;
}

.calendar-sidebar {
  align-self: start;
}

/* ── Channel selector ── */
.channel-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.channel-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 2px solid var(--gray-200, #e5e7eb);
  border-radius: var(--radius-sm, 8px);
  background: #fff;
  cursor: pointer;
  font-size: 0.92rem;
  font-family: "Sarabun", "Kanit", sans-serif;
  color: var(--gray-700, #374151);
  transition:
    border-color 0.2s,
    background 0.2s,
    box-shadow 0.2s;
  text-align: left;
  width: 100%;
}

.channel-btn:hover {
  border-color: var(--teal-mid, #2e8ba5);
  background: rgba(46, 139, 165, 0.05);
}

.channel-btn.selected {
  border-color: var(--teal-mid, #2e8ba5);
  background: rgba(46, 139, 165, 0.1);
  font-weight: 700;
  box-shadow: 0 0 0 3px rgba(46, 139, 165, 0.18);
}

.channel-btn .ch-icon {
  font-size: 1.3rem;
}

.channel-btn .ch-text {
  flex: 1;
}

.channel-btn .ch-name {
  font-weight: 600;
  color: var(--teal-dark, #1a6278);
}

.channel-btn .ch-desc {
  font-size: 0.78rem;
  color: var(--gray-500, #6b7280);
  margin-top: 2px;
}

.channel-btn .ch-check {
  color: var(--teal-mid, #2e8ba5);
  font-size: 1.1rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.channel-btn.selected .ch-check {
  opacity: 1;
}

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

  .calendar-sidebar {
    margin-top: 8px;
  }
}

