/* ── Sidebar polish ── */
.main-sidebar {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
  border-right: 1px solid #e2e8f0 !important;
  box-shadow: 2px 0 16px rgba(15, 23, 42, 0.04);
}

.sidebar {
  padding: 0 10px 24px !important;
}

.sidebar-doctor-card {
  margin: 0 4px 16px;
  padding: 14px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  max-width: 100%;
}

.sidebar-doctor-card-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sidebar-doctor-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.sidebar-doctor-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.sidebar-doctor-info strong,
.sidebar-doctor-info small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.sidebar-doctor-info strong {
  font-size: 14px;
  color: #0f172a;
  line-height: 1.3;
  font-weight: 600;
}

.sidebar-doctor-info small {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.sidebar-doctor-profile-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff !important;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-doctor-profile-link:hover {
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.sidebar-nav-header {
  padding: 18px 12px 6px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8 !important;
  background: transparent !important;
}

.sidebar-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: middle;
  line-height: 1.3;
}
.sidebar-tag--online {
  background: #dbeafe;
  color: #1d4ed8;
}
.sidebar-tag--soon {
  background: #fef3c7;
  color: #b45309;
}
.sidebar-nav-header--marketing {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-menu .treeview-menu .sidebar-tag {
  margin-left: 4px;
}

/* Marketing hub */
.marketing-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px;
  background: linear-gradient(135deg, #eff6ff 0%, #ecfdf5 100%);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
}
.marketing-hero--compact {
  padding: 18px 22px;
}
.marketing-hero__copy {
  flex: 1;
  min-width: 0;
}
.marketing-hero__art {
  flex-shrink: 0;
  width: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.marketing-hero__art--sm {
  width: 160px;
}
.marketing-hero__img {
  display: block;
  width: 100%;
  max-width: 220px;
  height: auto;
  max-height: 150px;
  object-fit: contain;
  border-radius: 0;
}
.marketing-hero__art--sm .marketing-hero__img {
  max-width: 160px;
  max-height: 120px;
}
.marketing-image-preview {
  max-width: 280px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafc;
}
.marketing-image-preview img {
  display: block;
  width: 100%;
  height: auto;
}
.marketing-soon-card {
  text-align: center;
  padding: 20px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  height: 100%;
}
.marketing-soon-card i {
  font-size: 28px;
  color: #2563eb;
  margin-bottom: 10px;
}
.marketing-soon-card h4 {
  font-size: 16px;
  margin: 0 0 8px;
}
.marketing-free-badge {
  font-size: 12px;
  padding: 5px 10px;
}

.marketing-merge-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.marketing-merge-tags__label {
  margin-right: 2px;
}

.marketing-merge-tag {
  border-radius: 999px;
  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
  font-size: 11px;
  padding: 2px 10px;
}

.sidebar-menu {
  padding: 0 !important;
}

.sidebar-menu > li > a {
  border-radius: 10px;
  margin: 2px 0;
  padding: 11px 14px !important;
  color: #334155 !important;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-menu > li > a > i,
.sidebar-menu > li > a > .bx {
  font-size: 18px !important;
  width: 22px;
  margin-right: 10px;
  color: #64748b;
  transition: color 0.15s ease;
}

.sidebar-menu > li:hover > a {
  background: rgba(37, 99, 235, 0.08) !important;
  color: #1e40af !important;
}

.sidebar-menu > li:hover > a > i,
.sidebar-menu > li:hover > a > .bx {
  color: #2563eb !important;
}

.sidebar-menu > li.active > a,
.sidebar-menu > li.menu-open > a {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12) 0%, rgba(37, 99, 235, 0.06) 100%) !important;
  color: #1d4ed8 !important;
  font-weight: 600;
}

.sidebar-menu > li.active > a > i,
.sidebar-menu > li.active > a > .bx,
.sidebar-menu > li.menu-open > a > i,
.sidebar-menu > li.menu-open > a > .bx {
  color: #2563eb !important;
}

.sidebar-menu .treeview-menu {
  padding-left: 8px !important;
  margin: 4px 0 8px 12px !important;
  border-left: 2px solid #e2e8f0;
}

.sidebar-menu .treeview-menu > li > a {
  padding: 8px 12px !important;
  border-radius: 8px;
  font-size: 13px;
  color: #64748b !important;
}

.sidebar-menu .treeview-menu > li.active > a,
.sidebar-menu .treeview-menu > li > a:hover {
  background: rgba(37, 99, 235, 0.08) !important;
  color: #1d4ed8 !important;
}

.sidebar-menu > li > a > .pull-right-container > .fa-angle-right {
  color: #94a3b8;
  font-size: 12px;
}

.sidebar-quick-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 4px 14px;
}

.sidebar-quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: 10px 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  color: #475569 !important;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  text-decoration: none !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sidebar-quick-link__label {
  display: block;
  max-width: 100%;
}

.sidebar-quick-link i,
.sidebar-quick-link .bx {
  font-size: 20px;
  color: #2563eb;
  margin-bottom: 4px;
}

.sidebar-quick-link:hover {
  border-color: #93c5fd;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
  color: #1d4ed8 !important;
}

.sidebar-collapse .sidebar-doctor-card,
.sidebar-collapse .sidebar-quick-links {
  display: none;
}

.sidebar::-webkit-scrollbar {
  width: 5px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.content-wrapper {
  background: #f8fafc !important;
}

/* ── Admin header toolbar ── */
@media (min-width: 768px) {
  .main-header .navbar.navbar-static-top {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    padding-right: 16px;
  }

  .main-header .sidebar-toggle.cus {
    flex-shrink: 0;
  }

  .main-header .navbar-toolbar {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
  }

  .main-header .dropdown.shortcut-menu {
    position: static !important;
    right: auto !important;
    float: none !important;
    margin: 0 !important;
    flex-shrink: 0;
  }

  .main-header .navbar-custom-menu {
    float: none !important;
    position: static !important;
    flex-shrink: 0;
  }

  .main-header .navbar-custom-menu > .navbar-nav {
    margin: 0;
    float: none;
    display: flex;
    align-items: center;
  }

  li.dropdown.user.user-menu {
    margin-top: 0 !important;
    margin-right: 0 !important;
  }

  .user-menu a.dropdown-toggle {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px !important;
    line-height: 1.2 !important;
    max-width: 220px;
    white-space: nowrap;
  }

  .user-menu a.dropdown-toggle .user-image {
    width: 34px !important;
    height: 34px !important;
    margin: 0 !important;
    float: none !important;
    flex-shrink: 0;
  }

  .user-menu a.dropdown-toggle .user-menu-label {
    display: inline-block !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 130px;
    font-size: 14px;
    color: #444;
  }

  .user-menu a.dropdown-toggle .user-menu-chevron {
    flex-shrink: 0;
    font-size: 12px;
    color: #666;
  }

  .navbar-custom-menu .navbar-nav > li {
    height: auto;
  }

  .navbar-custom-menu .navbar-nav li > a.dropdown-toggle {
    line-height: normal !important;
    padding: 0 !important;
  }

  .main-header .dnone-sm {
    display: inline !important;
  }

  .main-header .user-menu-label.dnone-sm {
    display: inline-block !important;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .user-menu a.dropdown-toggle .user-menu-label {
    max-width: 90px;
  }
}

/* ── Doctor dashboard polish ── */
.user-dashboard-wrap {
  padding-bottom: 12px;
}

/* Hero */
.user-dashboard-hero {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 20px;
  color: #fff;
  box-shadow: 0 20px 50px rgba(30, 64, 175, 0.25);
}

.user-dashboard-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 38%, #2563eb 72%, #60a5fa 100%);
  z-index: 0;
}

.user-dashboard-hero-bg::before,
.user-dashboard-hero-bg::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.user-dashboard-hero-bg::before {
  top: -35%;
  right: -8%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14) 0%, transparent 70%);
}

.user-dashboard-hero-bg::after {
  bottom: -45%;
  left: 5%;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.35) 0%, transparent 70%);
}

.user-dashboard-hero-inner {
  position: relative;
  z-index: 1;
  padding: 28px 28px 24px;
}

.user-dashboard-hero-profile {
  display: flex;
  align-items: center;
  gap: 18px;
}

.user-dashboard-hero-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.user-dashboard-hero-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.user-dashboard-hero-status {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.35);
}

.user-dashboard-greeting {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.82);
  text-transform: uppercase;
}

.user-dashboard-branding-badge {
  margin: 10px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
}

.user-dashboard-branding-badge i {
  margin-right: 4px;
}

.user-dashboard-branding-modal .modal-title {
  font-weight: 600;
}

.user-dashboard-branding-feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.user-dashboard-branding-feature-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #f8fafc;
}

.user-dashboard-branding-feature-list li.is-highlight {
  border-color: #99f6e4;
  background: #f0fdfa;
  font-weight: 600;
}

.rx-share-promo {
  margin-top: 16px;
}

.pt-id-card__brand {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #64748b;
}

.rx-field-toggle--locked {
  opacity: 0.65;
}

.user-dashboard-name {
  margin: 0 0 6px;
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
}

.user-dashboard-date {
  margin: 0 0 12px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.user-dashboard-date-sep {
  opacity: 0.65;
}

.user-dashboard-live-clock {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.95);
}

.user-dashboard-live-clock::before {
  content: '\f017';
  font-family: FontAwesome;
  font-weight: normal;
  margin-right: 5px;
  opacity: 0.85;
}

.user-dashboard-date i {
  margin-right: 4px;
  opacity: 0.85;
}

.user-dashboard-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.user-dashboard-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  backdrop-filter: blur(6px);
}

.user-dashboard-tag--accent {
  background: rgba(34, 197, 94, 0.22);
  border-color: rgba(34, 197, 94, 0.45);
}

/* Hero actions */
.user-dashboard-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-dashboard-actions-primary,
.user-dashboard-actions-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (min-width: 992px) {
  .user-dashboard-actions {
    align-items: flex-end;
  }

  .user-dashboard-actions-primary,
  .user-dashboard-actions-secondary {
    justify-content: flex-end;
  }
}

.btn-dashboard-primary,
.btn-dashboard-outline,
.btn-dashboard-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  border: none;
  cursor: pointer;
}

.btn-dashboard-primary {
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.btn-dashboard-primary:hover {
  background: #f8fafc;
  color: #1e40af;
  transform: translateY(-1px);
}

.btn-dashboard-outline {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(4px);
}

.btn-dashboard-outline:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.btn-dashboard-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-dashboard-ghost:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* Quick tiles */
.user-dashboard-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.user-dashboard-quick-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  text-decoration: none !important;
  color: #334155 !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.user-dashboard-quick-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.1);
}

.user-dashboard-quick-tile .tile-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.user-dashboard-quick-tile .tile-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-dashboard-quick-tile .tile-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  color: #0f172a;
}

.user-dashboard-quick-tile .tile-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.3;
}

.user-dashboard-quick-tile .tile-label--solo {
  font-size: 13px;
  color: #334155;
}

.user-dashboard-quick-tile--primary:hover { border-color: #93c5fd; }
.user-dashboard-quick-tile--primary .tile-icon { background: rgba(37, 99, 235, 0.12); color: #2563eb; }

.user-dashboard-quick-tile--success:hover { border-color: #86efac; }
.user-dashboard-quick-tile--success .tile-icon { background: rgba(34, 197, 94, 0.12); color: #16a34a; }

.user-dashboard-quick-tile--warning:hover { border-color: #fcd34d; }
.user-dashboard-quick-tile--warning .tile-icon { background: rgba(245, 158, 11, 0.12); color: #d97706; }

.user-dashboard-quick-tile--danger:hover { border-color: #fca5a5; }
.user-dashboard-quick-tile--danger .tile-icon { background: rgba(239, 68, 68, 0.12); color: #dc2626; }

/* Alert banner */
.user-dashboard-alert {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  margin-bottom: 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.12);
}

.user-dashboard-alert-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #f59e0b;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.user-dashboard-alert-copy strong {
  display: block;
  color: #92400e;
  margin-bottom: 4px;
}

.user-dashboard-alert-copy p {
  color: #78350f;
  font-size: 14px;
}

.user-dashboard-alert-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #b45309;
  text-decoration: none;
}

.user-dashboard-alert-link:hover {
  color: #92400e;
  text-decoration: underline;
}

/* Section headers */
.user-dashboard-section-head {
  margin-bottom: 16px;
}

.user-dashboard-section-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

/* Stat cards */
.user-dashboard-stat-link {
  display: block;
  text-decoration: none !important;
  height: 100%;
}

.user-dashboard-stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
  padding: 20px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.user-dashboard-stat-link:hover .user-dashboard-stat-card {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.1);
}

.user-dashboard-stat-card .stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.user-dashboard-stat-card .stat-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-dashboard-stat-card .stat-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 4px;
  line-height: 1.3;
}

.user-dashboard-stat-card .stat-value {
  font-size: 26px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.1;
}

.user-dashboard-stat-card--primary .stat-icon { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.user-dashboard-stat-card--primary:hover { border-color: #93c5fd; }

.user-dashboard-stat-card--success .stat-icon { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.user-dashboard-stat-card--success:hover { border-color: #86efac; }

.user-dashboard-stat-card--danger .stat-icon { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
.user-dashboard-stat-card--danger:hover { border-color: #fca5a5; }

.user-dashboard-stat-card--warning .stat-icon { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.user-dashboard-stat-card--warning:hover { border-color: #fcd34d; }

/* Share / QR card */
.user-dashboard-share-card {
  height: 100%;
  background: linear-gradient(165deg, #fff 0%, #f8fafc 55%, #eef2ff 100%);
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

.user-dashboard-share-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px 0;
}

.user-dashboard-share-header .share-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.user-dashboard-share-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.user-dashboard-share-header p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #64748b;
}

.user-dashboard-share-body {
  padding: 18px 22px 22px;
  text-align: center;
}

.user-dashboard-qr-frame {
  display: inline-block;
  padding: 12px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  margin-bottom: 14px;
}

.user-dashboard-qr-frame img {
  display: block;
  max-width: 150px;
  height: auto;
  border-radius: 6px;
}

.user-dashboard-domain-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  margin-bottom: 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}

.user-dashboard-profile-url {
  word-break: break-all;
  font-size: 12px;
  color: #475569;
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  margin-bottom: 8px;
}

.user-dashboard-domain-fallback {
  font-size: 11px;
  color: #94a3b8;
  margin: 0 0 12px;
  text-align: left;
}

.user-dashboard-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

/* Panels */
.user-dashboard-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
}

.user-dashboard-panel--fill {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.user-dashboard-panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.user-dashboard-panel-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.panel-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.panel-icon--blue { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.panel-icon--green { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.panel-icon--purple { background: rgba(139, 92, 246, 0.12); color: #7c3aed; }

.user-dashboard-panel-body {
  padding: 20px;
}

.user-dashboard-panel-body--flush {
  padding: 0;
  flex: 1;
}

.user-dashboard-chart {
  min-height: 260px;
}

#userIncomeChart {
  height: 260px !important;
}

/* Income pills */
.user-dashboard-income-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.user-dashboard-income-pill {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  text-align: center;
}

.user-dashboard-income-pill .income-year {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.user-dashboard-income-pill strong {
  font-size: 16px;
  font-weight: 700;
  color: #15803d;
}

/* Appointment list */
.user-dashboard-appointment-list {
  display: flex;
  flex-direction: column;
}

.user-dashboard-appointment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  text-decoration: none !important;
  color: inherit;
  transition: background 0.15s ease;
}

.user-dashboard-appointment-item:last-child {
  border-bottom: none;
}

.user-dashboard-appointment-item:hover {
  background: #f8fafc;
}

.user-dashboard-appointment-item .appointment-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.user-dashboard-appointment-item .appointment-date {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.user-dashboard-appointment-item .appointment-date i {
  margin-right: 4px;
  color: #2563eb;
  font-size: 13px;
}

.user-dashboard-appointment-item .appointment-count {
  font-size: 12px;
  color: #64748b;
}

.user-dashboard-appointment-item .appointment-count i {
  margin-right: 3px;
}

.user-dashboard-appointment-item .appointment-action {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: #2563eb;
  white-space: nowrap;
}

.user-dashboard-appointment-item:hover .appointment-action {
  color: #1d4ed8;
}

/* Empty states */
.user-dashboard-empty {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
}

.user-dashboard-empty--compact {
  padding: 24px 16px;
}

.user-dashboard-empty i {
  display: block;
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.45;
}

@media (max-width: 991px) {
  .user-dashboard-stats-row--duplicate {
    display: none;
  }

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

@media (max-width: 767px) {
  .content-wrapper > .content.container {
    padding-left: 10px;
    padding-right: 10px;
  }

  .user-dashboard-wrap {
    margin-left: -4px;
    margin-right: -4px;
  }

  .user-dashboard-hero {
    border-radius: 14px;
    margin-bottom: 14px;
  }

  .user-dashboard-hero-inner {
    padding: 18px 16px;
  }

  .user-dashboard-hero-profile {
    flex-direction: column;
    text-align: center;
  }

  .user-dashboard-hero-avatar {
    width: 72px;
    height: 72px;
  }

  .user-dashboard-name {
    font-size: 1.35rem;
  }

  .user-dashboard-hero-tags {
    justify-content: center;
  }

  .user-dashboard-actions {
    align-items: stretch;
  }

  .user-dashboard-actions-primary,
  .user-dashboard-actions-secondary {
    flex-direction: column;
  }

  .btn-dashboard-primary,
  .btn-dashboard-outline,
  .btn-dashboard-ghost {
    width: 100%;
    justify-content: center;
    padding: 11px 14px;
  }

  .user-dashboard-quick-grid {
    gap: 10px;
    margin-bottom: 20px;
  }

  .user-dashboard-quick-tile {
    flex-direction: column;
    text-align: center;
    padding: 14px 12px;
    border-radius: 14px;
    gap: 10px;
  }

  .user-dashboard-quick-tile .tile-icon {
    width: 42px;
    height: 42px;
    font-size: 19px;
  }

  .user-dashboard-quick-tile .tile-value {
    font-size: 20px;
  }

  .user-dashboard-quick-tile .tile-label {
    font-size: 11px;
  }

  .user-dashboard-section-title {
    font-size: 1.05rem;
  }

  .user-dashboard-stat-card {
    padding: 14px;
    gap: 12px;
  }

  .user-dashboard-stat-card .stat-icon {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }

  .user-dashboard-stat-card .stat-value {
    font-size: 22px;
  }

  .user-dashboard-stat-card .stat-label {
    font-size: 11px;
  }

  .user-dashboard-qr-frame img {
    max-width: 130px;
  }

  .user-dashboard-profile-url {
    font-size: 11px;
    padding: 8px 10px;
  }

  .user-dashboard-panel-head {
    padding: 14px 16px;
  }

  .user-dashboard-panel-body {
    padding: 14px;
  }

  #userIncomeChart {
    height: 220px !important;
  }

  .user-dashboard-appointment-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 16px;
  }

  .user-dashboard-appointment-item .appointment-action {
    align-self: flex-end;
  }

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

@media (max-width: 380px) {
  .user-dashboard-quick-grid {
    gap: 8px;
  }

  .user-dashboard-quick-tile .tile-label {
    font-size: 10px;
  }

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

/* ── Ratings page ── */
.rating-page-box .box-header-light {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.rating-summary-card {
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  height: 100%;
}

.rating-summary-label {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rating-summary-score {
  font-size: 48px;
  line-height: 1;
  font-weight: 700;
  color: #0f172a;
}

.rating-summary-score small {
  font-size: 20px;
  color: #94a3b8;
  font-weight: 500;
}

.rating-summary-stars {
  margin: 14px 0 10px;
  font-size: 18px;
}

.rating-summary-count {
  margin: 0;
  font-size: 13px;
  color: #64748b;
}

.rating-breakdown {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px 22px;
  height: 100%;
}

.rating-breakdown-title {
  margin: 0 0 18px;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}

.rating-breakdown-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.rating-breakdown-row:last-child {
  margin-bottom: 0;
}

.rating-breakdown-label {
  width: 42px;
  flex-shrink: 0;
  font-size: 13px;
  color: #475569;
  white-space: nowrap;
}

.rating-breakdown-bar {
  flex: 1;
  height: 10px;
  margin: 0;
  border-radius: 999px;
  background: #f1f5f9;
  overflow: hidden;
}

.rating-breakdown-bar .progress-bar {
  border-radius: 999px;
}

.rating-breakdown-count {
  width: 28px;
  flex-shrink: 0;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.rating-page-divider {
  margin: 28px 0 24px;
  border-color: #e2e8f0;
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.review-item {
  display: flex;
  gap: 16px;
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
}

.review-item-avatar img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.review-item-body {
  flex: 1;
  min-width: 0;
}

.review-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 6px;
}

.review-item-meta strong {
  color: #0f172a;
  font-size: 15px;
}

.review-item-meta span {
  color: #94a3b8;
  font-size: 13px;
}

.review-item-stars {
  margin-bottom: 8px;
}

.review-item-text {
  margin: 0;
  color: #475569;
  line-height: 1.6;
  white-space: pre-wrap;
}

.rating-page-empty {
  margin: 12px 0 4px;
}

@media (max-width: 767px) {
  .rating-summary-card,
  .rating-breakdown {
    margin-bottom: 16px;
  }

  .review-item {
    flex-direction: column;
  }
}

/* ── Admin header mobile ── */
@media (max-width: 767px) {
  .dnone-sm {
    display: none !important;
  }

  .dnone-smss {
    display: none !important;
  }

  .main-header {
    max-height: none;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto;
    align-items: center;
    column-gap: 6px;
    padding: 8px 10px 8px 4px;
  }

  .main-header .switch_business.logo,
  .main-header .switch_chambers.logo {
    grid-column: 2;
    grid-row: 1;
    float: none !important;
    width: auto !important;
    max-width: 100%;
    min-width: 0;
    margin: 0 !important;
    padding: 6px 8px;
    overflow: hidden;
    text-align: left;
  }

  .main-header .switch_business .logo-lg,
  .main-header .switch_chambers .logo-lg {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
  }

  .main-header .switch_business .logo-lg img,
  .main-header .switch_chambers .logo-lg img {
    flex-shrink: 0;
  }

  .main-header .switch_business .dnone-sms,
  .main-header .switch_chambers .logo-lg {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }

  .main-header .switch_business .buss-arrow {
    display: none;
  }

  .main-header .navbar.navbar-static-top {
    display: contents;
  }

  .main-header .navbar-toolbar {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    min-width: 0;
  }

  .main-header .sidebar-toggle.cus {
    grid-column: 1;
    grid-row: 1;
    float: none !important;
    padding: 8px 10px !important;
    margin: 0;
  }

  .main-header .sidebar-toggle .bx-menu {
    margin-top: 0 !important;
  }

  .main-header .navbar-custom-menu {
    grid-column: auto;
    grid-row: auto;
    flex-shrink: 0;
    float: none !important;
    margin: 0 !important;
    position: relative;
    right: auto;
  }

  .main-header .navbar-custom-menu > .navbar-nav {
    margin: 0;
    float: none;
    display: flex;
    align-items: center;
  }

  li.dropdown.user.user-menu {
    margin-top: 0 !important;
    margin-right: 0 !important;
    float: none;
  }

  .user-menu a.dropdown-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 2px !important;
    min-width: 0;
    border-radius: 50% !important;
  }

  .user-menu a.dropdown-toggle .user-image {
    width: 36px !important;
    height: 36px !important;
    margin: 0 !important;
    float: none !important;
  }

  /* scale-up uses display:inline-block + scale(0) instead of display:none — hide until opened */
  .navbar-nav > .user-menu > .dropdown-menu.scale-up:not(.show) {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: none !important;
  }

  .navbar-nav > .user-menu.show > .dropdown-menu.scale-up,
  .navbar-nav > .user-menu > .dropdown-menu.scale-up.show {
    display: block !important;
    visibility: visible !important;
    pointer-events: auto !important;
    opacity: 1 !important;
    transform: none !important;
    position: fixed !important;
    right: 8px !important;
    left: auto !important;
    top: 56px !important;
    margin-top: 0 !important;
    min-width: 240px;
    max-width: calc(100vw - 16px);
    z-index: 1050;
    float: none !important;
    width: auto !important;
    background-color: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.15) !important;
    overflow: hidden;
  }

  .navbar-nav > .user-menu > .dropdown-menu > li.user-header {
    margin-top: 0 !important;
    height: auto !important;
    min-height: 72px;
    padding: 12px 10px !important;
  }

  .navbar-nav > .user-menu > .dropdown-menu > li.user-header img {
    width: 40px !important;
    height: 40px !important;
    margin-top: 0 !important;
  }

  .navbar-nav > .user-menu > .dropdown-menu > .user-body {
    background: #fff !important;
    padding: 8px 0 12px !important;
  }

  .navbar-nav > .user-menu > .dropdown-menu > .user-body a {
    display: block;
    padding: 10px 16px !important;
    color: #334155 !important;
    font-size: 14px;
  }

  .navbar-nav > .user-menu > .dropdown-menu > .user-body a:hover {
    background: #f1f5f9;
    color: #1d4ed8 !important;
  }

  .dropdown.shortcut-menu {
    display: none !important;
  }

  .main-sidebar {
    padding-top: 72px !important;
  }
}

/* AI prescription & scribe (v2.6) */
.rx-page-head {
  align-items: center;
  gap: 12px;
}

.rx-workflow-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.rx-workflow-steps__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #f1f5f9;
  border-radius: 999px;
  font-size: 13px;
  color: #64748b;
}

.rx-workflow-steps__item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #cbd5e1;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.rx-workflow-steps__item.is-active {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}

.rx-workflow-steps__item.is-active span {
  background: #2563eb;
}

.rx-section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 10px;
}

.rx-patient-picker {
  padding: 14px 16px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: linear-gradient(180deg, #fafbfc 0%, #f8fafc 100%);
}

.rx-patient-picker__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.rx-patient-picker__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #ecfdf5;
  color: #0f766e;
  font-size: 18px;
}

.rx-patient-picker__titles {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.rx-patient-picker__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #334155;
}

.rx-patient-picker__hint {
  font-size: 11px;
  line-height: 1.4;
  color: #94a3b8;
}

.rx-patient-picker__body {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.rx-patient-picker__field {
  flex: 1 1 280px;
  min-width: 0;
}

.rx-patient-picker__label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #475569;
}

.rx-patient-select {
  width: 100% !important;
  min-height: 40px;
  border-radius: 8px;
  border-color: #cbd5e1;
}

.rx-patient-picker__field .select2-container {
  width: 100% !important;
}

.rx-patient-picker__field .select2-container .select2-selection--single {
  min-height: 40px;
  border-color: #cbd5e1;
  border-radius: 8px;
  background: #fff;
}

.rx-patient-picker__field .select2-container .select2-selection__rendered {
  line-height: 38px;
  padding-left: 12px;
  padding-right: 28px;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
}

.rx-patient-picker__field .select2-container .select2-selection__placeholder {
  color: #94a3b8;
  font-weight: 500;
}

.rx-patient-picker__field .select2-container .select2-selection__arrow {
  height: 38px;
}

.rx-patient-picker__field .patient_error_text {
  margin: 6px 0 0;
  font-size: 12px;
}

.rx-patient-option {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.3;
  padding: 2px 0;
}

.rx-patient-option__name {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.rx-patient-option__meta {
  font-size: 11px;
  color: #64748b;
}

.rx-patient-picker__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 0 1 auto;
}

.rx-patient-picker__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 148px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #475569;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.rx-patient-picker__btn:hover,
.rx-patient-picker__btn:focus {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.rx-patient-picker__btn--primary {
  border-color: #bae6fd;
  background: #f0f9ff;
}

.rx-patient-picker__btn--primary:hover,
.rx-patient-picker__btn--primary:focus {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0c4a6e;
}

.rx-patient-picker__btn-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 14px;
}

.rx-patient-picker__btn--primary .rx-patient-picker__btn-icon {
  background: #dbeafe;
  color: #2563eb;
}

.rx-patient-picker__btn-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.rx-patient-picker__btn-text strong {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  color: inherit;
}

.rx-patient-picker__btn-text small {
  font-size: 10px;
  line-height: 1.2;
  color: #94a3b8;
  font-weight: 500;
}

@media (max-width: 767px) {
  .rx-patient-picker {
    padding: 12px;
  }

  .rx-patient-picker__body {
    flex-direction: column;
    align-items: stretch;
  }

  .rx-patient-picker__field {
    flex: 1 1 100%;
    width: 100%;
  }

  .rx-patient-picker__actions {
    width: 100%;
  }

  .rx-patient-picker__btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }
}

.rx-builder-page .select2-results__option .rx-patient-option__name {
  display: block;
}

.rx-builder-page .select2-results__option .rx-patient-option__meta {
  display: block;
}

.rx-field-label {
  font-weight: 600;
  font-size: 13px;
  color: #334155;
  display: block;
  margin-bottom: 6px;
}

.rx-field-label small {
  font-weight: 400;
  color: #94a3b8;
}

.rx-ai-assist {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.rx-ai-assist-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 0;
  background: #f8fafc;
  text-align: left;
  cursor: pointer;
}

.rx-ai-assist-toggle:hover {
  background: #f1f5f9;
}

.rx-ai-assist-toggle__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #dbeafe;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rx-ai-assist-toggle__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rx-ai-assist-toggle__text strong {
  font-size: 14px;
  color: #0f172a;
}

.rx-ai-assist-toggle__text small {
  font-size: 12px;
  color: #64748b;
}

.rx-ai-assist-toggle__chevron,
.rx-ai-subtoggle .fa-chevron-down {
  color: #94a3b8;
  transition: transform 0.2s ease;
}

.rx-ai-assist-toggle__chevron.rotated,
.rx-ai-subtoggle .fa-chevron-down.rotated {
  transform: rotate(180deg);
}

.rx-ai-assist-body {
  padding: 16px;
  border-top: 1px solid #e2e8f0;
}

.rx-ai-block {
  margin-bottom: 16px;
}

.rx-ai-block:last-child {
  margin-bottom: 0;
}

.rx-ai-block__title {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 6px;
}

.rx-ai-block__hint {
  font-size: 12px;
  color: #64748b;
  margin: 0 0 12px;
  line-height: 1.5;
}

.rx-ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rx-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 6px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.rx-step-badge--muted {
  background: #94a3b8;
}

.rx-ai-block--secondary {
  border-top: 1px dashed #e2e8f0;
  padding-top: 12px;
}

.rx-ai-subtoggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}

.rx-ai-subtoggle small {
  font-weight: 400;
  color: #94a3b8;
}

.smart-draft-drawer,
.scribe-drawer {
  padding: 12px 0 4px;
}

.prescription-ai-toolbar .ai-toolbar-actions .btn {
  margin-right: 8px;
  margin-bottom: 8px;
}

.consultation-scribe-panel textarea {
  font-size: 13px;
}

.symptom-tags .ai-symptom-tag {
  margin: 0 6px 6px 0;
  text-transform: capitalize;
}

#ai_voice_toggle.listening,
#scribe_voice_toggle.listening {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

/* Follow-up automation & smart tools pages */
.rx-automation-page .rx-stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.rx-stat-card__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 6px;
}

.rx-stat-card__value {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
}

.rx-stat-card--ok { border-left: 4px solid #22c55e; }
.rx-stat-card--warn { border-left: 4px solid #f59e0b; }

.rx-channel-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 10px;
  margin-bottom: 8px;
  padding: 8px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  font-weight: 500;
  cursor: pointer;
}

.rx-channel-pill--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f8fafc;
}

.rx-channel-pill--disabled input {
  pointer-events: none;
}

.rx-rule-list { display: flex; flex-direction: column; gap: 12px; }

.rx-rule-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  opacity: 0.75;
}

.rx-rule-card.is-on {
  opacity: 1;
  border-color: #bfdbfe;
  background: #f8fafc;
}

.rx-rule-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
}

.rx-rule-card__toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  cursor: pointer;
  font-size: 14px;
}

.rx-rule-card__toggle input { margin: 0; }

.rx-rule-card__body {
  padding: 12px 14px;
  font-size: 13px;
}

.rx-dose-reminder-box {
  border-top: 3px solid #2563eb;
}
.rx-dose-reminder-box .box-header .label-primary {
  margin-top: 2px;
}
.rx-dose-time-grid .form-group label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.rx-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rx-checklist li {
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  color: #64748b;
  font-size: 13px;
}

.rx-checklist li.done {
  color: #0f172a;
}

.rx-checklist li i {
  color: #cbd5e1;
  margin-right: 8px;
}

.rx-checklist li.done i {
  color: #22c55e;
}

.rx-journey {
  padding-left: 18px;
  font-size: 13px;
  color: #475569;
  line-height: 1.8;
}

.rx-cron-code {
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px;
  border-radius: 8px;
  font-size: 11px;
  word-break: break-all;
  white-space: pre-wrap;
}

.rx-feature-card {
  text-align: center;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  height: 100%;
}

.rx-feature-card i {
  font-size: 28px;
  color: #2563eb;
  margin-bottom: 10px;
}

.rx-feature-card h4 {
  font-size: 15px;
  margin: 0 0 8px;
}

.rx-feature-card p {
  font-size: 12px;
  color: #64748b;
  min-height: 48px;
}

.rx-catalog-grid {
  margin-top: 8px;
}

.rx-pack-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 20px;
  height: calc(100% - 20px);
  background: #fff;
  display: flex;
  flex-direction: column;
}

.rx-pack-card__type {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 8px;
}

.rx-pack-card__title {
  font-size: 17px;
  margin: 0 0 10px;
}

.rx-pack-card__desc {
  font-size: 13px;
  color: #64748b;
  flex: 1;
}

.rx-pack-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0;
  font-size: 13px;
}

.rx-pack-card__actions {
  margin-top: auto;
}

.rx-toggle-row__label {
  display: block;
  cursor: pointer;
}

.rx-toggle-row__label input {
  margin-right: 8px;
}

/* Prescription builder split layout */
.rx-builder-page .w-1500 {
  max-width: 1600px;
  width: 100% !important;
}

.rx-builder-page .content.container-fluid {
  max-width: 100%;
  overflow-x: clip;
}

.rx-builder {
  display: grid;
  grid-template-columns: minmax(320px, 42%) minmax(360px, 58%);
  gap: 20px;
  align-items: start;
}

/* ---- Stepwise wizard ---- */
.rx-wizard {
  display: block;
  max-width: 920px;
  margin: 0 auto;
}

.rx-steps {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  align-items: flex-start;
  counter-reset: rxstep;
}

.rx-steps__item {
  position: relative;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  cursor: pointer;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  min-width: 0;
}

/* connector line between steps */
.rx-steps__item::before {
  content: "";
  position: absolute;
  top: 16px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: #e2e8f0;
  z-index: 0;
}

.rx-steps__item:first-child::before {
  display: none;
}

.rx-steps__num {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #e2e8f0;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.15s ease;
}

.rx-steps__text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.rx-steps__item.is-active {
  color: #2563eb;
}

.rx-steps__item.is-active .rx-steps__num {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.rx-steps__item.is-done {
  color: #16a34a;
}

.rx-steps__item.is-done .rx-steps__num {
  border-color: #16a34a;
  background: #16a34a;
  color: #fff;
}

.rx-steps__item.is-done::before {
  background: #16a34a;
}

.rx-step {
  display: none;
  animation: rxStepIn 0.18s ease;
}

.rx-step.is-active {
  display: block;
}

@keyframes rxStepIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.rx-step__head {
  margin-bottom: 16px;
}

.rx-step__title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
}

.rx-step__hint {
  margin: 0;
  font-size: 13px;
  color: #64748b;
}

.rx-wizard__nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid #e2e8f0;
  background: #fafbfc;
}

.rx-wizard__nav-spacer {
  flex: 1 1 auto;
}

.rx-wizard__nav .btn {
  min-height: 44px;
  padding: 0 22px;
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.rx-review .rx-preview-panel {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.rx-review .rx-preview-panel__body {
  max-height: none;
  padding: 16px;
}

.rx-wizard__form .box {
  margin-bottom: 0;
  overflow: visible;
}

.rx-wizard__form .box-body {
  overflow: visible;
}

.rx-builder-page .select2-container {
  width: 100% !important;
  max-width: 100% !important;
}

.rx-builder__preview {
  position: sticky;
  top: 80px;
}

.rx-preview-panel {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.rx-preview-panel__head {
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.rx-preview-panel__head h4 {
  font-size: 14px;
  font-weight: 700;
  color: #334155;
}

.rx-preview-panel__body {
  max-height: calc(100vh - 140px);
  overflow: auto;
  padding: 12px;
}

.rx-preview-paper--compact {
  font-size: 13px;
}

.rx-preview-paper--compact .prescription_headers h3,
.rx-preview-paper--compact .prescription_headers h4 {
  font-size: 15px;
}

.rx-preview-empty {
  text-align: center;
  padding: 48px 24px;
  color: #94a3b8;
}

.rx-preview-empty i {
  font-size: 28px;
  display: block;
  margin-bottom: 12px;
}

.rx-medicine-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rx-stock-hint {
  margin: 0 0 10px;
  font-size: 13px;
  color: #64748b;
}

.rx-stock-hint a {
  font-weight: 600;
}

.rx-medicine-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
  background: #fafbfc;
  overflow: visible;
}

/* Select2 in prescription builder — scoped styling (dropdownCssClass unsupported in this Select2 build) */
.rx-builder-page .select2-dropdown {
  z-index: 10050 !important;
  border-radius: 10px;
  border-color: #cbd5e1;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}

.rx-builder-page .select2-dropdown .select2-search--dropdown {
  display: block;
  padding: 10px 10px 6px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.rx-builder-page .select2-dropdown .select2-search--dropdown .select2-search__field {
  width: 100% !important;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.rx-builder-page .select2-dropdown .select2-search--dropdown .select2-search__field:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.rx-builder-page .select2-dropdown .select2-results__option {
  padding: 8px 12px;
  font-size: 14px;
}

.rx-builder-page .select2-dropdown .select2-results__message {
  padding: 10px 12px;
  color: #64748b;
  font-size: 13px;
}

.rx-medicine-card .select2-container--default .select2-selection--single {
  min-height: 40px;
  border-color: #cbd5e1;
  border-radius: 8px;
}

.rx-medicine-card .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 38px;
  padding-left: 12px;
  color: #334155;
}

.rx-medicine-card .select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: #94a3b8;
}

.rx-medicine-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.rx-medicine-card__num {
  font-size: 13px;
  font-weight: 700;
  color: #475569;
}

.rx-medicine-card__badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.rx-medicine-card__badge--drug {
  background: #dcfce7;
  color: #166534;
}

.rx-medicine-card__badge--formulation {
  background: #e0f2fe;
  color: #075985;
}

.rx-clinical-panel {
  margin-top: 20px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}

.rx-clinical-panel__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 0;
  background: #f8fafc;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}

.rx-clinical-panel__body {
  padding: 16px;
}

.rx-clinical-panel__body .group {
  margin-bottom: 14px;
}

.rx-custom-medicine-option {
  color: #2563eb;
  font-weight: 600;
}

.rx-custom-medicine-panel {
  border: 1px dashed #93c5fd;
  background: #f8fbff;
  border-radius: 8px;
  padding: 12px;
}

.rx-medicine-catalog-wrap .rx-show-custom-medicine,
.rx-custom-medicine-panel .rx-show-catalog-medicine {
  font-size: 13px;
}

.rx-save-custom-medicine-wrap {
  margin-top: 8px;
}

.rx-save-custom-medicine-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #334155;
  margin-bottom: 0;
  cursor: pointer;
}

.rx-therapies-panel {
  border: 1px solid #dbeafe;
  background: #f8fbff;
  border-radius: 10px;
  padding: 16px 18px;
}

.rx-dose-schedule {
  margin-top: 12px;
  padding: 14px 16px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: linear-gradient(180deg, #fafbfc 0%, #f8fafc 100%);
}

.rx-dose-schedule__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.rx-dose-schedule__titles {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.rx-dose-schedule__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #334155;
}

.rx-dose-schedule__hint {
  font-size: 11px;
  line-height: 1.4;
  color: #94a3b8;
}

.rx-dose-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rx-dose-row {
  position: relative;
}

.rx-dose-row--follow {
  padding-top: 12px;
  border-top: 1px dashed #dbeafe;
}

.rx-dose-row__then {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #0f766e;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rx-dose-row__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rx-dose-section {
  min-width: 0;
}

.rx-dose-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin-bottom: 8px;
}

.rx-dose-section__title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #0f766e;
}

.rx-dose-section__hint {
  font-size: 11px;
  color: #94a3b8;
}

.rx-dose-section--kala {
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.rx-dose-kala-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.rx-dose-kala-cell {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  margin: 0;
}

.rx-dose-kala-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 0;
  text-align: center;
}

.rx-dose-kala-sanskrit {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  color: #0f766e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.rx-dose-kala-hint {
  font-size: 9px;
  font-weight: 600;
  line-height: 1.2;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.rx-dose-row__fields {
  display: grid;
  grid-template-columns: minmax(150px, 0.85fr) minmax(180px, 1.15fr) minmax(200px, 1.3fr);
  gap: 12px;
  align-items: start;
}

.rx-dose-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.rx-dose-field__label {
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #475569;
}

.rx-dose-field__sublabel {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  line-height: 1.3;
  color: #94a3b8;
}

.rx-dose-select {
  width: 100%;
  height: 34px;
  padding: 4px 8px;
  font-size: 12px;
  border-color: #cbd5e1;
  border-radius: 6px;
  background: #fff;
  text-overflow: ellipsis;
}

.rx-dose-kala-cell .rx-dose-select {
  text-align: center;
  text-align-last: center;
  padding-right: 22px;
}

.rx-dose-field--timing .select2-container {
  width: 100% !important;
  max-width: 100%;
}

.rx-dose-field--timing .select2-container--default .select2-selection--multiple {
  min-height: 34px;
  border-color: #cbd5e1;
  border-radius: 6px;
  font-size: 12px;
  padding-bottom: 2px;
}

.rx-dose-field--timing .select2-container--default .select2-selection--multiple .select2-selection__rendered {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
  padding: 3px 6px;
  box-sizing: border-box;
}

.rx-dose-field--timing .select2-container--default .select2-selection--multiple .select2-selection__choice {
  font-size: 11px;
  line-height: 1.3;
  padding: 2px 6px;
  margin: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rx-dose-field--timing .select2-container--default .select2-search--inline {
  flex: 1 1 60px;
  min-width: 40px;
}

.rx-dose-field--timing .select2-container--default .select2-search--inline .select2-search__field {
  font-size: 12px;
  margin-top: 2px;
  min-width: 40px;
}

.rx-dose-inline-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.rx-dose-inline-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.rx-dose-inline-cell__label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}

.rx-dose-notes-wrap {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

.rx-dose-notes-wrap .rx-dose-select {
  flex: 1 1 auto;
  min-width: 0;
}

.rx-dose-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  padding-top: 0;
}

.rx-dose-actions .btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@media (max-width: 1199px) {
  .rx-dose-row__fields {
    grid-template-columns: 1fr 1fr;
  }

  .rx-dose-field--notes {
    grid-column: 1 / -1;
  }
}

@media (max-width: 991px) {
  .rx-dose-kala-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rx-dose-row__fields {
    grid-template-columns: 1fr;
  }

  .rx-dose-field--notes {
    grid-column: auto;
  }
}

@media (max-width: 767px) {
  .rx-dose-schedule {
    padding: 12px;
  }

  .rx-dose-section--kala {
    padding: 10px;
  }

  .rx-dose-kala-grid {
    gap: 8px;
  }
}

@media (max-width: 991px) {
  .rx-builder {
    grid-template-columns: 1fr;
  }

  .rx-builder__preview {
    position: static;
  }

  .rx-preview-panel__body {
    max-height: none;
  }
}

/* ---- Wizard: tablet & mobile ---- */
@media (max-width: 767px) {
  .rx-builder-page .content.container-fluid {
    padding-left: 8px;
    padding-right: 8px;
  }

  .rx-builder-page .box-body {
    padding: 14px 12px 96px;
  }

  .rx-wizard {
    max-width: none;
  }

  .rx-steps {
    margin-bottom: 14px;
    padding: 0 4px;
  }

  .rx-steps__item {
    font-size: 11px;
    gap: 4px;
  }

  .rx-steps__num {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }

  .rx-steps__item::before {
    top: 14px;
  }

  .rx-step__title {
    font-size: 16px;
  }

  .rx-step__head {
    margin-bottom: 12px;
  }

  .rx-patient-picker {
    padding: 12px;
  }

  .rx-patient-picker__field {
    flex: 1 1 100%;
    width: 100%;
  }

  .rx-patient-picker__btn {
    flex: 1 1 100%;
    min-height: 44px;
  }

  .rx-patient-picker__field .select2-container .select2-selection--single {
    min-height: 44px;
  }

  .rx-patient-picker__field .select2-container .select2-selection__rendered {
    line-height: 42px;
  }

  .rx-clinical-panel__body .d_flex {
    flex-wrap: wrap;
    gap: 8px;
  }

  .rx-clinical-panel__body .d_flex .form-control {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    width: auto !important;
  }

  /* Sticky bottom action bar for thumb reach */
  .rx-wizard__nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    margin: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.1);
    flex-wrap: nowrap;
  }

  .rx-wizard__nav .btn {
    flex: 1 1 auto;
    justify-content: center;
    min-height: 48px;
    font-size: 16px;
  }

  .rx-wizard__back {
    flex: 0 0 auto !important;
    min-width: 88px;
  }

  .rx-medicine-card {
    padding: 12px;
  }

  .rx-medicine-card.row_col {
    padding: 12px;
  }

  .rx-medicine-actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .rx-dose-section--kala {
    width: 100%;
  }

  .rx-dose-select {
    height: 40px;
    font-size: 14px;
  }

  .rx-medicine-card .select2-container--default .select2-selection--single {
    min-height: 44px;
  }

  .rx-medicine-card .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 42px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 480px) {
  /* show only the active step's label, keep numbers for the rest */
  .rx-steps__item .rx-steps__text {
    display: none;
  }

  .rx-steps__item.is-active .rx-steps__text {
    display: block;
    position: absolute;
    top: 38px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
  }

  .rx-steps {
    margin-bottom: 26px;
  }
}

/* Prescription sheet preview styling */
.rx-preview-paper {
  background: #fff;
  border-radius: 10px;
}

.rx-preview-empty__icon {
  font-size: 42px;
  color: #99f6e4;
  margin-bottom: 12px;
}

.rx-sheet-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 2px solid #0f766e;
  margin-bottom: 14px;
}

.rx-sheet-header__doctor h3 {
  margin: 0 0 4px;
  font-size: 18px;
  color: #0f766e;
  font-weight: 700;
}

.rx-sheet-header__doctor p,
.rx-sheet-header__clinic p {
  margin: 0 0 2px;
  font-size: 12px;
}

.rx-sheet-header__clinic {
  text-align: right;
  flex: 1;
}

.rx-sheet-header__clinic h4 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
}

.rx-sheet-header__clinic .chamber-img {
  max-height: 48px;
  margin-bottom: 6px;
}

.rx-muted {
  color: #64748b !important;
}

.rx-patient-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  background: linear-gradient(90deg, #f0fdfa, #ecfeff);
  border: 1px solid #99f6e4;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
}

.rx-patient-strip__name {
  font-weight: 700;
  color: #134e4a;
  font-size: 15px;
}

.rx-patient-strip__meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #475569;
}

.rx-patient-strip__meta span {
  background: #fff;
  padding: 2px 8px;
  border-radius: 999px;
}

.rx-sheet-body {
  display: grid;
  grid-template-columns: 34% 66%;
  gap: 16px;
}

.rx-sidebar-block {
  margin-bottom: 14px;
}

.rx-sidebar-block h5 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0f766e;
  margin: 0 0 6px;
}

.rx-sidebar-block ul {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: #334155;
}

.rx-sidebar-block .rx-notes {
  font-size: 12px;
  color: #475569;
  margin: 0;
}

.rx-sheet-main {
  padding-left: 8px;
  border-left: 1px dashed #cbd5e1;
}

.rx-symbol {
  font-size: 36px;
  color: #0f766e;
  line-height: 1;
  margin-bottom: 12px;
  opacity: 0.85;
}

.rx-med-item {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px dashed #e2e8f0;
}

.rx-med-item:last-child {
  border-bottom: 0;
}

.rx-med-item__name {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: #134e4a;
}

.rx-dose-line {
  margin: 0 0 4px;
  font-size: 13px;
  color: #334155;
}

.rx-dose-then {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 6px;
  text-transform: uppercase;
}

.rx-dose-qty {
  font-weight: 600;
}

.rx-dose-meal {
  color: #64748b;
  margin-left: 4px;
}

.rx-dose-duration {
  color: #0f766e;
  margin-left: 4px;
}

.rx-dose-note {
  margin: 0 0 6px 12px;
  font-size: 12px;
  color: #64748b;
  font-style: italic;
}

.rx-followup {
  margin-top: 12px;
  padding: 8px 12px;
  background: #fffbeb;
  border-radius: 6px;
  font-size: 13px;
  color: #92400e;
}

.rx-preview-paper--compact .rx-sheet-header__doctor h3 {
  font-size: 16px;
}

.rx-preview-paper--compact .rx-med-item__name {
  font-size: 14px;
}

@media (max-width: 767px) {
  .rx-sheet-body {
    grid-template-columns: 1fr;
  }

  .rx-sheet-main {
    border-left: 0;
    padding-left: 0;
    border-top: 1px dashed #cbd5e1;
    padding-top: 12px;
  }

  .rx-sheet-footer,
  .footer_pescript {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .rx-sheet-footer .visit_right,
  .footer_pescript .visit_right {
    text-align: left;
  }

  .rx-sheet-footer .visit_right img,
  .footer_pescript .visit_right img {
    margin-left: 0;
  }
}

/* Prescription layout builder (header/footer settings) */
.rx-layout-builder {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 20px;
  align-items: start;
}

.rx-layout-builder__preview {
  position: sticky;
  top: 80px;
}

.rx-layout-tabs .nav-link {
  font-size: 13px;
  font-weight: 600;
}

.rx-merge-group {
  margin-bottom: 16px;
}

.rx-merge-group h5 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin: 0 0 8px;
}

.rx-merge-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rx-merge-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  border-radius: 999px;
}

.rx-layout-tips {
  margin: 0 0 12px;
  padding-left: 18px;
  color: #475569;
  font-size: 13px;
}

.rx-layout-example {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12px;
  overflow: auto;
}

.rx-layout-custom-header,
.rx-layout-custom-footer {
  margin-bottom: 12px;
}

.rx-layout-custom-footer {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  clear: both;
}

/* Prescription sheet footer (share link, preview, PDF web view) */
.rx-sheet-footer,
.footer_pescript {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  clear: both;
}

.rx-sheet-footer .visit_left,
.footer_pescript .visit_left {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
}

.rx-sheet-footer .visit_right,
.footer_pescript .visit_right {
  flex: 0 0 auto;
  text-align: right;
}

.rx-sheet-footer .last_visit_pn,
.footer_pescript .last_visit_pn {
  margin: 0 0 4px;
  font-size: 13px;
  color: #334155;
}

.rx-sheet-footer .dr_name,
.footer_pescript .dr_name {
  margin: 0;
  font-size: 14px;
  color: #0f172a;
}

.rx-sheet-footer .visit_right img,
.footer_pescript .visit_right img {
  display: block;
  max-width: 150px;
  height: auto;
  margin-left: auto;
}

.rx-visual-footer .rx-visual-footer__extra,
.rx-visual-footer .rx-visual-footer__disclaimer {
  margin: 4px 0 0;
}

.rx-share-page .rx-preview-paper {
  padding: 16px 20px 20px;
}

.rx-print-area,
.rx-saved-print-box .box-body {
  background: #fff;
}

@media print {
  @page {
    size: A4;
    margin: 12mm;
  }

  body.rx-html-print-mode * {
    visibility: hidden;
  }

  body.rx-html-print-mode #print_area,
  body.rx-html-print-mode #print_area * {
    visibility: visible;
  }

  body.rx-html-print-mode #print_area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .rx-print-area .rx-preview-paper {
    box-shadow: none;
    border-radius: 0;
  }
}

.rx-share-page .rx-sheet-footer,
.rx-share-page .footer_pescript {
  margin-top: 24px;
}

@media (max-width: 991px) {
  .rx-layout-builder {
    grid-template-columns: 1fr;
  }

  .rx-layout-builder__preview {
    position: static;
  }
}

.rx-layout-panel--disabled {
  opacity: 0.45;
  pointer-events: none;
}

.rx-style-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.rx-style-card {
  display: block;
  margin: 0;
  cursor: pointer;
}

.rx-style-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rx-style-card__body {
  display: block;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.rx-style-card input:checked + .rx-style-card__body {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.rx-style-card__body strong {
  display: block;
  font-size: 14px;
  color: #0f172a;
}

.rx-style-card__body small {
  display: block;
  color: #64748b;
  margin-top: 4px;
}

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

.rx-check-card {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
}

.rx-check-card input {
  margin: 0;
}

.rx-color-input {
  max-width: 120px;
  height: 42px;
  padding: 4px;
}

.rx-visual-header {
  border-bottom: 2px solid var(--rx-accent, #0f766e);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.rx-visual-header--centered .rx-visual-header__center {
  text-align: center;
}

.rx-visual-header__name {
  font-size: 18px;
  font-weight: 700;
  color: var(--rx-accent, #0f766e);
  margin: 8px 0 4px;
}

.rx-visual-header__clinic-name {
  font-weight: 600;
  margin: 4px 0;
}

.rx-visual-header__tagline {
  font-style: italic;
  color: #64748b;
  margin-top: 6px;
}

.rx-visual-header__extra,
.rx-visual-footer__extra {
  font-size: 12px;
  color: #64748b;
  margin-top: 8px;
}

.rx-visual-footer__disclaimer {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 6px;
  margin-bottom: 0;
}

@media (max-width: 767px) {
  .rx-style-cards,
  .rx-field-grid {
    grid-template-columns: 1fr;
  }
}

/* Patient card dashboard & per-patient hub */
.pt-page .box-body {
  background: #f8fafc;
}

.pt-page-head {
  gap: 12px;
}

.pt-page-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.pt-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pt-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pt-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none !important;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.pt-tab:hover {
  border-color: #cbd5e1;
  color: #0f172a;
}

.pt-tab.is-active {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}

.pt-tab__badge {
  display: inline-flex;
  min-width: 22px;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  font-size: 11px;
  font-weight: 700;
}

.pt-tab.is-active .pt-tab__badge {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.pt-search {
  position: relative;
  min-width: min(100%, 280px);
}

.pt-search .fa-search {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.pt-search input {
  padding-left: 34px;
  border-radius: 10px;
  border-color: #e2e8f0;
  box-shadow: none;
}

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

.pt-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

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

.pt-card__head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.pt-card__top {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.pt-card__avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.pt-card__avatar--lg {
  width: 56px;
  height: 56px;
  font-size: 18px;
  border-radius: 14px;
}

.pt-card__name {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.pt-card__meta,
.pt-hub-profile__meta {
  margin: 0;
  font-size: 13px;
  color: #64748b;
}

.pt-card__facts,
.pt-hub-profile__facts {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}

.pt-card__facts li,
.pt-hub-profile__facts li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  color: #475569;
  margin-bottom: 6px;
}

.pt-card__facts li i {
  color: #94a3b8;
  width: 14px;
  margin-top: 2px;
}

.pt-hub-profile__facts li {
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}

.pt-hub-profile__facts li span {
  color: #94a3b8;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pt-hub-profile__facts li strong {
  text-align: right;
  color: #0f172a;
  font-weight: 600;
}

.pt-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pt-empty {
  text-align: center;
  padding: 48px 20px;
  color: #64748b;
}

.pt-empty i {
  font-size: 28px;
  color: #94a3b8;
  margin-bottom: 10px;
}

.pt-empty p {
  margin-bottom: 14px;
}

.pt-hub-page .content.container-fluid {
  max-width: 1280px;
}

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

.pt-hub-profile__hero {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.pt-hub-profile__name {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
}

.pt-hub-quick {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.pt-hub-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.pt-stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
}

.pt-stat-card__label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 6px;
}

.pt-stat-card__value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.pt-stat-card__value--sm {
  font-size: 16px;
}

.pt-stat-card__value small {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  margin-top: 2px;
}

.pt-hub-summary textarea {
  border-radius: 10px;
  border-color: #e2e8f0;
  resize: vertical;
  min-height: 120px;
}

.pt-hub-summary__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.pt-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 11px;
  font-weight: 600;
}

.pt-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pt-timeline__item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 18px;
  position: relative;
}

.pt-timeline__item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 34px;
  bottom: 0;
  width: 2px;
  background: #e2e8f0;
}

.pt-timeline__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #0f766e;
  position: relative;
  z-index: 1;
}

.pt-timeline__item--appointment .pt-timeline__icon { color: #2563eb; }
.pt-timeline__item--note .pt-timeline__icon { color: #7c3aed; }
.pt-timeline__item--report .pt-timeline__icon { color: #d97706; }

.pt-timeline__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.pt-timeline__head time {
  font-size: 12px;
  color: #94a3b8;
}

.pt-timeline__subtitle {
  margin: 0 0 6px;
  font-size: 13px;
  color: #64748b;
}

.pt-timeline__link {
  font-size: 12px;
  font-weight: 600;
}

.pt-hub-dual {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.pt-mini-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pt-mini-list li {
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}

.pt-mini-list li:last-child {
  border-bottom: 0;
}

.pt-mini-list a {
  font-weight: 600;
  color: #0f766e;
}

.pt-mini-list span {
  display: block;
  color: #64748b;
  margin-top: 4px;
}

@media (max-width: 991px) {
  .pt-hub-layout {
    grid-template-columns: 1fr;
  }

  .pt-hub-stats {
    grid-template-columns: 1fr;
  }

  .pt-hub-stats--4 {
    grid-template-columns: 1fr 1fr;
  }

  .pt-hub-dual {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .pt-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .pt-search {
    width: 100%;
  }

  .pt-card-grid {
    grid-template-columns: 1fr;
  }

  .pt-hub-stats--4 {
    grid-template-columns: 1fr 1fr;
  }

  .pt-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pt-hub-tabs__nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.pt-hub-stats--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pt-stat-card--rx { border-left: 4px solid #0f766e; }
.pt-stat-card--visit { border-left: 4px solid #ec4899; }
.pt-stat-card--last { border-left: 4px solid #6366f1; }
.pt-stat-card--report { border-left: 4px solid #f59e0b; }

.pt-card__head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pt-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.pt-action-grid__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 72px;
  padding: 10px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  color: #334155;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  text-decoration: none !important;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  cursor: pointer;
}

.pt-action-grid__item:hover {
  border-color: #0f766e;
  color: #0f766e;
  background: #f0fdfa;
}

.pt-action-grid__item i {
  font-size: 18px;
}

.pt-action-grid__item--wa:hover {
  border-color: #22c55e;
  color: #15803d;
  background: #f0fdf4;
}

.pt-action-grid__item--ai {
  border-color: #c4b5fd;
  background: #faf5ff;
  color: #6d28d9;
}

.pt-action-grid__item--ai:hover {
  border-color: #8b5cf6;
  background: #f3e8ff;
}

.pt-hub-tabs__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.pt-hub-tabs__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.pt-hub-tabs__btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.pt-hub-tabs__btn.is-active {
  background: #0f766e;
  color: #fff;
}

.pt-hub-tabs__count {
  display: inline-flex;
  min-width: 20px;
  justify-content: center;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  font-size: 11px;
}

.pt-hub-tabs__btn.is-active .pt-hub-tabs__count {
  background: rgba(255, 255, 255, 0.22);
}

.pt-hub-tabs__panel {
  display: none;
}

.pt-hub-tabs__panel.is-active {
  display: block;
}

.pt-appt-type-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pt-appt-type-pill {
  margin: 0;
  cursor: pointer;
}

.pt-appt-type-pill input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.pt-appt-type-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  transition: all 0.15s ease;
}

.pt-appt-type-pill:hover span {
  border-color: #94a3b8;
  background: #f8fafc;
}

.pt-appt-type-pill.is-active span {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.pt-wa-branding-notice {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
}

.pt-wa-branding-notice__label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.pt-wa-branding-notice__text {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.45;
  color: #334155;
  white-space: pre-wrap;
}

.pt-timeline-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pt-filter-chip {
  padding: 6px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.pt-filter-chip.is-active {
  border-color: #0f766e;
  background: #ecfdf5;
  color: #0f766e;
}

.pt-records-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  border-top: 0;
}

.pt-records-table td {
  vertical-align: middle !important;
  font-size: 13px;
}

.pt-notes {
  max-width: 720px;
}

.pt-notes-compose {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 24px;
}

.pt-notes-compose__input,
.pt-notes-soap textarea {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.5;
  color: #0f172a;
  resize: vertical;
  background: #f8fafc;
  transition: border-color 0.15s, background 0.15s;
}

.pt-notes-compose__input:focus,
.pt-notes-soap textarea:focus {
  outline: none;
  border-color: #0d9488;
  background: #fff;
}

.pt-notes-compose__input {
  min-height: 96px;
}

.pt-notes-soap {
  margin-top: 10px;
}

.pt-notes-soap summary {
  cursor: pointer;
  font-size: 12px;
  color: #64748b;
  user-select: none;
  list-style: none;
}

.pt-notes-soap summary::-webkit-details-marker {
  display: none;
}

.pt-notes-soap summary::before {
  content: '+ ';
  font-weight: 700;
}

.pt-notes-soap[open] summary::before {
  content: '− ';
}

.pt-notes-soap__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

@media (max-width: 640px) {
  .pt-notes-soap__grid {
    grid-template-columns: 1fr;
  }
}

.pt-notes-compose__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
}

.pt-notes-compose__status {
  font-size: 12px;
  color: #64748b;
  margin-right: auto;
}

.pt-notes-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pt-notes-item {
  padding: 14px 0;
  border-bottom: 1px solid #f1f5f9;
}

.pt-notes-item:first-child {
  padding-top: 0;
}

.pt-notes-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.pt-notes-item__meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 12px;
  color: #94a3b8;
}

.pt-notes-item__meta-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pt-notes-item__author {
  color: #64748b;
}

.pt-notes-item__source {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #2563eb;
}

.pt-notes-history.is-loading {
  opacity: 0.65;
  pointer-events: none;
}

.pt-notes-item__meta a {
  font-size: 12px;
  font-weight: 600;
}

.pt-notes-item__text,
.pt-notes-item__soap {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: #334155;
  word-break: break-word;
}

.pt-notes-item__soap + .pt-notes-item__soap {
  margin-top: 6px;
}

.pt-notes-item__soap span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-right: 6px;
  border-radius: 4px;
  background: #ecfdf5;
  color: #0f766e;
  font-size: 11px;
  font-weight: 700;
  vertical-align: top;
}

.pt-notes-empty {
  margin: 0;
  padding: 32px 0;
  text-align: center;
  font-size: 13px;
  color: #94a3b8;
}

.pt-status {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.pt-status--pending {
  background: #fef3c7;
  color: #b45309;
}

.pt-status--done {
  background: #dcfce7;
  color: #15803d;
}

.pt-print-sheet {
  display: none;
}

.pt-print-sheet--active {
  display: none;
}

body.pt-print-mode * {
  visibility: hidden;
}

body.pt-print-mode #pt_print_sheet,
body.pt-print-mode #pt_print_sheet * {
  visibility: visible;
}

body.pt-print-mode #pt_print_sheet {
  display: block !important;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  padding: 40px;
}

.pt-print-sheet__inner {
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
  border: 2px solid #0f766e;
  border-radius: 16px;
  padding: 32px 24px;
}

.pt-print-sheet__inner h1 {
  margin: 0 0 12px;
  font-size: 28px;
  color: #0f172a;
}

.pt-print-sheet__meta {
  margin-top: 24px;
  font-size: 12px;
  color: #64748b;
}

/* Premium patient ID card */
.pt-id-card {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.pt-id-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #fff;
}

.pt-id-card__logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 4px;
}

.pt-id-card__clinic {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.pt-id-card__tag {
  margin: 2px 0 0;
  font-size: 11px;
  opacity: 0.85;
}

.pt-id-card__body {
  padding: 16px;
}

.pt-id-card__profile {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.pt-id-card__profile h2 {
  margin: 0 0 4px;
  font-size: 18px;
  color: #0f172a;
}

.pt-id-card__profile p {
  margin: 0;
  font-size: 12px;
  color: #64748b;
}

.pt-id-card__avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #0f766e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.pt-id-card__uid {
  text-align: center;
  padding: 10px;
  margin-bottom: 12px;
  border: 1px dashed #0f766e;
  border-radius: 10px;
  background: #ecfdf5;
}

.pt-id-card__uid span {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.pt-id-card__uid strong {
  font-size: 16px;
  letter-spacing: 1px;
  color: #0f766e;
}

.pt-id-card__facts {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  font-size: 12px;
}

.pt-id-card__facts li {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid #f1f5f9;
}

.pt-id-card__qr {
  text-align: center;
  margin-top: 10px;
}

.pt-id-card__qr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 10px;
}

.pt-id-card__qr-grid .pt-id-card__qr {
  margin-top: 0;
}

.pt-id-card__qr--clinical img {
  border-color: #99f6e4;
  width: 120px;
  height: 120px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.pt-id-card__qr--clinical small {
  color: #0f766e;
}

.pt-id-card__qr img {
  width: 96px;
  height: 96px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 6px;
  background: #fff;
}

.pt-id-card__qr small {
  display: block;
  margin-top: 6px;
  color: #94a3b8;
  font-size: 11px;
}

.pt-id-card__footer {
  display: flex;
  justify-content: space-between;
  padding: 10px 16px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  font-size: 11px;
  color: #64748b;
}

.pt-uid { color: #0f766e; letter-spacing: 0.5px; }

.pt-wa-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none !important;
}

.pt-wa-badge--on { background: #dcfce7; color: #15803d; }
.pt-wa-badge--off { background: #fef3c7; color: #b45309; }

.pt-quick-msg { display: flex; flex-wrap: wrap; gap: 8px; }

.pt-comm-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pt-comm-list li {
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}

.pt-comm-list__head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
}

.pt-signature-pad {
  width: 100%;
  border: 1px dashed #94a3b8;
  border-radius: 8px;
  background: #fff;
  touch-action: none;
}

.pt-merge-tags {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pt-merge-tag {
  display: inline-block;
  margin: 0 6px 6px 0;
  padding: 4px 8px;
  background: #f1f5f9;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
}

.pt-timeline__item--consent .pt-timeline__icon { color: #7c3aed; }

.pt-action-grid__item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

body.pt-print-mode .pt-id-card {
  box-shadow: none;
}

/* CR80 portrait — ISO 7810 ID-1 (53.98 × 85.60 mm) */
.pt-id-card--cr80 {
  width: min(243px, 100%);
  aspect-ratio: 54 / 85.6;
  height: auto;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
}

.pt-id-card--cr80 .pt-id-card__header {
  flex: 0 0 auto;
  gap: 8px;
  padding: 8px 10px;
}

.pt-id-card--cr80 .pt-id-card__logo {
  width: 28px;
  height: 28px;
  padding: 2px;
  border-radius: 6px;
}

.pt-id-card--cr80 .pt-id-card__clinic {
  font-size: 10px;
  line-height: 1.2;
}

.pt-id-card--cr80 .pt-id-card__tag {
  font-size: 8px;
  margin-top: 1px;
}

.pt-id-card--cr80 .pt-id-card__body {
  flex: 1 1 auto;
  padding: 10px;
  overflow: hidden;
  min-height: 0;
}

.pt-id-card--cr80 .pt-id-card__profile {
  gap: 8px;
  margin-bottom: 8px;
}

.pt-id-card--cr80 .pt-id-card__avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 11px;
  flex-shrink: 0;
}

.pt-id-card--cr80 .pt-id-card__profile h2 {
  font-size: 13px;
  line-height: 1.15;
  margin-bottom: 2px;
}

.pt-id-card--cr80 .pt-id-card__profile p {
  font-size: 9px;
}

.pt-id-card--cr80 .pt-id-card__uid {
  padding: 6px 8px;
  margin-bottom: 8px;
  border-radius: 8px;
}

.pt-id-card--cr80 .pt-id-card__uid span {
  font-size: 7px;
}

.pt-id-card--cr80 .pt-id-card__uid strong {
  font-size: 12px;
}

.pt-id-card--cr80 .pt-id-card__facts {
  margin-bottom: 8px;
  font-size: 9px;
}

.pt-id-card--cr80 .pt-id-card__facts li {
  padding: 2px 0;
}

.pt-id-card--cr80 .pt-id-card__qr-grid {
  gap: 8px;
  margin-top: 6px;
}

.pt-id-card--cr80 .pt-id-card__qr img {
  width: 62px;
  height: 62px;
  padding: 4px;
  border-radius: 8px;
}

.pt-id-card--cr80 .pt-id-card__qr--clinical img {
  width: 62px;
  height: 62px;
}

.pt-id-card--cr80 .pt-id-card__qr small {
  font-size: 7px;
  margin-top: 4px;
  line-height: 1.2;
}

.pt-id-card--cr80 .pt-id-card__footer {
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 6px 10px;
  font-size: 7px;
  line-height: 1.3;
}

.pt-id-card--cr80 .pt-id-card__brand {
  flex: 0 0 100%;
  text-align: center;
}

.pt-id-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.pt-hub-sidebar .pt-id-card--cr80 {
  width: 100%;
  max-width: 243px;
}

@media print {
  @page {
    size: 54mm 85.6mm;
    margin: 0;
  }

  html,
  body {
    width: 54mm !important;
    height: 85.6mm !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #fff !important;
  }

  body.pt-print-mode * {
    visibility: visible;
  }

  body.pt-print-mode > *:not(#pt_print_sheet_active) {
    display: none !important;
  }

  body.pt-print-mode #pt_print_sheet_active {
    display: block !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: 54mm !important;
    height: 85.6mm !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    page-break-before: avoid;
    page-break-after: avoid;
    page-break-inside: avoid;
  }

  body.pt-print-mode #pt_print_sheet,
  body.pt-print-mode .wrapper,
  body.pt-print-mode .modal,
  body.pt-print-mode .pt-bill-modal {
    display: none !important;
  }

  body.pt-print-mode .pt-id-card--cr80 {
    width: 54mm !important;
    height: 85.6mm !important;
    max-width: none !important;
    aspect-ratio: auto !important;
    margin: 0 !important;
    border-radius: 3mm;
    page-break-inside: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.pt-print-mode .pt-id-card--cr80 .pt-id-card__header {
    padding: 2mm 2.5mm;
  }

  body.pt-print-mode .pt-id-card--cr80 .pt-id-card__logo {
    width: 8mm;
    height: 8mm;
  }

  body.pt-print-mode .pt-id-card--cr80 .pt-id-card__clinic {
    font-size: 7pt;
  }

  body.pt-print-mode .pt-id-card--cr80 .pt-id-card__tag {
    font-size: 5.5pt;
  }

  body.pt-print-mode .pt-id-card--cr80 .pt-id-card__body {
    padding: 2mm 2.5mm;
  }

  body.pt-print-mode .pt-id-card--cr80 .pt-id-card__avatar {
    width: 8mm;
    height: 8mm;
    font-size: 6pt;
  }

  body.pt-print-mode .pt-id-card--cr80 .pt-id-card__profile h2 {
    font-size: 8pt;
  }

  body.pt-print-mode .pt-id-card--cr80 .pt-id-card__profile p {
    font-size: 6pt;
  }

  body.pt-print-mode .pt-id-card--cr80 .pt-id-card__uid {
    padding: 1.5mm 2mm;
  }

  body.pt-print-mode .pt-id-card--cr80 .pt-id-card__uid span {
    font-size: 5pt;
  }

  body.pt-print-mode .pt-id-card--cr80 .pt-id-card__uid strong {
    font-size: 9pt;
  }

  body.pt-print-mode .pt-id-card--cr80 .pt-id-card__facts {
    font-size: 6pt;
  }

  body.pt-print-mode .pt-id-card--cr80 .pt-id-card__qr img,
  body.pt-print-mode .pt-id-card--cr80 .pt-id-card__qr--clinical img {
    width: 14mm;
    height: 14mm;
    padding: 0.5mm;
  }

  body.pt-print-mode .pt-id-card--cr80 .pt-id-card__qr small {
    font-size: 4.5pt;
  }

  body.pt-print-mode .pt-id-card--cr80 .pt-id-card__footer {
    padding: 1.5mm 2.5mm;
    font-size: 4.5pt;
  }
}

/* OPD Skyview */
body.opd-skyview-page,
body.opd-skyview-page .wrapper {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  height: auto !important;
  min-height: 100% !important;
  max-height: none !important;
  touch-action: pan-y;
}
body.opd-skyview-page:not(.modal-open) .modal-backdrop {
  display: none !important;
}
.opd-skyview-wrap {
  overflow: visible;
  position: relative;
  z-index: 1;
}
.opd-skyview-wrap .content { padding-top: 10px; }
.opd-skyview-wrap .content.container-fluid {
  max-width: 1600px;
}
.opd-skyview-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding: 18px 22px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.opd-skyview-title { margin: 0 0 4px; font-size: 1.6rem; font-weight: 700; color: #0f172a; }
.opd-skyview-header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.opd-skyview-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #f1f5f9;
  border-radius: 999px;
  font-size: 13px;
  color: #334155;
}
.opd-skyview-stat strong {
  font-size: 1.1rem;
  color: #0f766e;
}

.opd-tv-settings {
  margin-bottom: 20px;
}
.opd-tv-settings--collapsible {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}
.opd-tv-settings--collapsible > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 14px 18px;
  background: #f8fafc;
  border-bottom: 1px solid transparent;
  font-weight: 700;
  color: #0f172a;
}
.opd-tv-settings--collapsible > summary::-webkit-details-marker { display: none; }
.opd-tv-settings--collapsible[open] > summary {
  border-bottom-color: #e2e8f0;
}
.opd-tv-settings__body {
  padding: 18px;
}
.opd-skyview-scan-hero {
  margin-bottom: 20px;
  border: 2px solid #2563eb;
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.1);
}
.opd-skyview-scan-hero__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
}
.opd-skyview-scan-hero__head .box-title {
  font-size: 1.15rem;
  color: #1e40af;
}
.opd-skyview-scan-hero__hint {
  font-size: 13px;
}
.opd-skyview-scan-hero__layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.opd-skyview-scan-hero__camera {
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}
.opd-skyview-scanner-shell {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
  isolation: isolate;
  touch-action: pan-y;
  contain: layout paint style;
}
.opd-skyview-scanner-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.35);
  clip-path: polygon(
    evenodd,
    0 0,
    100% 0,
    100% 100%,
    0 100%,
    0 0,
    12% 12%,
    12% 88%,
    88% 88%,
    88% 12%,
    12% 12%
  );
}
.opd-skyview-scanner {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #0f172a;
  border: 3px solid #1e293b;
}
.opd-skyview-scanner-frame {
  pointer-events: none;
  position: absolute;
  inset: 12%;
  z-index: 2;
  border: 2px solid rgba(96, 165, 250, 0.95);
  border-radius: 10px;
}
.opd-skyview-scanner video,
.opd-skyview-scanner canvas {
  object-fit: cover;
  pointer-events: none;
  touch-action: pan-y;
}
.opd-skyview-scanner > div,
.opd-skyview-scanner #qr-reader__scan_region,
.opd-skyview-scanner #qr-reader__dashboard_section_csr {
  max-height: 100% !important;
}
.opd-skyview-scanner #qr-shaded-region,
.opd-skyview-scanner [id*="shaded-region"],
.opd-skyview-wrap #qr-shaded-region {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  box-shadow: none !important;
  pointer-events: none !important;
}
.opd-skyview-scanner * {
  box-shadow: none !important;
}
.opd-skyview-scan-hero__side {
  min-width: 0;
}
.opd-room-add-form {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  align-items: stretch;
}
.opd-room-add-form--inline {
  margin-bottom: 0;
  flex: 1 1 auto;
  max-width: 420px;
  min-width: 200px;
}
.opd-rooms-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.opd-rooms-panel-head .box-title {
  flex: 0 0 auto;
  margin: 0;
}
.opd-room-add-form .form-control {
  flex: 1 1 auto;
  min-width: 0;
}
.opd-room-add-form .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.opd-rooms-empty {
  margin: 0;
  padding: 12px 0;
}
.opd-room-card__actions {
  margin-top: 8px;
}
.opd-tv-lang-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.opd-tv-lang-opt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-weight: 600;
  cursor: pointer;
  margin: 0;
  transition: border-color 0.15s, background 0.15s;
}
.opd-tv-lang-opt input { margin: 0; }
.opd-tv-lang-opt.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.opd-skyview-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.opd-skyview-col {
  min-width: 0;
}
.opd-skyview-panel {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  margin-bottom: 0;
}
.opd-skyview-panel > .box-header {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 14px 18px;
}
.opd-skyview-panel > .box-header .box-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}
.opd-skyview-panel > .box-body {
  padding: 18px;
}
.opd-skyview-scan-result {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
}
.opd-skyview-scan-result--ok { background: #ecfdf5; border: 1px solid #6ee7b7; color: #065f46; }
.opd-skyview-scan-result--err { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.opd-skyview-sound-hint {
  margin-top: 10px;
  font-size: 12px;
}
.opd-manual-checkin {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.opd-manual-checkin .form-control { flex: 1 1 auto; min-width: 0; }
.opd-manual-checkin__btn { flex: 0 0 auto; white-space: nowrap; min-width: 110px; }
.opd-recheck-toggle-wrap {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #e2e8f0;
}
.opd-switch {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  cursor: pointer;
  user-select: none;
}
.opd-switch__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}
.opd-switch__track {
  flex: 0 0 44px;
  width: 44px;
  height: 24px;
  margin-top: 2px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.12);
}
.opd-switch__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
  transition: transform 0.2s ease;
}
.opd-switch__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.opd-switch__label {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
}
.opd-switch__hint {
  display: block;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.4;
}
.opd-switch:hover .opd-switch__track {
  background: #94a3b8;
}
.opd-switch--on .opd-switch__track,
.opd-switch__input:checked + .opd-switch__track {
  background: #f97316;
  box-shadow: inset 0 1px 2px rgba(154, 52, 18, 0.2);
}
.opd-switch--on:hover .opd-switch__track,
.opd-switch__input:checked + .opd-switch__track:hover {
  background: #ea580c;
}
.opd-switch--on .opd-switch__thumb,
.opd-switch__input:checked + .opd-switch__track .opd-switch__thumb {
  transform: translateX(20px);
}
.opd-switch__input:focus-visible + .opd-switch__track {
  outline: 2px solid #fdba74;
  outline-offset: 2px;
}
.opd-switch--on .opd-switch__label,
.opd-switch__input:checked ~ .opd-switch__text .opd-switch__label {
  color: #c2410c;
}
.opd-queue-table-wrap {
  max-height: none;
}
.opd-queue-table {
  margin-bottom: 0;
}
.opd-queue-table thead th {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 12px 14px;
  white-space: nowrap;
}
.opd-queue-table tbody td {
  padding: 14px;
  vertical-align: middle;
  border-top: 1px solid #f1f5f9;
}
.opd-queue-table tbody tr:hover {
  background: #f8fafc;
}
.opd-serial-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #0f766e;
  color: #fff;
  font-weight: 700;
}
.opd-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.opd-status--waiting { background: #fef3c7; color: #92400e; }
.opd-status--in-consultation { background: #fee2e2; color: #991b1b; }
.opd-status--completed { background: #d1fae5; color: #065f46; }
.opd-status--booked { background: #dbeafe; color: #1e40af; }
.opd-checkin-history {
  margin-top: 20px;
}
.opd-checkin-history__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.opd-checkin-history__count {
  font-size: 13px;
  color: #64748b;
  padding: 6px 12px;
  background: #f1f5f9;
  border-radius: 999px;
}
.opd-checkin-history__count strong {
  color: #0f766e;
  font-size: 1.05rem;
}
.opd-history-table-wrap {
  max-height: min(42vh, 420px);
  overflow: auto;
}
.opd-history-table thead th {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 12px 14px;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
.opd-history-table tbody td {
  padding: 12px 14px;
  vertical-align: middle;
  border-top: 1px solid #f1f5f9;
}
.opd-history-row--active {
  background: rgba(240, 253, 250, 0.55);
}
.opd-history-row--done {
  opacity: 0.88;
}
.opd-history-time {
  font-weight: 700;
  color: #0f766e;
}
.opd-serial-badge--sm {
  min-width: 30px;
  height: 30px;
  font-size: 12px;
}
.opd-queue-actions {
  min-width: 180px;
  white-space: nowrap;
}
.opd-queue-actions .opd-assign-select {
  display: inline-block;
  width: auto;
  min-width: 130px;
  max-width: 160px;
  margin-right: 6px;
  margin-bottom: 0;
  vertical-align: middle;
}
.opd-queue-actions .opd-complete-btn {
  vertical-align: middle;
}
.opd-rooms-grid {
  display: grid;
  gap: 12px;
}
.opd-room-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 0;
  background: #fff;
  transition: box-shadow 0.15s ease;
}
.opd-room-card:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}
.opd-room-card--free { border-left: 4px solid #22c55e; }
.opd-room-card--engaged { border-left: 4px solid #ef4444; }
.opd-room-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.opd-room-state {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}
.opd-room-card--free .opd-room-state { color: #16a34a; }
.opd-room-card--engaged .opd-room-state { color: #dc2626; }
.opd-room-card__serial {
  margin-top: 10px;
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
}

@media (min-width: 992px) {
  .opd-skyview-scan-hero__layout {
    flex-direction: row;
    align-items: stretch;
    gap: 24px;
  }
  .opd-skyview-scan-hero__camera {
    flex: 1.4 1 0;
  }
  .opd-skyview-scan-hero__side {
    flex: 1 1 320px;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .opd-skyview-scanner-shell {
    width: min(100%, 420px);
  }
  .opd-skyview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
    grid-template-areas: "queue rooms";
    gap: 20px;
    align-items: start;
  }
  .opd-skyview-col--queue { grid-area: queue; }
  .opd-skyview-col--rooms { grid-area: rooms; }
  .opd-queue-table-wrap {
    max-height: min(52vh, 520px);
    overflow: auto;
  }
  .opd-rooms-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
  }
}

@media (min-width: 1400px) {
  .opd-skyview-scanner-shell {
    width: min(100%, 480px);
  }
  .opd-skyview-grid {
    grid-template-columns: minmax(0, 1.75fr) minmax(320px, 1fr);
    gap: 24px;
  }
  .opd-queue-table-wrap {
    max-height: min(58vh, 600px);
  }
  .opd-rooms-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}
.user-dashboard-quick-tile--info {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #fff;
}
.user-dashboard-quick-tile--info .tile-icon,
.user-dashboard-quick-tile--info .tile-label,
.user-dashboard-quick-tile--info .tile-value,
.user-dashboard-quick-tile--info .tile-meta { color: #fff; }
.user-dashboard-quick-tile .tile-meta {
  display: block;
  font-size: 11px;
  opacity: .85;
  margin-top: 2px;
}
.pt-id-card--compact.pt-id-card--cr80 {
  max-width: 243px;
}
.pt-id-card__qr--compact img { max-width: 62px; }

/* Patient portal OPD ID card */
.patient-portal-id-box .box-body {
  padding: 18px 20px 22px;
}
.pt-id-card--portal {
  max-width: 100%;
  border: none;
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(15, 118, 110, 0.12);
  background: linear-gradient(180deg, #fff 0%, #f0fdfa 100%);
}
.pt-id-card--portal .pt-id-card__header {
  padding: 18px 20px;
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 55%, #2dd4bf 100%);
}
.pt-id-card--portal .pt-id-card__logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}
.pt-id-card__logo--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 20px;
  padding: 0;
}
.pt-id-card--portal .pt-id-card__clinic {
  font-size: 15px;
}
.pt-id-card--portal .pt-id-card__body {
  padding: 20px;
}
.pt-id-card--portal .pt-id-card__profile h2 {
  font-size: 20px;
}
.pt-id-card__uid--portal {
  padding: 16px 18px;
  margin: 16px 0;
  border: 2px dashed #14b8a6;
  border-radius: 14px;
  background: linear-gradient(180deg, #ecfdf5 0%, #fff 100%);
}
.pt-id-card__uid--portal span {
  font-size: 11px;
  letter-spacing: 0.1em;
}
.pt-id-card__uid--portal strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.06em;
  color: #0f766e;
  word-break: break-all;
}
.pt-id-card__uid--portal small {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: #64748b;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
}
.pt-id-card__qr-grid--portal {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin-top: 4px;
}
.pt-id-card__qr-grid--portal .pt-id-card__qr img {
  max-width: 110px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  padding: 6px;
  background: #fff;
}
.pt-id-card__qr-grid--portal .pt-id-card__qr--clinical img {
  border-color: #99f6e4;
}
.pt-id-card__history-note {
  margin: 14px 0 0;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: #475569;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}
.pt-id-card--portal .pt-id-card__footer {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 20px;
  font-size: 12px;
  color: #64748b;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}
.patient-portal-profiles {
  margin-bottom: 18px;
}
.patient-portal-profiles__label {
  margin: 0 0 10px;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}
.patient-portal-profiles__list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.patient-portal-profile-pill {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 160px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  text-decoration: none !important;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.patient-portal-profile-pill:hover {
  border-color: #14b8a6;
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.12);
}
.patient-portal-profile-pill.is-active {
  border-color: #0f766e;
  background: #ecfdf5;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.15);
}
.patient-portal-profile-pill__clinic {
  font-size: 13px;
  font-weight: 700;
  color: #0f766e;
}
.patient-portal-profile-pill__doctor {
  font-size: 12px;
  color: #64748b;
}
.patient-portal-profile-pill__uid {
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #475569;
  margin-top: 2px;
}

/* OPD Skyview + patient portal — tablet */
@media (min-width: 768px) and (max-width: 991px) {
  .opd-skyview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "queue rooms";
    gap: 16px;
  }
  .opd-skyview-col--queue { grid-area: queue; }
  .opd-skyview-col--rooms { grid-area: rooms; }
  .opd-skyview-scanner-shell {
    width: min(100%, 360px);
  }
  .opd-rooms-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
  }
}

@media (max-width: 991px) {
  .opd-skyview-wrap .content.container-fluid {
    padding-left: 10px;
    padding-right: 10px;
  }
}

@media (max-width: 767px) {
  .opd-skyview-wrap {
    margin-left: -4px;
    margin-right: -4px;
  }

  .opd-skyview-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 14px;
  }

  .opd-skyview-title {
    font-size: 1.35rem;
  }

  .opd-skyview-header-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .opd-skyview-header-actions .btn,
  .opd-skyview-stat {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .opd-skyview-stat {
    display: flex;
    padding: 10px 12px;
  }

  .opd-skyview-scanner-shell {
    width: min(calc(100vw - 40px), 340px);
  }

  .opd-manual-checkin {
    flex-direction: column;
    gap: 10px;
  }

  .opd-manual-checkin__btn {
    width: 100%;
    padding: 11px 14px;
  }

  .opd-rooms-panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .opd-room-add-form--inline {
    max-width: none;
    width: 100%;
  }

  .opd-queue-table-wrap {
    border: none;
    overflow: visible;
  }

  .opd-queue-table thead {
    display: none;
  }

  .opd-queue-table tbody tr {
    display: block;
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  }

  .opd-queue-table tbody tr.opd-queue-empty {
    border: none;
    box-shadow: none;
    padding: 20px;
  }

  .opd-queue-table tbody td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border: none;
    text-align: right !important;
  }

  .opd-queue-table tbody td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    flex: 0 0 auto;
    text-align: left;
    padding-top: 2px;
  }

  .opd-queue-table tbody td:first-child {
    padding-top: 0;
    border-bottom: 1px dashed #e2e8f0;
    margin-bottom: 4px;
    padding-bottom: 12px;
  }

  .opd-queue-table tbody td:first-child::before {
    content: 'Token';
  }

  .opd-queue-actions {
    min-width: 0 !important;
    flex-direction: column;
    align-items: stretch !important;
  }

  .opd-queue-actions::before {
    align-self: flex-start;
  }

  .opd-queue-actions .opd-assign-select {
    width: 100% !important;
    min-width: 0 !important;
    margin-bottom: 8px;
  }

  .opd-queue-actions .opd-complete-btn {
    width: 100%;
    padding: 8px 12px;
  }

  .opd-rooms-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .opd-rooms-grid .opd-room-card {
    margin-bottom: 0;
  }

  .opd-rooms-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start !important;
    gap: 10px;
  }

  .opd-rooms-header .box-tools {
    position: static;
    float: none !important;
    width: 100%;
  }

  .opd-rooms-header .box-tools .btn {
    width: 100%;
  }

  .opd-rooms-active-check {
    display: flex;
    align-items: center;
    min-height: 38px;
    margin: 0;
  }

  .opd-rooms-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 12px;
    background: #fff;
  }

  .opd-rooms-card__head {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
  }

  .opd-rooms-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
  }

  .opd-rooms-card__actions .btn {
    flex: 1 1 auto;
  }

  .patient-portal-wrap .box.add_area {
    border-radius: 14px;
  }

  .patient-portal-table-wrap {
    overflow: visible;
  }

  .patient-portal-table thead {
    display: none;
  }

  .patient-portal-table tbody tr {
    display: block;
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
  }

  .patient-portal-table tbody td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border: none;
    text-align: right !important;
  }

  .patient-portal-table tbody td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    flex: 0 0 38%;
    text-align: left;
  }

  .pt-id-card--compact:not(.pt-id-card--cr80) {
    max-width: none;
  }

  .pt-id-card--compact .pt-id-card__body {
    padding: 16px;
  }

  .pt-id-card--compact .pt-id-card__profile {
    flex-direction: column;
    text-align: center;
  }

  .pt-id-card--compact .pt-id-card__profile h2 {
    font-size: 1.2rem;
  }

  .pt-id-card__qr--compact img {
    max-width: min(180px, 60vw);
    width: 100%;
    height: auto;
  }

  .user-dashboard-quick-tile .tile-meta {
    font-size: 10px;
  }
}

@media (max-width: 380px) {
  .opd-skyview-title {
    font-size: 1.2rem;
  }

  .opd-serial-badge {
    min-width: 30px;
    height: 30px;
    font-size: 13px;
  }
}

/* Consent document layout */
.consent-template-edit__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.consent-template-intro { margin-bottom: 18px; }
.consent-starter-panel__label,
.consent-layout-options__title { display: block; font-weight: 600; margin-bottom: 6px; }
.consent-starter-panel__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.consent-editor-block__hint { margin: -2px 0 8px; }
.consent-layout-options .consent-default-check { margin-bottom: 6px; }
.consent-advanced-panel__toggle { font-weight: 600; text-decoration: none !important; color: #334155; }
.consent-advanced-panel__toggle:hover { color: #0f766e; }
.consent-advanced-panel__body { margin-top: 12px; padding-top: 12px; border-top: 1px dashed #e2e8f0; }
.consent-merge-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.consent-merge-tag { border-radius: 999px; max-width: 100%; white-space: normal; text-align: left; }
.consent-editor-block { margin-bottom: 18px; }
.consent-editor-block label { display: block; margin-bottom: 6px; font-weight: 600; }
.consent-default-check { display: block; margin: 8px 0 16px; }
.consent-template-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.consent-merge-panel { position: sticky; top: 80px; }
.consent-doc { color: #0f172a; }
.consent-doc__header { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #e2e8f0; }
.consent-doc__title { font-size: 1.25rem; font-weight: 700; color: #0f766e; margin: 0 0 14px; }
.consent-doc__body { line-height: 1.65; font-size: 14px; }
.consent-doc__body h3 { color: #0f766e; font-size: 1.05rem; margin-top: 0; }
.consent-doc__body ul { padding-left: 1.25rem; }
.consent-doc__signature { margin: 18px 0; padding: 12px 0; border-top: 1px dashed #cbd5e1; }
.consent-doc__signature-img { max-height: 80px; display: block; margin-bottom: 8px; }
.consent-doc__signature-meta { font-size: 12px; color: #64748b; }
.consent-doc__footer { margin-top: 16px; padding-top: 12px; border-top: 1px solid #e2e8f0; font-size: 13px; }
.consent-doc--preview { max-height: 480px; overflow: auto; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px; }
.consent-doc--web .consent-doc__header table { width: 100%; }

@media (max-width: 991px) {
  .consent-merge-panel { position: static; }
  .consent-preview-panel { margin-top: 0 !important; }
}

@media (max-width: 767px) {
  .consent-template-edit-wrap .content.container-fluid { padding-left: 10px; padding-right: 10px; }
  .consent-template-actions .btn { flex: 1 1 auto; }
  .consent-doc--web .consent-doc__header table,
  .consent-doc--web .consent-doc__header tr,
  .consent-doc--web .consent-doc__header td { display: block; width: 100% !important; }
  .consent-doc--web .consent-doc__header td { padding-bottom: 8px; text-align: left !important; }
  .consent-doc--web .consent-doc__footer table tr,
  .consent-doc--web .consent-doc__footer table td { display: block; width: 100% !important; padding-left: 0 !important; }
  .consent-sign-form .btn-primary { width: 100%; margin-top: 8px; float: none !important; }
}

/* Clinical QR public page + settings */
.clinical-qr-system-toggle__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.clinical-qr-system-toggle__switch {
  flex-shrink: 0;
}
.clinical-qr-builder--disabled .clinical-qr-builder__editor,
.clinical-qr-settings-panel--disabled {
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
}
.pt-clinical-page--disabled {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.pt-clinical-disabled {
  padding: 48px 24px;
  text-align: center;
}
.pt-clinical-disabled__icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.5;
}
.pt-clinical-disabled h2 {
  margin: 0 0 10px;
  font-size: 1.25rem;
}
.pt-clinical-disabled p {
  margin: 0;
  color: #64748b;
}
.pt-clinical-disabled__hint {
  margin-top: 12px !important;
  font-size: 0.875rem;
}
.clinical-qr-builder {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 20px;
  align-items: start;
}
.clinical-qr-builder__preview .box-body {
  background: #f1f5f9;
  max-height: 720px;
  overflow: auto;
}
.clinical-qr-preview-frame {
  min-height: 320px;
}
.pt-clinical-page {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.pt-clinical-page__head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 22px;
  border-bottom: 3px solid var(--pt-clinical-accent, #0f766e);
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}
.pt-clinical-page__logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
}
.pt-clinical-page__clinic {
  margin: 0 0 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pt-clinical-accent, #0f766e);
  font-weight: 700;
}
.pt-clinical-page__head h1 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  color: #0f172a;
}
.pt-clinical-page__intro {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
}
.pt-clinical-page__patient,
.pt-clinical-page__doctor,
.pt-clinical-page__visits {
  padding: 18px 22px;
}
.pt-clinical-page__patient h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}
.pt-clinical-page__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 13px;
  color: #64748b;
}
.pt-clinical-page__summary {
  margin-top: 14px;
  padding: 12px 14px;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 10px;
  font-size: 14px;
}
.pt-clinical-page__summary p { margin: 6px 0 0; }
.pt-clinical-page__address {
  margin: 12px 0 0;
  font-size: 13px;
  color: #64748b;
}
.pt-clinical-page__scope {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0 22px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 13px;
  line-height: 1.5;
}
.pt-clinical-page__scope-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #fef3c7;
  color: #b45309;
  font-size: 12px;
}
.pt-clinical-page__scope strong {
  display: block;
  margin-bottom: 4px;
  color: #78350f;
}
.pt-clinical-page__scope p {
  margin: 0;
}
.pt-clinical-page__doctor {
  border-top: 1px solid #f1f5f9;
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
}
.pt-clinical-page__visits h3 {
  margin: 0 0 14px;
  font-size: 1rem;
  color: #334155;
}
.pt-clinical-page__empty {
  color: #94a3b8;
  font-size: 14px;
}
.pt-clinical-visit {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  background: #fafafa;
}
.pt-clinical-visit__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #cbd5e1;
}
.pt-clinical-visit__head time {
  font-weight: 700;
  color: var(--pt-clinical-accent, #0f766e);
}
.pt-clinical-visit__doctor {
  font-size: 13px;
  color: #64748b;
}
.pt-clinical-block {
  margin-top: 10px;
  font-size: 14px;
}
.pt-clinical-block h4 {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}
.pt-clinical-block ul {
  margin: 0;
  padding-left: 1.2rem;
}
.pt-clinical-block--muted {
  font-size: 13px;
  color: #64748b;
}
.pt-clinical-rx li {
  margin-bottom: 6px;
}
.pt-clinical-rx li span {
  display: block;
  font-size: 12px;
  color: #64748b;
}
.pt-clinical-page__foot,
.pt-clinical-page__custom--footer {
  padding: 12px 22px 18px;
  border-top: 1px solid #e2e8f0;
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
}
.pt-clinical-page__custom--header {
  padding: 16px 22px;
  border-bottom: 1px solid #e2e8f0;
}

@media (max-width: 991px) {
  .clinical-qr-builder {
    grid-template-columns: 1fr;
  }
  .pt-id-card__qr-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .pt-clinical-page__head {
    flex-direction: column;
  }
  .pt-clinical-page__patient,
  .pt-clinical-page__doctor,
  .pt-clinical-page__visits {
    padding: 14px 16px;
  }
}

.pt-clinical-opdio-banner {
  display: block;
  margin-top: 16px;
  text-decoration: none;
  color: inherit;
}
.pt-clinical-opdio-banner__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0f766e 0%, #115e59 55%, #134e4a 100%);
  color: #ecfdf5;
  box-shadow: 0 10px 28px rgba(15, 118, 110, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pt-clinical-opdio-banner:hover,
.pt-clinical-opdio-banner:focus {
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(15, 118, 110, 0.28);
}
.pt-clinical-opdio-banner__logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  padding: 6px;
  flex-shrink: 0;
}
.pt-clinical-opdio-banner__mark {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.pt-clinical-opdio-banner__copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pt-clinical-opdio-banner__copy strong {
  font-size: 1rem;
  letter-spacing: 0.02em;
}
.pt-clinical-opdio-banner__copy span {
  font-size: 0.8125rem;
  line-height: 1.45;
  opacity: 0.92;
}
.pt-clinical-opdio-banner__cta {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
}
@media (max-width: 560px) {
  .pt-clinical-opdio-banner__inner {
    flex-wrap: wrap;
  }
  .pt-clinical-opdio-banner__cta {
    width: 100%;
    text-align: center;
  }
}

/* ===== Appointment Calendar ===== */
/* --- Appointment schedule (quick setup) --- */
.appt-schedule-wrap .content.container-fluid {
  max-width: 1200px;
  padding: 16px 18px 28px;
}
.appt-schedule-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.appt-schedule-title {
  margin: 0 0 4px;
  font-size: 1.55rem;
  font-weight: 700;
  color: #0f172a;
}
.appt-schedule-welcome,
.appt-schedule-current {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 18px;
}
.appt-schedule-welcome {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1px solid #bfdbfe;
}
.appt-schedule-welcome i {
  font-size: 1.4rem;
  color: #2563eb;
  margin-top: 2px;
}
.appt-schedule-current {
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
}
.appt-schedule-current__icon {
  color: #059669;
  font-size: 1.4rem;
  margin-top: 2px;
}
.appt-schedule-panel {
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.appt-schedule-panel > .box-header {
  border-bottom: 1px solid #f1f5f9;
  padding: 14px 18px;
}
.appt-schedule-panel > .box-body {
  padding: 18px;
}
.appt-schedule-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px dashed #e2e8f0;
}
.appt-schedule-presets__label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-right: 4px;
}
.appt-preset-btn.active {
  background: #fff7ed;
  border-color: #fdba74;
  color: #c2410c;
}
.appt-quick-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 8px;
}
.appt-day-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.appt-day-pill {
  margin: 0;
  cursor: pointer;
}
.appt-day-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.appt-day-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  transition: all 0.15s ease;
}
.appt-day-pill:hover span {
  border-color: #94a3b8;
  background: #f8fafc;
}
.appt-day-pill.is-active span {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.appt-day-actions {
  margin-top: 8px;
}
.appt-session-block {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.appt-session-block__title {
  margin: 0 0 12px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #0f172a;
}
.appt-evening-toggle-wrap {
  margin-bottom: 14px;
}
.appt-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin: 0;
}
.appt-switch__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.appt-switch__track {
  flex: 0 0 44px;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  transition: background-color 0.2s ease;
}
.appt-switch__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
  transition: transform 0.2s ease;
}
.appt-switch--on .appt-switch__track,
.appt-switch__input:checked + .appt-switch__track {
  background: #2563eb;
}
.appt-switch--on .appt-switch__thumb,
.appt-switch__input:checked + .appt-switch__track .appt-switch__thumb {
  transform: translateX(20px);
}
.appt-interval-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.appt-interval-group select {
  max-width: 220px;
}
.appt-save-schedule-btn {
  margin-top: 8px;
  font-weight: 600;
}
.appt-schedule-help h4 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 700;
}
.appt-help-steps {
  padding-left: 18px;
  margin: 0 0 14px;
  color: #334155;
}
.appt-help-steps li {
  margin-bottom: 8px;
}
.appt-advanced-wrap {
  margin-top: 24px;
}
.appt-advanced-toggle {
  font-weight: 600;
  padding-left: 0;
  color: #64748b;
}
.appt-advanced-panel {
  margin-top: 12px;
}
.appt-time-input {
  font-size: 1rem;
  height: 42px;
}

.appt-calendar-wrap {
  background: #f1f5f9 !important;
  min-height: calc(100vh - 50px);
}
.appt-calendar-wrap .content.appt-calendar-fluid {
  padding: 16px 18px 24px;
  max-width: 1680px;
}
.appt-calendar-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.appt-calendar-header__title {
  margin: 0 0 4px;
  font-size: 1.45rem;
  font-weight: 700;
  color: #0f172a;
}
.appt-calendar-header__title i {
  color: #2563eb;
  margin-right: 6px;
}
.appt-calendar-header__sub {
  margin: 0;
  font-size: 0.875rem;
  color: #64748b;
}
.appt-calendar-header__nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: center;
}
.appt-calendar-nav-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.appt-nav-btn {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 8px !important;
  min-width: 36px;
  height: 36px;
  padding: 0 10px !important;
}
.appt-nav-btn:hover {
  background: #fff !important;
}
.appt-nav-btn--today {
  font-weight: 700;
  color: #2563eb;
  padding: 0 14px !important;
}
.appt-calendar-header__range {
  font-weight: 600;
  font-size: 0.95rem;
  color: #334155;
  white-space: nowrap;
}
.appt-calendar-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.appt-view-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}
.appt-view-toolbar__label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  white-space: nowrap;
  padding-right: 4px;
  border-right: 1px solid #e2e8f0;
  margin-right: 2px;
  line-height: 1;
}
.appt-view-switcher {
  display: inline-flex;
  align-items: stretch;
  gap: 4px;
  padding: 3px;
  background: #e2e8f0;
  border-radius: 10px;
}
.appt-cal-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: #475569;
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  line-height: 1.2;
  min-height: 36px;
}
.appt-cal-view-btn i {
  font-size: 0.95rem;
  opacity: 0.85;
}
.appt-cal-view-btn:hover {
  background: rgba(255, 255, 255, 0.65);
  color: #0f172a;
}
.appt-cal-view-btn.active {
  background: #fff !important;
  color: #2563eb !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(37, 99, 235, 0.15);
}
.appt-cal-view-btn.active i {
  opacity: 1;
  color: #2563eb;
}
.appt-create-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 12px !important;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 10px 18px !important;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  border: 0 !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: transform 0.12s, box-shadow 0.12s;
  text-decoration: none !important;
  white-space: nowrap;
}
.appt-create-btn:hover,
.appt-create-btn:focus {
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.42);
  text-decoration: none !important;
}
.appt-create-btn i {
  font-size: 0.85rem;
}
.appt-calendar-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}
.appt-calendar-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 3;
}
.appt-calendar-sidebar--right {
  min-width: 0;
}
.appt-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.appt-panel--schedule {
  padding: 0;
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.appt-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
}
.appt-panel__title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #64748b;
  margin: 0 0 10px;
  font-weight: 700;
}
.appt-panel__head .appt-panel__title {
  margin: 0;
}
.appt-panel__title--lg {
  font-size: 0.85rem;
  text-transform: none;
  letter-spacing: 0;
  color: #0f172a;
}
.appt-panel-btn,
.appt-walkin-btn {
  border-radius: 12px !important;
  font-weight: 600;
  padding: 11px 14px !important;
  border: 1px solid #e2e8f0 !important;
}
.appt-walkin-btn {
  border: 0 !important;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.25);
}
.appt-doctor-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid #bbf7d0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #166534;
}
.appt-doctor-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}
.appt-date-input {
  border-radius: 10px !important;
  border-color: #e2e8f0 !important;
}
.appt-legend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.appt-legend-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: #475569;
}
.appt-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  flex-shrink: 0;
}
.appt-legend-swatch--offline { background: #16a34a; }
.appt-legend-swatch--online { background: #dc2626; }
.appt-legend-swatch--waiting { background: #d97706; }
.appt-legend-swatch--engaged { background: #7c3aed; }
.appt-legend-swatch--blocked { background: #94a3b8; }
.appt-schedule-link {
  display: block;
  text-align: center;
  font-size: 0.8125rem;
  color: #2563eb;
  padding: 8px;
}
.appt-schedule-link:hover {
  color: #1d4ed8;
  text-decoration: none;
}
.appt-calendar-main {
  position: relative;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  min-height: 560px;
  overflow: hidden;
}
.appt-filter-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 10px;
}
.appt-filter-tabs button {
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 8px 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.appt-filter-tabs button.active {
  background: #fff;
  color: #2563eb;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.appt-cal-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.appt-cal-stat {
  text-align: center;
  padding: 12px 8px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
}
.appt-cal-stat strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1.1;
  font-weight: 800;
}
.appt-cal-stat__label {
  display: block;
  margin-top: 4px;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  font-weight: 700;
}
.appt-cal-stat--today strong { color: #2563eb; }
.appt-cal-stat--waiting strong { color: #d97706; }
.appt-cal-stat--engaged strong { color: #7c3aed; }
.appt-skyview-link {
  color: #64748b;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 8px;
}
.appt-skyview-link:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.appt-today-list {
  max-height: calc(100vh - 420px);
  overflow-y: auto;
  padding: 0;
  position: relative;
  z-index: 1;
}
.appt-today-card {
  display: flex;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: background 0.12s;
}
.appt-today-empty {
  text-align: center;
  padding: 28px 16px;
  color: #94a3b8;
}
.appt-today-empty i {
  font-size: 2rem;
  margin-bottom: 8px;
}
.appt-today-card:hover {
  background: #f8fafc;
}
.appt-today-card__time {
  font-size: 0.75rem;
  font-weight: 800;
  color: #2563eb;
  min-width: 48px;
  padding-top: 2px;
}
.appt-today-card__body {
  flex: 1;
  min-width: 0;
}
.appt-today-card__body strong {
  display: block;
  font-size: 0.875rem;
  color: #0f172a;
}
.appt-today-card__meta {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 2px;
}
.appt-today-card__status {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.62rem;
  text-transform: uppercase;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}
.appt-today-card__status--waiting { background: #fef3c7; color: #b45309; }
.appt-today-card__status--engaged { background: #ede9fe; color: #6d28d9; }
.appt-today-card__status--completed { background: #dcfce7; color: #15803d; }
.appt-today-card__status--scheduled { background: #dbeafe; color: #1d4ed8; }
.appt-calendar-loading {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.appt-calendar-loading__inner {
  padding: 16px 24px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  font-weight: 600;
  color: #475569;
}
.appt-calendar-empty,
.appt-empty-state {
  padding: 48px 24px;
  text-align: center;
  color: #64748b;
}
.appt-empty-state i {
  font-size: 3rem;
  color: #cbd5e1;
  margin-bottom: 12px;
}
.appt-empty-state h3 {
  font-size: 1.1rem;
  color: #334155;
  margin-bottom: 8px;
}
.appt-time-grid {
  display: flex;
  flex-direction: column;
  min-width: 720px;
  height: 100%;
}
.appt-time-grid__headers {
  display: grid;
  grid-template-columns: 64px repeat(var(--appt-cols, 7), minmax(110px, 1fr));
  border-bottom: 2px solid #e2e8f0;
  background: #f8fafc;
  flex-shrink: 0;
}
.appt-time-grid--day .appt-time-grid__headers {
  grid-template-columns: 64px 1fr;
}
.appt-time-grid__corner {
  border-right: 1px solid #e2e8f0;
}
.appt-time-grid__day-head {
  border: 0;
  background: transparent;
  text-align: center;
  padding: 12px 6px;
  border-left: 1px solid #e2e8f0;
  cursor: pointer;
  transition: background 0.12s;
}
.appt-time-grid__day-head:hover {
  background: #eff6ff;
}
.appt-time-grid__day-head.is-today {
  background: #dbeafe;
}
.appt-day-dow {
  display: block;
  font-size: 0.65rem;
  color: #64748b;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.appt-day-num {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
  color: #0f172a;
}
.appt-day-mon {
  display: block;
  font-size: 0.65rem;
  color: #94a3b8;
  font-weight: 600;
}
.appt-time-grid__scroll {
  overflow: auto;
  max-height: calc(100vh - 280px);
  flex: 1;
}
.appt-time-grid__body {
  display: flex;
  min-height: var(--grid-height, 600px);
}
.appt-time-grid__times {
  width: 64px;
  flex-shrink: 0;
  border-right: 1px solid #e2e8f0;
  background: #fafbfc;
}
.appt-time-grid__time-label {
  font-size: 0.68rem;
  color: #94a3b8;
  text-align: right;
  padding: 0 8px;
  border-bottom: 1px solid #f1f5f9;
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  font-weight: 600;
}
.appt-time-grid__columns {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(var(--appt-cols, 7), minmax(110px, 1fr));
}
.appt-time-grid--day .appt-time-grid__columns {
  grid-template-columns: 1fr;
}
.appt-time-grid__col {
  position: relative;
  border-left: 1px solid #f1f5f9;
  background-image: linear-gradient(to bottom, #f8fafc 1px, transparent 1px);
  background-size: 100% 40px;
}
.appt-time-grid__col.is-today {
  background-color: rgba(239, 246, 255, 0.45);
}
.appt-time-grid__cell {
  border-bottom: 1px solid rgba(241, 245, 249, 0.8);
  cursor: pointer;
  transition: background 0.1s;
}
.appt-time-grid__cell:hover {
  background: rgba(37, 99, 235, 0.06);
}
.appt-event {
  position: absolute;
  left: 5px;
  right: 5px;
  border: 0;
  border-radius: 8px;
  padding: 5px 8px;
  text-align: left;
  overflow: hidden;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
  color: #fff;
  transition: transform 0.12s, box-shadow 0.12s;
}
.appt-event:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
  z-index: 3;
}
.appt-event__time {
  display: block;
  font-size: 0.62rem;
  opacity: 0.92;
  font-weight: 600;
}
.appt-event__title {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}
.appt-event__serial {
  display: block;
  font-size: 0.6rem;
  opacity: 0.85;
  margin-top: 2px;
}
.appt-event--offline { background: linear-gradient(135deg, #16a34a, #15803d); }
.appt-event--online { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.appt-event--waiting { background: linear-gradient(135deg, #d97706, #b45309); }
.appt-event--engaged { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.appt-event--completed { background: linear-gradient(135deg, #64748b, #475569); }
.appt-event--blocked { background: linear-gradient(135deg, #94a3b8, #64748b); }
.appt-now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #f97316;
  z-index: 5;
  pointer-events: none;
  box-shadow: 0 0 6px rgba(249, 115, 22, 0.5);
}
.appt-now-line::before {
  content: '';
  position: absolute;
  left: 0;
  top: -5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f97316;
  border: 2px solid #fff;
}
.appt-month-wrap {
  padding: 16px;
}
.appt-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  background: #e2e8f0;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}
.appt-month-grid__dow {
  background: #f8fafc;
  padding: 10px 8px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.appt-month-cell {
  background: #fff;
  border: 0;
  min-height: 96px;
  padding: 10px;
  text-align: left;
  cursor: pointer;
  position: relative;
  transition: background 0.12s;
}
.appt-month-cell:hover {
  background: #f8fafc;
}
.appt-month-cell.is-other {
  opacity: 0.4;
  background: #fafbfc;
}
.appt-month-cell.is-today {
  background: #eff6ff;
  box-shadow: inset 0 0 0 2px #2563eb;
}
.appt-month-cell__num {
  font-weight: 800;
  font-size: 1rem;
  color: #0f172a;
}
.appt-month-cell__count {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.68rem;
  background: #2563eb;
  color: #fff;
  border-radius: 999px;
  padding: 2px 7px;
  font-weight: 700;
}
.appt-month-cell__dots {
  display: block;
  margin-top: 8px;
}
.appt-month-cell__dots .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}
.dot--online { background: #dc2626; }
.dot--offline { background: #16a34a; }
.appt-block-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}
.appt-block-slot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8125rem;
  margin: 0;
  background: #fff;
  transition: border-color 0.12s, background 0.12s;
}
.appt-block-slot input {
  margin: 0;
}
.appt-block-slot.is-selected,
.appt-block-slot:has(input:checked) {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}
.appt-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.appt-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 10px;
  font-size: 0.875rem;
}
.appt-detail-row span {
  color: #64748b;
}
.appt-detail-row strong {
  color: #0f172a;
  text-align: right;
}
.appt-detail-row--link strong a {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}
.appt-detail-row--link strong a:hover {
  text-decoration: underline;
}
.appt-event-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.appt-modal .modal-content {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}
.appt-modal .modal-header {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
@media (max-width: 1280px) {
  .appt-calendar-layout {
    grid-template-columns: 1fr;
  }
  .appt-calendar-sidebar--left {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
  }
  .appt-calendar-sidebar--right {
    order: 3;
  }
  .appt-calendar-main {
    order: 2;
  }
}
@media (max-width: 768px) {
  .appt-calendar-wrap .content.appt-calendar-fluid {
    padding: 10px;
  }
  .appt-calendar-header {
    flex-direction: column;
    align-items: stretch;
  }
  .appt-calendar-header__nav {
    flex-direction: column;
    align-items: stretch;
  }
  .appt-calendar-header__actions {
    width: 100%;
    justify-content: space-between;
  }
  .appt-view-toolbar {
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
  }
  .appt-view-toolbar__label {
    display: none;
  }
  .appt-view-switcher {
    flex: 1;
    width: 100%;
  }
  .appt-cal-view-btn {
    flex: 1;
    padding: 8px 8px;
    font-size: 0.75rem;
  }
  .appt-cal-view-btn span {
    display: inline;
  }
  .appt-create-btn span {
    display: none;
  }
  .appt-create-btn {
    padding: 10px 14px !important;
  }
  .appt-time-grid {
    min-width: 640px;
  }
  .appt-time-grid__scroll {
    max-height: calc(100vh - 340px);
  }
}

/* Patient billing / invoices */
.pt-billing-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.pt-billing-stat {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.pt-billing-stat span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 4px;
}
.pt-billing-stat strong {
  font-size: 1.05rem;
  color: #0f172a;
}
.pt-billing-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.pt-billing-filter {
  width: auto;
  min-width: 140px;
}
.pt-bill-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.pt-bill-status--draft { background: #f1f5f9; color: #475569; }
.pt-bill-status--sent { background: #dbeafe; color: #1d4ed8; }
.pt-bill-status--partial { background: #fef3c7; color: #b45309; }
.pt-bill-status--paid { background: #dcfce7; color: #15803d; }
.pt-bill-status--void { background: #fee2e2; color: #b91c1c; }
.pt-bill-lines-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.pt-bill-lines-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.pt-bill-lines-actions select {
  min-width: 180px;
}
.pt-bill-totals {
  max-width: 280px;
  margin-left: auto;
  margin-bottom: 12px;
}
.pt-bill-totals > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 0.875rem;
}
.pt-bill-totals__grand {
  border-top: 1px solid #e2e8f0;
  margin-top: 6px;
  padding-top: 8px !important;
  font-size: 1rem !important;
}
.pt-bill-totals--detail {
  margin-left: 0;
  max-width: 100%;
}
.pt-bill-mark-sent {
  font-weight: normal;
  margin-bottom: 0;
}
.pt-bill-pay-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.875rem;
}
/* Keep dialogs above the dimmed backdrop (Bootstrap modal = 1050, backdrop = 1040). */
body.modal-open .modal.show {
  z-index: 1060;
}
body.modal-open .modal-backdrop.show {
  z-index: 1050;
}
.pt-bill-row-actions {
  white-space: nowrap;
}
.pt-bill-row-actions .btn {
  margin-left: 4px;
}
.pt-bill-notify-box {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.pt-bill-notify-opt {
  display: inline-block;
  margin: 8px 16px 0 0;
  font-weight: normal;
}
.pt-stat-card--billing {
  background: linear-gradient(135deg, #fef3c7 0%, #fff 100%);
  border-color: #fde68a;
}
@media (max-width: 991px) {
  .pt-billing-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* IPD — hospital mode only */
.user-dashboard-quick-tile--purple {
  background: linear-gradient(135deg, #6d28d9 0%, #7c3aed 100%);
  border-color: transparent;
}
.user-dashboard-quick-tile--purple:hover { border-color: #c4b5fd; }
.user-dashboard-quick-tile--purple .tile-icon,
.user-dashboard-quick-tile--purple .tile-label,
.user-dashboard-quick-tile--purple .tile-value,
.user-dashboard-quick-tile--purple .tile-meta { color: #fff; }

.opd-skyview-wrap--no-rooms .opd-skyview-grid {
  grid-template-columns: 1fr;
}

.ipd-wrap .ipd-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.ipd-title { margin: 0 0 6px; font-size: 1.6rem; font-weight: 700; }
.ipd-header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ipd-live-stat { font-size: 13px; color: #64748b; margin-right: 8px; }

.ipd-stat-row { margin-bottom: 20px; }
.ipd-stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.ipd-stat-card__value { display: block; font-size: 2rem; font-weight: 700; line-height: 1.1; color: #0f172a; }
.ipd-stat-card__label { display: block; margin-top: 6px; font-size: 13px; color: #64748b; }
.ipd-stat-card--primary { border-left: 4px solid #2563eb; }
.ipd-stat-card--success { border-left: 4px solid #16a34a; }
.ipd-stat-card--warning { border-left: 4px solid #d97706; }
.ipd-stat-card--info { border-left: 4px solid #0891b2; }

.ipd-capacity-list { list-style: none; margin: 0; padding: 0; }
.ipd-capacity-list li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}
.ipd-capacity-list li:last-child { border-bottom: 0; }

.ipd-ward-block {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
}
.ipd-ward-block__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
}
.ipd-ward-block__head h3 { margin: 0; font-size: 1.2rem; }
.ipd-room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.ipd-room-block {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  background: #f8fafc;
}
.ipd-room-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.ipd-bed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.ipd-bed-tile {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ipd-bed-tile--available { border-color: #86efac; background: #f0fdf4; }
.ipd-bed-tile--occupied { border-color: #fca5a5; background: #fef2f2; }
.ipd-bed-tile--maintenance { border-color: #fcd34d; background: #fffbeb; }
.ipd-bed-tile--reserved { border-color: #93c5fd; background: #eff6ff; }
.ipd-bed-tile__label { font-weight: 700; font-size: 13px; }
.ipd-bed-tile__state { font-size: 11px; letter-spacing: 0.04em; color: #64748b; }
.ipd-bed-tile__patient { margin-top: auto; font-size: 12px; line-height: 1.35; }
.ipd-bed-tile__patient small { display: block; color: #64748b; }

.ipd-setup-room {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fafafa;
}
.ipd-setup-room__head { margin-bottom: 8px; }
.ipd-setup-beds { display: flex; flex-wrap: wrap; gap: 8px; }
.ipd-setup-bed {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
}
.ipd-setup-bed--occupied { background: #fef2f2; border-color: #fecaca; }
.ipd-setup-bed--maintenance { background: #fffbeb; border-color: #fde68a; }

/* Medicine inventory — minimal sheet + cards */
.medicine-inventory-wrap .content { padding-top: 8px; }
.mi-page { max-width: 720px; margin: 0 auto; }
.mi-page--narrow { max-width: 520px; }
.mi-page--wide { max-width: none; margin: 0; }
.mi-page--form { max-width: 960px; margin: 0 auto; }

.mi-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.mi-topbar__main {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.mi-topbar__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: #111827;
}
.mi-topbar__count {
  font-size: 12px;
  color: #6b7280;
  font-variant-numeric: tabular-nums;
}
.mi-topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.mi-sheet-row--new,
.mi-card--new {
  animation: mi-row-flash 1.8s ease-out;
}
@keyframes mi-row-flash {
  0% { background-color: #ecfdf5; }
  100% { background-color: transparent; }
}
.mi-sheet-row--new { background-color: #ecfdf5 !important; }

.mi-topbar__add { white-space: nowrap; }
.mi-topbar__bulk { white-space: nowrap; }

.mi-bulk-modal__intro {
  font-size: 13px;
  margin-bottom: 12px;
}
.mi-bulk-modal__scope {
  font-size: 13px;
  margin-bottom: 16px;
  color: #334155;
}
.mi-bulk-modal__fields .form-group label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
}
.mi-bulk-modal .modal-footer {
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
}

.mi-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.mi-per-page {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}
.mi-per-page__label,
.mi-per-page__suffix {
  font-size: 12px;
  color: #64748b;
  margin: 0;
  white-space: nowrap;
}
.mi-per-page__select {
  height: 32px;
  min-width: 64px;
  padding: 0 28px 0 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.mi-per-page__select:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.mi-pagination-meta {
  text-align: center;
  font-size: 12px;
  color: #64748b;
  margin: 16px 0 12px;
}
.mi-view-switcher {
  display: inline-flex;
  align-items: stretch;
  gap: 2px;
  padding: 2px;
  background: #e5e7eb;
  border-radius: 6px;
  flex-shrink: 0;
}
.mi-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: #4b5563;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1.2;
}
.mi-view-btn i { font-size: 12px; }
.mi-view-btn:hover { background: rgba(255, 255, 255, 0.7); color: #111827; }
.mi-view-btn.is-active {
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.mi-inventory-views--table .mi-view-panel[data-view-panel="card"],
.mi-inventory-views--card .mi-view-panel[data-view-panel="table"] {
  display: none;
}

.mi-search {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 0 10px;
  flex: 1;
  min-width: 180px;
  max-width: 320px;
}
.mi-search i { color: #9ca3af; margin-right: 6px; font-size: 12px; }
.mi-search input {
  border: 0;
  box-shadow: none;
  flex: 1;
  height: 32px;
  font-size: 13px;
  background: transparent;
}
.mi-search__clear {
  color: #9ca3af;
  font-size: 18px;
  line-height: 1;
  text-decoration: none;
  border: 0;
  background: transparent;
  padding: 0 0 0 4px;
  cursor: pointer;
}
.mi-search__spinner {
  color: #6b7280;
  font-size: 12px;
  margin-left: 4px;
}
.mi-search.is-loading input {
  color: #6b7280;
}
.mi-filters { display: flex; gap: 6px; }
.mi-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  text-decoration: none;
  cursor: pointer;
}
.mi-filter-pill.is-active { background: #111827; border-color: #111827; color: #fff; }
.mi-filter-pill__count {
  background: rgba(255,255,255,.2);
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10px;
}
.mi-filter-pill.is-active .mi-filter-pill__count { background: rgba(255,255,255,.25); }

/* Tabular sheet (Excel-like) */
.mi-sheet-wrap {
  overflow: auto;
  max-height: calc(100vh - 220px);
  background: #fff;
  border: 1px solid #b4b4b4;
}
.mi-sheet {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
}
.mi-sheet th,
.mi-sheet td {
  border: 1px solid #d4d4d4;
  padding: 0;
  height: 26px;
  vertical-align: middle;
  overflow: hidden;
}
.mi-sheet thead th {
  background: #f0f0f0;
  font-weight: 600;
  color: #333;
  text-align: left;
  padding: 4px 8px;
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
  border-bottom: 1px solid #a0a0a0;
}
.mi-sheet tbody tr:nth-child(even) { background: #fafafa; }
.mi-sheet tbody tr:hover { background: #e7f3ff; }
.mi-sheet-row--low { background: #fff8e6 !important; }
.mi-sheet-row--out { background: #fde8e8 !important; }
.mi-col-name { width: auto; min-width: 160px; padding: 0 !important; }
.mi-col-unit { width: 56px; text-align: center; padding: 0 !important; color: #555; }
.mi-col-qty { width: 72px; background: #fffef5; }
.mi-col-alert { width: 56px; text-align: right; padding: 0 !important; }
.mi-col-price { width: 72px; text-align: right; padding: 0 !important; }
.mi-col-status { width: 48px; text-align: center; padding: 0 4px !important; }
.mi-num { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.mi-sheet-name {
  display: block;
  color: #111;
  text-decoration: none;
  padding: 4px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mi-sheet-name:hover { background: #dbeafe; color: #1e40af; }
.mi-sheet-status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.mi-sheet-status--ok { color: #047857; }
.mi-sheet-status--low { color: #b45309; }
.mi-sheet-status--out { color: #b91c1c; }
.mi-sheet-cell,
.mi-inline-cell {
  display: block;
  width: 100%;
  height: 26px;
  border: 0;
  background: transparent;
  font-size: 12px;
  padding: 0 8px;
  border-radius: 0;
  box-shadow: none;
}
.mi-inline-cell--text { text-align: left; font-weight: 500; color: #111; }
.mi-inline-cell--num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
}
.mi-inline-cell--select {
  text-align: center;
  padding: 0 4px;
  cursor: pointer;
  font-weight: 500;
  color: #374151;
}
.mi-col-qty { width: 72px; background: #fffef5; }
.mi-col-qty .mi-inline-cell--num { background: #fffef5; }
.mi-inline-cell:hover { background: #fff; }
.mi-inline-cell:focus {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
  background: #fff;
  z-index: 1;
  position: relative;
}
.mi-inline-cell--saving { opacity: 0.55; }
.mi-inline-cell--saved { background: #dcfce7 !important; }
.mi-sheet-hint {
  font-size: 11px;
  color: #6b7280;
  margin: 6px 0 0;
}

/* Card view */
.mi-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.mi-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-left: 3px solid #22c55e;
}
.mi-card--low { border-left-color: #f59e0b; background: #fffbeb; }
.mi-card--out { border-left-color: #ef4444; background: #fef2f2; }
.mi-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.mi-card__name {
  color: #0f172a;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.35;
  text-decoration: none;
}
.mi-card__name-input {
  flex: 1;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  background: transparent;
  height: auto;
}
.mi-card__name-input:focus {
  border-color: #2563eb;
  background: #fff;
  outline: none;
}
.mi-card__name:hover { text-decoration: underline; }
.mi-card__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0;
}
.mi-card__stats div { min-width: 0; }
.mi-card__stats dt {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}
.mi-card__stats dd {
  margin: 2px 0 0;
  font-size: 13px;
  color: #334155;
  font-weight: 600;
}
.mi-card__qty {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mi-card__qty label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}
.mi-card__stats dd .mi-inline-cell {
  width: 100%;
  height: 28px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 0 6px;
  background: #fff;
}
.mi-card__stats dd .mi-inline-cell--num { text-align: right; }
.mi-card__qty .mi-inline-cell {
  width: 80px;
  height: 32px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0 10px;
  text-align: right;
  background: #fff;
}
.mi-card__qty .mi-inline-cell:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.mi-card__edit {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  margin-top: auto;
}
.mi-card__edit:hover { color: #0f172a; }

.mi-grid-form { margin-bottom: 8px; }
.mi-grid-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}
.mi-grid-table th,
.mi-grid-table td {
  border: 1px solid #d0d7de;
  padding: 6px 10px;
  vertical-align: middle;
}
.mi-grid-table thead th {
  background: #f3f4f6;
  font-weight: 600;
  color: #374151;
  text-align: left;
}
.mi-grid-table--form .mi-grid-input {
  width: 100%;
  border: 1px solid #d0d7de;
  border-radius: 2px;
  padding: 8px 10px;
  font-size: 13px;
}
.mi-grid-table--form .mi-grid-input--name { min-width: 200px; }
.mi-grid-table--form .mi-grid-input--qty {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.mi-rx-details {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
}
.mi-rx-details summary { cursor: pointer; font-weight: 600; color: #475569; }

.mi-quick-add,
.mi-stock-in-btn {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.mi-quick-add:hover,
.mi-stock-in-btn:hover { background: #ecfdf5; border-color: #86efac; color: #047857; }

.mi-empty {
  text-align: center;
  padding: 48px 20px;
  color: #64748b;
  background: #f8fafc;
  border-radius: 14px;
  border: 1px dashed #cbd5e1;
}
.mi-empty i { font-size: 2rem; color: #cbd5e1; margin-bottom: 12px; }

.mi-stock-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.mi-stock-badge--low { background: #fffbeb; color: #b45309; }
.mi-stock-badge--out { background: #fef2f2; color: #b91c1c; }
.mi-stock-badge--ok { background: #ecfdf5; color: #047857; }

.mi-form-head { margin-bottom: 20px; }
.mi-form-head h1 { margin: 8px 0 0; font-size: 1.4rem; font-weight: 700; }
.mi-back { color: #64748b; font-size: 14px; text-decoration: none; }
.mi-back:hover { color: #0f172a; }

.mi-callout {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 14px;
  color: #1e3a5f;
  line-height: 1.5;
}
.mi-callout p { margin: 0 0 8px; }
.mi-callout p:last-child { margin-bottom: 0; }
.mi-callout__foot { font-size: 13px; color: #475569; }

.mi-rx-link-box {
  border-top: 1px solid #e2e8f0;
  padding-top: 20px;
}
.mi-rx-link-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  margin: 0;
}
.mi-rx-link-toggle input { margin-top: 3px; }
.mi-rx-link-toggle small { font-weight: 400; color: #94a3b8; }
.mi-rx-link-fields { margin-top: 14px; }
.mi-rx-link-fields.hide { display: none; }

.mi-dispense-card__hint {
  display: block;
  font-size: 12px;
  color: #92400e;
  margin-top: 4px;
}

.mi-form-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px;
}
.mi-label { display: block; font-size: 13px; font-weight: 600; color: #475569; margin-bottom: 6px; }
.mi-hint { display: block; font-size: 12px; color: #94a3b8; margin-top: 6px; }
.mi-linked-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 13px;
}
.mi-linked-badge__label { font-weight: 600; }
.mi-topbar__sync { margin-right: 8px; }

.drug-stock-panel {
  border-top: 1px solid #e2e8f0;
  padding-top: 24px;
}
.drug-stock-panel__title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
  color: #334155;
}
.drug-stock-panel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 12px;
}
.drug-stock-panel__label {
  display: block;
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 4px;
}
.drug-stock-panel__hint {
  color: #64748b;
  font-size: 13px;
  margin: 0 0 12px;
}

.mi-dispense-patient { margin: 4px 0 0; color: #64748b; font-size: 14px; }
.mi-dispense-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.mi-dispense-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
}
.mi-dispense-card--unmapped { background: #fffbeb; border-color: #fde68a; }
.mi-dispense-card__main { flex: 1; min-width: 0; }
.mi-dispense-card__main strong { display: block; font-size: 15px; color: #0f172a; }
.mi-dispense-card__stock { font-size: 13px; color: #64748b; }
.mi-dispense-card__link { font-size: 12px; margin-left: 6px; }
.mi-dispense-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.mi-dispense-card__actions .mi-dispense-card__link {
  margin-left: 0;
}
.mi-dispense-card__qty { width: 88px; flex-shrink: 0; }
.mi-dispense-card__qty label { display: block; font-size: 11px; font-weight: 600; color: #94a3b8; margin-bottom: 4px; text-transform: uppercase; }
.mi-dispense-card__qty input {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  height: 44px;
  border-radius: 10px;
}

.mi-dispense-footer {
  position: sticky;
  bottom: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 4px 24px rgba(15,23,42,.08);
}
.mi-dispense-bill {
  display: block;
  margin: 12px 0;
  font-size: 14px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
}
.mi-dispense-bill input { margin-right: 8px; }

.mi-history { font-size: 14px; color: #64748b; }
.mi-history summary { cursor: pointer; font-weight: 600; color: #475569; }
.mi-history__list { margin: 10px 0 0; padding-left: 0; list-style: none; }
.mi-history__list li { padding: 10px 0; border-bottom: 1px solid #f1f5f9; line-height: 1.5; }
.mi-history__list li:last-child { border-bottom: 0; }
.mi-history__amount { color: #0f766e; font-weight: 600; margin-left: 6px; }

.mi-dispense-log {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
}
.mi-dispense-log__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.mi-dispense-log__head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
}
.mi-dispense-log__count {
  font-size: 12px;
  color: #94a3b8;
}
.mi-dispense-log__table-wrap {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}
.mi-dispense-log__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.mi-dispense-log__table th,
.mi-dispense-log__table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}
.mi-dispense-log__table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  background: #f8fafc;
}
.mi-dispense-log__table tbody tr:last-child td { border-bottom: 0; }
.mi-dispense-log__summary { color: #475569; max-width: 360px; }
.mi-dispense-log__meta {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

.mi-pagination-wrap {
  display: flex;
  justify-content: center;
  margin: 20px 0 12px;
  padding: 0 8px;
}

.mi-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  border-radius: 0;
}

.mi-pagination > .mi-page-item {
  display: inline-flex;
  float: none;
  margin: 0 !important;
}

.mi-pagination .mi-page-link,
.mi-pagination > .mi-page-item > a.mi-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.mi-pagination > .mi-page-item > a.mi-page-link:hover,
.mi-pagination > .mi-page-item > a.mi-page-link:focus {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
  text-decoration: none;
}

.mi-pagination > .mi-page-item.active > .mi-page-link {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  cursor: default;
}

.mi-pagination > .mi-page-item--arrow > a.mi-page-link {
  min-width: 34px;
  padding: 0 10px;
  font-size: 18px;
  line-height: 1;
}

.mi-pagination > .mi-page-item.disabled {
  display: none;
}

.mi-topbar__sync--locked {
  border-color: #fbbf24;
  color: #92400e;
  background: #fffbeb;
}

.mi-sync-pay-modal .modal-body {
  padding-top: 8px;
}

.mi-sync-pay-price {
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
}

.mi-sync-qr-state.hide {
  display: none !important;
}

.mi-sync-qr-image {
  width: 220px;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.mi-sync-qr-image--cropped {
  background: transparent;
}

.mi-sync-upi-pay-btn.hide {
  display: none !important;
}

.mi-modal .modal-item-name,
.mi-modal-item-name { font-weight: 600; color: #0f172a; margin-bottom: 12px; text-align: center; }
.mi-modal .modal-footer { border: 0; padding-top: 0; }

@media (max-width: 480px) {
  .mi-hero { flex-direction: column; }
  .mi-hero__add { width: 100%; }
  .mi-dispense-card { flex-wrap: wrap; }
  .mi-dispense-card__qty { width: 100%; }
  .mi-dispense-card__qty input { width: 100%; }
}

/* Patient dashboard — sidebar layout */
.pt-dash-page .content.container-fluid,
.pt-dash-wrap {
  max-width: none;
  padding-left: 12px;
  padding-right: 12px;
}

.pt-dash-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e2e8f0;
}

.pt-dash-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #64748b;
  text-decoration: none;
  margin-bottom: 4px;
}
.pt-dash-back:hover { color: #0f172a; }

.pt-dash-head__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
}

.pt-dash-head__meta {
  margin: 4px 0 0;
  font-size: 13px;
  color: #64748b;
}

.pt-dash-head__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pt-dash-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 0;
  min-height: calc(100vh - 180px);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}

.pt-dash-nav {
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.pt-dash-nav__patient {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 8px 12px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 4px;
}

.pt-dash-nav__avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pt-dash-nav__identity strong {
  display: block;
  font-size: 13px;
  color: #0f172a;
  line-height: 1.3;
}
.pt-dash-nav__identity span {
  font-size: 11px;
  color: #64748b;
}

.pt-dash-nav__label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  padding: 8px 8px 4px;
}

.pt-dash-nav__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
}
.pt-dash-nav__item i {
  width: 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}
.pt-dash-nav__item:hover {
  background: #fff;
  color: #0f172a;
}
.pt-dash-nav__item.is-active {
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.pt-dash-nav__item.is-active i { color: #1d4ed8; }

.pt-dash-nav__badge {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}
.pt-dash-nav__item.is-active .pt-dash-nav__badge {
  background: #dbeafe;
  color: #1d4ed8;
}

.pt-dash-nav__actions {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
  display: grid;
  gap: 6px;
}

.pt-dash-main {
  padding: 20px 24px;
  overflow: auto;
  background: #fff;
}

.pt-dash-main__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.pt-dash-section-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
}

.pt-dash-alert {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.pt-dash-panels .pt-hub-tabs__panel {
  display: none;
}
.pt-dash-panels .pt-hub-tabs__panel.is-active {
  display: block;
}

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

.pt-dash-stat {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
}
.pt-dash-stat span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 4px;
}
.pt-dash-stat strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}
.pt-dash-stat small {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}
.pt-dash-stat--warn strong { color: #b45309; }

.pt-dash-overview__grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}

.pt-dash-details {
  display: grid;
  gap: 10px;
  margin: 0;
}
.pt-dash-details div {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 8px;
  font-size: 13px;
}
.pt-dash-details dt {
  margin: 0;
  color: #64748b;
  font-weight: 500;
}
.pt-dash-details dd {
  margin: 0;
  color: #0f172a;
  font-weight: 600;
}

.pt-dash-empty {
  text-align: center;
  padding: 48px 20px;
  color: #64748b;
}
.pt-dash-empty i {
  font-size: 2rem;
  color: #cbd5e1;
  margin-bottom: 12px;
}
.pt-files-upload-empty {
  margin-top: 16px;
}

.pt-files-view__toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.pt-files-view__counter {
  font-size: 12px;
  color: #64748b;
  flex: 1;
}
.pt-files-view__tools {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.pt-files-view__layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  min-height: 420px;
}

.pt-files-list {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: auto;
  max-height: 520px;
  background: #f8fafc;
}

.pt-files-list__item {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #e2e8f0;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
}
.pt-files-list__item:last-child { border-bottom: 0; }
.pt-files-list__item strong {
  display: block;
  font-size: 13px;
  color: #0f172a;
  margin-bottom: 2px;
}
.pt-files-list__item span {
  font-size: 11px;
  color: #64748b;
}
.pt-files-list__item.is-active,
.pt-files-list__item:hover {
  background: #fff;
}
.pt-files-list__item.is-active {
  border-left: 3px solid #1d4ed8;
}

.pt-files-preview {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #f1f5f9;
}

.pt-files-preview__meta {
  padding: 10px 14px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
}

.pt-files-preview__stage {
  flex: 1;
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow: auto;
}

.pt-files-preview__img {
  max-width: 100%;
  max-height: 480px;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.pt-files-preview__frame {
  width: 100%;
  height: 480px;
  border: 0;
  background: #fff;
  border-radius: 4px;
}

@media (max-width: 991px) {
  .pt-dash-layout {
    grid-template-columns: 1fr;
  }
  .pt-dash-nav {
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .pt-dash-nav__patient {
    width: 100%;
  }
  .pt-dash-nav__group {
    flex: 1;
    min-width: 140px;
  }
  .pt-dash-nav__actions {
    width: 100%;
    grid-template-columns: repeat(2, 1fr);
  }
  .pt-dash-stats,
  .pt-dash-overview__grid,
  .pt-files-view__layout {
    grid-template-columns: 1fr;
  }
}

/* ── Invoices module ── */
.inv-module-wrap .inv-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 4px 32px;
}
.inv-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.inv-topbar__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
}
.inv-topbar__sub {
  display: block;
  font-size: 13px;
  color: #64748b;
  margin-top: 4px;
}
.inv-topbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.inv-rx-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: 13px;
}
.inv-rx-banner .fa {
  opacity: 0.85;
}
.inv-topbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.inv-rx-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: 13px;
}
.inv-rx-banner .fa {
  flex-shrink: 0;
}
.inv-modal .modal-dialog {
  margin: 16px auto;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
}
.inv-modal .modal-content {
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 10px;
}
.inv-modal .modal-header {
  flex: 0 0 auto;
  padding: 14px 18px;
  border-bottom: 1px solid #e2e8f0;
}
.inv-modal .modal-header .modal-title {
  font-size: 17px;
  line-height: 1.35;
  margin: 0;
  padding-right: 28px;
}
.inv-modal .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 18px;
}
.inv-modal--create .inv-create-body {
  overflow-y: visible;
}
.inv-modal .modal-footer {
  flex: 0 0 auto;
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 18px;
  border-top: 1px solid #e2e8f0;
  background: #fafafa;
}
.inv-modal .modal-footer .pt-bill-mark-sent {
  margin-right: auto;
  margin-bottom: 0;
}
.inv-modal--create .modal-dialog.modal-lg {
  width: calc(100% - 32px);
  max-width: 940px;
}
.inv-modal--create .modal-header {
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}
.inv-modal--create .modal-content {
  max-height: none;
  overflow: visible;
}
.inv-modal--create .modal-dialog {
  max-height: none;
}
.inv-modal--create .inv-create-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: visible;
  padding: 14px 16px 10px;
  background: #f1f5f9;
  gap: 10px;
}
.inv-modal--create .inv-section {
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
}
.inv-modal--create .inv-create-fields {
  flex: 0 0 auto;
  padding: 12px 14px;
  overflow: visible;
}
.inv-modal--create .inv-rx-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: 13px;
  font-weight: 500;
}
.inv-modal--create .inv-rx-banner__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #dbeafe;
  flex-shrink: 0;
}
.inv-modal--create .inv-label {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}
.inv-modal--create .inv-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
}
.inv-modal--create .inv-field--patient {
  grid-column: 1 / -1;
  overflow: visible;
  position: relative;
  z-index: 1;
}
.inv-modal--create .inv-field--patient.inv-patient-field-open,
.inv-patient-select-wrap--open {
  z-index: 10071;
}
.inv-patient-select-wrap {
  width: 100%;
  min-width: 0;
  position: relative;
}
.inv-patient-select-wrap .inv-patient-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0;
  pointer-events: none;
}
.inv-patient-combo-input {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 14px;
  color: #0f172a;
  box-shadow: none;
}
.inv-patient-combo-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
  outline: none;
}
.inv-patient-combo-list {
  display: none;
  list-style: none;
  margin: 4px 0 0;
  padding: 4px 0;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  max-height: min(240px, 40vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  z-index: 10072;
}
.inv-patient-select-wrap--open .inv-patient-combo-list {
  display: block;
}
.inv-patient-combo-item {
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.35;
  color: #0f172a;
  cursor: pointer;
}
.inv-patient-combo-item.is-active,
.inv-patient-combo-item:hover {
  background: #f1f5f9;
}
.inv-patient-combo-empty {
  padding: 10px 12px;
  font-size: 13px;
  color: #64748b;
}
.inv-modal--create .inv-input,
.inv-modal--create .inv-field .form-control {
  min-height: 38px;
  border-radius: 8px;
  border-color: #cbd5e1;
  font-size: 14px;
  box-shadow: none;
}
.inv-modal--create .inv-input:focus,
.inv-modal--create .inv-field .form-control:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.inv-modal--create .select2-container--default .select2-selection--single {
  min-height: 38px;
  height: 38px;
  border-radius: 8px;
  border-color: #cbd5e1;
}
.inv-modal--create .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 36px;
  padding-left: 10px;
  padding-right: 28px;
  font-size: 14px;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inv-modal--create .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 36px;
}
.inv-modal--create .inv-lines-panel {
  flex: 0 0 auto;
  overflow: visible;
  display: block;
}
.inv-modal--create .inv-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.inv-modal--create .inv-section-head__title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.01em;
}
.inv-modal--create .inv-section-head__title .fa {
  margin-right: 6px;
  color: #64748b;
}
.inv-modal--create .inv-line-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.inv-modal--create .inv-service-pick {
  min-width: 160px;
  max-width: 240px;
  height: 34px;
  padding: 4px 8px;
  font-size: 13px;
  border-radius: 8px;
}
.inv-modal--create .inv-line-action {
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.inv-modal--create .inv-line-action .fa {
  margin-right: 4px;
  opacity: 0.75;
}
.inv-modal--create .inv-lines-table-wrap {
  overflow: visible;
}
.inv-modal--create .inv-lines-table {
  table-layout: fixed;
  width: 100%;
  margin-bottom: 0;
}
.inv-modal--create .inv-lines-table col.inv-col-desc { width: auto; }
.inv-modal--create .inv-lines-table col.inv-col-qty { width: 76px; }
.inv-modal--create .inv-lines-table col.inv-col-unit { width: 100px; }
.inv-modal--create .inv-lines-table col.inv-col-amt { width: 92px; }
.inv-modal--create .inv-lines-table col.inv-col-rm { width: 40px; }
.inv-modal--create .inv-lines-table thead th {
  position: static;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  padding: 9px 8px;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
  background: #fff;
}
.inv-modal--create .inv-lines-table tbody tr:nth-child(even) {
  background: #fafbfc;
}
.inv-modal--create .inv-lines-table tbody tr:hover {
  background: #f0f9ff;
}
.inv-modal--create .inv-lines-table tbody td {
  vertical-align: middle;
  padding: 6px 6px;
  border-top: 1px solid #f1f5f9;
}
.inv-modal--create .inv-lines-table .inv-bill-desc,
.inv-modal--create .inv-lines-table .inv-bill-qty,
.inv-modal--create .inv-lines-table .inv-bill-unit {
  width: 100%;
  min-height: 36px;
  height: 36px;
  padding: 7px 10px;
  font-size: 13px;
  line-height: 1.35;
  border-radius: 7px;
  border-color: #e2e8f0;
  background: #fff;
}
.inv-modal--create .inv-lines-table .inv-bill-desc:focus,
.inv-modal--create .inv-lines-table .inv-bill-qty:focus,
.inv-modal--create .inv-lines-table .inv-bill-unit:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}
.inv-modal--create .inv-lines-table .inv-bill-qty,
.inv-modal--create .inv-lines-table .inv-bill-unit {
  text-align: right;
}
.inv-modal--create .inv-lines-table .inv-bill-amt {
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  padding-right: 8px;
  white-space: nowrap;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}
.inv-modal--create .inv-lines-table .inv-bill-rm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 17px;
  line-height: 1;
  border-radius: 7px;
  color: #dc2626;
  opacity: 0.7;
}
.inv-modal--create .inv-lines-table .inv-bill-rm:hover {
  opacity: 1;
  background: #fee2e2;
  text-decoration: none;
}
.inv-modal--create .inv-create-summary {
  flex: 0 0 auto;
  padding: 10px 12px;
  border: 0;
  background: transparent;
}
.inv-modal--create .inv-summary-grid {
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}
.inv-modal--create .inv-totals-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
}
.inv-modal--create .inv-totals-card__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 5px 0;
  font-size: 13px;
  color: #64748b;
}
.inv-modal--create .inv-totals-card__row strong {
  color: #0f172a;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.inv-modal--create .inv-totals-card__row--grand {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 2px solid #e2e8f0;
  font-size: 14px;
  color: #0f172a;
}
.inv-modal--create .inv-totals-card__row--grand strong {
  font-size: 18px;
  font-weight: 800;
  color: #1d4ed8;
}
.inv-modal--create .inv-notes-field textarea {
  min-height: 88px;
  resize: vertical;
  border-radius: 8px;
}
.inv-modal--create .inv-create-footer {
  background: #fff;
  box-shadow: 0 -6px 16px rgba(15, 23, 42, 0.06);
}
.inv-modal--create .inv-mark-sent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
  margin-bottom: 0;
  font-weight: 500;
  font-size: 13px;
  color: #475569;
  cursor: pointer;
}
@media (max-width: 768px) {
  .inv-modal .modal-dialog {
    margin: 8px auto;
    max-height: calc(100vh - 16px);
    width: calc(100% - 16px) !important;
  }
  .inv-modal .modal-content {
    max-height: calc(100vh - 16px);
  }
  .inv-modal .modal-footer {
    justify-content: stretch;
  }
  .inv-modal .modal-footer .btn {
    flex: 1 1 auto;
    min-width: 0;
  }
  .inv-modal .modal-footer .pt-bill-mark-sent {
    width: 100%;
    margin-right: 0;
  }
  .inv-modal--create .inv-field-grid {
    grid-template-columns: 1fr;
  }
  .inv-modal--create .inv-summary-grid {
    grid-template-columns: 1fr;
  }
  .inv-modal--create .inv-line-actions {
    width: 100%;
    margin-left: 0;
  }
  .inv-modal--create .inv-service-pick {
    width: 100%;
    max-width: none;
  }
  .inv-modal--create .inv-lines-table col.inv-col-qty { width: 64px; }
  .inv-modal--create .inv-lines-table col.inv-col-unit { width: 84px; }
  .inv-modal--create .inv-lines-table col.inv-col-amt { width: 76px; }
}
.inv-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.inv-kpi {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
}
.inv-kpi span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 6px;
}
.inv-kpi strong {
  display: block;
  font-size: 1.25rem;
  color: #0f172a;
}
.inv-kpi small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #94a3b8;
}
.inv-kpi--warn { border-color: #fde68a; background: #fffbeb; }
.inv-kpi--danger { border-color: #fecaca; background: #fef2f2; }
.inv-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}
.inv-search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 360px;
}
.inv-search-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}
.inv-search-wrap input {
  padding-left: 34px;
  border-radius: 999px;
  border-color: #e2e8f0;
}
.inv-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.inv-filter-pill {
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  color: #475569;
  cursor: pointer;
}
.inv-filter-pill.is-active,
.inv-filter-pill:hover {
  border-color: #2563eb;
  color: #2563eb;
  background: #eff6ff;
}
.inv-date-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.inv-date-filters input { width: 130px; }
.inv-table-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
}
.inv-table-head,
.inv-table-foot {
  padding: 10px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12px;
  color: #64748b;
}
.inv-table-foot { border-bottom: 0; border-top: 1px solid #e2e8f0; }
.inv-list-wrap { min-height: 120px; position: relative; }
.inv-list-wrap--loading {
  opacity: 0.55;
  pointer-events: none;
}
.inv-list-wrap--loading:after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.35);
}
.inv-loading,
.inv-empty {
  text-align: center;
  padding: 48px 20px;
  color: #64748b;
}
.inv-empty i { font-size: 2rem; color: #cbd5e1; margin-bottom: 10px; }
.inv-table thead th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
}
.inv-sort-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.inv-sort-th:hover {
  color: #334155;
}
.inv-sort-icon {
  margin-left: 4px;
  font-size: 10px;
  color: #cbd5e1;
}
.inv-sort-th.is-asc .inv-sort-icon:before,
.inv-sort-th.is-desc .inv-sort-icon:before {
  color: #2563eb;
}
.inv-sort-th.is-asc .inv-sort-icon:before {
  content: "\f0de";
}
.inv-sort-th.is-desc .inv-sort-icon:before {
  content: "\f0dd";
}
.inv-sort-th:not(.is-asc):not(.is-desc) .inv-sort-icon:before {
  content: "\f0dc";
}
.inv-table tbody td { vertical-align: middle; font-size: 13px; }
.inv-row--overdue { background: #fff7ed; }
.inv-overdue-tag {
  color: #c2410c;
  font-weight: 600;
  font-size: 12px;
}
.inv-patient-cell strong {
  display: block;
  color: #0f172a;
}
.inv-patient-cell span {
  display: block;
  font-size: 11px;
  color: #94a3b8;
}
.inv-row-actions .btn { margin-left: 2px; }
@media (max-width: 1100px) {
  .inv-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .inv-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inv-date-filters { margin-left: 0; width: 100%; flex-wrap: wrap; }
}

body.modal-open .select2-container--open .select2-dropdown {
  z-index: 10060;
}

body.inv-patient-select-open .select2-dropdown {
  z-index: 10070 !important;
  border-radius: 10px;
  border-color: #cbd5e1;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

body.inv-patient-select-open .select2-dropdown .select2-search--dropdown {
  display: block;
  padding: 10px 10px 6px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

body.inv-patient-select-open .select2-dropdown .select2-search--dropdown .select2-search__field {
  width: 100% !important;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 16px;
  outline: none;
}

body.inv-patient-select-open .select2-dropdown .select2-results__option {
  padding: 8px 12px;
  font-size: 14px;
}

.inv-modal.inv-select2-open .modal-dialog,
.inv-modal.inv-select2-open .modal-content,
.inv-modal.inv-select2-open .modal-body,
.inv-modal.inv-select2-open .inv-create-body {
  overflow: visible !important;
}

.inv-modal .select2-dropdown {
  z-index: 10060 !important;
  border-radius: 10px;
  border-color: #cbd5e1;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.inv-modal .select2-dropdown .select2-search--dropdown {
  display: block;
  padding: 10px 10px 6px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.inv-modal .select2-dropdown .select2-search--dropdown .select2-search__field {
  width: 100% !important;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 16px;
  outline: none;
}

.inv-modal .select2-dropdown .select2-results__option {
  padding: 8px 12px;
  font-size: 14px;
}

@media (max-width: 768px) {
  .inv-patient-combo-input {
    min-height: 44px;
    font-size: 16px;
  }

  .inv-patient-combo-item {
    padding: 12px;
    min-height: 44px;
    font-size: 16px;
  }
}

/* Doctor subscription page */
.subscription-page-wrap .content.container-fluid {
  max-width: 1320px;
}

.subscription-sidebar {
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.subscription-sidebar .box-header {
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
  color: #fff;
  border-bottom: none;
}

.subscription-sidebar .box-title {
  color: #fff;
  font-weight: 700;
}

.subscription-sidebar__body {
  padding: 1.25rem 1.35rem 1.35rem;
}

.subscription-sidebar__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}

.subscription-sidebar__pill--active {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #6ee7b7;
}

.subscription-sidebar__pill--pending {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.subscription-sidebar__pill--trial {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.subscription-sidebar__plan {
  margin: 0 0 0.85rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}

.subscription-sidebar__hint {
  margin: 0;
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.5;
}

.subscription-sidebar__meta {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.subscription-sidebar__meta li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.8125rem;
}

.subscription-sidebar__meta li span {
  color: #64748b;
}

.subscription-sidebar__meta li strong {
  color: #0f172a;
  text-align: right;
}

.subscription-sidebar__commission-label {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.subscription-pending-payment {
  border-radius: 16px;
  background: linear-gradient(135deg, #fffbeb 0%, #ffffff 55%);
  border: 1px solid #fde68a !important;
}

.subscription-pending-payment__meta li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.875rem;
}

.subscription-pending-payment__meta li span {
  color: #64748b;
}

.subscription-pending-payment__meta li strong {
  color: #0f172a;
  text-align: right;
}

.subscription-plans-panel__head {
  margin-bottom: 1.5rem;
}

.subscription-plans-panel__title {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
}

.subscription-plans-panel__subtitle {
  margin: 0 0 1rem;
  color: #64748b;
  font-size: 0.9375rem;
}

.subscription-plans-panel__toggle .btn {
  min-width: 120px;
  font-weight: 600;
  border-radius: 999px !important;
}

/* Annual upsell (shared with public pricing) */
.subscription-page-wrap .pricing-page__annual-upsell {
  position: relative;
  max-width: 100%;
  margin: 1.25rem auto 0;
  padding-top: 0.5rem;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 45%, #eff6ff 100%);
  box-shadow: 0 14px 40px rgba(16, 185, 129, 0.12);
}

.subscription-page-wrap .pricing-page__annual-upsell-glow {
  position: absolute;
  top: -40px;
  right: -20px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.22) 0%, transparent 70%);
  pointer-events: none;
}

.subscription-page-wrap .pricing-page__annual-upsell-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  padding: 1rem 1.25rem;
}

.subscription-page-wrap .pricing-page__annual-upsell-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  text-align: left;
}

.subscription-page-wrap .pricing-page__annual-upsell-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.subscription-page-wrap .pricing-page__annual-upsell-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  font-size: 1.15rem;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
}

.subscription-page-wrap .pricing-page__annual-upsell-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.subscription-page-wrap .pricing-page__annual-upsell-copy strong {
  font-size: 1rem;
  font-weight: 800;
  color: #065f46;
}

.subscription-page-wrap .pricing-page__annual-upsell-copy span {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #047857;
}

.subscription-page-wrap .pricing-page__annual-upsell-copy small {
  display: block;
  font-size: 0.75rem;
  color: #475569;
  line-height: 1.4;
}

.subscription-page-wrap .pricing-page__annual-upsell-cta {
  border: none !important;
  border-radius: 999px !important;
  padding: 0.55rem 1.1rem !important;
  font-weight: 700 !important;
  font-size: 0.8125rem !important;
  color: #fff !important;
  background: linear-gradient(135deg, #286efb 0%, #1d4ed8 100%) !important;
  box-shadow: 0 8px 20px rgba(40, 110, 251, 0.35);
  white-space: nowrap;
}

.subscription-page-wrap .pricing-page__annual-upsell-active {
  display: none;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid #6ee7b7;
  color: #065f46;
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
}

.subscription-page-wrap .pricing-page__annual-upsell.is-monthly-active .pricing-upsell-when-monthly {
  display: inline-flex;
}

.subscription-page-wrap .pricing-page__annual-upsell.is-monthly-active .pricing-upsell-when-yearly {
  display: none;
}

.subscription-page-wrap .pricing-page__annual-upsell.is-yearly-active .pricing-upsell-when-monthly {
  display: none;
}

.subscription-page-wrap .pricing-page__annual-upsell.is-yearly-active .pricing-upsell-when-yearly {
  display: inline-flex;
}

.subscription-page-wrap .pricing-page__annual-upsell.is-yearly-active {
  border-color: rgba(16, 185, 129, 0.55);
  background: linear-gradient(135deg, #d1fae5 0%, #ecfdf5 100%);
}

/* Plan cards */
.subscription-plans-grid {
  align-items: stretch;
}

.subscription-plans-grid__col {
  margin-bottom: 1.25rem;
}

.sub-pricing-card {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.25rem 1.25rem;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sub-pricing-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.1);
}

.sub-pricing-card--popular {
  border: 2px solid #286efb;
  box-shadow: 0 18px 44px rgba(40, 110, 251, 0.16);
  transform: translateY(-6px);
}

.sub-pricing-card--current {
  border-color: #0f766e;
}

.sub-pricing-card__popular {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #286efb, #1d4ed8);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  z-index: 2;
}

.sub-pricing-card__current {
  display: block;
  margin-bottom: 0.65rem;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}

.sub-pricing-card__current--hint {
  background: #eff6ff;
  color: #1d4ed8;
}

.sub-pricing-card__name {
  margin: 0;
  text-align: center;
  font-size: 1.125rem;
  font-weight: 800;
  color: #0f172a;
}

.sub-pricing-card__price-wrap {
  text-align: center;
  margin: 1rem 0;
  padding-bottom: 1rem;
  border-bottom: 1px dashed #e2e8f0;
}

.sub-pricing-card__amount-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0.1rem;
  line-height: 1;
}

.sub-pricing-card__currency {
  margin-top: 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  color: #286efb;
}

.sub-pricing-card__amount {
  font-size: 2.35rem;
  font-weight: 800;
  color: #286efb;
  letter-spacing: -0.02em;
}

.sub-pricing-card__period {
  align-self: flex-end;
  margin-bottom: 0.25rem;
  margin-left: 0.15rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #64748b;
}

.sub-pricing-card__equiv {
  margin: 0.45rem 0 0;
  font-size: 0.8125rem;
  color: #475569;
}

.sub-pricing-card__equiv--muted {
  color: #94a3b8;
}

.sub-pricing-card__offer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.sub-pricing-card__offer-badge {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sub-pricing-card__offer-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: #166534;
}

.sub-pricing-card__savings {
  margin: 0.45rem 0 0;
  font-size: 0.75rem;
  color: #64748b;
}

.sub-pricing-card__savings strong {
  color: #15803d;
}

.subscription-page-wrap .pricing-commission {
  margin: 0 0 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: linear-gradient(180deg, #f0f7ff 0%, #f8fafc 100%);
  border: 1px solid #dbeafe;
  text-align: left;
}

.subscription-page-wrap .pricing-commission__rate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.8125rem;
  color: #1e3a8a;
  margin-bottom: 0.3rem;
}

.subscription-page-wrap .pricing-commission__rate strong {
  font-size: 1rem;
  color: #1d4ed8;
}

.subscription-page-wrap .pricing-commission__hint,
.subscription-page-wrap .pricing-commission__example {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #475569;
}

.subscription-page-wrap .pricing-commission__hint {
  margin-bottom: 0.25rem;
}

.sub-pricing-card__features {
  flex: 1 1 auto;
  margin-bottom: 1rem;
}

.sub-pricing-card__feature {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.8125rem;
  color: #334155;
}

.sub-pricing-card__feature--off {
  opacity: 0.55;
}

.sub-pricing-card__feature-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #ecfdf5;
  color: #10b981;
  font-size: 0.625rem;
}

.sub-pricing-card__feature--off .sub-pricing-card__feature-icon {
  background: #fef2f2;
  color: #ef4444;
}

.sub-pricing-card__feature-limit {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
}

.sub-pricing-card__cta {
  margin-top: auto;
  border-radius: 12px !important;
  font-weight: 700;
}

.sub-pricing-card--popular .sub-pricing-card__cta.btn-primary {
  box-shadow: 0 8px 18px rgba(40, 110, 251, 0.3);
}

@media (max-width: 991px) {
  .subscription-page-wrap .mt-84 {
    margin-top: 1rem !important;
  }
}

@media (max-width: 767px) {
  .subscription-page-wrap .pricing-page__annual-upsell-inner {
    flex-direction: column;
    align-items: stretch;
    padding-top: 1.25rem;
  }

  .subscription-page-wrap .pricing-page__annual-upsell-left {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .subscription-page-wrap .pricing-page__annual-upsell-cta,
  .subscription-page-wrap .pricing-page__annual-upsell-active {
    width: 100%;
    justify-content: center;
  }

  .sub-pricing-card--popular {
    transform: none;
  }
}

