:root {
  --navy: #1E293B;
  --navy-deep: #0F172A;
  --royal: #0B7A75;
  --teal: #0B7A75;
  --teal-bright: #14A39A;
  --cyan: #14A39A;
  --gold: #D97706;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(148, 163, 184, 0.22);
  --card: #FFFFFF;
  --text: #1E293B;
  --muted: #64748B;
  --success: #2E8B57;
  --danger: #DC2626;
  --warning: #D97706;
  --surface: #F8FAFC;
  --surface-alt: #F0F4F8;
  --border: #E2E8F0;
  --primary-soft: #E6F4F2;
  --success-soft: #E8F5EC;
  --radius: 16px;
  --shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 60px rgba(15, 23, 42, 0.12);
  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;

  /* Bootstrap 5 theme bridge — prevents default blue from dominating */
  --bs-primary: #0B7A75;
  --bs-primary-rgb: 11, 122, 117;
  --bs-success: #2E8B57;
  --bs-success-rgb: 46, 139, 87;
  --bs-danger: #DC2626;
  --bs-danger-rgb: 220, 38, 38;
  --bs-warning: #D97706;
  --bs-warning-rgb: 217, 119, 6;
  --bs-info: #14A39A;
  --bs-info-rgb: 20, 163, 154;
  --bs-body-color: #1E293B;
  --bs-body-bg: #F8FAFC;
  --bs-secondary-color: #64748B;
  --bs-border-color: #E2E8F0;
  --bs-link-color: #0B7A75;
  --bs-link-hover-color: #096B66;
  --bs-focus-ring-color: rgba(11, 122, 117, 0.25);
  --bs-primary-bg-subtle: #E6F4F2;
  --bs-success-bg-subtle: #E8F5EC;
  --bs-danger-bg-subtle: #FEE2E2;
  --bs-warning-bg-subtle: #FEF3C7;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: linear-gradient(145deg, #F8FAFC 0%, #F0F4F8 40%, #E6F4F2 100%);
  min-height: 100vh;
  background-attachment: fixed;
}
body.app-body {
  background:
    radial-gradient(ellipse at 10% 10%, rgba(11, 122, 117, 0.08), transparent 45%),
    radial-gradient(ellipse at 90% 20%, rgba(46, 139, 87, 0.06), transparent 40%),
    linear-gradient(160deg, #F8FAFC 0%, #F0F4F8 50%, #E6F4F2 100%);
}
body.sidebar-open {
  overflow: hidden;
}
h1, h2, h3, h4, h5, .brand-font {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}
a {
  text-decoration: none;
  color: var(--teal);
}
a:hover {
  color: var(--teal-bright);
}
/* Auth pages */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  overflow: hidden;
}
.auth-shell::before {
  content: "";
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(11, 122, 117, 0.28), transparent 70%);
  top: -120px;
  right: -80px;
  animation: floatOrb 12s ease-in-out infinite;
}
.auth-shell::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20, 163, 154, 0.2), transparent 70%);
  bottom: -100px;
  left: -60px;
  animation: floatOrb 14s ease-in-out infinite reverse;
}
@keyframes floatOrb {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(24px); }
}
.auth-card {
  width: 100%;
  max-width: 460px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  padding: 2.5rem;
  position: relative;
  z-index: 1;
  animation: fadeUp 0.6s ease;
}
.auth-card.wide {
  max-width: 760px;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.brand-mark .logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--teal), var(--royal));
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.35rem;
  box-shadow: 0 8px 24px rgba(11, 122, 117, 0.35);
}
.brand-mark .brand-name {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
}
.brand-mark .brand-tag {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.auth-title {
  font-size: 1.75rem;
  color: var(--navy);
  margin-bottom: 0.35rem;
}
.auth-sub {
  color: var(--muted);
  margin-bottom: 1.75rem;
  font-size: 0.95rem;
}
.form-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--navy);
  margin-bottom: 0.35rem;
}
.form-control,
.form-select {
  border-radius: 12px;
  border: 1.5px solid var(--border);
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(11, 122, 117, 0.15);
  background: var(--card);
}

/* Show / hide password button inside the sign-in field */
.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  z-index: 2;
  padding: 0.25rem 0.5rem;
  line-height: 1;
  color: var(--muted, #64748B);
  text-decoration: none;
}
.password-toggle:hover,
.password-toggle:focus {
  color: var(--teal);
  text-decoration: none;
}
.password-toggle i {
  font-size: 1.1rem;
  pointer-events: none;
}
@media (max-width: 575.98px) {
  /* Touch screens: keep the eye icon visible and easy to tap. */
  .password-toggle {
    display: grid;
    place-items: center;
    min-width: 48px;
    min-height: 48px;
    right: 0;
    padding: 0;
    font-size: 1.15rem;
  }
  .position-relative > .form-control {
    padding-right: 3.3rem !important;
  }
}

/* Sign-in tabs: Email & Password / Login with OTP */
.auth-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  border-bottom: 1px solid var(--border, #E2E8F0);
  padding-bottom: 0.4rem;
}
.auth-tabs .nav-item {
  flex: 1 1 0;
  min-width: 0;
}
.auth-tabs .nav-link {
  width: 100%;
  cursor: pointer;
  border: 1px solid transparent;
  padding: 0.5rem 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted, #64748B);
  background: transparent;
  border-radius: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-tabs .nav-link:hover:not(.active) {
  color: var(--teal);
  background: rgba(11, 122, 117, 0.08);
}
.auth-tabs .nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, #0B7A75, #096B66);
}
@media (max-width: 575.98px) {
  /* Two half-width tabs cannot hold "Email & Password" on one line on phones
     (or with Android's larger text sizes), so let the label wrap instead of clipping. */
  .auth-tabs .nav-item {
    display: flex;
  }
  .auth-tabs .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-height: 48px;
    padding: 0.45rem 0.5rem;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  .auth-tabs .nav-link > i {
    margin-right: 0 !important;
  }
}
/* Sign-in panes switch instantly instead of cross-fading: a fade leaves the outgoing
   form's height in place for ~150ms, which made the card jump when moving between
   "Email & Password" and "Login with OTP". Only the visible pane is laid out, so the
   card resizes once, cleanly, and the fields are never half-rendered.
   (The old :target rules were removed with this: they kept the previous pane visible
   for a frame after a tab click, which caused the same stutter.) */
.auth-pane {
  transition: none;
}
.auth-pane.fade:not(.show) {
  display: none;
  opacity: 0;
}
.auth-pane.fade.show {
  display: block;
  opacity: 1;
}
.tab-content > .auth-pane {
  min-height: 0;
}
.otp-input {
  font-size: 1.35rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
}
/* Time left for the emailed code (and the 20 second resend wait) */
.auth-otp-timer {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--primary-soft, #E6F4F2);
  color: var(--teal);
  font-size: 0.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.auth-otp-timer.is-late {
  background: #FEF3C7;
  color: var(--warning, #D97706);
}
.auth-otp-timer.is-expired {
  background: #FEE2E2;
  color: var(--danger, #DC2626);
}

/* Checkbox-style selects (patient / OPD forms) */
.checkbox-select {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
  padding: 0.65rem 0.75rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
}
.checkbox-select-scroll {
  max-height: 220px;
  overflow-y: auto;
}
.checkbox-option {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.35rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.checkbox-option input {
  margin: 0;
  accent-color: var(--teal);
}
.checkbox-option.is-checked {
  border-color: var(--teal);
  background: var(--primary-soft);
  color: var(--navy);
  font-weight: 600;
}
.checkbox-option.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.checkbox-option.is-disabled input {
  pointer-events: none;
}

.btn-premium {
  background: linear-gradient(135deg, var(--teal) 0%, var(--royal) 100%);
  border: none;
  color: #fff;
  font-weight: 600;
  border-radius: 12px;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 8px 24px rgba(11, 122, 117, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-premium:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(11, 122, 117, 0.4);
}
.btn-ghost {
  background: transparent;
  border: 1.5px solid rgba(30, 41, 59, 0.15);
  color: var(--navy);
  font-weight: 600;
  border-radius: 12px;
  padding: 0.7rem 1.25rem;
}
.btn-ghost:hover {
  background: var(--primary-soft);
  color: var(--navy);
}
/* App layout */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 280px;
  background: linear-gradient(180deg, #0F172A 0%, #1E293B 100%);
  backdrop-filter: blur(24px);
  border-right: 1px solid var(--glass-border);
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  overflow-y: auto;
}
.sidebar-brand {
  padding: 1.5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--glass-border);
}
/* Arrow in the topbar that hides / shows the menu bar.
   Self-contained styling (no CSS variables) so it stays visible even when a
   cached sidebar stylesheet is served on top of this one. */
.topbar .sidebar-collapse,
.sidebar-collapse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
  border: 1.5px solid #0B7A75 !important;
  border-radius: 11px;
  background: #E6F4F2 !important;
  color: #0B7A75 !important;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.topbar .sidebar-collapse i,
.sidebar-collapse i {
  color: #0B7A75 !important;
  font-size: 1rem;
  line-height: 1;
}
.topbar .sidebar-collapse:hover,
.sidebar-collapse:hover {
  background: #0B7A75 !important;
  border-color: #0B7A75 !important;
  color: #fff !important;
}
.topbar .sidebar-collapse:hover i,
.sidebar-collapse:hover i {
  color: #fff !important;
}
.topbar .sidebar-collapse:focus-visible,
.sidebar-collapse:focus-visible {
  outline: 2px solid #0B7A75;
  outline-offset: 2px;
}
/* Desktop collapse: hide the menu bar and give the space back to the page */
@media (min-width: 992px) {
  body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
  }
  body.sidebar-collapsed .main-content {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
  }
}
@media (max-width: 991.98px) {
  /* The hamburger already toggles the drawer on small screens */
  .sidebar-collapse {
    display: none;
  }
}
.sidebar-brand .logo-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--teal), var(--teal-bright));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
}
.sidebar-nav {
  padding: 1rem 0.85rem;
  flex: 1;
}
.nav-section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.4);
  padding: 0.75rem 0.85rem 0.4rem;
}
.sidebar .nav-link {
  color: rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
  font-size: 0.92rem;
  transition: all 0.2s;
}
.sidebar .nav-link i {
  width: 20px;
  text-align: center;
  opacity: 0.85;
}
.sidebar .nav-link:hover {
  background: rgba(11, 122, 117, 0.18);
  color: #fff;
}
.sidebar .nav-link.active {
  background: linear-gradient(135deg, rgba(11, 122, 117, 0.45), rgba(11, 122, 117, 0.25));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(11, 122, 117, 0.4);
}
.sidebar .nav-link[data-bs-toggle="collapse"] .bi-chevron-down {
  width: auto;
  transition: transform 0.2s;
}
.sidebar .nav-link[data-bs-toggle="collapse"][aria-expanded="true"] .bi-chevron-down {
  transform: rotate(180deg);
}
.sidebar .nav-submenu {
  margin: 0 0 0.35rem 1.4rem;
  padding-left: 0.65rem;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}
.sidebar .nav-submenu .nav-sublink {
  padding: 0.5rem 0.7rem;
  font-size: 0.85rem;
  border-radius: 10px;
}
.sidebar .nav-submenu .nav-sublink i {
  width: 18px;
  font-size: 0.85rem;
}
.main-content {
  margin-left: 280px;
  width: calc(100% - 280px);
  max-width: calc(100% - 280px);
  min-width: 0;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-title {
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0;
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--navy);
}
.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--teal), var(--teal-bright));
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
}
.page-body {
  padding: 1.5rem 1.75rem 2rem;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}
.glass-panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  animation: fadeUp 0.45s ease;
  margin-bottom: 0;
  /* Grid/flex items default to min-width:auto, so one wide child (e.g. long doctor
     choice chips) stretched the whole panel and pushed form fields off the card. */
  min-width: 0;
  max-width: 100%;
}
.glass-panel > h5,
.glass-panel > .brand-font {
  margin-top: 0;
  margin-bottom: 1rem;
  line-height: 1.3;
  color: var(--navy);
}
.glass-panel .alert {
  margin-bottom: 1rem;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
  align-items: stretch;
}
/* Six cards fit as two even rows on laptop widths, or one row on a wide screen. */
@media (min-width: 576px) {
  .stat-grid:has(> .stat-card:nth-child(6):last-child) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1500px) {
  .stat-grid:has(> .stat-card:nth-child(6):last-child) {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
.stat-card .stat-card-link {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
}
.stat-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  color: #fff;
  box-shadow: var(--shadow);
  min-height: 112px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: fadeUp 0.5s ease backwards;
}
.stat-card:nth-child(1) { animation-delay: 0.05s; background: linear-gradient(135deg, #0B7A75, #096B66); }
.stat-card:nth-child(2) { animation-delay: 0.1s; background: linear-gradient(135deg, #1E293B, #0F172A); }
.stat-card:nth-child(3) { animation-delay: 0.15s; background: linear-gradient(135deg, #14A39A, #0B7A75); }
.stat-card:nth-child(4) { animation-delay: 0.2s; background: linear-gradient(135deg, #D97706, #B45309); }
.stat-card:nth-child(5) { animation-delay: 0.25s; background: linear-gradient(135deg, #334155, #1E293B); }
.stat-card:nth-child(6) { animation-delay: 0.3s; background: linear-gradient(135deg, #2E8B57, #1F6B42); }
.stat-card:nth-child(7) { animation-delay: 0.35s; background: linear-gradient(135deg, #0F766E, #115E59); }
.stat-card:nth-child(8) { animation-delay: 0.4s; background: linear-gradient(135deg, #1E3A5F, #0F2744); }
.stat-card:nth-child(9) { animation-delay: 0.45s; background: linear-gradient(135deg, #475569, #334155); }
.stat-card:nth-child(10) { animation-delay: 0.5s; background: linear-gradient(135deg, #0E7490, #155E75); }
.stat-card:nth-child(11) { animation-delay: 0.55s; background: linear-gradient(135deg, #3F6212, #365314); }
.stat-card:nth-child(12) { animation-delay: 0.6s; background: linear-gradient(135deg, #9A3412, #7C2D12); }
.stat-card .stat-icon {
  position: absolute;
  right: 0.85rem;
  top: 0.85rem;
  transform: none;
  font-size: 1.65rem;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
  line-height: 1;
}
.stat-card .stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.88;
  margin: 0 0 0.4rem;
  padding-right: 2.5rem;
  line-height: 1.25;
}
.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
  padding-right: 2.5rem;
  word-break: break-word;
  position: relative;
  z-index: 1;
  text-shadow: none;
  filter: none;
}
.stat-card .stat-label,
.stat-card .stat-meta {
  position: relative;
  z-index: 1;
}
.stat-card .stat-meta,
.stat-card .text-muted {
  color: rgba(255, 255, 255, 0.82) !important;
  font-size: 0.75rem;
  line-height: 1.35;
  margin-top: 0.35rem;
  padding-right: 2.25rem;
  opacity: 1;
  text-shadow: none;
  filter: none;
}
.stat-card .stat-meta a,
.stat-card .text-muted a {
  color: #fff !important;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.table-responsive {
  width: 100%;
  margin: 0;
  border-radius: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-premium {
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
  table-layout: auto;
}
.table-premium thead th {
  background: linear-gradient(90deg, #1E293B, #0B7A75);
  color: #fff;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.8rem 0.9rem;
  border: none;
  white-space: nowrap;
  vertical-align: middle;
  line-height: 1.3;
}
.table-premium thead th:first-child {
  border-radius: 12px 0 0 0;
  padding-left: 1.1rem;
}
.table-premium thead th:last-child {
  border-radius: 0 12px 0 0;
  padding-right: 1.1rem;
  text-align: right;
}
.table-premium tbody td {
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 0.875rem;
  background: var(--card);
  line-height: 1.4;
  color: var(--text);
}
.table-premium tbody td:first-child {
  padding-left: 1.1rem;
  font-weight: 600;
}
.table-premium tbody td:last-child {
  padding-right: 1.1rem;
  text-align: right;
  white-space: nowrap;
}
.table-premium tbody tr:last-child td {
  border-bottom: none;
}
.table-premium tbody tr:hover td {
  background: var(--surface-alt);
}
/* Action buttons inside table cells — aligned in one row */
.table-premium td .btn,
.table-premium td form,
.table-premium td .d-inline {
  vertical-align: middle;
}
.table-premium td form.d-inline {
  margin: 0 0.15rem;
}
.table-premium td .btn-sm {
  min-width: 34px;
  height: 34px;
  padding: 0.25rem 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.table-premium td .btn + .btn,
.table-premium td form + .btn,
.table-premium td .btn + form,
.table-premium td form + form {
  margin-left: 0.25rem;
}
.badge-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
  line-height: 1.2;
  white-space: nowrap;
}
.badge-pending { background: #FEF3C7; color: #92400E; }
.badge-approved, .badge-active, .badge-completed, .badge-checkedin, .badge-confirmed { background: var(--success-soft); color: #1B5E3B; }
.badge-rejected, .badge-cancelled { background: #FEF3C7; color: #B45309; }
.badge-inactive, .badge-deactivated, .badge-scheduled { background: var(--surface-alt); color: #475569; }
.badge-missed, .badge-emergency, .badge-noshow { background: #FEE2E2; color: #991B1B; }
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem 1rem;
  margin-bottom: 1.25rem;
}
.page-header h2 {
  color: var(--navy);
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.25;
}
.page-header p {
  color: var(--muted);
  margin: 0.3rem 0 0;
  font-size: 0.88rem;
  line-height: 1.4;
  max-width: 52rem;
}
.filter-bar {
  background: var(--surface);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin-bottom: 1.15rem;
  border: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}
.filter-bar.row {
  display: flex;
  margin-left: -0.4rem;
  margin-right: -0.4rem;
  margin-bottom: 1.15rem;
}
.filter-bar.row > [class*="col-"] {
  padding-left: 0.4rem;
  padding-right: 0.4rem;
  margin-bottom: 0.35rem;
}
.filter-bar .form-label {
  margin-bottom: 0.3rem;
  font-size: 0.8rem;
}
.filter-bar .btn-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.filter-bar .btn-group > .btn {
  border-radius: 10px !important;
  margin: 0 !important;
  min-height: 36px;
  padding: 0.4rem 0.9rem;
}
/* Equal-height panels in Bootstrap rows (admin pricing, etc.) */
.page-body > .row {
  --bs-gutter-x: 1rem;
  --bs-gutter-y: 1rem;
  margin-bottom: 0;
}
.page-body > .row > [class*="col-"] {
  display: flex;
  flex-direction: column;
}
.page-body > .row > [class*="col-"] > .glass-panel {
  /* Grow to the row's height, but never below the panel's own content. A plain
     height:100% let the shorter sibling column (e.g. a short "Recent visits" list)
     size this panel, so the OPD visit form was cut off after "Doctor".
     min-height:100% is deliberately NOT used: with two stacked panels in one column
     it made the second card claim the full row height and spill over the cards below. */
  flex: 1 1 auto;
  width: 100%;
  height: auto;
  align-self: stretch;
}
.page-body > .row + .glass-panel,
.page-body > .stat-grid + .glass-panel,
.page-body > .glass-panel + .glass-panel {
  margin-top: 1.15rem;
}
.glass-panel .table-responsive + .empty-state,
.glass-panel .filter-bar + .table-responsive {
  margin-top: 0;
}
.empty-state {
  text-align: center;
  padding: 2.25rem 1rem;
  color: var(--muted);
  margin: 0;
}
.empty-state.py-3,
.empty-state.py-4 {
  padding-top: 1.75rem !important;
  padding-bottom: 1.75rem !important;
}
@media (max-width: 1199.98px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 575.98px) {
  .stat-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
  .page-body {
    padding: 1rem;
  }
  .glass-panel {
    padding: 1rem 1.1rem;
  }
  .table-premium {
    min-width: 640px;
  }
}
.alert {
  border-radius: 12px;
  border: none;
  font-weight: 500;
}
.alert-success {
  background-color: var(--success-soft);
  color: #1B5E3B;
}
.alert-danger {
  background-color: #FEE2E2;
  color: #991B1B;
}
.alert-warning {
  background-color: #FEF3C7;
  color: #92400E;
}
.alert-info {
  background-color: var(--primary-soft);
  color: #0B5C58;
}
.text-success {
  color: var(--success) !important;
}
.text-danger {
  color: var(--danger) !important;
}
.text-warning {
  color: var(--warning) !important;
}
.text-muted {
  color: var(--muted) !important;
}
.btn-primary {
  background-color: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.btn-primary:hover,
.btn-primary:focus {
  background-color: #096B66;
  border-color: #096B66;
  color: #fff;
}
.btn-success {
  background-color: var(--success);
  border-color: var(--success);
  color: #fff;
}
.btn-success:hover,
.btn-success:focus {
  background-color: #267A4B;
  border-color: #267A4B;
  color: #fff;
}
.btn-danger {
  background-color: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn-danger:hover,
.btn-danger:focus {
  background-color: #B91C1C;
  border-color: #B91C1C;
  color: #fff;
}
.modal-content {
  border: none;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--card);
}
.modal-header {
  background: linear-gradient(90deg, var(--navy), var(--royal));
  color: #fff;
  border: none;
}
.modal-header .btn-close {
  filter: invert(1);
}
.modal-body {
  background: var(--card);
  color: var(--text);
}
.modal-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.empty-state i {
  font-size: 2.75rem;
  color: var(--teal);
  opacity: 0.5;
  margin-bottom: 0.75rem;
  display: block;
}
/* Print lab sheet */
@media print {
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: #fff;
    padding: 1.5rem;
  }
  .no-print { display: none !important; }
}
.lab-sheet {
  border: 2px solid var(--navy);
  border-radius: 8px;
  padding: 2rem;
  background: #fff;
}
.lab-sheet-header {
  border-bottom: 3px double var(--teal);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.lab-test-picker {
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 12px;
  padding: 0.85rem;
  background: var(--surface-alt, #F0F4F8);
}
.lab-picker-panels {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0.85rem;
}
.lab-picker-list {
  max-height: 280px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 10px;
  padding: 0.35rem;
}
.lab-picker-option {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  color: inherit;
}
.lab-picker-option:hover,
.lab-picker-option:focus {
  background: rgba(11, 122, 117, 0.08);
  outline: 2px solid rgba(11, 122, 117, 0.35);
  outline-offset: -2px;
}
.lab-picker-option.is-selected {
  background: rgba(11, 122, 117, 0.12);
  box-shadow: inset 3px 0 0 var(--teal, #0B7A75);
}
.lab-picker-option .opt-title {
  font-weight: 600;
  font-size: 0.9rem;
}
.lab-picker-option .opt-meta {
  font-size: 0.78rem;
  color: #64748b;
}
.lab-picker-selected {
  background: #fff;
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 10px;
  padding: 0.75rem;
  min-height: 140px;
}
.lab-selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.lab-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border, #E2E8F0);
  background: var(--surface-alt, #F0F4F8);
  border-radius: 999px;
  padding: 0.25rem 0.55rem 0.25rem 0.7rem;
  font-size: 0.82rem;
}
.lab-chip[data-kind="bundle"] {
  border-color: rgba(11, 122, 117, 0.35);
  background: rgba(11, 122, 117, 0.08);
}
.lab-chip button {
  border: 0;
  background: transparent;
  color: #64748b;
  line-height: 1;
  padding: 0;
  font-size: 1rem;
  cursor: pointer;
}
.lab-chip button:hover,
.lab-chip button:focus {
  color: #991B1B;
  outline: none;
}
.lab-picker-search {
  position: relative;
}
.lab-picker-search > i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  pointer-events: none;
}
.lab-picker-search .form-control {
  padding-left: 2.4rem;
}
.lab-picker-status {
  font-size: 0.76rem;
  color: #64748b;
  margin: 0.35rem 0 0.5rem;
}
.lab-picker-list {
  max-height: 360px;
}
.lab-picker-group {
  position: sticky;
  top: -0.35rem;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.35rem -0.35rem 0.15rem;
  padding: 0.4rem 0.85rem;
  background: #f1f5f9;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.lab-picker-group:first-child {
  margin-top: -0.35rem;
}
.lab-picker-count {
  font-weight: 600;
  color: #64748b;
}
.lab-picker-check {
  color: var(--teal, #0B7A75);
  font-size: 1rem;
  line-height: 1.3;
}
.lab-picker-option:not(.is-selected) .lab-picker-check {
  color: #94a3b8;
}
.lab-picker-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
@media (max-width: 767.98px) {
  .lab-picker-panels {
    grid-template-columns: 1fr;
  }
  .lab-picker-list {
    max-height: 320px;
  }
}
.sidebar-toggle {
  display: none;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--navy);
  border-radius: 10px;
  width: 42px;
  height: 42px;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1035;
}
@media (max-width: 991.98px) {
  .app-wrapper {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.show {
    transform: translateX(0);
  }
  .sidebar-overlay.show {
    display: block;
  }
  .main-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-left: 0;
  }
  .topbar,
  .page-body,
  .footer-bar {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    clear: both;
  }
  .sidebar-toggle {
    display: grid;
    place-items: center;
  }
  .page-body {
    padding: 1rem;
  }
  .page-header,
  .page-header > div {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .page-header .d-flex.gap-2 {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    align-items: stretch;
  }
  .page-header .d-flex.gap-2 > .btn,
  .page-header .d-flex.gap-2 > a.btn {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: normal;
    text-align: center;
  }
}
.wallet-balance {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--teal), var(--royal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--primary-soft);
  border: 1px solid rgba(11, 122, 117, 0.28);
  color: var(--navy);
  font-weight: 600;
  border-radius: 10px;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  transition: background 0.2s, color 0.2s;
}
.btn-logout:hover {
  background: rgba(11, 122, 117, 0.18);
  color: var(--navy-deep);
}
.sidebar .nav-logout {
  color: rgba(255, 255, 255, 0.72) !important;
}
.sidebar .nav-logout:hover {
  background: rgba(11, 122, 117, 0.2) !important;
  color: #fff !important;
}
.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--glass-border);
}
.login-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  background: var(--surface-alt);
  padding: 0.35rem;
  border-radius: 12px;
}
.login-mode-tabs-3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.login-mode-tab {
  text-align: center;
  padding: 0.65rem 0.5rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
  transition: all 0.2s;
}
.login-mode-tab:hover {
  color: var(--navy);
}
.login-mode-tab.active {
  background: var(--card);
  color: var(--teal);
  box-shadow: 0 0 0 1px rgba(11, 122, 117, 0.22), 0 4px 14px rgba(15, 23, 42, 0.08);
}
.footer-bar {
  text-align: center;
  padding: 1rem;
  color: var(--muted);
  font-size: 0.8rem;
}

/* Specialty-dependent form sections */
.specialty-sections .specialty-field-group:not(.is-active),
.specialty-sections .specialty-common-fields:not(.is-active),
.specialty-sections .specialty-common-fields[hidden],
.specialty-field-group[hidden] {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
}
.specialty-sections .specialty-field-group.is-active,
.specialty-sections .specialty-common-fields.is-active {
  display: block !important;
}
.specialty-sections .form-label {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* -------------------------------------------------------------------------- */
/* Mobile / tablet only — desktop (≥992px) keeps the original web layout      */
/* -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body {
    overflow-x: hidden;
  }

  .sidebar {
    width: min(300px, 86vw);
    box-shadow: 12px 0 40px rgba(15, 23, 42, 0.28);
  }

  .sidebar-toggle {
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
  }

  .sidebar-overlay {
    -webkit-tap-highlight-color: transparent;
  }

  .sidebar-nav {
    padding-bottom: 1.5rem;
  }

  .sidebar .nav-link {
    min-height: 44px;
    padding: 0.75rem 0.95rem;
  }

  .main-content {
    width: 100%;
    min-width: 0;
  }

  .topbar {
    padding: 0.7rem 0.9rem;
    gap: 0.75rem;
  }

  .topbar > .d-flex {
    min-width: 0;
    flex: 1 1 auto;
  }

  .topbar-title {
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-user {
    flex-shrink: 0;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .page-header > div:last-child,
  .page-header > .d-flex,
  .page-header > a.btn,
  .page-header > .btn {
    width: 100%;
  }

  .page-header .d-flex {
    flex-wrap: wrap;
  }

  .page-header .btn,
  .page-header a.btn {
    justify-content: center;
  }

  .page-header h2 {
    font-size: 1.25rem;
  }

  .page-header p {
    font-size: 0.84rem;
    max-width: none;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar .btn-group {
    width: 100%;
  }

  .filter-bar .btn-group > .btn {
    flex: 1 1 auto;
    text-align: center;
  }

  .table-premium td .btn-sm,
  .table-premium td .btn {
    min-height: 36px;
    padding: 0.4rem 0.65rem;
  }

  .wallet-balance {
    font-size: 2rem;
  }

  .auth-card {
    padding: 1.75rem 1.25rem;
    border-radius: 20px;
  }

  .auth-card.wide {
    max-width: 100%;
  }

  .auth-title {
    font-size: 1.45rem;
  }

  .login-mode-tab {
    font-size: 0.72rem;
    padding: 0.65rem 0.25rem;
  }
  .login-mode-tabs-3 {
    gap: 0.35rem;
  }

  /* Keep label/value pairs on one line on phones; only field columns stack.
     (row-cols rules are used as well: :has() is not supported by older WebViews.) */
  .glass-panel .row.row-cols-2.g-2 > .col-6:has(input, select, textarea) {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .glass-panel .row.g-2 > .col-6.text-muted {
    margin-bottom: 0.1rem;
    padding-bottom: 0;
  }

  .glass-panel .row.g-2 > .col-6:not(.text-muted) {
    margin-bottom: 0.65rem;
    font-weight: 600;
  }

  #opdChargeStatus .d-flex {
    flex-direction: column;
    align-items: stretch !important;
  }

  #opdChargeStatus .text-end {
    text-align: left !important;
    margin-top: 0.75rem;
  }

  .specialty-sections .p-3 {
    padding: 0.85rem !important;
  }

  .btn-premium,
  .btn-ghost,
  .btn-logout,
  .sidebar-toggle {
    min-height: 42px;
  }

  .table-responsive {
    overscroll-behavior-x: contain;
  }
}

@media (max-width: 575.98px) {
  .auth-shell {
    padding: 1rem 0.75rem;
    align-items: flex-start;
    padding-top: max(1rem, env(safe-area-inset-top));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .auth-card {
    padding: 1.35rem 1rem;
    margin: 0.25rem 0 1rem;
  }

  .brand-mark {
    margin-bottom: 1.1rem;
  }

  .brand-mark .brand-name {
    font-size: 1.25rem;
  }

  .auth-sub {
    font-size: 0.88rem;
    margin-bottom: 1.25rem;
  }

  .topbar {
    padding: 0.65rem 0.75rem;
    padding-top: max(0.65rem, env(safe-area-inset-top));
  }

  .topbar-title {
    font-size: 0.98rem;
  }

  .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 0.9rem;
  }

  .btn-logout {
    padding: 0.4rem 0.65rem;
    min-width: 42px;
    justify-content: center;
  }

  .page-body {
    padding: 0.75rem 0.65rem 1.35rem;
    padding-bottom: max(1.35rem, env(safe-area-inset-bottom));
  }

  .glass-panel {
    padding: 0.95rem 0.9rem;
    border-radius: 14px;
  }

  .page-header h2 {
    font-size: 1.15rem;
  }

  .stat-card {
    min-height: 96px;
    padding: 1rem;
  }

  .stat-card .stat-value {
    font-size: 1.45rem;
  }

  .stat-card .stat-label {
    font-size: 0.72rem;
  }

  .wallet-balance {
    font-size: 1.75rem;
  }

  .form-control,
  .form-select,
  textarea.form-control {
    font-size: 16px;
    padding: 0.75rem 0.9rem;
  }

  .page-header .btn-premium,
  .page-header .btn-ghost,
  .page-header a.btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1rem;
  }

  .page-header .d-flex.gap-2 {
    width: 100%;
    flex-direction: column;
  }

  .page-header .d-flex.gap-2 > .btn,
  .page-header .d-flex.gap-2 > a {
    width: 100%;
  }

  .table-premium {
    min-width: 520px;
    font-size: 0.82rem;
  }

  .table-premium thead th,
  .table-premium tbody td {
    padding: 0.65rem 0.7rem;
  }

  .table-premium td .btn + .btn,
  .table-premium td form + .btn,
  .table-premium td .btn + form,
  .table-premium td form + form {
    margin-left: 0.2rem;
  }

  .badge-status {
    white-space: normal;
    text-align: center;
  }

  .footer-bar {
    padding: 0.85rem 0.75rem;
    font-size: 0.75rem;
  }

  .modal-dialog {
    margin: 0.5rem;
  }

  .lab-sheet {
    padding: 1rem;
  }

  .lab-sheet-header {
    flex-direction: column;
    gap: 0.75rem;
  }

  form > .mt-4 > .btn-premium,
  form > .mt-4 > button.btn-premium,
  form .mt-4 > .btn.btn-premium,
  #opdVisitForm > .btn-premium,
  #opdSubmitBtn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 379.98px) {
  .login-mode-tabs {
    grid-template-columns: 1fr;
  }

  .topbar-user .user-avatar {
    display: none;
  }

  .table-premium {
    min-width: 480px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Reports dashboard */
.report-stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  align-items: stretch;
}
.report-stat-grid .report-stat-card,
.report-stat-grid .stat-card {
  isolation: isolate;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
  transform: none;
  animation: none;
  background-clip: padding-box;
}
.report-stat-grid .stat-card::after,
.report-stat-grid .stat-card::before {
  content: none !important;
  display: none !important;
}
.report-chart-wrap {
  position: relative;
  width: 100%;
  height: 240px;
  min-height: 240px;
}
.report-chart-wrap-sm {
  height: 210px;
  min-height: 210px;
}
.report-filter-quick .btn.active,
.glass-panel .btn.btn-ghost.active {
  background: rgba(11, 122, 117, 0.12);
  color: var(--navy);
  border-color: rgba(11, 122, 117, 0.35);
}

/* Patient Journey */
.journey-picker-panel { padding: 1.5rem; }
.journey-picker-intro { display: flex; align-items: center; gap: 1rem; }
.journey-icon, .journey-avatar, .journey-event-icon {
  display: grid; place-items: center; flex: 0 0 auto;
  color: #fff; background: linear-gradient(135deg, var(--teal), #14A39A);
  box-shadow: 0 10px 24px rgba(11, 122, 117, .24);
}
.journey-icon { width: 48px; height: 48px; border-radius: 15px; font-size: 1.25rem; }
.journey-hero {
  display: flex; align-items: center; gap: 1rem; padding: 1.45rem 1.6rem;
  border-radius: 22px; color: #fff; overflow: hidden; position: relative;
  background: linear-gradient(125deg, #0F766E 0%, #0B7A75 52%, #155E75 100%);
  box-shadow: 0 18px 42px rgba(11, 122, 117, .22);
}
.journey-hero::after { content: ''; position: absolute; width: 250px; height: 250px; border-radius: 50%; background: rgba(255,255,255,.09); right: -85px; top: -150px; }
.journey-avatar { width: 64px; height: 64px; border-radius: 20px; background: rgba(255,255,255,.18); box-shadow: none; font: 800 1.6rem var(--font-display); }
.journey-hero-copy { position: relative; z-index: 1; min-width: 0; }
.journey-hero h3 { margin: .15rem 0; font-size: 1.6rem; }
.journey-hero p, .journey-eyebrow { margin: 0; color: rgba(255,255,255,.78); }
.journey-eyebrow { font-size: .72rem; letter-spacing: .1em; font-weight: 700; }
.journey-hero-meta { margin-left: auto; position: relative; z-index: 1; text-align: right; padding-left: 1rem; }
.journey-hero-meta span { display: block; color: rgba(255,255,255,.7); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.journey-hero-meta strong { font-family: var(--font-display); font-size: 1.05rem; }
.journey-stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .85rem; }
.journey-stat { position: relative; min-height: 112px; padding: 1rem; border: 1px solid var(--border); border-radius: 16px; background: rgba(255,255,255,.82); overflow: hidden; box-shadow: 0 6px 20px rgba(15,23,42,.05); }
.journey-stat i { color: var(--teal); font-size: 1.2rem; }
.journey-stat span { display: block; margin-top: .42rem; color: var(--muted); font-size: .78rem; }
.journey-stat strong { display: block; margin-top: .2rem; color: var(--navy); font: 800 1.25rem var(--font-display); }
.journey-chart-wrap { height: 255px; position: relative; }
.journey-chip { display: inline-block; padding: .26rem .58rem; border-radius: 99px; background: var(--primary-soft); color: var(--teal); font-size: .72rem; font-weight: 700; white-space: nowrap; }
.journey-chip-visit { margin-bottom: .45rem; background: #E8F5EC; color: #216E42; }
.journey-snapshot { display: grid; gap: .7rem; }
.journey-snapshot > div { padding: .68rem .8rem; background: var(--surface); border-radius: 11px; }
.journey-snapshot span, .journey-note-grid span { display: block; margin-bottom: .12rem; color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .045em; }
.journey-snapshot strong { display: block; font-size: .88rem; font-weight: 600; overflow-wrap: anywhere; }
.journey-visit-list { display: grid; gap: .8rem; }
.journey-visit-card { display: flex; gap: .8rem; padding: .9rem; border: 1px solid var(--border); border-radius: 14px; background: linear-gradient(120deg, #fff, #F8FCFC); }
.journey-visit-date { width: 48px; height: 52px; flex: 0 0 48px; border-radius: 12px; color: var(--teal); background: var(--primary-soft); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .68rem; font-weight: 700; text-transform: uppercase; }
.journey-visit-date span { font: 800 1.2rem/1 var(--font-display); }
.journey-visit-content { min-width: 0; flex: 1; }
.journey-visit-content h6 { margin: 0; color: var(--navy); font-size: 1rem; }
.journey-vitals { padding: .45rem .6rem; border-radius: 8px; color: #255E5A; background: #EDF8F7; font-size: .8rem; }
.journey-vitals i { color: var(--teal); }
.journey-note-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem; font-size: .8rem; }
.journey-note-grid > div { overflow-wrap: anywhere; }
.journey-med-list { display: grid; gap: .65rem; }
.journey-med-entry { display: flex; align-items: flex-start; justify-content: space-between; gap: .65rem; padding: .8rem; background: var(--surface); border-radius: 12px; }
.journey-med-entry span { display: block; color: var(--muted); font-size: .72rem; }
.journey-med-entry strong { display: block; font-size: .9rem; }
.journey-med-entry p { margin: .2rem 0 0; color: var(--text); font-size: .82rem; overflow-wrap: anywhere; }
.journey-timeline { position: relative; display: grid; gap: .95rem; }
.journey-timeline::before { content: ''; position: absolute; left: 17px; top: 18px; bottom: 18px; width: 2px; background: linear-gradient(var(--teal), #DCEDEA); }
.journey-event { position: relative; display: flex; gap: .8rem; }
.journey-event-icon { width: 36px; height: 36px; border-radius: 11px; z-index: 1; font-size: .85rem; }
.journey-event-lab .journey-event-icon { background: linear-gradient(135deg, #7C3AED, #A855F7); }
.journey-event-medication .journey-event-icon { background: linear-gradient(135deg, #D97706, #F59E0B); }
.journey-event-appointment .journey-event-icon { background: linear-gradient(135deg, #2563EB, #38BDF8); }
.journey-event-body { flex: 1; min-width: 0; padding: .1rem 0 .25rem; }
.journey-event-body strong { font-size: .88rem; }
.journey-event-body time { color: var(--muted); font-size: .7rem; white-space: nowrap; }
.journey-event-body p { margin: .16rem 0 .28rem; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.journey-event-body a { font-size: .78rem; font-weight: 700; }
@media (max-width: 991.98px) { .journey-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .journey-hero { align-items: flex-start; flex-wrap: wrap; padding: 1.15rem; } .journey-hero-meta { width: 100%; margin-left: 0; padding-left: 80px; text-align: left; } .journey-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .journey-stat:last-child { grid-column: span 2; } .journey-chart-wrap { height: 220px; } }
@media (max-width: 767.98px) {
  .report-chart-wrap,
  .report-chart-wrap-sm {
    height: 220px;
    min-height: 220px;
  }
}

/* Pharmacy medicine entry — wider columns, aligned inputs */
/* Patient Journey — clinical command centre refinement */
.journey-hero {
  min-height: 178px; padding: 2rem; border: 0;
  background: radial-gradient(circle at 88% 15%, rgba(45, 212, 191, .34), transparent 25%), radial-gradient(circle at 76% 130%, rgba(125, 211, 252, .16), transparent 34%), linear-gradient(125deg, #0B2239 0%, #0B4F5B 55%, #08756F 100%);
  box-shadow: 0 24px 54px rgba(8, 67, 81, .25);
}
.journey-hero::before { content: ''; position: absolute; inset: 0; opacity: .3; background-image: radial-gradient(rgba(255,255,255,.38) 1px, transparent 1px); background-size: 20px 20px; mask-image: linear-gradient(90deg, transparent, #000 45%, transparent); }
.journey-hero::after { width: 340px; height: 340px; right: -60px; top: -190px; background: radial-gradient(circle, rgba(255,255,255,.20), rgba(255,255,255,0) 68%); }
.journey-avatar { width: 76px; height: 76px; border-radius: 24px; background: linear-gradient(145deg, rgba(255,255,255,.25), rgba(255,255,255,.08)); border: 1px solid rgba(255,255,255,.28); font-size: 2rem; box-shadow: 0 12px 30px rgba(0,0,0,.12); }
.journey-hero-copy h3 { font-size: clamp(1.7rem, 3vw, 2.25rem); letter-spacing: -.045em; }
.journey-hero-copy p b { margin: 0 .25rem; color: #5EEAD4; }
.journey-eyebrow { display: flex; align-items: center; gap: .45rem; color: #99F6E4; font-size: .68rem; }
.journey-eyebrow::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #5EEAD4; box-shadow: 0 0 0 4px rgba(94,234,212,.12); }
.journey-hero-meta { min-width: 190px; padding: 1rem 1.15rem; border-radius: 16px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.09); backdrop-filter: blur(12px); }
.journey-hero-meta strong { display: block; margin-top: .15rem; font-size: 1.2rem; }
.journey-hero-meta::after { content: 'LIVE RECORD'; display: inline-block; margin-top: .55rem; color: #99F6E4; font-size: .62rem; font-weight: 800; letter-spacing: .11em; }
.journey-signal-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.journey-signal { display: flex; align-items: center; gap: .7rem; min-width: 0; padding: .88rem .9rem; background: rgba(255,255,255,.86); border: 1px solid rgba(203, 213, 225, .8); border-radius: 15px; box-shadow: 0 8px 24px rgba(15,23,42,.055); }
.journey-signal-icon { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 36px; border-radius: 11px; color: #08756F; background: #DDF8F2; }
.journey-signal-icon-blue { color: #2563EB; background: #E8F1FF; }.journey-signal-icon-gold { color: #B45309; background: #FFF4D9; }.journey-signal-icon-purple { color: #7C3AED; background: #F1EAFE; }
.journey-signal > div { min-width: 0; }.journey-signal span { display: block; margin-bottom: .14rem; color: var(--muted); font-size: .67rem; font-weight: 800; letter-spacing: .065em; text-transform: uppercase; }.journey-signal strong { display: block; color: var(--navy); font-size: .8rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.journey-signal-alert { border-color: #F7D2D7; background: linear-gradient(135deg, #FFFDFD, #FFF6F6); }.journey-signal-alert .journey-signal-icon { color: #C2414A; background: #FEEAEC; }
.journey-stat-grid { gap: .75rem; }.journey-stat { min-height: 124px; padding: 1rem 1.05rem; border: 1px solid rgba(203,213,225,.9); border-radius: 17px; background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(247,252,252,.78)); box-shadow: 0 8px 22px rgba(15,23,42,.045); transition: transform .2s ease, box-shadow .2s ease; }.journey-stat:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(15,23,42,.09); }.journey-stat::before { content: ''; position: absolute; width: 70px; height: 70px; border-radius: 50%; right: -24px; top: -30px; background: rgba(20,163,154,.08); }.journey-stat i { position: relative; z-index: 1; font-size: 1.1rem; }.journey-stat strong { position: relative; z-index: 1; font-size: 1.4rem; }.journey-stat small { display: block; position: relative; z-index: 1; margin-top: .12rem; color: var(--muted); font-size: .68rem; }
.journey-roadmap-panel { min-width: 0; max-width: 100%; padding: 1.3rem 1.35rem 1.45rem; border: 1px solid #DCEAE8; border-radius: 19px; background: linear-gradient(135deg, #FFFFFF, #F1FAF9); box-shadow: 0 12px 30px rgba(15,23,42,.045); }.journey-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.15rem; }.journey-section-heading p { max-width: 320px; margin: 0; color: var(--muted); font-size: .78rem; text-align: right; }.journey-kicker { display: block; margin-bottom: .2rem; color: #0F766E; font-size: .64rem; font-weight: 800; letter-spacing: .115em; }
.journey-roadmap { display: flex; width: 100%; min-width: 0; max-width: 100%; gap: 0; overflow-x: auto; overscroll-behavior-x: contain; padding: .7rem .25rem 1.05rem; scroll-snap-type: x proximity; scrollbar-width: thin; }.journey-station { position: relative; flex: 0 0 190px; min-width: 0; min-height: 156px; padding: 2.55rem .85rem .75rem; scroll-snap-align: start; }.journey-station:not(:last-child)::after { content: ''; position: absolute; z-index: 0; height: 2px; top: 22px; left: 34px; width: calc(100% - 22px); background: linear-gradient(90deg, #68D6C7, #B8E5DF); }.journey-station-node { position: absolute; z-index: 1; left: .85rem; top: 5px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; color: #fff; background: linear-gradient(135deg, #0B7A75, #14A39A); box-shadow: 0 6px 14px rgba(11,122,117,.25); }.journey-station-lab .journey-station-node { background: linear-gradient(135deg, #7C3AED, #A855F7); }.journey-station-medication .journey-station-node { background: linear-gradient(135deg, #D97706, #F59E0B); }.journey-station-appointment .journey-station-node { background: linear-gradient(135deg, #2563EB, #38BDF8); }.journey-station time { display: block; color: #64748B; font-size: .68rem; font-weight: 700; }.journey-station strong { display: block; margin-top: .27rem; color: var(--navy); font: 700 .88rem/1.2 var(--font-display); }.journey-station p { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; margin: .3rem 0 0; color: var(--muted); font-size: .73rem; line-height: 1.35; }.journey-station a { position: absolute; right: .7rem; bottom: .55rem; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; color: #0F766E; background: #DDF8F2; font-size: .75rem; }
.journey-chart-wrap { height: 285px; }.journey-chart-wrap::before { content: ''; position: absolute; inset: 0; z-index: 0; border-radius: 14px; background: linear-gradient(135deg, rgba(11,122,117,.035), rgba(37,99,235,.025)); }.journey-chart-wrap canvas { position: relative; z-index: 1; }.journey-snapshot > div { position: relative; padding: .8rem .8rem .8rem 2.35rem; border: 1px solid #E5EFEE; background: linear-gradient(135deg, #FBFEFE, #F4FAFA); }.journey-snapshot > div::before { content: ''; position: absolute; left: .85rem; top: .95rem; width: 8px; height: 8px; border-radius: 50%; background: #14A39A; box-shadow: 0 0 0 4px #DDF8F2; }.journey-visit-card { position: relative; padding: 1.05rem; border-color: #E0EBE9; border-radius: 16px; box-shadow: 0 5px 14px rgba(15,23,42,.025); }.journey-visit-card::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 4px; border-radius: 16px 0 0 16px; background: linear-gradient(#14A39A, #0B7A75); }.journey-visit-date { width: 54px; height: 58px; flex-basis: 54px; border-radius: 14px; }.journey-timeline { padding-left: .1rem; }.journey-event-body { padding: .3rem .65rem .55rem; border-radius: 12px; background: #FAFCFC; }.journey-event-body:hover { background: #F0FAF8; }
@media (max-width: 1199.98px) { .journey-signal-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } } @media (max-width: 767.98px) { .journey-hero { min-height: 0; padding: 1.3rem; }.journey-hero-meta { margin-left: 0; width: 100%; }.journey-signal-strip { grid-template-columns: 1fr; }.journey-section-heading { align-items: flex-start; flex-direction: column; }.journey-section-heading p { text-align: left; }.journey-roadmap-panel { padding: 1.1rem; }.journey-chart-wrap { height: 235px; } }

.pharmacy-rx-panel {
  overflow: visible;
}
.pharmacy-medicine-wrap {
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 12px;
  background: var(--card, #fff);
}
.medicine-entry-table {
  min-width: 980px;
  table-layout: fixed;
  width: 100%;
}
.medicine-entry-table thead th {
  white-space: nowrap;
}
.medicine-entry-table .col-med { width: 28%; }
.medicine-entry-table .col-dose { width: 14%; }
.medicine-entry-table .col-freq { width: 14%; }
.medicine-entry-table .col-dur { width: 14%; }
.medicine-entry-table .col-ins { width: 24%; }
.medicine-entry-table .col-act {
  width: 52px;
  text-align: center !important;
  padding-left: 0.4rem !important;
  padding-right: 0.4rem !important;
}
.medicine-entry-table tbody td {
  padding: 0.65rem 0.55rem;
  vertical-align: middle;
}
.medicine-entry-table tbody td:first-child {
  font-weight: 400;
  padding-left: 0.75rem;
}
.medicine-entry-table tbody td:last-child {
  text-align: center;
  white-space: nowrap;
  padding-right: 0.5rem;
}
.medicine-entry-table .form-control {
  width: 100%;
  min-height: 42px;
  font-size: 0.95rem;
  line-height: 1.35;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
}
.medicine-entry-table thead th.col-act {
  text-align: center !important;
}
@media (min-width: 1200px) {
  .medicine-entry-table {
    min-width: 0;
  }
}


/* ---------- Prescription writer ---------- */
.rx-patient-strip { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.rx-patient-avatar { width: 46px; height: 46px; border-radius: 50%; flex: 0 0 46px; display: grid; place-items: center;
  font-weight: 700; font-size: 1.15rem; color: #fff; background: linear-gradient(135deg, var(--teal), var(--teal-bright)); }
.rx-patient-main { flex: 1 1 220px; min-width: 0; }
.rx-patient-name { font-weight: 700; font-size: 1.05rem; }
.rx-patient-id { font-weight: 500; color: #64748b; font-size: .85rem; }
.rx-patient-meta { color: #64748b; font-size: .86rem; }
.rx-allergy { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; border-radius: 10px; padding: .4rem .75rem; font-size: .86rem; font-weight: 600; }
.rx-section-head { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.rx-section-sub { color: #64748b; font-size: .84rem; }
.rx-step { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 30px;
  background: var(--primary-soft); color: var(--teal); font-weight: 700; }
.rx-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.rx-chip { border: 1px solid #d5e3e2; background: #fff; color: #334155; border-radius: 999px; padding: .22rem .7rem;
  font-size: .8rem; line-height: 1.4; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.rx-chip:hover { border-color: var(--teal); color: var(--teal); }
.rx-chip.is-on { background: var(--teal); border-color: var(--teal); color: #fff; }
.rx-vitals { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .6rem; }
.rx-vital { display: flex; flex-direction: column; gap: .2rem; margin: 0; }
.rx-vital-label { font-size: .78rem; color: #64748b; font-weight: 600; }
.rx-vital-input { position: relative; display: block; }
.rx-vital-input .form-control { padding-right: 2.9rem; }
.rx-vital-unit { position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); font-size: .75rem; color: #94a3b8; pointer-events: none; }
.rx-med-list { display: flex; flex-direction: column; gap: .8rem; }
.rx-med-card { border: 1px solid #dbe7e6; border-left: 4px solid var(--teal); border-radius: 14px; background: #fbfdfd; padding: .85rem; }
.rx-med-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .7rem; }
.rx-med-no { width: 26px; height: 26px; border-radius: 50%; flex: 0 0 26px; display: grid; place-items: center;
  background: var(--teal); color: #fff; font-size: .8rem; font-weight: 700; }
.rx-med-form { flex: 0 0 120px; width: 120px; }
.rx-med-name { flex: 1 1 auto; min-width: 0; font-weight: 600; }
.rx-med-remove { flex: 0 0 auto; color: #b91c1c; }
.rx-med-grid { display: grid; grid-template-columns: 1fr 1.6fr 1fr 1.2fr; gap: .7rem; }
.rx-med-grid .form-label { font-size: .78rem; margin-bottom: .25rem; color: #475569; }
.rx-med-wide { grid-column: 1 / -1; }
.rx-slots { display: flex; gap: .3rem; }
.rx-slot { flex: 1 1 0; border: 1px solid #cfdedd; background: #fff; border-radius: 8px; padding: .35rem .2rem; font-size: .78rem; color: #475569; cursor: pointer; }
.rx-slot.is-on { background: var(--primary-soft); border-color: var(--teal); color: var(--teal); font-weight: 700; }
.rx-duration-unit { max-width: 105px; }
.rx-add { border-style: dashed !important; }
.rx-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
  background: rgba(255, 255, 255, .96); border: 1px solid #e2e8f0; border-radius: 14px; padding: .7rem .9rem; box-shadow: 0 -6px 20px rgba(15, 23, 42, .06); }
.rx-savebar-info { font-size: .88rem; color: #475569; font-weight: 600; }
.rx-lang { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.rx-lang-option { margin: 0; cursor: pointer; }
.rx-lang-option input { position: absolute; opacity: 0; pointer-events: none; }
.rx-lang-option span { display: inline-block; border: 1px solid #d5e3e2; border-radius: 999px; padding: .3rem .85rem; font-size: .88rem; background: #fff; }
.rx-lang-option input:checked + span { background: var(--teal); border-color: var(--teal); color: #fff; font-weight: 600; }
.rx-lang-option input:focus-visible + span { outline: 2px solid var(--teal-bright); outline-offset: 2px; }
.rx-paper-wrap { padding: 1.5rem; }
@media (max-width: 991.98px) {
  .rx-med-grid { grid-template-columns: 1fr 1fr; grid-auto-flow: dense; }
  .rx-when { grid-column: 1 / -1; }
  .rx-med-grid .input-group > .form-control { flex: 0 0 42%; min-width: 0; }
  .rx-duration-unit { max-width: none; padding-left: .5rem; }
}
@media (max-width: 767.98px) {
  .rx-vitals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rx-med-head { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; }
  .rx-med-form { width: 100%; }
  .rx-med-name { grid-column: 1 / -1; order: 3; }
  .rx-save { white-space: nowrap; }
  .rx-savebar { bottom: .5rem; flex-wrap: nowrap; padding: .55rem .65rem; }
  .rx-savebar-info { font-size: .8rem; white-space: nowrap; }
  .rx-save { flex: 1 1 auto; max-width: 260px; }
  .rx-paper-wrap { padding: .9rem; }
}
/* ---------- Dashboard: patient overview ---------- */
.pov-search { position: relative; display: flex; align-items: center; gap: .4rem; flex: 0 1 420px; }
.pov-search > i { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: #94a3b8; pointer-events: none; }
.pov-search .form-control { padding-left: 2.2rem; min-width: 0; }
.pov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: .9rem; }
.pov-card { display: flex; flex-direction: column; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; padding: .9rem;
  transition: box-shadow .15s, border-color .15s; }
.pov-card:hover { border-color: #b9dcd9; box-shadow: 0 6px 18px rgba(15, 23, 42, .06); }
.pov-head { display: flex; gap: .7rem; align-items: flex-start; margin-bottom: .6rem; }
.pov-avatar { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  color: var(--teal); background: var(--primary-soft); }
.pov-who { min-width: 0; }
.pov-name { font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.pov-meta { font-size: .8rem; color: #64748b; }
.pov-allergy { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; border-radius: 8px; padding: .25rem .55rem; font-size: .78rem; font-weight: 600; margin-bottom: .6rem; }
.pov-facts { margin: 0 0 .7rem; display: flex; flex-direction: column; gap: .45rem; }
.pov-facts > div { display: grid; grid-template-columns: 112px 1fr; gap: .5rem; font-size: .84rem; }
.pov-facts dt { color: #64748b; font-weight: 600; font-size: .78rem; padding-top: .05rem; }
.pov-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.pov-facts a { font-weight: 600; color: var(--teal); text-decoration: none; }
.pov-count { display: inline-block; margin-left: .3rem; font-size: .72rem; color: #64748b; background: #f1f5f9; border-radius: 999px; padding: 0 .45rem; }
.pov-note { display: block; color: #475569; font-size: .78rem; margin-top: .15rem; font-style: italic; }
.pov-actions { margin-top: auto; display: flex; gap: .35rem; flex-wrap: wrap; border-top: 1px dashed #e2e8f0; padding-top: .6rem; }
.pov-actions .btn { flex: 1 1 auto; }
@media (max-width: 575.98px) {
  .pov-search { flex: 1 1 100%; }
  .pov-grid { grid-template-columns: 1fr; }
  .pov-facts > div { grid-template-columns: 100px 1fr; }
}

/* ---------- Patient type-ahead (search box + suggestions, no dropdown) ---------- */
.patient-typeahead { position: relative; }
.patient-typeahead-box { position: relative; display: flex; align-items: center; }
.patient-typeahead-box > i {
  position: absolute;
  left: .85rem;
  color: #94a3b8;
  pointer-events: none;
  z-index: 1;
}
.patient-typeahead-box .form-control { padding-left: 2.3rem; }
.patient-typeahead-list {
  position: absolute;
  z-index: 1080;
  top: calc(100% + .25rem);
  left: 0;
  right: 0;
  margin: 0;
  padding: .3rem;
  list-style: none;
  max-height: 280px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .14);
}
.patient-typeahead-option {
  padding: .5rem .7rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: .9rem;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.patient-typeahead-option:hover,
.patient-typeahead-option.is-active { background: #E8F5F4; color: var(--teal); }
.patient-typeahead-empty { padding: .55rem .7rem; color: #64748b; font-size: .85rem; }
.patient-typeahead-picked {
  padding: .5rem .75rem;
  border: 1px solid #A5D6A7;
  background: #E8F5E9;
  border-radius: 12px;
  font-size: .9rem;
  color: #1B5E20;
}
.patient-typeahead-picked .btn-link { font-size: .82rem; color: var(--teal); text-decoration: none; vertical-align: baseline; }
