:root {
  --lg-bg-1: #fff5fb;
  --lg-bg-2: #ffe8f5;
  --lg-bg-3: #f4ecff;
  --lg-panel: rgba(255, 255, 255, 0.62);
  --lg-panel-strong: rgba(255, 255, 255, 0.78);
  --lg-border: rgba(255, 255, 255, 0.72);
  --lg-shadow: 0 24px 52px rgba(170, 61, 124, 0.16);
  --lg-shadow-soft: 0 12px 26px rgba(122, 53, 101, 0.12);
  --lg-accent: #ef3ea9;
  --lg-accent-2: #ff77b4;
  --lg-text: #2a1023;
  --lg-muted: #6b4b63;
}

body.index-primary-scope {
  --bs-primary: #ef3ea9;
  --bs-primary-rgb: 239, 62, 169;
  --bs-link-color: #d92b9b;
  --bs-link-hover-color: #b91f83;
}

body.liquid-body {
  min-height: 100vh;
  color: var(--lg-text);
  font-family: "Sarabun", "Kanit", -apple-system, "Segoe UI", sans-serif;
  overflow-x: clip;
  background:
    radial-gradient(900px 620px at 10% -10%, rgba(255, 114, 201, 0.33), transparent 70%),
    radial-gradient(780px 520px at 110% 5%, rgba(194, 120, 255, 0.26), transparent 70%),
    linear-gradient(165deg, var(--lg-bg-1) 0%, var(--lg-bg-2) 50%, var(--lg-bg-3) 100%);
}

.page-shell {
  width: min(1280px, 94vw);
  margin-inline: auto;
}

.signature-doc {
  position: relative;
  overflow: hidden;
}

.signature-doc::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, rgba(239, 62, 169, 0), rgba(239, 62, 169, 0.9), rgba(255, 119, 180, 0));
}

.balanced-lead {
  max-width: 680px;
  font-size: clamp(1rem, 1.4vw, 1.3rem);
  text-wrap: balance;
}

.doc-kicker {
  letter-spacing: 0.18em;
  color: #9b5e89;
}

.liquid-glass {
  background: linear-gradient(145deg, var(--lg-panel-strong), var(--lg-panel));
  border: 1px solid var(--lg-border);
  box-shadow: var(--lg-shadow);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}

.liquid-soft {
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--lg-shadow-soft);
}

.liquid-card {
  border-radius: 1.2rem;
}

.directory-card {
  border: 1px solid rgba(228, 190, 220, 0.85) !important;
  box-shadow:
    0 14px 34px rgba(167, 77, 126, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.directory-card .card-header {
  border-bottom: 1px solid rgba(226, 189, 222, 0.7);
}

.staff-item {
  border: 1px solid rgba(214, 177, 208, 0.72) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-radius: 1rem !important;
}

.staff-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(162, 76, 125, 0.16);
}

.staff-main {
  min-width: 0;
}

.staff-name-row > .fs-4 {
  line-height: 1.3;
}

.staff-role {
  line-height: 1.35;
}

.people-list.single-person .staff-item {
  width: min(100%, 640px);
}

.liquid-pill {
  border-radius: 999px;
}

.liquid-title {
  font-family: "Kanit", "Sarabun", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #2f1026;
}

h1, h2, h3, h4, h5, h6, .display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
  font-family: "Kanit", "Sarabun", sans-serif;
  letter-spacing: -0.01em;
  color: #2b0f24;
}

.text-secondary {
  color: var(--lg-muted) !important;
}

.btn-liquid {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--lg-accent), var(--lg-accent-2));
  box-shadow: 0 14px 28px rgba(239, 62, 169, 0.38);
}

.btn-liquid:hover,
.btn-liquid:focus {
  color: #fff;
  filter: brightness(1.03);
}

.btn-liquid-outline {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.75);
  color: #5d4861;
}

.btn-liquid-outline:hover,
.btn-liquid-outline:focus {
  color: #4e3554;
  background: rgba(255, 255, 255, 0.75);
}

.list-group-item.active {
  border: 0;
  background: linear-gradient(135deg, var(--lg-accent), var(--lg-accent-2));
  color: #fff;
  box-shadow: 0 10px 20px rgba(225, 114, 176, 0.28);
}

.form-control,
.form-select,
.input-group-text {
  border-color: rgba(190, 162, 188, 0.45);
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(222, 91, 165, 0.5);
  box-shadow: 0 0 0 0.25rem rgba(222, 91, 165, 0.17);
}

.table > :not(caption) > * > * {
  background-color: transparent;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border: 1px solid rgba(190, 162, 188, 0.45);
  border-radius: 0.5rem;
  padding: 0.3rem 0.45rem;
  background: rgba(255, 255, 255, 0.85);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 0.5rem !important;
}

.staff-avatar,
.profile-photo {
  width: 88px;
  height: 88px;
  object-fit: cover;
  object-position: center;
  image-rendering: auto;
  background: #f6e4ef;
}

.profile-photo {
  width: min(360px, 72vw);
  height: min(360px, 72vw);
}

.intro-modal {
  border: 1px solid rgba(242, 173, 220, 0.7) !important;
  box-shadow: 0 28px 70px rgba(146, 45, 110, 0.28);
}

.intro-badge {
  display: inline-block;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #7d2c63;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(233, 170, 213, 0.8);
}

@media (min-width: 1600px) {
  .page-shell {
    width: min(1380px, 90vw);
  }
}

@media (max-width: 1199.98px) {
  .page-shell {
    width: min(100%, 95vw);
  }
}

@media (max-width: 991.98px) {
  .page-shell {
    width: min(100%, 95vw);
  }

  .hero-actions .btn {
    min-width: 220px;
  }

  .directory-card .card-header .badge {
    font-size: 0.95rem !important;
  }
}

@media (max-width: 767.98px) {
  .page-shell {
    width: min(100%, 96vw);
  }

  header.sticky-top {
    position: static;
  }

  h1.display-5 {
    font-size: clamp(1.9rem, 8vw, 2.5rem);
  }

  .balanced-lead {
    font-size: 1rem !important;
  }

  .hero-section {
    margin-bottom: 1.5rem !important;
  }

  .hero-actions {
    gap: 0.75rem !important;
  }

  .hero-actions .btn {
    width: 100%;
  }

  header .liquid-pill {
    width: 100%;
    text-align: center;
  }

  .directory-card .card-header .h4 {
    font-size: 1.2rem;
  }

  .staff-item {
    padding: 1rem !important;
  }

  .staff-avatar {
    width: 68px;
    height: 68px;
    flex-shrink: 0;
  }

  .staff-item .fs-4 {
    font-size: 1.28rem !important;
    line-height: 1.35;
  }

  .staff-item .fs-5 {
    font-size: 1.03rem !important;
  }

  .staff-item .badge {
    max-width: fit-content;
    overflow-wrap: anywhere;
    white-space: normal;
    text-align: left;
  }

  .staff-item-layout {
    gap: 0.85rem !important;
  }

  .staff-name-row {
    gap: 0.4rem !important;
    margin-bottom: 0.35rem !important;
  }

  .staff-name-row .rounded-pill.text-bg-primary {
    font-size: 0.88rem !important;
    padding-inline: 0.7rem !important;
    padding-block: 0.32rem !important;
  }

  .staff-role {
    margin-bottom: 0.65rem !important;
  }

  .staff-meta {
    gap: 0.45rem !important;
  }

  .staff-meta .badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    font-size: 0.98rem !important;
    padding: 0.42rem 0.75rem !important;
    border-color: rgba(201, 168, 197, 0.7) !important;
    background-color: rgba(255, 255, 255, 0.78) !important;
  }

  .staff-link {
    width: 100%;
    margin-left: 0 !important;
    padding-top: 0.2rem;
    font-size: 1.02rem !important;
  }

  .modal-dialog {
    margin: 0.65rem;
  }

  #modal .modal-body,
  #introModal .modal-body {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  #mRole {
    font-size: 1.05rem !important;
  }

  #mEmail,
  #mPhone {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

@media (max-width: 479.98px) {
  .page-shell {
    width: min(100%, 97vw);
  }

  .liquid-card {
    border-radius: 1rem;
  }

  .directory-card .card-header {
    padding-top: 0.85rem !important;
    padding-bottom: 0.85rem !important;
  }

  .profile-photo {
    width: min(250px, 75vw);
    height: min(250px, 75vw);
  }

  .staff-item .fs-6 {
    font-size: 0.9rem !important;
  }

  .staff-item {
    padding: 0.95rem !important;
  }

  .staff-avatar {
    width: 62px;
    height: 62px;
  }

  .staff-item .fs-4 {
    font-size: 1.17rem !important;
  }

  .staff-item .fs-5 {
    font-size: 0.98rem !important;
  }

  .staff-name-row .rounded-pill.text-bg-primary {
    font-size: 0.8rem !important;
  }

  .staff-meta {
    flex-direction: column;
    align-items: flex-start !important;
  }

  .staff-meta .badge {
    width: 100%;
    justify-content: flex-start;
    border-radius: 0.8rem !important;
  }

  .hero-actions .btn {
    min-width: 0;
    font-size: 1rem;
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
  }

  #count {
    font-size: 0.95rem;
  }
}

@media (min-width: 992px) {
  .sidebar-sticky {
    position: sticky;
    top: 1rem;
  }
}

.auth-box {
  max-width: 520px;
}
