/* ==========================================================================
   VITAE - TAILWIND CSS v4 MODERN DESIGN SYSTEM
   Brand Colors: Vitae Plum (#A84F8B) & Vitae Green (#7A9E1E)
   Aesthetics: Clean Minimalist, Glassmorphism, Subtle Gradients, Full Responsiveness
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Roboto:wght@300;400;500;700&display=swap');

@theme {
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-roboto: 'Roboto', sans-serif;

  /* --- Vitae Brand Plum Tokens --- */
  --color-vitae-plum: #A84F8B;
  --color-vitae-plum-hover: #933E77;
  --color-vitae-plum-light: #FCEEF6;
  --color-vitae-plum-lighter: #FCF5F9;
  --color-vitae-plum-dark: #470D37;
  --color-vitae-plum-border: #E8D3E1;

  /* --- Vitae Brand Green Tokens --- */
  --color-vitae-green: #7A9E1E;
  --color-vitae-green-hover: #678716;
  --color-vitae-green-light: #F1F7DC;
  --color-vitae-green-lighter: #F8FBEF;
  --color-vitae-green-dark: #263802;
  --color-vitae-green-border: #D7E5AD;

  /* --- Neutral & Surface System --- */
  --color-vitae-bg: #FAF8FA;
  --color-vitae-card: #FFFFFF;
  --color-vitae-surface: #F4EEF3;
  --color-vitae-border: #EDE4EA;
  --color-vitae-border-subtle: #F2EBF0;
  --color-vitae-text-main: #1E1A1D;
  --color-vitae-text-muted: #6B5E67;

  /* --- Radius Tokens --- */
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-3xl: 1.75rem;
  --radius-full: 9999px;

  /* --- Shadows --- */
  --shadow-subtle: 0 1px 3px 0 rgba(168, 79, 139, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 4px 16px -2px rgba(168, 79, 139, 0.08), 0 2px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-card-hover: 0 12px 28px -4px rgba(168, 79, 139, 0.14), 0 4px 12px -2px rgba(0, 0, 0, 0.06);
  --shadow-glass: 0 8px 32px 0 rgba(168, 79, 139, 0.08);
}

:root {
  --vitae-plum: #A84F8B;
  --vitae-plum-hover: #933E77;
  --vitae-plum-light: #FCEEF6;
  --vitae-plum-dark: #470D37;
  --vitae-green: #7A9E1E;
  --vitae-green-hover: #678716;
  --vitae-green-light: #F1F7DC;
  --vitae-bg: #FAF8FA;
  --vitae-border: #EDE4EA;
}

html {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--vitae-bg);
  color: #1E1A1D;
  scroll-behavior: smooth;
}

body {
  background-color: var(--vitae-bg);
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* --- Brand Gradients --- */
.bg-gradient-vitae {
  background: linear-gradient(135deg, #381530 0%, #5E2651 55%, #A84F8B 100%);
}

.bg-gradient-vitae-plum {
  background: linear-gradient(135deg, #7A3663 0%, #A84F8B 100%);
}

.bg-gradient-vitae-green {
  background: linear-gradient(135deg, #5C7714 0%, #7A9E1E 100%);
}

.bg-gradient-soft {
  background: radial-gradient(circle at 10% 10%, rgba(168, 79, 139, 0.05) 0%, transparent 40%),
              radial-gradient(circle at 90% 90%, rgba(122, 158, 30, 0.05) 0%, transparent 40%);
}

/* --- Glassmorphism --- */
.glass-panel {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(237, 228, 234, 0.8);
}

.glass-nav {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(237, 228, 234, 0.9);
}

/* --- Tailwind CSS Component Styles --- */
.tw-card {
  background-color: #FFFFFF;
  border: 1px solid #EDE4EA;
  border-radius: 1.5rem;
  box-shadow: 0 2px 10px 0 rgba(168, 79, 139, 0.05);
  transition: all 0.25s cubic-bezier(0.2, 0, 0, 1);
}

.tw-card-hover:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -4px rgba(168, 79, 139, 0.12), 0 4px 10px -2px rgba(0, 0, 0, 0.04);
  border-color: #D9CBD4;
}

.tw-btn-primary {
  background-color: #A84F8B;
  color: #FFFFFF;
  font-weight: 600;
  border-radius: 9999px;
  padding: 0.625rem 1.375rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  box-shadow: 0 2px 8px 0 rgba(168, 79, 139, 0.25);
  text-decoration: none;
  border: none;
}

.tw-btn-primary:hover {
  background-color: #933E77;
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px 0 rgba(168, 79, 139, 0.35);
}

.tw-btn-secondary {
  background-color: #7A9E1E;
  color: #FFFFFF;
  font-weight: 600;
  border-radius: 9999px;
  padding: 0.625rem 1.375rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  box-shadow: 0 2px 8px 0 rgba(122, 158, 30, 0.25);
  text-decoration: none;
  border: none;
}

.tw-btn-secondary:hover {
  background-color: #678716;
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px 0 rgba(122, 158, 30, 0.35);
}

.tw-btn-outlined {
  background-color: transparent;
  color: #A84F8B;
  border: 1.5px solid #A84F8B;
  font-weight: 600;
  border-radius: 9999px;
  padding: 0.55rem 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.tw-btn-outlined:hover {
  background-color: #FCEEF6;
  color: #933E77;
  border-color: #933E77;
}

.tw-chip {
  background-color: #FFFFFF;
  border: 1px solid #D9CBD4;
  border-radius: 9999px;
  padding: 0.4rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #52474E;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.tw-chip:hover {
  background-color: #EDE4EA;
  color: #1E1A1D;
}

.tw-chip.active {
  background-color: #FCEEF6;
  color: #470D37;
  border-color: #A84F8B;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: #FAF8FA;
}

::-webkit-scrollbar-thumb {
  background: #D9CBD4;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #A84F8B;
}

/* ==========================================================================
   HEALTHTECH & CLINICAL ERGONOMIC TOKENS (Error Prevention & High Accessibility)
   ========================================================================== */

/* Tabular Numbers for Clinical Precision to avoid digit misreading */
.clinical-num {
  font-family: 'Roboto', 'Plus Jakarta Sans', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: -0.02em;
}

/* High-Contrast Clinical Status Pills */
.clinical-status-normal {
  background-color: #F1F7DC;
  color: #263802;
  border: 1px solid #C4DA89;
  font-weight: 700;
}

.clinical-status-warning {
  background-color: #FEF3C7;
  color: #92400E;
  border: 1px solid #FCD34D;
  font-weight: 700;
}

.clinical-status-alert {
  background-color: #FFE4E6;
  color: #9F1239;
  border: 1px solid #FDA4AF;
  font-weight: 700;
}

.clinical-status-info {
  background-color: #FCEEF6;
  color: #470D37;
  border: 1px solid #E8D3E1;
  font-weight: 700;
}

/* High Visibility Allergy Banner */
.allergy-badge-critical {
  background-color: #FFF1F2;
  color: #BE123C;
  border: 1.5px solid #F43F5E;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(225, 29, 72, 0.15);
}

/* Clinical Vital Sign Card */
.vital-stat-card {
  background: #FFFFFF;
  border: 1.5px solid #EDE4EA;
  border-radius: 1.25rem;
  padding: 1.25rem;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  position: relative;
  overflow: hidden;
}

.vital-stat-card:hover {
  border-color: #A84F8B;
  box-shadow: 0 8px 24px -4px rgba(168, 79, 139, 0.12);
  transform: translateY(-2px);
}

.vital-stat-card.alert-border {
  border-color: #F43F5E;
  background: linear-gradient(180deg, #FFF1F2 0%, #FFFFFF 30%);
}

.vital-stat-card.warning-border {
  border-color: #F59E0B;
  background: linear-gradient(180deg, #FFFBEB 0%, #FFFFFF 30%);
}

/* High-Contrast Focus Visible Ring for Keyboard Accessibility (WCAG AAA) */
:focus-visible {
  outline: 3px solid #A84F8B !important;
  outline-offset: 2px !important;
}

/* Clinical Reference Range Helper */
.ref-range-bar {
  height: 6px;
  border-radius: 9999px;
  background: #E5E7EB;
  position: relative;
  overflow: hidden;
}

.ref-range-fill-normal {
  background: #7A9E1E;
  height: 100%;
}

.ref-range-fill-warning {
  background: #F59E0B;
  height: 100%;
}

.ref-range-fill-alert {
  background: #E11D48;
  height: 100%;
}

/* Clinical Interactive Timeline */
.timeline-stem {
  position: absolute;
  top: 1.5rem;
  bottom: 0;
  left: 1.25rem;
  width: 2px;
  background: #EDE4EA;
}

.timeline-dot {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  flex-shrink: 0;
}