        /* ==========================================================================
   CUREXAL SPACE — CORE DESIGN SYSTEM & STYLING TOKENS
   Modern Hybrid Healthcare & Telehealth Operations
   ========================================================================== */

:root {
  /* shadcn/ui Semantic Tokens (Curexal Clinical Palette) */
  --background: #F8FAFC;
  --foreground: #0F172A;

  --card: #FFFFFF;
  --card-foreground: #0F172A;

  --popover: #FFFFFF;
  --popover-foreground: #0F172A;

  --primary: #0D9488;
  --primary-foreground: #FFFFFF;

  --secondary: #F1F5F9;
  --secondary-foreground: #0F172A;

  --muted: #F1F5F9;
  --muted-foreground: #64748B;

  --accent: #F1F5F9;
  --accent-foreground: #0F172A;

  --destructive: #EF4444;
  --destructive-foreground: #FFFFFF;

  --border: #E2E8F0;
  --input: #E2E8F0;
  --ring: #2563EB;
  --radius: 0.5rem;

  /* Official Curexal Brand System (Verified from master logo) */
  --curexal-mint: #00DF9B;
  --curexal-mint-tint: #5FE8CF;
  --curexal-mint-subtle: #E6FAF5;
  --curexal-mint-dark: #007A5C;
  --curexal-blue: #2563EB;
  --curexal-blue-dark: #1D4ED8;
  --curexal-blue-subtle: #EFF6FF;
  --curexal-navy: #091322;
  --curexal-navy-secondary: #10223A;
  --curexal-navy-deep: #070E1A;
  --curexal-navy-surface: #10223A;
  --curexal-white: #FFFFFF;

  /* Interface Neutrals (Deliberately separated from brand colors) */
  --bg-main: #F0F6F4;
  --surface-card: #FBFEFD;
  --surface-muted: #F1F5F9;
  --border-light: #E2E8F0;
  --border-subtle: #F1F5F9;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --text-faint: #94A3B8;

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

.font-mono-code {
  font-family: var(--font-mono);
}

/* Glassmorphism & Elevated Panels */
.glass-panel {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.glass-dark-panel {
  background: rgba(9, 19, 34, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Interactive Card Elevation */
.hover-lift {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -8px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
}


/* Form Controls (using :where to allow utility classes like pl-10 to override gracefully) */
:where(
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="number"],
  input[type="date"],
  input[type="search"],
  select,
  textarea
) {
  font-family: inherit;
  font-size: 0.8125rem;
  border-radius: 0.625rem;
  border: 1px solid var(--border-light);
  padding: 0.5625rem 0.875rem;
  width: 100%;
  background-color: #FFFFFF;
  color: var(--text-primary);
  transition: all 0.15s ease-in-out;
}

:where(input:focus, select:focus, textarea:focus) {
  outline: none;
  border-color: var(--curexal-teal);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.16);
}

:where(input::placeholder, textarea::placeholder) {
  color: #94A3B8;
  font-size: 0.8125rem;
}

/* Bulletproof Input Icon Alignment */
.curexal-input-leading-icon {
  padding-left: 2.75rem !important; /* 44px ensures text never overlaps 16px icon */
}

.curexal-input-trailing-icon {
  padding-right: 2.75rem !important; /* 44px ensures text never overlaps trailing button */
}

/* 100vh Layout Constraint */
.auth-viewport-fixed {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

/* Table Styling */
.curexal-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.curexal-table th {
  padding: 0.75rem 1.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background-color: #F8FAFC;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
}

.curexal-table td {
  padding: 0.9375rem 1.25rem;
  font-size: 0.8125rem;
  color: var(--text-primary);
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}

.curexal-table tr:hover td {
  background-color: #FAFCFE;
}

/* Status Badges */
.badge-active {
  background-color: var(--curexal-emerald-light);
  color: #047857;
  border: 1px solid #A7F3D0;
}

.badge-pending {
  background-color: var(--curexal-amber-light);
  color: #B45309;
  border: 1px solid #FDE68A;
}

.badge-suspended {
  background-color: var(--curexal-rose-light);
  color: #BE123C;
  border: 1px solid #FECDD3;
}

.badge-facility-physical {
  background-color: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.badge-facility-virtual {
  background-color: #F5F3FF;
  color: #6D28D9;
  border: 1px solid #DDD6FE;
}

/* Pulsing Status Dot */
.pulse-indicator {
  position: relative;
  display: inline-flex;
  height: 8px;
  width: 8px;
}

.pulse-indicator .ping {
  position: absolute;
  display: inline-flex;
  height: 100%;
  width: 100%;
  border-radius: 9999px;
  opacity: 0.75;
  animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.pulse-indicator .dot {
  position: relative;
  display: inline-flex;
  border-radius: 9999px;
  height: 8px;
  width: 8px;
}

@keyframes ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Button Accents */
.btn-curexal-primary {
  background-color: #0F172A;
  color: #FFFFFF;
  font-weight: 600;
  border-radius: 0.625rem;
  padding: 0.5rem 1rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  transition: all 0.15s ease-in-out;
}

.btn-curexal-primary:hover {
  background-color: #1E293B;
  transform: translateY(-1px);
}

.btn-curexal-secondary {
  background: #FFFFFF;
  color: var(--text-primary);
  font-weight: 600;
  border: 1px solid var(--border-light);
  border-radius: 0.625rem;
  padding: 0.5rem 1rem;
  transition: all 0.15s ease-in-out;
}

.btn-curexal-secondary:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
}

/* Care Journey Stage Step Indicator */
.journey-track {
  display: flex;
  align-items: center;
  position: relative;
}

.journey-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  flex: 1;
}

.journey-connector {
  position: absolute;
  top: 14px;
  left: 0;
  right: 0;
  height: 2px;
  background: #E2E8F0;
  z-index: 0;
}

/* Cloaking */
[x-cloak] {
  display: none !important;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* ==========================================================================
   TOP NAVIGATION PROGRESS BAR
   ========================================================================== */
#curexal-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background-color: #00DFA8;
  z-index: 99999;
  pointer-events: none;
  transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 0;
}

#curexal-progress-bar.active {
  opacity: 1;
}

#curexal-progress-bar.done {
  opacity: 0;
  transition: width 0.2s ease, opacity 0.35s ease 0.1s;
}

/* ==========================================================================
   SCROLL-TRIGGERED REVEAL ANIMATIONS (IntersectionObserver)
   ========================================================================== */
.curexal-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.curexal-reveal.revealed {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

.curexal-delay-100 { transition-delay: 100ms; }
.curexal-delay-200 { transition-delay: 200ms; }
.curexal-delay-300 { transition-delay: 300ms; }
.curexal-delay-400 { transition-delay: 400ms; }
.curexal-delay-500 { transition-delay: 500ms; }

@media (prefers-reduced-motion: reduce) {
  .curexal-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ==========================================================================
   CLINICAL HOLOGRAPHIC SHIMMER SKELETON
   ========================================================================== */
@keyframes curexal-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.curexal-skeleton {
  position: relative;
  overflow: hidden;
  background-color: #F1F5F9;
  border-radius: 0.5rem;
}

.curexal-skeleton::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(13, 148, 136, 0.08) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: curexal-shimmer 1.8s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   BUTTON SUBMITTING STATE MORPH
   ========================================================================== */
.btn-submitting {
  pointer-events: none;
  opacity: 0.85;
  cursor: wait !important;
}

.btn-submitting .btn-spinner {
  display: inline-flex !important;
}

.btn-spinner {
  display: none;
  animation: curexal-spin 0.75s linear infinite;
}

@keyframes curexal-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   SWUP 4.x PAGE TRANSITIONS (SPA-LIKE SMOOTH PAGE TRANSITIONS)
   ========================================================================== */
.transition-fade {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 200ms cubic-bezier(0.16, 1, 0.3, 1), transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

html.is-animating .transition-fade {
  opacity: 0;
  transform: translateY(8px);
}

html.is-leaving .transition-fade {
  opacity: 0;
  transform: translateY(-6px);
}

@media (prefers-reduced-motion: reduce) {
  .transition-fade,
  html.is-animating .transition-fade,
  html.is-leaving .transition-fade {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   ALPINE.JS CLOAK & VIEW TRANSITIONS API
   ========================================================================== */
[x-cloak] {
  display: none !important;
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: 160ms cubic-bezier(0.16, 1, 0.3, 1) both curexal-fade-out;
}

::view-transition-new(root) {
  animation: 180ms cubic-bezier(0.16, 1, 0.3, 1) both curexal-fade-in;
}

@keyframes curexal-fade-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-4px); }
}

@keyframes curexal-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

/* ==========================================================================
   CUREXAL SPACE — ADMIN PORTAL & DASHBOARD DESIGN SYSTEM
   ========================================================================== */

.admin-card {
  background-color: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 0.875rem;
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.04), 0 1px 2px -1px rgba(15, 23, 42, 0.02);
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.admin-card:hover {
  border-color: #CBD5E1;
  box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.05), 0 4px 6px -4px rgba(15, 23, 42, 0.02);
  transform: translateY(-1px);
}

.admin-card-interactive {
  cursor: pointer;
}

.admin-surface {
  background-color: #FFFFFF;
  border: 1px solid #E2E8F0;
}

/* Card Accent Top Rails */
.card-accent-mint::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #00DFA8, #5FE8CF);
  border-radius: 0.875rem 0.875rem 0 0;
}

.card-accent-blue::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #2563EB, #60A5FA);
  border-radius: 0.875rem 0.875rem 0 0;
}

.card-accent-purple::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #8B5CF6, #C084FC);
  border-radius: 0.875rem 0.875rem 0 0;
}

.card-accent-amber::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #F59E0B, #FBBF24);
  border-radius: 0.875rem 0.875rem 0 0;
}

/* Fast Hardware-Accelerated Sidebar Collapse & State Transitions */
#admin-sidebar {
  width: 16rem;
  transition: width 120ms cubic-bezier(0.16, 1, 0.3, 1) !important;
  will-change: width;
}

#admin-sidebar.is-collapsed {
  width: 4.5rem !important;
}

#admin-sidebar.is-collapsed .sidebar-label {
  display: none !important;
}

#admin-sidebar.is-collapsed .sidebar-header-brand {
  margin: 0 auto !important;
  padding: 0 !important;
}

#admin-sidebar.is-collapsed .sidebar-header .sidebar-collapse-btn {
  display: none !important;
}

#admin-sidebar.is-collapsed .sidebar-header {
  justify-content: center !important;
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
}

#admin-sidebar.is-collapsed .sidebar-section-divider {
  display: block !important;
  height: 1px;
  background-color: #10223A;
  margin: 0.5rem 0.25rem;
}

#admin-sidebar.is-collapsed .sidebar-footer-expanded {
  display: none !important;
}

#admin-sidebar.is-collapsed .sidebar-footer-collapsed {
  display: flex !important;
}

#admin-sidebar:not(.is-collapsed) .sidebar-footer-expanded {
  display: flex !important;
}

#admin-sidebar:not(.is-collapsed) .sidebar-footer-collapsed {
  display: none !important;
}

#admin-sidebar:not(.is-collapsed) .sidebar-tooltip {
  display: none !important;
}

#admin-sidebar.is-collapsed .sidebar-nav-item {
  justify-content: center !important;
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
}

#admin-sidebar.is-collapsed .sidebar-nav-item .sidebar-icon-wrap {
  margin: 0 auto !important;
}

/* Custom Smooth Dark Scrollbar for Admin Sidebar (Expanded & Collapsed) */
#admin-sidebar nav {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain !important;
  scrollbar-width: thin !important;
  scrollbar-color: #1E293B transparent !important;
  -webkit-overflow-scrolling: touch !important;
}

#admin-sidebar nav::-webkit-scrollbar {
  width: 4px !important;
}

#admin-sidebar nav::-webkit-scrollbar-track {
  background: transparent !important;
}

#admin-sidebar nav::-webkit-scrollbar-thumb {
  background: #1E293B !important;
  border-radius: 9999px !important;
}

#admin-sidebar nav::-webkit-scrollbar-thumb:hover {
  background: #00DF9B !important;
}

#admin-sidebar.is-collapsed nav {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-left: 0.25rem !important;
  padding-right: 0.25rem !important;
  scrollbar-width: thin !important;
  scrollbar-color: #00DF9B #10223A !important;
}

#admin-sidebar.is-collapsed nav::-webkit-scrollbar {
  width: 5px !important;
  display: block !important;
}

#admin-sidebar.is-collapsed nav::-webkit-scrollbar-track {
  background: #10223A !important;
  border-radius: 9999px !important;
}

#admin-sidebar.is-collapsed nav::-webkit-scrollbar-thumb {
  background: #00DF9B !important;
  border-radius: 9999px !important;
}

#admin-sidebar.is-collapsed nav::-webkit-scrollbar-thumb:hover {
  background: #5FE8CF !important;
}

/* ==========================================================================
   ADMIN EXECUTIVE TOP NAVBAR (Expanded & Sized Generously)
   ========================================================================== */

.admin-top-navbar,
.sidebar-header {
  height: 4.75rem !important; /* 76px on mobile */
  min-height: 4.75rem !important;
}

@media (min-width: 640px) {
  .admin-top-navbar,
  .sidebar-header {
    height: 5.25rem !important; /* 84px on tablet/desktop */
    min-height: 5.25rem !important;
  }
}

.admin-nav-icon-btn {
  width: 2.5rem !important;
  height: 2.5rem !important;
  border-radius: 0.625rem !important;
}

.admin-nav-search-btn {
  height: 2.75rem !important; /* 44px */
}

.admin-nav-avatar {
  width: 2.375rem !important; /* 38px */
  height: 2.375rem !important;
  border-radius: 0.625rem !important;
}

.admin-nav-summary-trigger {
  height: 2.75rem !important;
  padding-left: 0.5rem !important;
  padding-right: 0.75rem !important;
}

/* ==========================================================================
   DASHBOARD VISUAL ARCHITECTURE & LAYOUT ENGINE
   Guaranteed Grid & Flexbox Behaviors (Offline / Independent of Tailwind Purge)
   ========================================================================== */

.dashboard-layout-container {
  max-width: 1440px;
  margin: 0 auto;
  padding-bottom: 2.5rem;
  width: 100%;
}

/* 4-Column KPI Grid */
.dashboard-kpi-grid {
  display: grid !important;
  grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
  gap: 1.25rem !important;
  margin-top: 1.5rem !important;
  margin-bottom: 1.5rem !important;
}

@media (min-width: 640px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 1024px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

/* Split Rows (65% Main Column, 35% Side Column) */
.dashboard-split-row {
  display: flex !important;
  flex-direction: column !important;
  gap: 1.5rem !important;
  width: 100% !important;
  margin-bottom: 1.5rem !important;
  align-items: stretch !important;
}

@media (min-width: 1024px) {
  .dashboard-split-row {
    flex-direction: row !important;
  }
  .dashboard-col-main {
    flex: 2 1 65% !important;
    width: 65% !important;
    min-width: 0 !important;
  }
  .dashboard-col-side {
    flex: 1 1 35% !important;
    width: 35% !important;
    min-width: 0 !important;
  }
}

/* Hero Executive Command Deck */
.dashboard-hero-banner {
  background: linear-gradient(135deg, #090F1E 0%, #0F172A 50%, #172554 100%) !important;
  border: 1px solid rgba(51, 65, 85, 0.7) !important;
  border-radius: 1rem !important;
  color: #FFFFFF !important;
  padding: 1.75rem 2rem !important;
  position: relative !important;
  overflow: hidden !important;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.3), 0 8px 10px -6px rgba(15, 23, 42, 0.2) !important;
}

.dashboard-hero-banner::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.hero-glow-orb-1 {
  position: absolute;
  top: -6rem;
  right: -4rem;
  width: 22rem;
  height: 22rem;
  border-radius: 9999px;
  background: radial-gradient(circle, rgba(0, 223, 168, 0.22) 0%, rgba(0, 223, 168, 0) 70%);
  filter: blur(40px);
  pointer-events: none;
}

.hero-glow-orb-2 {
  position: absolute;
  bottom: -5rem;
  right: 25%;
  width: 18rem;
  height: 18rem;
  border-radius: 9999px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.25) 0%, rgba(37, 99, 235, 0) 70%);
  filter: blur(45px);
  pointer-events: none;
}

.hero-badge-plane {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(0, 223, 168, 0.12) !important;
  border: 1px solid rgba(0, 223, 168, 0.35) !important;
  color: #00DFA8 !important;
  backdrop-filter: blur(12px);
}

.hero-greeting {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: #FFFFFF !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.hero-name-gradient {
  background: linear-gradient(135deg, #FFFFFF 20%, #5FE8CF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: #94A3B8 !important;
  font-size: 0.8125rem;
  line-height: 1.5;
  margin-top: 0.375rem;
  max-width: 42rem;
}

.hero-actions-container {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-wrap: wrap;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  border-radius: 0.625rem;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: #FFFFFF !important;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  backdrop-filter: blur(8px);
  transition: all 180ms ease;
}

.hero-btn:hover {
  background: rgba(255, 255, 255, 0.18) !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  color: #FFFFFF !important;
  transform: translateY(-1px);
}

.hero-btn-mint {
  background: #00DFA8 !important;
  border: 1px solid #00DFA8 !important;
  color: #090F1E !important;
  font-weight: 700;
}

.hero-btn-mint:hover {
  background: #5FE8CF !important;
  border-color: #5FE8CF !important;
  color: #090F1E !important;
  transform: translateY(-1px);
}

/* KPI Card Details */
.kpi-metric-title {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.kpi-metric-value {
  font-size: 1.875rem;
  font-weight: 800;
  color: #0F172A;
  font-family: var(--font-mono);
  letter-spacing: -0.03em;
  line-height: 1;
}

.kpi-icon-box {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 200ms ease;
}

.admin-card:hover .kpi-icon-box {
  transform: scale(1.05);
}

.outbox-status-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 0.5rem !important;
  margin-top: 0.75rem !important;
}

.outbox-status-pill {
  padding: 0.5rem 0.25rem;
  border-radius: 0.5rem;
  text-align: center;
}

.outbox-status-pill-pending {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.outbox-status-pill-dispatched {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.outbox-status-pill-failed {
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.25);
}

/* Guaranteed Non-Zero Dimensions for Apache ECharts */
.chart-activity-container {
  height: 310px !important;
  min-height: 310px !important;
  width: 100% !important;
  display: block !important;
  position: relative !important;
}

.chart-role-container {
  height: 220px !important;
  min-height: 220px !important;
  width: 100% !important;
  display: block !important;
  position: relative !important;
}

/* Branch Matrix Table Styles */
.branch-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.75rem;
}

.branch-table th {
  padding: 0.75rem 0.875rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748B;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
}

.branch-table td {
  padding: 0.875rem;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}

.branch-table tr:hover td {
  background: rgba(248, 250, 252, 0.8);
}

/* ==========================================================================
   Admin & Clinic Sidebar Active Link Styling
   ========================================================================== */
#admin-sidebar .sidebar-nav-item.is-active {
  background-color: var(--curexal-blue-subtle, #EFF6FF) !important;
  border-color: rgba(37, 99, 235, 0.25) !important;
  color: var(--curexal-blue-dark, #1D4ED8) !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03) !important;
}

#admin-sidebar .sidebar-nav-item.is-active .sidebar-icon-wrap {
  color: var(--curexal-blue, #2563EB) !important;
}

#admin-sidebar .sidebar-nav-item.is-active .sidebar-active-pill {
  background-color: var(--curexal-blue, #2563EB) !important;
  display: block !important;
}

#clinic-sidebar .sidebar-nav-item.is-active {
  background-color: #F0FDFA !important;
  border-color: rgba(20, 184, 166, 0.3) !important;
  color: #134E4A !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03) !important;
}

#clinic-sidebar .sidebar-nav-item.is-active .sidebar-icon-wrap {
  color: #0F766E !important;
}

#clinic-sidebar .sidebar-nav-item.is-active .sidebar-active-pill {
  background-color: #0D9488 !important;
  display: block !important;
}

.sidebar-nav-item:not(.is-active) .sidebar-active-pill {
  display: none !important;
}

/* Sidebar Collapse States (Pure Vanilla CSS) */
#admin-sidebar.is-collapsed,
#clinic-sidebar.is-collapsed {
  width: 4.5rem !important;
  min-width: 4.5rem !important;
  overflow: visible !important;
}

#admin-sidebar.is-collapsed .sidebar-label,
#clinic-sidebar.is-collapsed .sidebar-label {
  display: none !important;
}

#admin-sidebar.is-collapsed > div,
#clinic-sidebar.is-collapsed > div {
  overflow: hidden !important;
}

#admin-sidebar.is-collapsed .sidebar-header,
#clinic-sidebar.is-collapsed .sidebar-header {
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
  justify-content: center !important;
}

#admin-sidebar.is-collapsed .sidebar-header .sidebar-collapse-btn,
#clinic-sidebar.is-collapsed .sidebar-header .sidebar-collapse-btn {
  display: none !important;
}

#admin-sidebar.is-collapsed .sidebar-header-brand,
#clinic-sidebar.is-collapsed .sidebar-header-brand {
  justify-content: center !important;
  width: 100% !important;
}

#admin-sidebar.is-collapsed nav,
#clinic-sidebar.is-collapsed nav {
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

#admin-sidebar.is-collapsed .sidebar-section-divider,
#clinic-sidebar.is-collapsed .sidebar-section-divider {
  display: block !important;
  border-top: 1px solid #E2E8F0 !important;
  margin: 0.5rem 0.25rem !important;
}

#admin-sidebar.is-collapsed .sidebar-nav-item,
#clinic-sidebar.is-collapsed .sidebar-nav-item {
  justify-content: center !important;
  padding: 0.5rem 0 !important;
  width: 2.75rem !important;
  height: 2.75rem !important;
  margin-left: auto !important;
  margin-right: auto !important;
  border-radius: 0.75rem !important;
}

#admin-sidebar.is-collapsed .sidebar-nav-item > div,
#clinic-sidebar.is-collapsed .sidebar-nav-item > div {
  justify-content: center !important;
  width: 100% !important;
  gap: 0 !important;
}

#admin-sidebar.is-collapsed .sidebar-icon-wrap,
#clinic-sidebar.is-collapsed .sidebar-icon-wrap {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
}

#admin-sidebar.is-collapsed .sidebar-footer,
#clinic-sidebar.is-collapsed .sidebar-footer {
  padding: 0.75rem 0.5rem !important;
  justify-content: center !important;
}

#admin-sidebar.is-collapsed .sidebar-footer-expanded,
#clinic-sidebar.is-collapsed .sidebar-footer-expanded {
  display: none !important;
}

#admin-sidebar .sidebar-footer-collapsed,
#clinic-sidebar .sidebar-footer-collapsed {
  display: none;
}

#admin-sidebar.is-collapsed .sidebar-footer-collapsed,
#clinic-sidebar.is-collapsed .sidebar-footer-collapsed {
  display: flex !important;
}

#admin-sidebar .sidebar-tooltip,
#clinic-sidebar .sidebar-tooltip {
  display: none !important;
}

#admin-sidebar.is-collapsed .group:hover > .sidebar-tooltip,
#admin-sidebar.is-collapsed .group:focus-visible > .sidebar-tooltip,
#admin-sidebar.is-collapsed .group:focus-within > .sidebar-tooltip,
#clinic-sidebar.is-collapsed .group:hover > .sidebar-tooltip,
#clinic-sidebar.is-collapsed .group:focus-visible > .sidebar-tooltip,
#clinic-sidebar.is-collapsed .group:focus-within > .sidebar-tooltip {
  display: flex !important;
  position: absolute;
  left: calc(100% + 0.75rem);
  top: 50%;
  transform: translateY(-50%);
  background-color: #0F172A;
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  padding: 0.4rem 0.625rem;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.25), 0 4px 6px -4px rgba(15, 23, 42, 0.1);
  z-index: 100;
  pointer-events: none;
}

#admin-sidebar.is-collapsed .group:hover > .sidebar-tooltip::before,
#admin-sidebar.is-collapsed .group:focus-visible > .sidebar-tooltip::before,
#admin-sidebar.is-collapsed .group:focus-within > .sidebar-tooltip::before,
#clinic-sidebar.is-collapsed .group:hover > .sidebar-tooltip::before,
#clinic-sidebar.is-collapsed .group:focus-visible > .sidebar-tooltip::before,
#clinic-sidebar.is-collapsed .group:focus-within > .sidebar-tooltip::before {
  content: "";
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: transparent #0F172A transparent transparent;
}

/* ==========================================================================
   CUREXAL SPACE — PATIENT PORTAL DESIGN SYSTEM
   Calm, modern, accessible healthcare UI
   ========================================================================== */

#patient-shell,
.patient-portal {
  /* Brand */
  --patient-primary: #123B43;
  --patient-action: #087F8C;
  --patient-action-hover: #066873;
  --patient-accent: #E7F5F3;
  --patient-accent-hover: #D6EFEA;
  
  /* Surfaces */
  --patient-bg: #EDF3F2;
  --patient-surface: #FFFFFF;
  --patient-border: #D1DEDC;
  --patient-border-subtle: #E2ECE9;
  
  /* Text */
  --patient-text: #1C2E3D;
  --patient-muted: #556B67;
  --patient-faint: #7E938F;
  
  /* Status */
  --patient-success-bg: #DCEFE3;
  --patient-success-text: #0E5C38;
  --patient-warning-bg: #FFF0C2;
  --patient-warning-text: #7A4B00;
  --patient-danger-bg: #FBE3E3;
  --patient-danger-text: #991B1B;
  
  /* Shape and spacing */
  --patient-radius-sm: 8px;
  --patient-radius-md: 12px;
  --patient-radius-lg: 16px;
  --patient-card-padding: 24px;
  --patient-content-width: 1240px;
  
  /* Interaction */
  --patient-focus-ring: 0 0 0 3px #A8DCD8;

  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--patient-bg);
  color: var(--patient-text);
  line-height: 1.5;
}

/* Patient Card Container */
.patient-card {
  background-color: #FFFFFF !important;
  border: 1px solid #D1DEDC !important;
  border-radius: 16px !important;
  padding: 24px !important;
  box-shadow: 0 4px 16px -2px rgba(18, 59, 67, 0.08), 0 2px 6px -1px rgba(18, 59, 67, 0.04) !important;
  transition: all 0.2s ease;
}

.patient-card:hover {
  border-color: #087F8C !important;
  box-shadow: 0 8px 24px -4px rgba(18, 59, 67, 0.12), 0 4px 8px -2px rgba(18, 59, 67, 0.06) !important;
}

/* Doctor & Metric Cards */
.patient-doctor-card {
  background-color: #FFFFFF;
  border: 1px solid #D1DEDC;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 3px 12px rgba(18, 59, 67, 0.06);
  transition: all 0.2s ease;
}

.patient-doctor-card:hover {
  border-color: #087F8C;
  box-shadow: 0 6px 20px rgba(8, 127, 140, 0.12);
  transform: translateY(-2px);
}

.patient-metric-card {
  background-color: #FFFFFF;
  border: 1px solid #D1DEDC;
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 3px 12px rgba(18, 59, 67, 0.05);
  transition: all 0.2s ease;
}

.patient-metric-card:hover {
  border-color: #087F8C;
  transform: translateY(-2px);
}

/* Patient Action Buttons */
.patient-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: var(--patient-action);
  color: #FFFFFF !important;
  font-weight: 600;
  font-size: 0.875rem;
  min-height: 44px;
  padding: 0.625rem 1.25rem;
  border-radius: var(--patient-radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  box-shadow: 0 1px 2px 0 rgba(8, 127, 140, 0.15);
  transition: all 0.15s ease;
  text-decoration: none;
}

.patient-btn-primary:hover {
  background-color: var(--patient-action-hover);
  box-shadow: 0 2px 4px 0 rgba(6, 104, 115, 0.25);
}

.patient-btn-primary:focus-visible {
  outline: none;
  box-shadow: var(--patient-focus-ring);
}

.patient-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: var(--patient-accent);
  color: var(--patient-primary) !important;
  font-weight: 600;
  font-size: 0.875rem;
  min-height: 44px;
  padding: 0.625rem 1.25rem;
  border-radius: var(--patient-radius-md);
  border: 1px solid rgba(8, 127, 140, 0.15);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.patient-btn-secondary:hover {
  background-color: var(--patient-accent-hover);
  color: var(--patient-primary) !important;
}

.patient-btn-secondary:focus-visible {
  outline: none;
  box-shadow: var(--patient-focus-ring);
}

.patient-btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: var(--patient-surface);
  color: var(--patient-text) !important;
  font-weight: 600;
  font-size: 0.875rem;
  min-height: 44px;
  padding: 0.625rem 1.25rem;
  border-radius: var(--patient-radius-md);
  border: 1px solid var(--patient-border);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.patient-btn-outline:hover {
  background-color: var(--patient-bg);
  border-color: #CAD5D1;
  color: var(--patient-primary) !important;
}

.patient-btn-outline:focus-visible {
  outline: none;
  box-shadow: var(--patient-focus-ring);
}

/* Patient Input Controls */
.patient-input {
  width: 100%;
  min-height: 44px;
  background-color: var(--patient-surface);
  border: 1px solid var(--patient-border);
  border-radius: var(--patient-radius-md);
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  color: var(--patient-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.patient-input:focus {
  outline: none;
  border-color: var(--patient-action);
  box-shadow: var(--patient-focus-ring);
}

/* Status Badges */
.patient-badge-success {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background-color: var(--patient-success-bg);
  color: var(--patient-success-text);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  border: 1px solid rgba(14, 92, 56, 0.15);
}

.patient-badge-warning {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background-color: var(--patient-warning-bg);
  color: var(--patient-warning-text);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  border: 1px solid rgba(122, 75, 0, 0.15);
}

.patient-badge-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background-color: var(--patient-danger-bg);
  color: var(--patient-danger-text);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  border: 1px solid rgba(153, 27, 27, 0.15);
}

.patient-badge-neutral {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background-color: var(--patient-accent);
  color: var(--patient-primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  border: 1px solid var(--patient-border);
}

/* Luxury Glassmorphism & Bento Utilities */
.patient-glass-card {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(209, 222, 220, 0.75);
  border-radius: 20px;
  box-shadow: 0 4px 20px -2px rgba(18, 59, 67, 0.05), 0 2px 6px -1px rgba(18, 59, 67, 0.02);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.patient-glass-card:hover {
  border-color: rgba(8, 127, 140, 0.45);
  box-shadow: 0 12px 32px -4px rgba(18, 59, 67, 0.1), 0 4px 12px -2px rgba(18, 59, 67, 0.04);
}

.patient-hero-card {
  background: linear-gradient(135deg, #123B43 0%, #0D2C32 60%, #087F8C 130%);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 16px 40px -8px rgba(18, 59, 67, 0.25);
  color: #FFFFFF;
  position: relative;
  overflow: hidden;
}

.patient-hero-glow {
  position: absolute;
  top: -30%;
  right: -20%;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(8, 127, 140, 0.35) 0%, rgba(18, 59, 67, 0) 70%);
  pointer-events: none;
  border-radius: 50%;
}

.patient-ai-card {
  background: linear-gradient(135deg, #FFFFFF 0%, #F3FAF9 100%);
  border: 1px solid #A8DCD8;
  border-radius: 20px;
  box-shadow: 0 6px 24px -4px rgba(8, 127, 140, 0.08);
}

.patient-metric-glow {
  position: relative;
  overflow: hidden;
}

.patient-metric-glow::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #087F8C, #A8DCD8);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.patient-metric-glow:hover::after {
  opacity: 1;
}

/* ==========================================================================
   MOBILE-FIRST & IOS SAFE AREA UTILITIES
   ========================================================================== */
:root {
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
}

.pt-safe {
  padding-top: env(safe-area-inset-top, 0px);
}
.pb-safe {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.pl-safe {
  padding-left: env(safe-area-inset-left, 0px);
}
.pr-safe {
  padding-right: env(safe-area-inset-right, 0px);
}
.mb-safe {
  margin-bottom: env(safe-area-inset-bottom, 0px);
}

/* Touch targets: 44x44 CSS pixels minimum recommended by iOS Human Interface Guidelines */
.touch-target {
  min-height: 44px;
  min-width: 44px;
}

/* iOS Safari auto-zoom prevention: ensure form inputs have at least 16px font size on mobile viewports */
@media screen and (max-width: 768px) {
  input[type="text"],
  input[type="search"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="url"],
  select,
  textarea {
    font-size: 16px !important;
  }
}


