:root {
  --primary: #2563eb;
  --primary-soft: #dbeafe;
  --primary-wash: #eff6ff;
  --bg: #f6f8fc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: rgba(226, 232, 240, 0.9);
  --shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
  --radius: 22px;
}

body[data-theme="orange"] {
  --primary: #f97316;
  --primary-soft: #ffedd5;
  --primary-wash: #fff7ed;
  --bg: #fff8f1;
}

body[data-theme="teal"] {
  --primary: #0d9488;
  --primary-soft: #ccfbf1;
  --primary-wash: #f0fdfa;
  --bg: #f2fbf8;
}

body[data-theme="purple"] {
  --primary: #6d28d9;
  --primary-soft: #ede9fe;
  --primary-wash: #f5f3ff;
  --bg: #f8f5ff;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: "Noto Sans Thai", system-ui, sans-serif;
  background:
    radial-gradient(circle at top left, var(--primary-soft), transparent 34rem),
    linear-gradient(135deg, var(--bg), #ffffff 48%, var(--primary-wash));
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  max-width: 1540px;
  min-height: calc(100vh - 48px);
  margin: 24px auto;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(37, 99, 235, 0.14);
  backdrop-filter: blur(18px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-height: 100%;
  padding: 28px 22px;
  border-right: 1px solid var(--line);
  background: var(--card);
}

/* ============================================================
   Bottom Sheet (mobile menu drawer slide-up)
   ============================================================ */
.bottom-nav-more {
  display: grid;
  place-items: center;
  gap: 2px;
  background: transparent;
  border: 0;
  color: #64748b;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  padding: 0;
}

.bottom-nav-more:hover,
.bottom-nav-more[aria-expanded="true"] {
  color: var(--primary);
}

.bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.bottom-sheet-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 95;
  max-height: 85vh;
  padding: 8px 18px 24px;
  background: var(--card);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  box-shadow: 0 -16px 40px rgba(15, 23, 42, 0.18);
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  overflow-y: auto;
  visibility: hidden;
}

.bottom-sheet.is-open {
  transform: translateY(0);
  visibility: visible;
}

.bottom-sheet-handle {
  width: 44px;
  height: 4px;
  margin: 6px auto 14px;
  background: #cbd5e1;
  border-radius: 2px;
}

.bottom-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.bottom-sheet-head strong {
  font-size: 16px;
  font-weight: 700;
}

.bottom-sheet-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  cursor: pointer;
  color: var(--text);
}

.bottom-sheet-close:hover {
  background: var(--primary-wash);
  color: var(--primary);
}

.bottom-sheet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.bottom-sheet-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  text-decoration: none;
  color: var(--text);
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.bottom-sheet-item:hover {
  background: var(--primary-wash);
  border-color: color-mix(in srgb, var(--primary) 30%, white);
}

.bottom-sheet-item:active {
  transform: scale(0.97);
}

.bottom-sheet-item.is-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.bottom-sheet-item.is-active i,
.bottom-sheet-item.is-active svg {
  color: #fff;
}

.bottom-sheet-item i,
.bottom-sheet-item svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.bottom-sheet-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #fecaca;
  background: #fff;
  color: #dc2626;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.bottom-sheet-logout:hover {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}

.bottom-sheet-logout i,
.bottom-sheet-logout svg {
  width: 18px;
  height: 18px;
}

/* เมื่อ sheet เปิด — ซ่อน floating UI */
body.sheet-open .chat-widget {
  display: none !important;
}

.sidebar-backdrop.is-open {
  opacity: 1;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #fecaca;
  background: #fff;
  color: #dc2626;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-logout:hover {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}

.sidebar-logout i,
.sidebar-logout svg {
  width: 18px;
  height: 18px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 65%, #38bdf8));
  border-radius: 16px;
  box-shadow: 0 14px 24px color-mix(in srgb, var(--primary) 22%, transparent);
}

.brand-lockup strong {
  display: block;
  font-size: 18px;
  line-height: 1.08;
}

.brand-lockup span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.side-nav {
  display: grid;
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 46px;
  padding: 0 16px;
  color: #52627a;
  border-radius: 12px;
  transition: 0.2s ease;
}

.side-nav a.active,
.side-nav a:hover {
  color: var(--primary);
  background: var(--primary-wash);
}

.side-nav a.active {
  box-shadow: inset 4px 0 0 var(--primary);
}

.sidebar-card {
  margin-top: auto;
  padding: 22px;
  text-align: center;
  background: linear-gradient(180deg, var(--primary-wash), #fff);
  border-radius: 18px;
}

.sidebar-card h2 {
  margin: 0;
  color: var(--primary);
  font-size: 20px;
  line-height: 1.35;
}

.sidebar-card p {
  margin: 10px 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.people-illustration {
  display: flex;
  justify-content: center;
  gap: 10px;
  height: 100px;
  align-items: end;
}

.people-illustration span {
  width: 58px;
  height: 76px;
  background: linear-gradient(180deg, var(--primary), #93c5fd);
  border-radius: 28px 28px 12px 12px;
}

.people-illustration span:nth-child(2) {
  height: 88px;
  background: linear-gradient(180deg, #fb7185, #fbcfe8);
}

.main-panel {
  min-width: 0;
  padding: 32px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.topbar h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0;
}

.topbar p {
  margin: 8px 0 0;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.status-pill,
.search-box,
.profile-menu,
.icon-button {
  display: flex;
  align-items: center;
  min-height: 46px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.status-pill {
  gap: 8px;
  padding: 0 16px;
  color: #16a34a;
  font-size: 13px;
  white-space: nowrap;
}

.status-pill svg {
  width: 10px;
  fill: currentColor;
}

.search-box {
  gap: 10px;
  width: min(360px, 42vw);
  padding: 0 14px;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

kbd {
  padding: 2px 7px;
  color: var(--muted);
  background: #f1f5f9;
  border-radius: 6px;
}

.icon-button {
  position: relative;
  justify-content: center;
  width: 46px;
  color: #1e293b;
}

.icon-button span {
  position: absolute;
  top: -7px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  background: #ef4444;
  border-radius: 999px;
}

.profile-menu {
  gap: 10px;
  padding: 5px 12px 5px 6px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.profile-menu:hover {
  background: var(--primary-wash);
  border-color: color-mix(in srgb, var(--primary) 25%, white);
}

.profile-menu small,
.contact-list small {
  display: block;
  color: var(--muted);
}

.profile-wrapper {
  position: relative;
}

.profile-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  z-index: 60;
  overflow: hidden;
  padding: 6px;
}

.profile-panel-head {
  padding: 10px 14px 12px;
  border-bottom: 1px solid var(--line);
  margin: -6px -6px 6px;
}

.profile-panel-head strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.profile-panel-head small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.profile-panel-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.profile-panel-item:hover {
  background: var(--primary-wash);
  color: var(--primary);
}

.profile-panel-item i,
.profile-panel-item svg {
  width: 18px;
  height: 18px;
}

.profile-panel-divider {
  margin: 6px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.profile-panel-danger {
  color: #dc2626;
}

.profile-panel-danger:hover {
  background: #fef2f2;
  color: #dc2626;
}

.profile-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.profile-info-grid > div {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.profile-info-grid small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.profile-info-grid strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

/* ============================================================
   Coming Soon page
   ============================================================ */
.coming-soon-shell {
  max-width: 640px;
  margin: 40px auto;
  padding: 48px 32px;
  background: var(--card);
  border-radius: 28px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-align: center;
}

.coming-soon-art {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 24px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 65%, #1e293b));
  border-radius: 50%;
  color: #fff;
}

.coming-soon-art i,
.coming-soon-art svg {
  width: 56px;
  height: 56px;
  position: relative;
  z-index: 1;
}

.coming-soon-pulse {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 25%, transparent);
  animation: comingSoonPulse 2s ease-out infinite;
}

@keyframes comingSoonPulse {
  0% { transform: scale(0.95); opacity: 0.7; }
  100% { transform: scale(1.25); opacity: 0; }
}

.coming-soon-shell .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.coming-soon-shell h1 {
  margin: 0 0 12px;
  font-size: 26px;
  line-height: 1.4;
}

.coming-soon-shell > p {
  color: var(--muted);
  margin: 0 0 32px;
  font-size: 15px;
}

.coming-soon-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}

.coming-soon-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.coming-soon-item i,
.coming-soon-item svg {
  width: 14px;
  height: 14px;
}

.coming-soon-item.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.coming-soon-item.is-active i,
.coming-soon-item.is-active svg {
  animation: comingSoonSpin 1.5s linear infinite;
}

@keyframes comingSoonSpin {
  to { transform: rotate(360deg); }
}

.coming-soon-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}

.coming-soon-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--primary-wash);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
}

.coming-soon-note i,
.coming-soon-note svg {
  width: 16px;
  height: 16px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, #0f172a, var(--primary));
  border-radius: 999px;
}

.theme-switcher {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 46px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.theme-dot {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 999px;
}

.theme-dot.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--primary);
}

.theme-blue { background: #2563eb; }
.theme-orange { background: #f97316; }
.theme-teal { background: #0d9488; }
.theme-purple { background: #6d28d9; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.data-mode-note {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: -8px 0 22px;
  padding: 10px 14px;
  color: var(--primary);
  font-weight: 800;
  font-size: 13px;
  background: var(--primary-wash);
  border: 1px solid color-mix(in srgb, var(--primary) 18%, white);
  border-radius: 14px;
}

.flash-message {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: -8px 0 22px;
  padding: 10px 14px;
  font-weight: 800;
  font-size: 13px;
  border-radius: 14px;
}

.flash-success {
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.flash-error {
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.kpi-card,
.card {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.kpi-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  overflow: hidden;
  min-height: 136px;
  padding: 18px;
  border-radius: 18px;
}

.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, currentColor 0%, transparent 42%);
  opacity: 0.03;
  pointer-events: none;
}

.kpi-card.tone-blue { color: #2563eb; background: #eef5ff; border-color: #dbeafe; }
.kpi-card.tone-orange { color: #f97316; background: #fff4e5; border-color: #fed7aa; }
.kpi-card.tone-purple { color: #7c3aed; background: #f5f1ff; border-color: #ddd6fe; }
.kpi-card.tone-teal { color: #0d9488; background: #e8f8f5; border-color: #c7eee8; }

.kpi-card-head,
.kpi-card-body,
.kpi-meter {
  position: relative;
  z-index: 1;
}

.kpi-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.kpi-card h2,
.kpi-card p {
  margin: 0;
}

.kpi-card h2 {
  max-width: 130px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.kpi-card strong {
  display: block;
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 34px;
  line-height: 1;
}

.kpi-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.kpi-meter {
  height: 7px;
  overflow: hidden;
  background: rgba(100, 116, 139, 0.12);
  border-radius: 999px;
}

.kpi-meter span {
  display: block;
  height: 100%;
  min-width: 18px;
  background: currentColor;
  border-radius: inherit;
}

.card {
  min-width: 0;
  padding: 22px;
  border-radius: var(--radius);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  align-items: start;
}

.dashboard-grid .contact-card {
  grid-column: 1 / -1;
}

.faq-quick-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.faq-quick-list details {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.faq-quick-list details[open] {
  border-color: color-mix(in srgb, var(--primary) 30%, white);
  background: var(--primary-wash);
}

.faq-quick-list summary {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.faq-quick-list summary::-webkit-details-marker {
  display: none;
}

.faq-quick-list summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.faq-quick-list .chevron {
  transition: transform 0.2s ease;
  color: var(--muted);
  width: 18px;
  height: 18px;
}

.faq-quick-list details[open] .chevron {
  transform: rotate(180deg);
}

.faq-quick-list details[open] summary span {
  white-space: normal;
}

.faq-quick-list p {
  margin: 0;
  padding: 0 14px 14px 44px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.card-head h2 {
  margin: 0;
  font-size: 18px;
}

.card-head a,
.online-dot {
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
}

.news-list,
.ticket-list,
.contact-list,
.chat-window {
  display: grid;
  gap: 12px;
}

.news-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 3px 0;
}

.news-item h3,
.news-item p {
  margin: 0;
}

.news-item h3 {
  font-size: 15px;
}

.news-item p {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-item time {
  color: var(--muted);
  font-size: 12px;
}

.icon-box {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
}

.tone-blue { color: #2563eb; background: #dbeafe; }
.tone-green { color: #059669; background: #d1fae5; }
.tone-orange { color: #f97316; background: #ffedd5; }
.tone-red { color: #b91c1c; background: #fee2e2; }
.tone-purple { color: #7c3aed; background: #ede9fe; }
.tone-cyan { color: #0891b2; background: #cffafe; }
.tone-pink { color: #ec4899; background: #fce7f3; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  font-style: normal;
  font-weight: 700;
  font-size: 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.onboarding-feature-card {
  position: relative;
  display: grid;
  align-content: end;
  gap: 8px;
  min-height: 178px;
  padding: 20px;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.02) 0%, rgba(15, 23, 42, 0.72) 100%),
    linear-gradient(135deg, #2563eb 0%, #0d9488 52%, #f97316 100%);
  border-radius: 18px;
}

.onboarding-feature-card::before {
  content: "";
  position: absolute;
  inset: 18px 18px auto auto;
  width: 150px;
  height: 92px;
  background: rgba(255, 255, 255, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  box-shadow: -86px 26px 0 rgba(255, 255, 255, 0.12), -32px 90px 0 rgba(15, 23, 42, 0.14);
}

.onboarding-feature-card > span {
  position: absolute;
  inset: 20px auto auto 20px;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 16px;
}

.onboarding-feature-card strong,
.onboarding-feature-card small,
.onboarding-feature-card em {
  position: relative;
  z-index: 1;
}

.onboarding-feature-card strong {
  max-width: 230px;
  font-size: 20px;
  line-height: 1.2;
}

.onboarding-feature-card small {
  max-width: 250px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.45;
}

.onboarding-feature-card em {
  width: max-content;
  margin-top: 4px;
  padding: 6px 10px;
  color: #fff;
  font-style: normal;
  font-weight: 800;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
}

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.shortcut-grid a,
.complaint-options button,
.complaint-options a {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 96px;
  padding: 12px;
  color: var(--text);
  background: var(--primary-wash);
  border: 1px solid var(--line);
  border-radius: 16px;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.complaint-options a:hover,
.complaint-options button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.shortcut-grid a:nth-child(2),
.complaint-options button:nth-child(1),
.complaint-options a:nth-child(1) {
  color: #059669;
  background: #ecfdf5;
}

.shortcut-grid a:nth-child(3),
.complaint-options button:nth-child(2),
.complaint-options a:nth-child(2) {
  color: #f97316;
  background: #fff7ed;
}

.shortcut-grid a:nth-child(4) {
  color: #7c3aed;
  background: #f5f3ff;
}

.shortcut-grid span {
  font-weight: 700;
  font-size: 13px;
  text-align: center;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.chip-row button {
  min-height: 36px;
  padding: 0 14px;
  color: var(--primary);
  background: var(--primary-wash);
  border: 1px solid color-mix(in srgb, var(--primary) 20%, white);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.chip-row button.is-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.help-card h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.ticket-list div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 7px 0;
}

.contact-list > div {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 7px 0;
}

.ticket-list span,
.contact-list span {
  min-width: 0;
  flex: 1;
}

.ticket-list strong {
  display: block;
  color: #334155;
  font-size: 12px;
}

.ticket-type {
  display: inline-flex;
  width: fit-content;
  margin: 3px 0 2px;
  padding: 2px 8px;
  color: var(--primary);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.ticket-sla {
  display: inline-flex;
  width: fit-content;
  margin: 3px 0 2px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.queue-stats {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.ticket-list span {
  color: #475569;
  font-size: 13px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  margin-top: 14px;
  color: #fff;
  font-weight: 800;
  background: var(--primary);
  border: 0;
  border-radius: 12px;
  box-shadow: 0 14px 24px color-mix(in srgb, var(--primary) 24%, transparent);
}

.complaint-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.complaint-options button,
.complaint-options a {
  place-items: start;
  text-align: left;
}

.complaint-options strong {
  font-size: 18px;
}

.complaint-options span {
  color: var(--muted);
  font-size: 13px;
}

.privacy-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.chat-window {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 178px;
  max-height: 320px;
  overflow-y: auto;
}

.chat-window p {
  max-width: 78%;
  margin: 0;
  padding: 12px 14px;
  color: #475569;
  background: #f1f5f9;
  border-radius: 16px;
}

.chat-window .bot {
  justify-self: start;
}

.chat-window .user {
  justify-self: end;
  color: #1e40af;
  background: var(--primary-soft);
}

.chat-window .bot.hint {
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  border: 1px dashed #fdba74;
}

.chat-suggestions-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-self: start;
  max-width: 92%;
}

.chat-suggestion-pill {
  font-family: inherit;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, white);
  background: var(--primary-wash);
  color: var(--primary);
  cursor: pointer;
  text-align: left;
  line-height: 1.4;
  transition: background 0.15s ease, color 0.15s ease;
}

.chat-suggestion-pill:hover {
  background: var(--primary);
  color: #fff;
}

.chat-input {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 14px;
  padding: 0 6px 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.chat-input input {
  width: 100%;
  border: 0;
  outline: 0;
}

.chat-input button,
.contact-actions a,
.contact-actions button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--primary);
  background: var(--primary-wash);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.chat-widget {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: grid;
  justify-items: end;
  gap: 12px;
  pointer-events: none;
}

.chat-widget-toggle,
.chat-widget-panel {
  pointer-events: auto;
}

.chat-widget-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  color: #fff;
  font-weight: 800;
  background: var(--primary);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.28);
}

.chat-widget-panel {
  width: min(360px, calc(100vw - 32px));
  padding: 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
}

.chat-widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.chat-widget-head span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 900;
}

.chat-widget-head button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.chat-widget .chat-window {
  min-height: 190px;
  max-height: 300px;
  padding: 4px;
}

.chat-widget-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chat-widget-suggestions button {
  min-height: 32px;
  padding: 0 10px;
  color: var(--primary);
  font-weight: 800;
  font-size: 12px;
  background: var(--primary-wash);
  border: 1px solid color-mix(in srgb, var(--primary) 18%, white);
  border-radius: 999px;
}

.contact-list strong {
  display: block;
}

.contact-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  grid-column: 2;
  justify-self: start;
  min-width: max-content;
}

.auth-page {
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-shell {
  width: min(1180px, 100%);
}

.auth-card {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(0, 1.1fr);
  gap: 0;
  min-height: 680px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(18px);
}

.auth-form-panel {
  display: flex;
  flex-direction: column;
  padding: 42px;
  background: rgba(255, 255, 255, 0.9);
  border-right: 1px solid var(--line);
}

.auth-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.auth-card h1 {
  margin: 14px 0 10px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: 0;
}

.auth-card p {
  margin: 0;
  color: var(--muted);
}

.auth-copy {
  margin: 70px 0 28px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  color: var(--primary);
  font-weight: 800;
  font-size: 13px;
  background: var(--primary-wash);
  border: 1px solid color-mix(in srgb, var(--primary) 18%, white);
  border-radius: 999px;
}

.form-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-bottom: 18px;
  padding: 10px 14px;
  color: #dc2626;
  font-weight: 700;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 14px;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form label {
  display: grid;
  gap: 8px;
  color: #334155;
  font-weight: 700;
}

.input-shell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: 0.2s ease;
}

.input-shell:focus-within {
  border-color: color-mix(in srgb, var(--primary) 55%, white);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent);
}

.input-shell svg {
  color: var(--muted);
}

.auth-form input[type="text"],
.auth-form input[type="password"] {
  width: 100%;
  height: 48px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.check-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px !important;
  font-weight: 600 !important;
}

.check-row input {
  accent-color: var(--primary);
}

.auth-options a {
  color: var(--primary);
  font-weight: 800;
  white-space: nowrap;
}

.auth-submit {
  gap: 10px;
  min-height: 52px;
  margin-top: 4px;
  border-radius: 16px;
}

.demo-note {
  margin-top: auto !important;
  padding-top: 24px;
  font-size: 13px;
}

.auth-preview {
  position: relative;
  display: grid;
  place-items: center;
  padding: 44px;
  overflow: hidden;
  background:
    radial-gradient(circle at 28% 18%, color-mix(in srgb, var(--primary) 24%, transparent), transparent 18rem),
    linear-gradient(135deg, var(--primary-wash), #ffffff 52%, var(--primary-soft));
}

.auth-preview::before,
.auth-preview::after {
  content: "";
  position: absolute;
  border: 1px solid color-mix(in srgb, var(--primary) 18%, white);
  background: rgba(255, 255, 255, 0.44);
  border-radius: 999px;
}

.auth-preview::before {
  top: 54px;
  right: -78px;
  width: 240px;
  height: 240px;
}

.auth-preview::after {
  bottom: -92px;
  left: -80px;
  width: 280px;
  height: 280px;
}

.preview-glass {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  padding: 26px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 26px;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(18px);
}

.preview-head,
.preview-card,
.preview-chat span {
  display: flex;
  align-items: center;
}

.preview-head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.preview-date {
  color: var(--muted);
  font-size: 13px;
}

.preview-glass h2 {
  margin: 0 0 10px;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: 0;
}

.preview-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0 18px;
}

.preview-stats div {
  display: grid;
  gap: 6px;
  min-height: 118px;
  padding: 16px;
  color: var(--primary);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.preview-stats strong {
  color: var(--text);
  font-size: 30px;
  line-height: 1;
}

.preview-stats span {
  color: var(--muted);
  font-size: 12px;
}

.preview-card {
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.preview-card span {
  min-width: 0;
  flex: 1;
}

.preview-card strong,
.preview-card small {
  display: block;
}

.preview-card small {
  color: var(--muted);
}

.preview-chat {
  margin-top: 14px;
  padding: 16px;
  background: linear-gradient(135deg, #fff, var(--primary-wash));
  border: 1px solid var(--line);
  border-radius: 18px;
}

.preview-chat span {
  gap: 8px;
  color: var(--primary);
  font-weight: 800;
}

.preview-chat p {
  margin-top: 10px;
}

.btn-ghost,
.mini-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  color: var(--primary);
  font-weight: 800;
  background: var(--primary-wash);
  border: 1px solid color-mix(in srgb, var(--primary) 20%, white);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}

.mini-action.danger {
  color: #dc2626;
  background: #fff;
  border: 1px solid #fecaca;
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  gap: 6px;
  transition: all 0.15s ease;
}

.mini-action.danger:hover {
  color: #fff;
  background: #dc2626;
  border-color: #dc2626;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
  transform: translateY(-1px);
}

.mini-action.danger i,
.mini-action.danger svg {
  width: 14px;
  height: 14px;
}

/* Inline-admin-form override: ให้ปุ่ม danger ไม่โดนบังคับเป็น 36x36 grid */
.inline-admin-form .mini-action {
  display: inline-flex;
  width: auto;
  height: auto;
  border-radius: 8px;
}

.inline-admin-form .mini-action.danger {
  background: #fff;
  border-color: #fecaca;
  color: #dc2626;
}

.comment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.comment-edit {
  width: 100%;
}

.comment-edit summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
}

.comment-edit summary::-webkit-details-marker {
  display: none;
}

.comment-edit[open] summary {
  margin-bottom: 8px;
}

.admin-summary .kpi-card {
  min-height: 108px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.page-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.page-hero h1 {
  margin: 14px 0 8px;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: 0;
}

.page-hero p {
  margin: 0;
  color: var(--muted);
}

.hero-action-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.content-list,
.faq-page-list {
  display: grid;
  gap: 12px;
}

.faq-page-list {
  scroll-margin-top: 24px;
  margin-top: 18px;
}

.list-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.list-card strong,
.list-card small {
  display: block;
}

.list-card small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-card time,
.detail-card time {
  color: var(--muted);
  font-size: 13px;
}

.detail-card {
  margin-bottom: 18px;
}

.detail-card h2 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.2;
}

.detail-card > p {
  margin: 0 0 18px;
  color: var(--muted);
}

.detail-body {
  color: #334155;
  line-height: 1.75;
}

.faq-row {
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.faq-row summary {
  cursor: pointer;
  font-weight: 800;
}

.faq-row p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.onboarding-hub {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 0.9fr);
  gap: 18px;
  scroll-margin-top: 24px;
  margin-bottom: 18px;
  padding: 22px;
  background: linear-gradient(135deg, #f8fbff 0%, #fff7ed 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.onboarding-copy h2 {
  margin: 10px 0 8px;
  font-size: 28px;
  line-height: 1.15;
}

.onboarding-copy p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.onboarding-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}

.onboarding-actions a {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 88px;
  padding: 12px;
  color: var(--primary);
  font-weight: 800;
  text-align: center;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.onboarding-checklist {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.onboarding-checklist div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 12px;
  color: #334155;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.onboarding-checklist svg {
  flex: 0 0 auto;
  color: var(--primary);
}

#ticket-form {
  scroll-margin-top: 24px;
}

.module-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
  align-items: start;
}

.ticket-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.ticket-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  color: #475569;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
}

.comment-list {
  display: grid;
  gap: 12px;
}

.comment-item {
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.comment-item strong,
.comment-item time {
  display: block;
}

.comment-item time {
  color: var(--muted);
  font-size: 12px;
}

.comment-item p {
  margin: 10px 0 0;
  color: #334155;
  line-height: 1.65;
}

.comment-form {
  margin-top: 16px;
}

.attachment-list {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.attachment-list h3 {
  margin: 0;
  font-size: 16px;
}

.attachment-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px;
  color: #334155;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.attachment-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.attachment-list strong,
.attachment-list small,
.attachment-main span {
  display: block;
}

.attachment-list small {
  color: var(--muted);
}

.attachment-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  grid-column: 1 / -1;
}

.inline-attachments a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 0 10px;
  color: var(--primary);
  background: var(--primary-wash);
  border: 1px solid color-mix(in srgb, var(--primary) 18%, white);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-attachments a svg {
  flex: 0 0 auto;
}

.admin-table,
.faq-admin,
.admin-contact-list,
.settings-form {
  display: grid;
  gap: 12px;
}

.admin-table div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(40px, auto);
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.admin-table div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.admin-table strong,
.admin-table small {
  display: block;
}

.admin-table small {
  color: var(--muted);
}

.admin-table button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--primary);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.inline-admin-form {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.inline-admin-form button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--primary);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.status-form select {
  width: 132px;
  height: 36px;
  padding: 0 10px;
  color: #334155;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.faq-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  margin-top: 12px;
}

.faq-action-row .mini-action,
.faq-action-row .btn-primary {
  width: auto;
  padding: 0 14px;
}

.faq-action-row form {
  margin: 0;
}

.empty-note {
  margin: 0;
  color: var(--muted);
}

.faq-admin details {
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.faq-admin summary {
  cursor: pointer;
  font-weight: 800;
}

.faq-admin p {
  margin: 10px 0 0;
  color: var(--muted);
}

#contact {
  scroll-margin-top: 24px;
}

.admin-contact-list {
  margin-bottom: 18px;
}

.admin-contact-list > div {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.admin-contact-list strong,
.admin-contact-list small {
  display: block;
}

.admin-contact-list small {
  color: var(--muted);
}

.admin-contact-form {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.settings-form label {
  display: grid;
  gap: 8px;
  color: #334155;
  font-weight: 800;
}

.settings-form input,
.settings-form select,
.settings-form textarea {
  height: 44px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.settings-form textarea {
  min-height: 110px;
  padding: 12px;
  resize: vertical;
}

.settings-form input[type="file"] {
  height: auto;
  padding: 10px 12px;
}

.field-help {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.bottom-nav {
  display: none;
}

@media (max-width: 1240px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .dashboard-grid .news-card {
    grid-row: auto;
    grid-column: 1 / -1;
  }

  .dashboard-grid .contact-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  body {
    padding-bottom: 88px;
  }

  .auth-page {
    align-items: start;
    justify-items: center;
    min-height: 100dvh;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: 16px;
  }

  .auth-shell {
    width: 100%;
  }

  .auth-card {
    grid-template-columns: 1fr;
    min-height: auto;
    width: 100%;
  }

  .auth-form-panel {
    padding: 24px;
    border-right: 0;
  }

  .auth-topline {
    align-items: flex-start;
  }

  .auth-copy {
    margin: 42px 0 24px;
  }

  .auth-preview {
    display: none;
  }

  .app-shell {
    display: block;
    min-height: 100vh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .sidebar {
    display: none;
  }

  .main-panel {
    padding: 18px;
  }

  .topbar {
    display: block;
  }

  .topbar h1 {
    font-size: 20px;
  }

  .topbar-actions {
    justify-content: stretch;
    margin-top: 16px;
  }

  .search-box {
    order: 5;
    width: 100%;
  }

  .profile-wrapper {
    display: none;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .kpi-card {
    min-height: 128px;
    padding: 14px;
    gap: 12px;
  }

  .kpi-card strong {
    font-size: 28px;
  }

  .kpi-card h2,
  .kpi-card p {
    font-size: 12px;
  }

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

  .chat-widget {
    right: 14px;
    bottom: 96px;
  }

  .chat-widget-toggle {
    min-width: 48px;
    padding: 0 14px;
  }

  .onboarding-hub {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .onboarding-actions,
  .onboarding-checklist {
    grid-template-columns: 1fr;
  }

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

  .page-hero {
    display: grid;
    padding: 20px;
  }

  .page-hero h1 {
    font-size: 28px;
  }

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

  .ticket-detail-grid {
    grid-template-columns: 1fr;
  }

  .list-card {
    grid-template-columns: 40px minmax(0, 1fr) auto;
  }

  .list-card time {
    display: none;
  }

  .news-item {
    grid-template-columns: 40px minmax(0, 1fr) auto;
  }

  .news-item time {
    display: none;
  }

  .shortcut-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .complaint-options {
    grid-template-columns: 1fr;
  }

  .bottom-nav {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: 66px;
    padding: 8px 6px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(16px);
  }

  .bottom-nav a {
    display: grid;
    place-items: center;
    gap: 2px;
    color: #64748b;
    font-size: 11px;
  }

  .bottom-nav a.active {
    color: var(--primary);
    font-weight: 800;
  }
}

@media (max-width: 520px) {
  .auth-page {
    display: block;
    min-height: 100dvh;
    padding: 0;
  }

  .auth-card {
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .auth-form-panel {
    min-height: 100dvh;
    padding: 20px;
  }

  .auth-topline {
    display: grid;
    gap: 18px;
  }

  .auth-card h1 {
    font-size: 30px;
  }

  .auth-copy {
    margin: 34px 0 22px;
  }

  .auth-form {
    gap: 14px;
  }

  .demo-note {
    margin-top: 22px !important;
    padding-top: 0;
  }

  .auth-options {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .main-panel {
    padding: 14px;
  }

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

  .kpi-card {
    align-items: start;
  }

  .icon-box {
    width: 40px;
    height: 40px;
  }

  .card {
    padding: 16px;
  }

  .news-item {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .news-item .badge {
    justify-self: start;
    grid-column: 2;
  }

  .contact-list > div {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .contact-actions {
    gap: 4px;
  }

  .contact-actions button {
    width: 30px;
    height: 30px;
  }

  .list-card {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .list-card .badge {
    justify-self: start;
    grid-column: 2;
  }
}

.notification-wrapper {
  position: relative;
}

.notification-wrapper .icon-button {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  max-width: calc(100vw - 24px);
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  z-index: 60;
  overflow: hidden;
}

.notification-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.notification-head strong {
  font-size: 14px;
}

.notification-head small {
  color: var(--muted);
  font-size: 12px;
}

.notification-list {
  max-height: 360px;
  overflow-y: auto;
}

.notification-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: flex-start;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s ease;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item:hover {
  background: var(--primary-wash);
}

.notification-item.is-unread {
  background: rgba(37, 99, 235, 0.06);
}

.notification-item.is-unread strong::after {
  content: '•';
  color: var(--primary);
  margin-left: 6px;
}

.notification-item span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.notification-item strong {
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
  word-break: break-word;
}

.notification-item small {
  font-size: 11px;
  color: var(--muted);
}

.notification-list .empty-note {
  padding: 18px 16px;
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.contact-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.contact-chip-row [data-contact-filter] {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.contact-chip-row [data-contact-filter].is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.role-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.role-row:last-child {
  border-bottom: none;
}

.user-search-form {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.user-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-top: 12px;
}

.user-filter-row label {
  min-width: 160px;
}

.user-filter-row .btn-primary,
.user-filter-row .mini-action {
  align-self: end;
}

/* ============================================================
   Document Library
   ============================================================ */
.document-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.document-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  text-decoration: none;
  color: inherit;
}

.document-card .icon-box {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.document-card span {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.document-card strong {
  font-size: 15px;
  font-weight: 700;
}

.document-card small {
  font-size: 12px;
  color: var(--muted);
}

.document-meta {
  font-size: 11px !important;
  color: var(--muted);
}

/* ============================================================
   Phone Directory
   ============================================================ */
.directory-section {
  margin-bottom: 22px;
}

.directory-dept {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text);
}

.directory-dept small {
  color: var(--muted);
  font-weight: 400;
  font-size: 13px;
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.directory-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  align-items: start;
}

.directory-card .avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.directory-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.directory-info strong {
  font-size: 14px;
  font-weight: 700;
}

.directory-info .muted {
  color: var(--muted);
  font-size: 12px;
}

.directory-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 6px;
  font-size: 12px;
}

.directory-contact a,
.directory-contact span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text);
  text-decoration: none;
  word-break: break-all;
}

.directory-contact a:hover {
  color: var(--primary);
}

.directory-contact i,
.directory-contact svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

/* ============================================================
   Quick Links Card on Dashboard
   ============================================================ */
.quicklinks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.quicklink-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  text-decoration: none;
  color: inherit;
  align-items: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.quicklink-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.07);
  border-color: color-mix(in srgb, var(--primary) 30%, white);
}

.quicklink-item .icon-box {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.quicklink-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.quicklink-text strong {
  font-size: 14px;
  font-weight: 700;
}

.quicklink-text small {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quicklink-ext {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.quicklinks-card {
  grid-column: 1 / -1;
}

.welcome-page {
  min-height: 100vh;
  padding: 24px 16px 60px;
}

.welcome-shell {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.welcome-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.welcome-cta {
  display: flex;
  gap: 10px;
}

.welcome-hero {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--card);
  border-radius: 22px;
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.welcome-hero h1 {
  margin: 0;
  font-size: 28px;
}

.welcome-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.welcome-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.welcome-feature {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 65%, #1e293b));
  color: #fff;
}

.welcome-feature .icon-box {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: none;
}

.welcome-feature h2,
.welcome-feature p {
  color: #fff;
}

.welcome-feature .btn-primary {
  background: #fff;
  color: var(--primary);
  align-self: flex-start;
}

.welcome-steps {
  margin: 8px 0 14px;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text);
}

.welcome-footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 720px) {
  .welcome-grid {
    grid-template-columns: 1fr;
  }
}

.welcome-link {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.welcome-link a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.welcome-link a:hover {
  text-decoration: underline;
}

.welcome-about {
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--card);
  border-radius: 22px;
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.welcome-about-head h2 {
  margin: 6px 0 0;
  font-size: 24px;
}

.welcome-about-head .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.welcome-video-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.welcome-video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: #0f172a;
}

.welcome-video-frame iframe,
.welcome-video-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.welcome-video-meta h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.welcome-video-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.welcome-about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.welcome-about-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

a.welcome-about-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  border-color: color-mix(in srgb, var(--primary) 30%, white);
}

.welcome-about-card .icon-box {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.welcome-about-card.welcome-about-image {
  padding: 0;
  overflow: hidden;
}

.welcome-about-card.welcome-about-image img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.welcome-about-card.welcome-about-image .welcome-about-body {
  padding: 14px 18px 18px;
}

.welcome-about-body h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
}

.welcome-about-body p {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}

.welcome-about-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.welcome-about-cta:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .welcome-about {
    padding: 20px;
  }

  .welcome-about-grid {
    grid-template-columns: 1fr;
  }
}

.mode-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  margin-bottom: 14px;
  font-size: 14px;
  border: 1px solid var(--line);
}

.mode-banner.mode-anonymous {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.mode-banner.mode-revealed {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.mode-banner span {
  flex: 1;
}

.mode-banner a {
  font-weight: 700;
  color: inherit;
  text-decoration: underline;
}

.mode-banner a:hover {
  opacity: 0.8;
}
