/* ============================================================
   PUSKESMAS MINAHASA TENGGARA — Design System
   Bootstrap 5 Override + Custom Components
   ============================================================ */

/* --- Font import handled dynamically by dynamic_style.php --- */

/* ============================================================
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================================ */
:root {
  /* — Bootstrap Overrides — */
  --bs-primary: var(--pk-primary);
  --bs-primary-rgb: var(--pk-primary-rgb);
  --bs-secondary: var(--pk-secondary);
  --bs-body-font-family: var(--pk-font-family);

  /* — Brand Colors — */
  --pk-red: var(--pk-primary);
  --pk-red-light: var(--pk-primary-light);
  --pk-red-dark: var(--pk-secondary);
  --pk-red-bg: var(--pk-primary-light);
  --pk-blue: var(--pk-accent);
  --pk-blue-light: var(--pk-accent);
  --pk-blue-bg: #FFFFFF;
  --pk-red: var(--pk-primary);
  --pk-red-bg: var(--pk-primary-light);
  --pk-yellow: #F9A825;
  --pk-yellow-bg: #FFF8E1;
  --pk-orange: #EF6C00;
  --pk-orange-bg: #FFF3E0;
  --pk-teal: #00897B;
  --pk-teal-bg: #E0F2F1;
  --pk-purple: #6A1B9A;
  --pk-purple-bg: #F3E5F5;

  /* — Neutrals — */
  --pk-bg: #F5F7FA;
  --pk-white: #FFFFFF;
  --pk-gray-50: #FAFAFA;
  --pk-gray-100: #F5F5F5;
  --pk-gray-200: #EEEEEE;
  --pk-gray-300: #E0E0E0;
  --pk-gray-400: #BDBDBD;
  --pk-gray-500: #9E9E9E;
  --pk-gray-600: #757575;
  --pk-gray-700: #616161;
  --pk-gray-800: #424242;
  --pk-gray-900: #212121;

  /* — Typography — */
  --pk-font: var(--pk-font-family);
  --pk-fs-xs: 0.75rem;
  /* 12px */
  --pk-fs-sm: 0.8125rem;
  /* 13px */
  --pk-fs-base: 0.9375rem;
  /* 15px */
  --pk-fs-md: 1rem;
  /* 16px */
  --pk-fs-lg: 1.125rem;
  /* 18px */
  --pk-fs-xl: 1.5rem;
  /* 24px */
  --pk-fs-2xl: 2rem;
  /* 32px */
  --pk-fs-3xl: 2.5rem;
  /* 40px */

  /* — Spacing — */
  --pk-sidebar-w: 260px;
  --pk-navbar-h: 60px;

  /* — Shadows — */
  --pk-shadow-sm: 0 1px 3px rgba(0, 0, 0, .08);
  --pk-shadow: 0 2px 8px rgba(0, 0, 0, .08);
  --pk-shadow-md: 0 4px 16px rgba(0, 0, 0, .1);
  --pk-shadow-lg: 0 8px 30px rgba(0, 0, 0, .12);

  /* — Radius — */
  --pk-radius-sm: calc(var(--pk-radius) * 0.5);
  --pk-radius: var(--pk-radius);
  --pk-radius-lg: calc(var(--pk-radius) * 1.5);
  --pk-radius-xl: calc(var(--pk-radius) * 2);
  --pk-radius-full: 50%;

  /* — Transitions & Animations — */
  --pk-transition: all .4s cubic-bezier(0.4, 0, 0.2, 1);
  --pk-transition-fast: all .2s ease;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
  100% { transform: translateY(0px); }
}

@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(211, 47, 47, 0); }
  100% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.glass-morphism {
  background: #ffffff;
  border: 1px solid var(--pk-gray-200);
}

.hero-img-custom {
  max-height: 450px;
  width: auto;
  object-fit: contain;
  animation: fadeInUp 1.2s ease-out;
}

/* ============================================================
   2. GLOBAL RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: calc(var(--pk-base-size) * var(--pk-scale));
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--pk-font-heading);
}

.pk-hero h1 {
  font-size: var(--pk-fs-hero-title) !important;
}

.pk-hero .lead {
  font-size: var(--pk-fs-hero-desc) !important;
}

section h2, section h3 {
  font-size: var(--pk-fs-section-title) !important;
}

.action-card .action-title, 
.info-card .info-title, 
.stat-card .stat-value {
  font-size: var(--pk-fs-card-title) !important;
}

.action-card .action-desc, 
.info-card .info-text, 
.stat-card .stat-label {
  font-size: var(--pk-fs-card-text) !important;
}

body {
  font-family: var(--pk-font);
  font-size: var(--pk-fs-base);
  color: var(--pk-gray-800);
  background: var(--pk-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--pk-red);
  text-decoration: none;
  transition: var(--pk-transition);
}

a:hover {
  color: var(--pk-red-dark);
}

img {
  max-width: 100%;
  height: auto;
}

::selection {
  background: var(--pk-red-bg);
  color: var(--pk-red-dark);
}

/* ============================================================
   3. TYPOGRAPHY
   ============================================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  color: var(--pk-gray-900);
  line-height: 1.3;
}

h1 {
  font-size: var(--pk-fs-3xl);
}

h2 {
  font-size: var(--pk-fs-2xl);
}

h3 {
  font-size: var(--pk-fs-xl);
}

h4 {
  font-size: var(--pk-fs-lg);
}

h5 {
  font-size: var(--pk-fs-md);
}

h6 {
  font-size: var(--pk-fs-base);
}

.text-muted {
  color: var(--pk-gray-500) !important;
}

.text-red {
  color: var(--pk-red) !important;
}

.text-blue {
  color: var(--pk-blue) !important;
}

.text-red {
  color: var(--pk-red) !important;
}

.page-title {
  font-size: var(--pk-fs-xl);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.page-subtitle {
  font-size: var(--pk-fs-sm);
  color: var(--pk-gray-500);
  margin-bottom: 1.5rem;
}

/* ============================================================
   4. TOP NAVBAR
   ============================================================ */
.pk-navbar {
  height: var(--pk-navbar-h);
  background: var(--pk-white);
  border-bottom: 1px solid var(--pk-gray-200);
  box-shadow: var(--pk-shadow-sm);
  z-index: 1050;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  transition: var(--pk-transition);
}

.pk-navbar .navbar-brand {
  font-weight: 700;
  font-size: var(--pk-fs-lg);
  color: var(--pk-red);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.pk-navbar .navbar-brand .brand-icon {
  width: 36px;
  height: 36px;
  background: var(--pk-red);
  color: #fff;
  border-radius: var(--pk-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.pk-navbar .nav-link {
  color: var(--pk-gray-600);
  font-weight: 500;
  font-size: var(--pk-fs-sm);
  padding: .5rem 1rem !important;
  border-radius: var(--pk-radius-sm);
  transition: var(--pk-transition);
}

.pk-navbar .nav-link:hover,
.pk-navbar .nav-link.active {
  color: var(--pk-red);
  background: var(--pk-red-bg);
}

.pk-navbar .btn-login {
  background: var(--pk-red);
  color: #fff;
  border: none;
  padding: .45rem 1.25rem;
  border-radius: var(--pk-radius-sm);
  font-weight: 600;
  font-size: var(--pk-fs-sm);
  transition: var(--pk-transition);
}

.pk-navbar .btn-login:hover {
  background: var(--pk-red-dark);
  color: #fff;
}

.pk-navbar .navbar-toggler {
  border: none;
  padding: .25rem .5rem;
  color: var(--pk-gray-700);
  font-size: 1.4rem;
}

.pk-navbar .navbar-toggler:focus {
  box-shadow: none;
}

/* — Navbar for admin (with sidebar) — */
.pk-navbar.admin-navbar {
  left: var(--pk-sidebar-w);
}

.pk-navbar .nav-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--pk-radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--pk-gray-600);
  font-size: 1.1rem;
  transition: var(--pk-transition);
  position: relative;
}

.pk-navbar .nav-icon:hover {
  background: var(--pk-gray-100);
  color: var(--pk-red);
}

.pk-navbar .nav-icon .badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--pk-red);
  border-radius: 50%;
  border: 2px solid #fff;
}

.pk-navbar .admin-user {
  display: flex;
  align-items: center;
  gap: .6rem;
  cursor: pointer;
}

.pk-navbar .admin-user .user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--pk-red-bg);
  color: var(--pk-red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--pk-fs-sm);
}

.pk-navbar .admin-user .user-info {
  line-height: 1.2;
}

.pk-navbar .admin-user .user-name {
  font-weight: 600;
  font-size: var(--pk-fs-sm);
  color: var(--pk-gray-800);
}

.pk-navbar .admin-user .user-role {
  font-size: var(--pk-fs-xs);
  color: var(--pk-gray-500);
}

/* ============================================================
   5. LEFT SIDEBAR
   ============================================================ */
.pk-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--pk-sidebar-w);
  background: var(--pk-white);
  border-right: 1px solid var(--pk-gray-200);
  z-index: 1060;
  display: flex;
  flex-direction: column;
  transition: transform .3s ease;
  overflow-y: auto;
}

.pk-sidebar .sidebar-header {
  height: var(--pk-navbar-h);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  border-bottom: 1px solid var(--pk-gray-200);
  flex-shrink: 0;
}

.pk-sidebar .sidebar-header .brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--pk-red), var(--pk-red-light));
  color: #fff;
  border-radius: var(--pk-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.pk-sidebar .sidebar-header .brand-text {
  line-height: 1.2;
}

.pk-sidebar .sidebar-header .brand-name {
  font-weight: 700;
  font-size: var(--pk-fs-sm);
  color: var(--pk-gray-900);
}

.pk-sidebar .sidebar-header .brand-sub {
  font-size: var(--pk-fs-xs);
  color: var(--pk-gray-500);
}

.pk-sidebar .sidebar-nav {
  padding: 1rem 0;
  flex: 1;
}

.pk-sidebar .nav-section-title {
  font-size: var(--pk-fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--pk-gray-400);
  padding: .75rem 1.25rem .35rem;
  margin-top: .5rem;
}

.pk-sidebar .sidebar-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 1.25rem;
  margin: 1px .75rem;
  color: var(--pk-gray-600);
  font-size: var(--pk-fs-sm);
  font-weight: 500;
  border-radius: var(--pk-radius-sm);
  transition: var(--pk-transition);
}

.pk-sidebar .sidebar-link i {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.pk-sidebar .sidebar-link:hover {
  background: var(--pk-red-bg);
  color: var(--pk-red);
}

.pk-sidebar .sidebar-link.active {
  background: var(--pk-red);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(183, 28, 28, .25);
}

.pk-sidebar .sidebar-link .badge-count {
  margin-left: auto;
  background: var(--pk-red);
  color: #fff;
  font-size: .65rem;
  padding: .15rem .45rem;
  border-radius: 10px;
  font-weight: 600;
}

.pk-sidebar .sidebar-link.active .badge-count {
  background: rgba(255, 255, 255, .25);
}

.pk-sidebar .sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--pk-gray-200);
  flex-shrink: 0;
}

.pk-sidebar .sidebar-footer .sidebar-link {
  margin: 0;
  color: var(--pk-red);
}

.pk-sidebar .sidebar-footer .sidebar-link:hover {
  background: var(--pk-red-bg);
}

/* ============================================================
   6. MAIN CONTENT AREA
   ============================================================ */
.pk-main {
  margin-left: var(--pk-sidebar-w);
  padding-top: var(--pk-navbar-h);
  min-height: 100vh;
}

.pk-main .content-wrapper {
  padding: 1.5rem;
}

/* public pages — no sidebar */
.pk-public-main {
  padding-top: var(--pk-navbar-h);
}

/* ============================================================
   7. CARDS
   ============================================================ */
.pk-card {
  background: var(--pk-white);
  border: 1px solid var(--pk-gray-200);
  border-radius: var(--pk-radius);
  box-shadow: var(--pk-shadow-sm);
  transition: var(--pk-transition);
}

.pk-card:hover {
  box-shadow: var(--pk-shadow);
}

/* — Stat Cards — */
.stat-card {
  padding: 1.5rem 1.25rem;
  border-radius: var(--pk-radius-lg);
  background: var(--pk-white);
  border: 1px solid var(--pk-gray-200);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 4px; height: 100%;
  background: var(--pk-red);
}

.stat-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(var(--pk-primary-rgb), 0.12);
  border-color: var(--pk-red-light);
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--pk-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-card .stat-icon.red {
  background: var(--pk-red-bg);
  color: var(--pk-red);
}

.stat-card .stat-icon.blue {
  background: var(--pk-blue-bg);
  color: var(--pk-blue);
}

.stat-card .stat-icon.orange {
  background: var(--pk-orange-bg);
  color: var(--pk-orange);
}

.stat-card .stat-icon.red {
  background: var(--pk-red-bg);
  color: var(--pk-red);
}

.stat-card .stat-icon.teal {
  background: var(--pk-teal-bg);
  color: var(--pk-teal);
}

.stat-card .stat-icon.purple {
  background: var(--pk-purple-bg);
  color: var(--pk-purple);
}

.stat-card .stat-label {
  font-size: var(--pk-fs-xs);
  color: #444;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.stat-card .stat-value {
  font-size: var(--pk-fs-2xl);
  font-weight: 800;
  color: var(--pk-gray-900);
  line-height: 1.2;
}

.stat-card .stat-change {
  font-size: var(--pk-fs-xs);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: .2rem;
}

.stat-card .stat-change.up {
  color: var(--pk-red);
}

.stat-card .stat-change.down {
  color: var(--pk-red);
}

/* — Quick Action Cards — */
.action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--pk-white);
  border: 1px solid var(--pk-gray-200);
  border-radius: var(--pk-radius-lg);
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: var(--pk-shadow-sm);
  height: 100%;
}

.action-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
  border-color: var(--pk-red);
}

.action-card .action-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--pk-radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 1.25rem;
  transition: transform 0.3s ease;
}

.action-card:hover .action-icon {
  transform: rotate(-10deg) scale(1.1);
}

.live-indicator-pulse {
  display: inline-block;
  width: 10px;
  height: 10px;
  background-color: #ff4757;
  border-radius: 50%;
  margin-right: 8px;
  box-shadow: 0 0 0 rgba(255, 71, 87, 0.4);
  animation: pulse-red 2s infinite;
  vertical-align: middle;
}

.action-card .action-title {
  font-weight: 700;
  font-size: var(--pk-fs-base);
  color: var(--pk-gray-900);
  margin-bottom: .25rem;
}

.action-card .action-desc {
  font-size: var(--pk-fs-xs);
  color: #555;
}

/* ============================================================
   8. BUTTONS
   ============================================================ */
.btn-pk-primary {
  background: var(--pk-red, #D32F2F);
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: var(--pk-fs-sm);
  padding: .55rem 1.25rem;
  border-radius: var(--pk-radius-sm);
  transition: var(--pk-transition);
}

.btn-pk-primary:hover {
  background: var(--pk-red-dark);
  color: #fff;
  box-shadow: 0 4px 12px rgba(183, 28, 28, .3);
}

.btn-pk-primary:active {
  background: var(--pk-red-dark);
  transform: scale(.97);
}

.btn-pk-outline {
  background: transparent;
  color: var(--pk-red);
  border: 1.5px solid var(--pk-red);
  font-weight: 600;
  font-size: var(--pk-fs-sm);
  padding: .5rem 1.25rem;
  border-radius: var(--pk-radius-sm);
  transition: var(--pk-transition);
}

.btn-pk-outline:hover {
  background: var(--pk-red);
  color: #fff;
}

.btn-pk-danger {
  background: var(--pk-red);
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: var(--pk-fs-sm);
  padding: .55rem 1.25rem;
  border-radius: var(--pk-radius-sm);
  transition: var(--pk-transition);
}

.btn-pk-danger:hover {
  background: var(--pk-red-dark);
  color: #fff;
}

.btn-pk-secondary {
  background: var(--pk-blue);
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: var(--pk-fs-sm);
  padding: .55rem 1.25rem;
  border-radius: var(--pk-radius-sm);
  transition: var(--pk-transition);
}

.btn-pk-secondary:hover {
  background: #0D47A1;
  color: #fff;
}

.btn-pk-warning {
  background: var(--pk-yellow);
  color: var(--pk-gray-900);
  border: none;
  font-weight: 600;
  font-size: var(--pk-fs-sm);
  padding: .55rem 1.25rem;
  border-radius: var(--pk-radius-sm);
  transition: var(--pk-transition);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--pk-radius-sm);
  font-size: .95rem;
}

/* ============================================================
   9. BADGES
   ============================================================ */
.badge-pk {
  font-size: var(--pk-fs-xs);
  font-weight: 600;
  padding: .3rem .7rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}

.badge-menunggu {
  background: var(--pk-yellow-bg);
  color: var(--pk-yellow);
}

.badge-dipanggil {
  background: var(--pk-blue-bg);
  color: var(--pk-blue);
}

.badge-selesai {
  background: var(--pk-red-bg);
  color: var(--pk-red);
}

.badge-batal {
  background: var(--pk-red-bg);
  color: var(--pk-red);
}

.badge-aktif {
  background: var(--pk-red-bg);
  color: var(--pk-red);
}

.badge-nonaktif {
  background: var(--pk-gray-200);
  color: var(--pk-gray-600);
}

.badge-cuti {
  background: var(--pk-orange-bg);
  color: var(--pk-orange);
}

.badge-pk i {
  font-size: .7rem;
}

/* ============================================================
   10. FORMS
   ============================================================ */
.form-label {
  font-weight: 600;
  font-size: var(--pk-fs-sm);
  color: var(--pk-gray-700);
  margin-bottom: .35rem;
}

.form-control,
.form-select {
  border: 1.5px solid var(--pk-gray-300);
  border-radius: var(--pk-radius-sm);
  font-size: var(--pk-fs-base);
  padding: .6rem .9rem;
  transition: var(--pk-transition);
  color: var(--pk-gray-800);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--pk-red);
  box-shadow: 0 0 0 3px rgba(183, 28, 28, .12);
}

.form-control.is-invalid {
  border-color: var(--pk-red);
}

.form-control.is-valid {
  border-color: var(--pk-red);
}

.invalid-feedback {
  font-size: var(--pk-fs-xs);
  color: var(--pk-red);
}

.input-group-text {
  background: var(--pk-gray-100);
  border: 1.5px solid var(--pk-gray-300);
  border-radius: var(--pk-radius-sm);
  color: var(--pk-gray-500);
}

.form-check-input:checked {
  background-color: var(--pk-red);
  border-color: var(--pk-red);
}

.form-text {
  font-size: var(--pk-fs-xs);
  color: var(--pk-gray-500);
}

/* Large form for elderly */
.form-lg .form-label {
  font-size: var(--pk-fs-md);
}

.form-lg .form-control,
.form-lg .form-select {
  font-size: var(--pk-fs-lg);
  padding: .75rem 1rem;
}

/* ============================================================
   11. TABLES & DATATABLES
   ============================================================ */
.pk-table-wrapper {
  background: var(--pk-white);
  border: 1px solid var(--pk-gray-200);
  border-radius: var(--pk-radius);
  box-shadow: var(--pk-shadow-sm);
  overflow: hidden;
}

.pk-table-wrapper .table-header {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  border-bottom: 1px solid var(--pk-gray-200);
}

.pk-table-wrapper .table-header h5 {
  margin: 0;
  font-weight: 700;
}

table.dataTable,
.pk-table {
  width: 100% !important;
  margin: 0 !important;
}

table.dataTable thead th,
.pk-table thead th {
  background: var(--pk-gray-50);
  color: var(--pk-gray-600);
  font-weight: 600;
  font-size: var(--pk-fs-xs);
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: .8rem 1rem;
  border-bottom: 2px solid var(--pk-gray-200);
  white-space: nowrap;
}

table.dataTable tbody td,
.pk-table tbody td {
  padding: .75rem 1rem;
  font-size: var(--pk-fs-sm);
  color: var(--pk-gray-700);
  vertical-align: middle;
  border-bottom: 1px solid var(--pk-gray-100);
}

table.dataTable tbody tr:hover,
.pk-table tbody tr:hover {
  background: var(--pk-red-bg);
}

/* DataTables overrides */
.dataTables_wrapper .dataTables_filter input {
  border: 1.5px solid var(--pk-gray-300);
  border-radius: var(--pk-radius-sm);
  padding: .4rem .75rem;
  font-size: var(--pk-fs-sm);
  margin-left: .5rem;
}

.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--pk-red);
  outline: none;
  box-shadow: 0 0 0 3px rgba(183, 28, 28, .12);
}

.dataTables_wrapper .dataTables_length select {
  border: 1.5px solid var(--pk-gray-300);
  border-radius: var(--pk-radius-sm);
  padding: .3rem .5rem;
  font-size: var(--pk-fs-sm);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: var(--pk-radius-sm) !important;
  font-size: var(--pk-fs-sm);
  padding: .35rem .65rem !important;
  margin: 0 2px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--pk-red) !important;
  border-color: var(--pk-red) !important;
  color: #fff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--pk-red-bg) !important;
  border-color: var(--pk-red-bg) !important;
  color: var(--pk-red) !important;
}

.dataTables_wrapper .dataTables_info {
  font-size: var(--pk-fs-xs);
  color: var(--pk-gray-500);
  padding-top: .75rem;
}

div.dataTables_wrapper div.dataTables_filter,
div.dataTables_wrapper div.dataTables_length {
  padding: .75rem 1rem;
}

div.dataTables_wrapper div.dataTables_info,
div.dataTables_wrapper div.dataTables_paginate {
  padding: .75rem 1rem;
}

/* ============================================================
   12. MODALS
   ============================================================ */
.modal-content {
  border: none;
  border-radius: var(--pk-radius-lg);
  box-shadow: var(--pk-shadow-lg);
}

.modal-header {
  border-bottom: 1px solid var(--pk-gray-200);
  padding: 1.15rem 1.5rem;
}

.modal-header .modal-title {
  font-weight: 700;
  font-size: var(--pk-fs-lg);
}

.modal-header .btn-close:focus {
  box-shadow: none;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid var(--pk-gray-200);
  padding: 1rem 1.5rem;
}

/* Delete confirmation */
.modal-delete .modal-body {
  text-align: center;
  padding: 2rem 1.5rem;
}

.modal-delete .delete-icon {
  width: 64px;
  height: 64px;
  background: var(--pk-red-bg);
  color: var(--pk-red);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.modal-delete .delete-title {
  font-weight: 700;
  font-size: var(--pk-fs-lg);
  margin-bottom: .5rem;
}

.modal-delete .delete-text {
  color: var(--pk-gray-500);
  font-size: var(--pk-fs-sm);
}

/* ============================================================
   13. ALERTS
   ============================================================ */
.alert-pk {
  border: none;
  border-radius: var(--pk-radius-sm);
  padding: .85rem 1.15rem;
  font-size: var(--pk-fs-sm);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: .6rem;
}

.alert-pk.alert-success {
  background: var(--pk-red-bg);
  color: var(--pk-red-dark);
}

.alert-pk.alert-danger {
  background: var(--pk-red-bg);
  color: var(--pk-red);
}

.alert-pk.alert-warning {
  background: var(--pk-yellow-bg);
  color: #E65100;
}

.alert-pk.alert-info {
  background: var(--pk-blue-bg);
  color: var(--pk-blue);
}

/* ============================================================
   14. HERO SECTION (Public)
   ============================================================ */
.pk-hero {
  padding: 8rem 0 6rem;
  background: radial-gradient(at 0% 0%, rgba(211, 47, 47, 0.15) 0px, transparent 50%),
              radial-gradient(at 100% 0%, rgba(211, 47, 47, 0.1) 0px, transparent 50%),
              var(--pk-secondary);
  color: var(--pk-white);
  position: relative;
  overflow: hidden;
}

.pk-hero::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.05;
  pointer-events: none;
}

.hero-icon-float {
  animation: float 6s ease-in-out infinite;
}

.pk-hero .hero-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, .15);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: .4rem 1.25rem;
  border-radius: 50px;
  margin-bottom: 1.5rem;
  color: #fff;
}

.pk-hero .hero-badge::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  margin-right: 10px;
  box-shadow: 0 0 10px #4ade80;
}

.pk-hero h1 {
  color: #fff;
  font-size: var(--pk-fs-3xl);
  font-weight: 800;
  margin-bottom: .75rem;
}

.pk-hero p {
  font-size: var(--pk-fs-md);
  opacity: .9;
  max-width: 520px;
  margin-bottom: 1.5rem;
}

.pk-hero .btn-hero {
  background: #fff;
  color: var(--pk-red);
  font-weight: 700;
  padding: .7rem 1.75rem;
  border-radius: var(--pk-radius-sm);
  font-size: var(--pk-fs-base);
  border: none;
  transition: var(--pk-transition);
}

.pk-hero .btn-hero:hover {
  background: var(--pk-gray-100);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .15);
}

.pk-hero .btn-hero-outline-solid {
  background: #ffffff;
  color: var(--pk-primary);
  font-weight: 700;
  padding: .7rem 1.75rem;
  border-radius: var(--pk-radius-sm);
  font-size: var(--pk-fs-base);
  border: 2px solid #ffffff;
  transition: var(--pk-transition);
}

.pk-hero .btn-hero-outline-solid:hover {
  background: var(--pk-primary);
  color: #fff;
  border-color: var(--pk-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .15);
}

/* ============================================================
   15. INFO CARDS (Public)
   ============================================================ */
.info-card {
  background: var(--pk-white);
  border: 1px solid var(--pk-gray-200);
  border-radius: var(--pk-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--pk-shadow-sm);
  transition: all 0.4s ease;
  height: 100%;
}

.info-card:hover {
  transform: scale(1.03);
  box-shadow: 0 15px 35px rgba(0,0,0,0.06);
  border-color: var(--pk-red-light);
}

.info-card .info-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--pk-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  margin-bottom: .75rem;
}

.info-card .info-title {
  font-weight: 700;
  font-size: var(--pk-fs-base);
  margin-bottom: .35rem;
}

.info-card .info-text {
  font-size: var(--pk-fs-sm);
  color: #444;
  line-height: 1.5;
}

/* ============================================================
   16. FOOTER
   ============================================================ */
.pk-footer {
  background: var(--pk-gray-900);
  color: var(--pk-gray-400);
  padding: 3rem 0 1.5rem;
  font-size: var(--pk-fs-sm);
}

.pk-footer h5 {
  color: #fff;
  font-size: var(--pk-fs-base);
  font-weight: 700;
  margin-bottom: .75rem;
}

.pk-footer a {
  color: var(--pk-gray-400);
}

.pk-footer a:hover {
  color: var(--pk-red-light);
}

.pk-footer .footer-bottom {
  border-top: 1px solid var(--pk-gray-700);
  padding-top: 1.25rem;
  margin-top: 2rem;
  text-align: center;
  font-size: var(--pk-fs-xs);
  color: var(--pk-gray-500);
}

.pk-footer .social-links a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--pk-gray-800);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--pk-gray-400);
  margin-right: .5rem;
  transition: var(--pk-transition);
}

.pk-footer .social-links a:hover {
  background: var(--pk-red);
  color: #fff;
}

/* ============================================================
   17. LOGIN PAGE
   ============================================================ */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--pk-primary-light) 0%, var(--pk-white) 100%);
  padding: 2rem 1rem;
}

.login-card {
  background: var(--pk-white);
  border-radius: var(--pk-radius-lg);
  box-shadow: var(--pk-shadow-lg);
  width: 100%;
  max-width: 420px;
  padding: 2.5rem 2rem;
}

.login-card .login-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-card .login-logo .logo-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--pk-red), var(--pk-red-light));
  color: #fff;
  border-radius: var(--pk-radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: .75rem;
}

.login-card .login-logo h4 {
  font-weight: 700;
  margin-bottom: .1rem;
}

.login-card .login-logo p {
  font-size: var(--pk-fs-sm);
  color: var(--pk-gray-500);
}

/* Role Tabs on Login */
.role-tabs {
  display: flex;
  background: var(--pk-gray-100);
  border-radius: var(--pk-radius-sm);
  padding: 3px;
  margin-bottom: 1.5rem;
}

.role-tabs .role-tab {
  flex: 1;
  padding: .5rem .75rem;
  text-align: center;
  border: none;
  background: transparent;
  font-size: var(--pk-fs-sm);
  font-weight: 600;
  color: var(--pk-gray-500);
  border-radius: 5px;
  cursor: pointer;
  transition: var(--pk-transition);
}

.role-tabs .role-tab.active,
.role-tabs .role-tab:hover {
  background: var(--pk-white);
  color: var(--pk-red);
  box-shadow: var(--pk-shadow-sm);
}

/* ============================================================
   18. QUEUE SYSTEM STYLES
   ============================================================ */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 2rem;
}

.step-indicator .step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  flex-shrink: 0;
}

.step-indicator .step .step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2.5px solid var(--pk-gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--pk-fs-sm);
  color: var(--pk-gray-400);
  background: var(--pk-white);
  transition: var(--pk-transition);
}

.step-indicator .step.active .step-circle {
  background: var(--pk-red);
  border-color: var(--pk-red);
  color: #fff;
}

.step-indicator .step.done .step-circle {
  background: var(--pk-red);
  border-color: var(--pk-red);
  color: #fff;
}

.step-indicator .step .step-label {
  font-size: var(--pk-fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  color: var(--pk-gray-400);
  letter-spacing: .03em;
}

.step-indicator .step.active .step-label {
  color: var(--pk-red);
}

.step-indicator .step.done .step-label {
  color: var(--pk-red);
}

.step-indicator .step-line {
  height: 3px;
  width: 60px;
  background: var(--pk-gray-300);
  border-radius: 2px;
  margin: 0 .5rem;
  margin-bottom: 1.2rem;
}

.step-indicator .step-line.done {
  background: var(--pk-red);
}

/* Ticket Card */
.ticket-card {
  max-width: 400px;
  margin: 0 auto;
  background: var(--pk-white);
  border: 2px solid var(--pk-red-bg);
  border-radius: var(--pk-radius-lg);
  overflow: hidden;
  box-shadow: var(--pk-shadow-md);
}

.ticket-card .ticket-header {
  background: linear-gradient(135deg, var(--pk-red-bg), #FFCDD2);
  text-align: center;
  padding: 1.25rem 1rem;
}

.ticket-card .ticket-header .ticket-label {
  font-size: var(--pk-fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--pk-red);
}

.ticket-card .ticket-header .ticket-number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--pk-red-dark);
  line-height: 1.1;
}

.ticket-card .ticket-header .ticket-sub {
  font-size: var(--pk-fs-sm);
  color: var(--pk-red);
  font-weight: 600;
}

.ticket-card .ticket-body {
  padding: 1.5rem;
}

.ticket-card .ticket-body .qr-placeholder {
  width: 160px;
  height: 160px;
  background: var(--pk-gray-100);
  border-radius: var(--pk-radius);
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pk-gray-400);
  font-size: 3rem;
}

.ticket-card .ticket-row {
  display: flex;
  justify-content: space-between;
  padding: .6rem 0;
  border-bottom: 1px dashed var(--pk-gray-200);
  font-size: var(--pk-fs-sm);
}

.ticket-card .ticket-row .ticket-key {
  color: var(--pk-gray-500);
}

.ticket-card .ticket-row .ticket-val {
  font-weight: 600;
  color: var(--pk-gray-800);
}

/* Queue Status Tracker */
.queue-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 1.25rem;
}

.queue-status .qs-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
}

.queue-status .qs-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2.5px solid var(--pk-gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--pk-gray-400);
  background: var(--pk-white);
}

.queue-status .qs-step.done .qs-circle {
  background: var(--pk-red);
  border-color: var(--pk-red);
  color: #fff;
}

.queue-status .qs-step.active .qs-circle {
  background: var(--pk-blue);
  border-color: var(--pk-blue);
  color: #fff;
  animation: pulse 1.5s infinite;
}

.queue-status .qs-label {
  font-size: var(--pk-fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  color: var(--pk-gray-400);
}

.queue-status .qs-step.done .qs-label {
  color: var(--pk-red);
}

.queue-status .qs-step.active .qs-label {
  color: var(--pk-blue);
}

.queue-status .qs-line {
  height: 3px;
  width: 50px;
  background: var(--pk-gray-300);
  margin: 0 .35rem;
  margin-bottom: 1.2rem;
  border-radius: 2px;
}

.queue-status .qs-line.done {
  background: var(--pk-red);
}

@keyframes pulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(21, 101, 192, .3);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(21, 101, 192, 0);
  }
}

/* ============================================================
   19. DOCTOR CARD
   ============================================================ */
.doctor-card {
  background: var(--pk-white);
  border: 1px solid var(--pk-gray-200);
  border-radius: var(--pk-radius);
  box-shadow: var(--pk-shadow-sm);
  padding: 1.5rem;
  text-align: center;
  transition: var(--pk-transition);
}

.doctor-card:hover {
  box-shadow: var(--pk-shadow);
  transform: translateY(-2px);
}

.doctor-card .doctor-photo {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--pk-red-bg);
  margin: 0 auto .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pk-red);
  font-size: 2.25rem;
  border: 3px solid var(--pk-red-bg);
  overflow: hidden;
}

.doctor-card .doctor-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.doctor-card .doctor-name {
  font-weight: 700;
  font-size: var(--pk-fs-base);
  margin-bottom: .15rem;
}

.doctor-card .doctor-poli {
  display: inline-block;
  font-size: var(--pk-fs-xs);
  font-weight: 600;
  color: var(--pk-red);
  background: var(--pk-red-bg);
  padding: .2rem .65rem;
  border-radius: 12px;
  margin-bottom: .75rem;
}

.doctor-card .schedule-mini {
  width: 100%;
  margin-bottom: 1rem;
}

.doctor-card .schedule-mini th {
  font-size: .65rem;
  font-weight: 600;
  color: var(--pk-gray-500);
  text-align: center;
  padding: .2rem .15rem;
  text-transform: uppercase;
}

.doctor-card .schedule-mini td {
  font-size: var(--pk-fs-xs);
  text-align: center;
  padding: .2rem .15rem;
  color: var(--pk-gray-600);
  font-weight: 500;
}

/* ============================================================
   20. CHART CONTAINER
   ============================================================ */
.chart-container {
  background: var(--pk-white);
  border: 1px solid var(--pk-gray-200);
  border-radius: var(--pk-radius);
  box-shadow: var(--pk-shadow-sm);
  padding: 1.25rem;
}

.chart-container .chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.chart-container .chart-header h5 {
  margin: 0;
  font-weight: 700;
}

/* ============================================================
   21. LOADING SPINNER
   ============================================================ */
.pk-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid var(--pk-gray-200);
  border-top-color: var(--pk-red);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, .7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}

/* ============================================================
   22. EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-state .empty-icon {
  width: 80px;
  height: 80px;
  background: var(--pk-gray-100);
  border-radius: 50%;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--pk-gray-400);
}

.empty-state .empty-title {
  font-weight: 700;
  font-size: var(--pk-fs-lg);
  color: var(--pk-gray-700);
  margin-bottom: .25rem;
}

.empty-state .empty-text {
  font-size: var(--pk-fs-sm);
  color: var(--pk-gray-500);
}

/* ============================================================
   23. FILTER PILLS
   ============================================================ */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.5rem;
}

.filter-pill {
  padding: .4rem 1rem;
  border-radius: 20px;
  font-size: var(--pk-fs-sm);
  font-weight: 600;
  border: 1.5px solid var(--pk-gray-300);
  background: var(--pk-white);
  color: var(--pk-gray-600);
  cursor: pointer;
  transition: var(--pk-transition);
}

.filter-pill:hover,
.filter-pill.active {
  background: var(--pk-red);
  border-color: var(--pk-red);
  color: #fff;
}

/* ============================================================
   24. PRINT STYLES
   ============================================================ */
@media print {

  .pk-sidebar,
  .pk-navbar,
  .no-print {
    display: none !important;
  }

  .pk-main {
    margin-left: 0 !important;
    padding-top: 0 !important;
  }

  body {
    background: #fff;
  }

  .pk-card,
  .stat-card,
  .chart-container,
  .pk-table-wrapper {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ============================================================
   25. SIDEBAR OVERLAY (mobile)
   ============================================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  z-index: 1055;
}

.sidebar-overlay.show {
  display: block;
}

/* ============================================================
   26. RESPONSIVE
   ============================================================ */
@media (max-width: 991.98px) {
  .pk-navbar.admin-navbar {
    left: 0;
  }

  .pk-sidebar {
    transform: translateX(-100%);
  }

  .pk-sidebar.show {
    transform: translateX(0);
  }

  .pk-main {
    margin-left: 0;
  }
}

@media (max-width: 767.98px) {
  .py-5 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
  .py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
  
  .pk-hero h1 {
    font-size: var(--pk-fs-2xl);
  }

  .stat-card {
    padding: 0.75rem 1rem;
    gap: 0.75rem;
  }

  .action-card {
    padding: 1.25rem 1rem;
  }

  .info-card {
    padding: 1.25rem;
  }

  .stat-card .stat-value {
    font-size: var(--pk-fs-xl);
  }

  .step-indicator .step-line {
    width: 30px;
  }

  h1 {
    font-size: var(--pk-fs-2xl);
  }

  h2 {
    font-size: var(--pk-fs-xl);
  }

  .pk-table-wrapper .table-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 575.98px) {
  .pk-hero {
    padding: 2.5rem 0 2rem;
  }

  .content-wrapper {
    padding: 1rem !important;
  }

  .ticket-card .ticket-header .ticket-number {
    font-size: 2.25rem;
  }
}

/* ============================================================
   14. CHARTS
   ============================================================ */
.chart-container {
  position: relative;
  width: 100%;
  background: var(--pk-white);
  border-radius: var(--pk-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--pk-shadow-sm);
  border: 1px solid var(--pk-gray-200);
  margin-bottom: 1rem;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.chart-header h5 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--pk-gray-800);
  margin: 0;
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 250px;
}

.chart-wrapper.chart-wrapper-lg {
  height: 280px;
}

@media (max-width: 768px) {
  .chart-wrapper {
    height: 200px;
  }
  .chart-wrapper.chart-wrapper-lg {
    height: 220px;
  }
  .chart-container {
    padding: 1rem;
  }
}

/* ============================================================
   15. CHATBOT (Layanan Bantuan Mitra)
   ============================================================ */
.chat-widget-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.chat-fab {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--pk-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: var(--pk-shadow-lg);
  cursor: pointer;
  transition: var(--pk-transition);
  border: none;
}

.chat-fab:hover {
  transform: scale(1.1) rotate(5deg);
  background: var(--pk-secondary);
}

.chat-window {
  width: 360px;
  max-width: calc(100vw - 4rem);
  height: 600px;
  max-height: calc(100vh - 8rem);
  background: #f4f7f9;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: var(--pk-shadow-lg);
  margin-bottom: 1rem;
  display: none;
  flex-direction: column;
  animation: fadeInUp 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.chat-window.active {
  display: flex;
}

.chat-header {
  background: white;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--pk-gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-header-info h6 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #1a1a1a;
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--pk-gray-500);
  font-weight: 500;
}

.chat-status-dot {
  width: 8px;
  height: 8px;
  background: #2ecc71;
  border-radius: 50%;
}

.chat-body {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-date-separator {
  text-align: center;
  margin: 0.5rem 0;
}

.chat-date-separator span {
  background: #e1e8ed;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #657786;
  text-transform: uppercase;
}

.chat-bubble {
  max-width: 85%;
  padding: 0.85rem 1rem;
  border-radius: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.5;
  position: relative;
}

.chat-bubble-admin {
  background: white;
  color: #1a1a1a;
  align-self: flex-start;
  border-bottom-left-radius: 0.25rem;
}

.chat-bubble-user {
  background: #1aff8c; /* Green from screen.png */
  color: #004d26;
  align-self: flex-end;
  border-bottom-right-radius: 0.25rem;
}

.bubble-time {
  font-size: 0.7rem;
  margin-top: 0.35rem;
  opacity: 0.6;
}

.bubble-sender {
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: #657786;
}

.chat-footer {
  background: white;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--pk-gray-200);
}

.chat-quick-replies {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.quick-reply-pill {
  background: #e8fff3;
  color: #004d26;
  border: 1px solid #b3ffcf;
  padding: 0.4rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--pk-transition-fast);
}

.quick-reply-pill:hover {
  background: #b3ffcf;
}

.chat-input-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #f0f2f5;
  padding: 0.5rem 0.75rem;
  border-radius: 1.5rem;
}

.chat-input {
  border: none;
  background: transparent;
  flex: 1;
  font-size: 0.9rem;
  padding: 0.25rem;
}

.chat-input:focus {
  outline: none;
}

.chat-send-btn {
  background: #1aff8c;
  color: #004d26;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--pk-transition-fast);
}

.chat-send-btn:hover {
  transform: scale(1.1);
}

@media (max-width: 576px) {
  .chat-widget-container {
    bottom: 1rem;
    right: 1rem;
  }
  .chat-window {
    width: calc(100vw - 2rem);
    height: calc(100vh - 2rem);
    margin-bottom: 0;
  }
}
