/* ClinicFiler Custom Styles */

/* Footer - push below initial viewport so user must scroll to see it */
.page-wrapper > .footer {
  margin-top: 150px;
}

/* Brand text styling */
.brand-text {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: #1d2939; /* Dark charcoal for light mode */
}

[data-bs-theme="dark"] .brand-text {
  color: #f5f5f5; /* Off-white for dark mode */
}

/* ============================================
   THEME CUSTOMIZATION SYSTEM
   ============================================ */

/* Accent Colors */
[data-theme-color="blue"] { --tblr-primary: #206bc4; --tblr-primary-rgb: 32,107,196; }
[data-theme-color="cyan"] { --tblr-primary: #17a2b8; --tblr-primary-rgb: 23,162,184; }
[data-theme-color="teal"] { --tblr-primary: #0ca678; --tblr-primary-rgb: 12,166,120; }
[data-theme-color="green"] { --tblr-primary: #2fb344; --tblr-primary-rgb: 47,179,68; }
[data-theme-color="yellow"] { --tblr-primary: #f59f00; --tblr-primary-rgb: 245,159,0; }
[data-theme-color="orange"] { --tblr-primary: #f76707; --tblr-primary-rgb: 247,103,7; }
[data-theme-color="red"] { --tblr-primary: #d63939; --tblr-primary-rgb: 214,57,57; }
[data-theme-color="pink"] { --tblr-primary: #d6336c; --tblr-primary-rgb: 214,51,108; }
[data-theme-color="purple"] { --tblr-primary: #ae3ec9; --tblr-primary-rgb: 174,62,201; }

/* Font Families */
[data-theme-font="sans-serif"] {
  --tblr-font-sans-serif: 'Inter', -apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue, sans-serif;
}
[data-theme-font="sans-serif"] body { font-family: var(--tblr-font-sans-serif); }

[data-theme-font="serif"] {
  --tblr-font-sans-serif: Georgia, Cambria, 'Times New Roman', Times, serif;
}
[data-theme-font="serif"] body { font-family: Georgia, Cambria, 'Times New Roman', Times, serif; }

[data-theme-font="monospace"] {
  --tblr-font-sans-serif: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, 'Courier New', monospace;
}
[data-theme-font="monospace"] body { font-family: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, 'Courier New', monospace; }

/* Theme Base - Gray Shades (Tailwind-inspired palettes) */
/* Slate - Cool blue-gray */
[data-theme-base="slate"] {
  --tblr-gray-50: #f8fafc; --tblr-gray-100: #f1f5f9; --tblr-gray-200: #e2e8f0;
  --tblr-gray-300: #cbd5e1; --tblr-gray-400: #94a3b8; --tblr-gray-500: #64748b;
  --tblr-gray-600: #475569; --tblr-gray-700: #334155; --tblr-gray-800: #1e293b;
  --tblr-gray-900: #0f172a;
}

/* Gray - Neutral gray */
[data-theme-base="gray"] {
  --tblr-gray-50: #f9fafb; --tblr-gray-100: #f3f4f6; --tblr-gray-200: #e5e7eb;
  --tblr-gray-300: #d1d5db; --tblr-gray-400: #9ca3af; --tblr-gray-500: #6b7280;
  --tblr-gray-600: #4b5563; --tblr-gray-700: #374151; --tblr-gray-800: #1f2937;
  --tblr-gray-900: #111827;
}

/* Zinc - Cool gray */
[data-theme-base="zinc"] {
  --tblr-gray-50: #fafafa; --tblr-gray-100: #f4f4f5; --tblr-gray-200: #e4e4e7;
  --tblr-gray-300: #d4d4d8; --tblr-gray-400: #a1a1aa; --tblr-gray-500: #71717a;
  --tblr-gray-600: #52525b; --tblr-gray-700: #3f3f46; --tblr-gray-800: #27272a;
  --tblr-gray-900: #18181b;
}

/* Neutral - True gray */
[data-theme-base="neutral"] {
  --tblr-gray-50: #fafafa; --tblr-gray-100: #f5f5f5; --tblr-gray-200: #e5e5e5;
  --tblr-gray-300: #d4d4d4; --tblr-gray-400: #a3a3a3; --tblr-gray-500: #737373;
  --tblr-gray-600: #525252; --tblr-gray-700: #404040; --tblr-gray-800: #262626;
  --tblr-gray-900: #171717;
}

/* Stone - Warm gray */
[data-theme-base="stone"] {
  --tblr-gray-50: #fafaf9; --tblr-gray-100: #f5f5f4; --tblr-gray-200: #e7e5e4;
  --tblr-gray-300: #d6d3d1; --tblr-gray-400: #a8a29e; --tblr-gray-500: #78716c;
  --tblr-gray-600: #57534e; --tblr-gray-700: #44403c; --tblr-gray-800: #292524;
  --tblr-gray-900: #1c1917;
}

/* Apply gray shades to common elements */
[data-theme-base] {
  --tblr-border-color: var(--tblr-gray-200);
  --tblr-muted: var(--tblr-gray-500);
}
[data-bs-theme="dark"][data-theme-base] {
  --tblr-border-color: var(--tblr-gray-700);
  --tblr-muted: var(--tblr-gray-400);
}

/* Border Radius */
[data-theme-radius="0"] {
  --tblr-border-radius: 0;
  --tblr-border-radius-sm: 0;
  --tblr-border-radius-lg: 0;
}
[data-theme-radius="0.5"] {
  --tblr-border-radius: 0.25rem;
  --tblr-border-radius-sm: 0.125rem;
  --tblr-border-radius-lg: 0.375rem;
}
[data-theme-radius="1"] {
  --tblr-border-radius: 0.375rem;
  --tblr-border-radius-sm: 0.25rem;
  --tblr-border-radius-lg: 0.5rem;
}
[data-theme-radius="1.5"] {
  --tblr-border-radius: 0.5rem;
  --tblr-border-radius-sm: 0.375rem;
  --tblr-border-radius-lg: 0.75rem;
}
[data-theme-radius="2"] {
  --tblr-border-radius: 0.75rem;
  --tblr-border-radius-sm: 0.5rem;
  --tblr-border-radius-lg: 1rem;
}

/* Apply border radius to cards, buttons, inputs */
[data-theme-radius] .card { border-radius: var(--tblr-border-radius-lg); }
[data-theme-radius] .btn { border-radius: var(--tblr-border-radius); }
[data-theme-radius] .form-control,
[data-theme-radius] .form-select { border-radius: var(--tblr-border-radius); }
[data-theme-radius] .badge { border-radius: var(--tblr-border-radius-sm); }
[data-theme-radius] .avatar { border-radius: var(--tblr-border-radius); }
[data-theme-radius] .dropdown-menu { border-radius: var(--tblr-border-radius); }
[data-theme-radius] .modal-content { border-radius: var(--tblr-border-radius-lg); }
[data-theme-radius] .toast { border-radius: var(--tblr-border-radius); }
[data-theme-radius] .alert { border-radius: var(--tblr-border-radius); }

/* Theme color swatches for settings */
.theme-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
}
.theme-color-swatch:hover {
  transform: scale(1.1);
}
.theme-color-swatch.active {
  border-color: var(--tblr-primary);
  box-shadow: 0 0 0 2px rgba(var(--tblr-primary-rgb), 0.25);
}
.theme-color-swatch[data-color="blue"] { background: #206bc4; }
.theme-color-swatch[data-color="cyan"] { background: #17a2b8; }
.theme-color-swatch[data-color="teal"] { background: #0ca678; }
.theme-color-swatch[data-color="green"] { background: #2fb344; }
.theme-color-swatch[data-color="yellow"] { background: #f59f00; }
.theme-color-swatch[data-color="orange"] { background: #f76707; }
.theme-color-swatch[data-color="red"] { background: #d63939; }
.theme-color-swatch[data-color="pink"] { background: #d6336c; }
.theme-color-swatch[data-color="purple"] { background: #ae3ec9; }

/* Theme preview alert - ensure contrast in both modes */
.alert.bg-primary-lt {
  background-color: rgba(var(--tblr-primary-rgb), 0.1) !important;
  color: var(--tblr-primary);
  border: 1px solid rgba(var(--tblr-primary-rgb), 0.2);
}
[data-bs-theme="dark"] .alert.bg-primary-lt {
  background-color: rgba(var(--tblr-primary-rgb), 0.15) !important;
  color: var(--tblr-primary);
}

/* ============================================ */

/* Clickable rows */
.cursor-pointer {
  cursor: pointer;
}

tr.cursor-pointer:hover {
  background-color: rgba(32, 107, 196, 0.04);
}

/* Table styling in dark mode - clean borderless look */
[data-bs-theme="dark"] .table thead th,
[data-bs-theme="dark"] .card-table thead th {
  background-color: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .table tbody td,
[data-bs-theme="dark"] .card-table tbody td {
  border-color: transparent;
}

[data-bs-theme="dark"] tr.cursor-pointer:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Table striped rows in dark mode - remove striping, use consistent dark background */
[data-bs-theme="dark"] .table-striped {
  --tblr-table-striped-bg: transparent !important;
}

[data-bs-theme="dark"] .table-striped > tbody > tr > *,
[data-bs-theme="dark"] .table-striped > tbody > tr {
  background-color: transparent !important;
  --tblr-table-striped-bg: transparent !important;
  --tblr-table-bg: transparent !important;
  color: rgba(255, 255, 255, 0.85) !important;
}

[data-bs-theme="dark"] .table > tbody > tr > td,
[data-bs-theme="dark"] .card-table > tbody > tr > td {
  background-color: transparent !important;
  background: transparent !important;
  color: rgba(255, 255, 255, 0.85) !important;
}

[data-bs-theme="dark"] .table .text-muted,
[data-bs-theme="dark"] .table td .text-muted {
  color: rgba(255, 255, 255, 0.6) !important;
}

[data-bs-theme="dark"] .table td .small,
[data-bs-theme="dark"] .table td small {
  color: rgba(255, 255, 255, 0.6) !important;
}

/* Card header and footer in dark mode */
[data-bs-theme="dark"] .card-header {
  background-color: #1d2128;
  border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .card-footer {
  background-color: #1d2128;
  border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .card-footer .text-muted {
  color: rgba(255, 255, 255, 0.6) !important;
}

[data-bs-theme="dark"] .page-link {
  background-color: transparent;
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
}

[data-bs-theme="dark"] .page-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

[data-bs-theme="dark"] .page-item.disabled .page-link {
  background-color: transparent;
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.3);
}

/* Outline buttons in dark mode */
[data-bs-theme="dark"] .btn-outline-primary {
  background-color: transparent;
  border-color: var(--tblr-primary);
  color: var(--tblr-primary);
}

[data-bs-theme="dark"] .btn-outline-primary:hover {
  background-color: var(--tblr-primary);
  color: #fff;
}

[data-bs-theme="dark"] .btn-outline-secondary {
  background-color: transparent;
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.7);
}

[data-bs-theme="dark"] .btn-outline-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

/* Brand colors */
:root {
  --cf-primary: #206bc4;
  --cf-success: #2fb344;
  --cf-warning: #f59f00;
  --cf-danger: #d63939;
  --cf-info: #4299e1;
  --cf-pink: #d6336c;
}

/* Logo placeholder */
.navbar-brand-image {
  height: 32px;
  width: auto;
}

.navbar-brand span {
  font-weight: 700;
  font-size: 1.25rem;
}

/* Patient summary card */
.patient-summary-card .badge {
  font-size: 0.75rem;
}

/* Patient summary card dark mode styling */
[data-bs-theme="dark"] {
  --tblr-card-bg: #1e2329;
  --tblr-card-border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .card.card-link {
  background-color: #1e2329 !important;
  background: #1e2329 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  --tblr-card-bg: #1e2329 !important;
}

[data-bs-theme="dark"] .card-body {
  background-color: #1e2329 !important;
}

[data-bs-theme="dark"] .card .text-reset,
[data-bs-theme="dark"] .card a.text-reset {
  color: rgba(255, 255, 255, 0.85) !important;
}

[data-bs-theme="dark"] .card .card-title {
  color: #fff !important;
}

[data-bs-theme="dark"] .card dl dt.text-muted {
  color: rgba(255, 255, 255, 0.6) !important;
}

[data-bs-theme="dark"] .card dl dd {
  color: rgba(255, 255, 255, 0.85) !important;
}

/* Tabs styling in dark mode - Native Tabler style */
[data-bs-theme="dark"] .nav-tabs {
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

[data-bs-theme="dark"] .nav-tabs .nav-link {
  color: rgba(255, 255, 255, 0.7);
  background-color: transparent;
  border: 1px solid transparent;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  padding: 0.75rem 1.25rem;
  margin-bottom: -1px;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

[data-bs-theme="dark"] .nav-tabs .nav-link iconify-icon,
[data-bs-theme="dark"] .nav-tabs .nav-link i {
  opacity: 0.7;
}

[data-bs-theme="dark"] .nav-tabs .nav-link:hover,
[data-bs-theme="dark"] .nav-tabs .nav-link:focus {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1) rgba(255, 255, 255, 0.1) transparent;
}

[data-bs-theme="dark"] .nav-tabs .nav-link:hover iconify-icon,
[data-bs-theme="dark"] .nav-tabs .nav-link:hover i,
[data-bs-theme="dark"] .nav-tabs .nav-link:focus iconify-icon,
[data-bs-theme="dark"] .nav-tabs .nav-link:focus i {
  opacity: 1;
}

[data-bs-theme="dark"] .nav-tabs .nav-link.active {
  color: #fff;
  background-color: #1e2329;
  border-color: rgba(255, 255, 255, 0.15) rgba(255, 255, 255, 0.15) #1e2329;
}

[data-bs-theme="dark"] .nav-tabs .nav-link.active iconify-icon,
[data-bs-theme="dark"] .nav-tabs .nav-link.active i {
  opacity: 1;
  color: var(--tblr-primary);
}

/* Card header tabs specific styling */
[data-bs-theme="dark"] .card-header-tabs {
  margin-bottom: -1px;
  border-bottom: none;
}

[data-bs-theme="dark"] .card-header-tabs .nav-link.active {
  background-color: #1e2329;
  border-bottom-color: #1e2329;
}

[data-bs-theme="dark"] .card > .card-header:has(.card-header-tabs) {
  background-color: #252a31;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0;
}

/* Alert boxes inside cards in dark mode */
[data-bs-theme="dark"] .card .alert-info {
  background-color: rgba(66, 153, 225, 0.15) !important;
  border-color: rgba(66, 153, 225, 0.3) !important;
  color: rgba(255, 255, 255, 0.85) !important;
}

[data-bs-theme="dark"] .card .alert-info .text-muted {
  color: rgba(255, 255, 255, 0.6) !important;
}

[data-bs-theme="dark"] .card .alert-info .alert-title {
  color: #fff !important;
}

[data-bs-theme="dark"] .card .alert-warning {
  background-color: rgba(245, 159, 0, 0.15) !important;
  border-color: rgba(245, 159, 0, 0.3) !important;
  color: rgba(255, 255, 255, 0.85) !important;
}

/* GPAL display */
.gpal-display {
  font-family: monospace;
  font-size: 1rem;
  letter-spacing: 0.5px;
}

/* Calendar customizations */
.fc-event {
  cursor: pointer;
  border-radius: 4px;
}

.fc-event-title {
  font-weight: 500;
}

/* Form improvements */
.form-label.required::after {
  content: " *";
  color: var(--cf-danger);
}

/* Time slot buttons */
.time-slot {
  padding: 0.75rem 0.5rem;
  font-size: 0.875rem;
}

.time-slot.active {
  background-color: var(--cf-primary) !important;
  border-color: var(--cf-primary) !important;
  color: white !important;
}

/* Print styles */
@media print {
  .navbar,
  .page-header,
  .btn,
  .card-actions,
  .dropdown,
  footer {
    display: none !important;
  }

  .card {
    border: 1px solid #ddd !important;
    box-shadow: none !important;
  }

  .page-body {
    padding: 0 !important;
  }
}

/* RTL support for Arabic */
[dir="rtl"] .ms-auto {
  margin-left: 0 !important;
  margin-right: auto !important;
}

[dir="rtl"] .me-2 {
  margin-right: 0 !important;
  margin-left: 0.5rem !important;
}

[dir="rtl"] .text-end {
  text-align: left !important;
}

[dir="rtl"] .text-start {
  text-align: right !important;
}

/* Responsive table on mobile */
@media (max-width: 768px) {
  .table-responsive-cards tbody tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius);
    padding: 1rem;
  }

  .table-responsive-cards tbody td {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border: none;
  }

  .table-responsive-cards tbody td::before {
    content: attr(data-label);
    font-weight: 600;
  }

  .table-responsive-cards thead {
    display: none;
  }
}

/* Loading spinner */
.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* Alert animations */
.alert {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Badge improvements */
.badge-gpal {
  background-color: var(--cf-pink);
  color: white;
}

/* Pregnancy status colors */
.pregnancy-ongoing {
  border-left: 4px solid var(--cf-info);
}

.pregnancy-delivered {
  border-left: 4px solid var(--cf-success);
}

.pregnancy-risk {
  border-left: 4px solid var(--cf-danger);
}

/* Visit timeline */
.visit-timeline {
  position: relative;
  padding-left: 2rem;
}

.visit-timeline::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--tblr-border-color);
}

.visit-timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
}

.visit-timeline-item::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 0.25rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cf-primary);
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--cf-primary);
}

/* Document dropzone styles */
.dropzone-active {
  border-color: var(--tblr-primary) !important;
  background: var(--tblr-primary-lt) !important;
}

.dropzone-active * {
  pointer-events: none;
}

.dropzone-area {
  transition: all 0.2s ease;
}

[data-bs-theme="dark"] .dropzone-area:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

/* Toast styles */
.toast {
  cursor: pointer;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.toast-body {
  padding: 0.75rem 1rem;
}

[data-bs-theme="dark"] .toast {
  background-color: #1e2329;
  border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .toast-body {
  color: rgba(255, 255, 255, 0.85);
}

/* ============================================ */
/* PATIENT VIEW STYLES */
/* ============================================ */

/* Hero section */
.patient-hero {
  background: linear-gradient(180deg, rgba(32, 107, 196, 0.08) 0%, transparent 100%);
}

.patient-hero .py-4 {
  padding-top: 0.75rem !important;
  padding-bottom: 0.5rem !important;
}

[data-bs-theme="dark"] .patient-hero {
  background: linear-gradient(180deg, rgba(32, 107, 196, 0.15) 0%, transparent 100%);
}

/* Patient card */
.patient-card {
  overflow: hidden;
}

/* Info sections */
.info-section {
  background: var(--tblr-bg-surface);
  border: 1px solid var(--tblr-border-color);
  border-radius: var(--tblr-border-radius);
  overflow: hidden;
}

/* Make left column cards stretch to match right column */
#overview-tab > .row > .col-lg-6 {
  display: flex;
  flex-direction: column;
}

#overview-tab > .row > .col-lg-6 > .info-section:last-child {
  flex: 1;
}

#overview-tab > .row > .col-lg-6 > .info-section:last-child > div {
  height: 100%;
  display: flex;
  flex-direction: column;
}

#overview-tab > .row > .col-lg-6 > .info-section:last-child .info-section-body {
  flex: 1;
}

[data-bs-theme="dark"] .info-section {
  background: #1e2329;
  border-color: rgba(255, 255, 255, 0.1);
}

.info-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.02);
  border-bottom: 1px solid var(--tblr-border-color);
}

[data-bs-theme="dark"] .info-section-header {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}

.info-section-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--tblr-body-color);
}

[data-bs-theme="dark"] .info-section-title {
  color: #fff;
}

.info-section-title iconify-icon,
.info-section-title i {
  opacity: 0.7;
}

/* Section last updated timestamp */
.section-updated {
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--tblr-muted);
  margin-left: 0.5rem;
  opacity: 0.7;
}

[data-bs-theme="dark"] .section-updated {
  color: rgba(255, 255, 255, 0.4);
}

.info-section-body {
  padding: 1rem;
}

.info-section-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.02);
  border-top: 1px solid var(--tblr-border-color);
}

[data-bs-theme="dark"] .info-section-footer {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Labels and values */
.info-label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--tblr-muted);
  margin-bottom: 0.25rem;
}

[data-bs-theme="dark"] .info-label {
  color: rgba(255, 255, 255, 0.5);
}

.info-value {
  font-size: 0.875rem;
  color: var(--tblr-body-color);
}

[data-bs-theme="dark"] .info-value {
  color: rgba(255, 255, 255, 0.85);
}

.info-value .text-muted {
  color: var(--tblr-muted) !important;
}

[data-bs-theme="dark"] .info-value .text-muted {
  color: rgba(255, 255, 255, 0.4) !important;
}

/* GPAL Display */
.gpal-display {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.gpal-item {
  text-align: center;
  padding: 0.75rem 0.5rem;
  background: rgba(32, 107, 196, 0.08);
  border-radius: var(--tblr-border-radius);
  border: 1px solid rgba(32, 107, 196, 0.15);
}

[data-bs-theme="dark"] .gpal-item {
  background: rgba(32, 107, 196, 0.15);
  border-color: rgba(32, 107, 196, 0.25);
}

.gpal-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tblr-primary);
  margin-bottom: 0.25rem;
}

[data-bs-theme="dark"] .gpal-label {
  color: #5eafff;
}

.gpal-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--tblr-body-color);
  line-height: 1;
}

[data-bs-theme="dark"] .gpal-value {
  color: #fff;
}

/* GPAL input in edit mode */
.gpal-input {
  font-size: 1.5rem;
  font-weight: 700;
  padding: 0.25rem;
  height: auto;
  line-height: 1;
  text-align: center;
  background: transparent;
  border: 1px solid rgba(32, 107, 196, 0.3);
}

.gpal-input:focus {
  background: rgba(32, 107, 196, 0.1);
  border-color: var(--tblr-primary);
}

[data-bs-theme="dark"] .gpal-input {
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(32, 107, 196, 0.4);
  color: #fff;
}

[data-bs-theme="dark"] .gpal-input:focus {
  background: rgba(32, 107, 196, 0.2);
  border-color: var(--tblr-primary);
}

/* Patient view body */
.patient-view-body {
  background: var(--tblr-bg-surface-secondary);
  min-height: calc(100vh - 300px);
}

[data-bs-theme="dark"] .patient-view-body {
  background: #14171a;
}

/* Form styling in info sections */
.info-section .form-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--tblr-muted);
  margin-bottom: 0.25rem;
}

[data-bs-theme="dark"] .info-section .form-label {
  color: rgba(255, 255, 255, 0.5);
}

/* Hide number input spinners for cleaner Tabler look */
.info-section input[type="number"] {
  -moz-appearance: textfield;
}

.info-section input[type="number"]::-webkit-inner-spin-button,
.info-section input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Hide date input native controls for cleaner Tabler look */
.info-section input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.5;
  cursor: pointer;
}

.info-section input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

[data-bs-theme="dark"] .info-section input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

[data-bs-theme="dark"] .info-section .form-control,
[data-bs-theme="dark"] .info-section .form-select {
  background-color: #232a31;
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

[data-bs-theme="dark"] .info-section .form-control:focus,
[data-bs-theme="dark"] .info-section .form-select:focus {
  background-color: #2a323b;
  border-color: var(--tblr-primary);
  box-shadow: 0 0 0 0.2rem rgba(32, 107, 196, 0.25);
}

[data-bs-theme="dark"] .info-section .form-control::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Pregnancy banner in hero */
.text-pink {
  color: #d6336c !important;
}

/* Ghost button improvements in dark mode */
[data-bs-theme="dark"] .btn-ghost-primary {
  color: #5eafff;
}

[data-bs-theme="dark"] .btn-ghost-primary:hover {
  background: rgba(32, 107, 196, 0.15);
  color: #5eafff;
}

[data-bs-theme="dark"] .btn-ghost-secondary {
  color: rgba(255, 255, 255, 0.6);
}

[data-bs-theme="dark"] .btn-ghost-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
}

/* Empty state improvements */
[data-bs-theme="dark"] .empty-icon {
  color: rgba(255, 255, 255, 0.3);
}

[data-bs-theme="dark"] .empty-title {
  color: rgba(255, 255, 255, 0.85);
}

[data-bs-theme="dark"] .empty-subtitle {
  color: rgba(255, 255, 255, 0.5) !important;
}

/* Badge improvements in dark mode */
[data-bs-theme="dark"] .badge.bg-secondary-lt {
  background: rgba(255, 255, 255, 0.1) !important;
  color: rgba(255, 255, 255, 0.7) !important;
}

[data-bs-theme="dark"] .badge.bg-red-lt {
  background: rgba(214, 57, 57, 0.2) !important;
  color: #ff6b6b !important;
}

[data-bs-theme="dark"] .badge.bg-green-lt {
  background: rgba(47, 179, 68, 0.2) !important;
  color: #69db7c !important;
}

[data-bs-theme="dark"] .badge.bg-azure-lt {
  background: rgba(32, 107, 196, 0.2) !important;
  color: #5eafff !important;
}

[data-bs-theme="dark"] .badge.bg-warning-lt {
  background: rgba(245, 159, 0, 0.2) !important;
  color: #ffc078 !important;
}

[data-bs-theme="dark"] .badge.bg-success-lt {
  background: rgba(47, 179, 68, 0.2) !important;
  color: #69db7c !important;
}

/* ============================================ */
/* VISIT FORM STYLES */
/* ============================================ */

/* Hide number input spinners globally */
input[type="number"] {
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Dark mode form controls in card body */
[data-bs-theme="dark"] .card-body .form-control,
[data-bs-theme="dark"] .card-body .form-select {
  background-color: #232a31;
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

[data-bs-theme="dark"] .card-body .form-control:focus,
[data-bs-theme="dark"] .card-body .form-select:focus {
  background-color: #2a323b;
  border-color: var(--tblr-primary);
  box-shadow: 0 0 0 0.2rem rgba(32, 107, 196, 0.25);
  color: #fff;
}

[data-bs-theme="dark"] .card-body .form-control::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Dark mode input-group-text */
[data-bs-theme="dark"] .card-body .input-group-text {
  background-color: #1a1f25;
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.6);
}

/* Dark mode textarea */
[data-bs-theme="dark"] .card-body textarea.form-control {
  background-color: #232a31;
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

[data-bs-theme="dark"] .card-body textarea.form-control:focus {
  background-color: #2a323b;
  border-color: var(--tblr-primary);
}

/* Spinner animation for sync */
.spin {
  animation: spin 1s linear infinite;
}

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

/* ============================================ */
/* PATIENT TIMELINE STYLES */
/* ============================================ */

/* Timeline container */
#timeline-tab {
  padding: 1rem;
}

/* Timeline filters */
#timelineFilters {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(98, 105, 118, 0.16);
  margin-bottom: 1rem;
}

#timelineFilters .form-selectgroup-item {
  margin: 0;
}

#timelineFilters .form-selectgroup-label {
  padding: 0.25rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: 20px;
  cursor: pointer;
  border: 1px solid rgba(98, 105, 118, 0.24);
  background: transparent;
  transition: all 0.15s ease;
}

#timelineFilters .form-selectgroup-input:checked + .form-selectgroup-label {
  background: var(--tblr-primary);
  color: white;
  border-color: var(--tblr-primary);
}

#timelineFilters .form-selectgroup-label:hover {
  border-color: var(--tblr-primary);
}

[data-bs-theme="dark"] #timelineFilters {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] #timelineFilters .form-selectgroup-label {
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
}

[data-bs-theme="dark"] #timelineFilters .form-selectgroup-input:checked + .form-selectgroup-label {
  background: var(--tblr-primary);
  color: white;
}

/* ============================================ */
/* PATIENT TIMELINE - NEW FEED STYLE           */
/* ============================================ */

/* Month separator */
.timeline-month-separator {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0 1rem 0;
}

.timeline-month-separator:first-child {
  margin-top: 0;
}

.timeline-month-line {
  flex: 1;
  height: 1px;
  background: var(--tblr-border-color);
}

[data-bs-theme="dark"] .timeline-month-line {
  background: rgba(255, 255, 255, 0.15);
}

.timeline-month-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tblr-secondary);
  white-space: nowrap;
}

[data-bs-theme="dark"] .timeline-month-label {
  color: rgba(255, 255, 255, 0.5);
}

/* Timeline item */
.timeline-item {
  position: relative;
  padding-left: 1.75rem;
  padding-bottom: 1rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

/* Dashed timeline line */
.timeline-item:not(.is-last)::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 12px;
  bottom: -6px;
  width: 0;
  border-left: 2px dashed var(--tblr-border-color);
}

[data-bs-theme="dark"] .timeline-item:not(.is-last)::before {
  border-left-color: rgba(255, 255, 255, 0.2);
}

/* Header row with marker and date */
.timeline-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Timeline marker - empty circle with 2px border */
.timeline-marker {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid var(--tblr-primary);
  z-index: 1;
  position: relative;
  left: -1.75rem;
  margin-right: -1.75rem;
}

/* First marker is filled */
.timeline-item.is-first .timeline-marker {
  background: var(--tblr-primary);
}

/* Last marker is a triangle pointing up */
.timeline-item.is-last .timeline-marker {
  width: 0;
  height: 0;
  border-radius: 0;
  border: none;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 10px solid var(--tblr-primary);
  background: transparent;
}

/* Date */
.timeline-date {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--tblr-secondary);
}

[data-bs-theme="dark"] .timeline-date {
  color: rgba(255, 255, 255, 0.6);
}

/* Card link wrapper */
.timeline-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.timeline-card-link:hover {
  text-decoration: none;
  color: inherit;
}

.timeline-card-wrapper {
  display: block;
}

/* Card */
.timeline-card {
  background: var(--tblr-bg-surface);
  border: 1px solid var(--tblr-border-color);
  border-radius: var(--tblr-border-radius);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

[data-bs-theme="dark"] .timeline-card {
  background: #232a31;
  border-color: rgba(255, 255, 255, 0.08);
}

.timeline-card-link:hover .timeline-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-color: var(--tblr-primary);
}

[data-bs-theme="dark"] .timeline-card-link:hover .timeline-card {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  border-color: rgba(32, 107, 196, 0.5);
}

/* Card header */
.timeline-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
}

/* Icon in card */
.timeline-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.timeline-icon iconify-icon,
.timeline-icon i {
  font-size: 14px;
}

/* Event type colors - light mode */
.timeline-icon.bg-azure-lt { background: rgba(32, 107, 196, 0.15); color: #206bc4; }
.timeline-icon.bg-cyan-lt { background: rgba(23, 162, 184, 0.15); color: #17a2b8; }
.timeline-icon.bg-pink-lt { background: rgba(214, 51, 108, 0.15); color: #d6336c; }
.timeline-icon.bg-green-lt { background: rgba(47, 179, 68, 0.15); color: #2fb344; }
.timeline-icon.bg-red-lt { background: rgba(214, 57, 57, 0.15); color: #d63939; }
.timeline-icon.bg-orange-lt { background: rgba(253, 126, 20, 0.15); color: #fd7e14; }
.timeline-icon.bg-purple-lt { background: rgba(113, 89, 193, 0.15); color: #7159c1; }
.timeline-icon.bg-secondary-lt { background: rgba(108, 117, 125, 0.15); color: #6c757d; }

/* Event type colors - dark mode */
[data-bs-theme="dark"] .timeline-icon.bg-azure-lt { background: rgba(32, 107, 196, 0.25); color: #5eafff; }
[data-bs-theme="dark"] .timeline-icon.bg-cyan-lt { background: rgba(23, 162, 184, 0.25); color: #5dd3e8; }
[data-bs-theme="dark"] .timeline-icon.bg-pink-lt { background: rgba(214, 51, 108, 0.25); color: #f06595; }
[data-bs-theme="dark"] .timeline-icon.bg-green-lt { background: rgba(47, 179, 68, 0.25); color: #69db7c; }
[data-bs-theme="dark"] .timeline-icon.bg-red-lt { background: rgba(214, 57, 57, 0.25); color: #ff8787; }
[data-bs-theme="dark"] .timeline-icon.bg-orange-lt { background: rgba(253, 126, 20, 0.25); color: #ffc078; }
[data-bs-theme="dark"] .timeline-icon.bg-purple-lt { background: rgba(113, 89, 193, 0.25); color: #a78bfa; }
[data-bs-theme="dark"] .timeline-icon.bg-secondary-lt { background: rgba(108, 117, 125, 0.25); color: #adb5bd; }

/* Title */
.timeline-title {
  font-weight: 500;
  flex: 1;
  min-width: 0;
}

/* Chevron */
.timeline-chevron {
  color: var(--tblr-secondary);
  opacity: 0.5;
  transition: opacity 0.15s ease, transform 0.15s ease;
  margin-left: auto;
}

.timeline-card-link:hover .timeline-chevron {
  opacity: 1;
  transform: translateX(2px);
}

/* Card body */
.timeline-card-body {
  padding: 0 1rem 0.75rem 1rem;
  font-size: 0.875rem;
}

/* Detail styles */
.timeline-detail-complaint {
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.timeline-detail-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: var(--tblr-secondary);
}

[data-bs-theme="dark"] .timeline-detail-row {
  color: rgba(255, 255, 255, 0.6);
}

.timeline-detail-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  font-weight: 500;
  color: var(--tblr-secondary);
}

[data-bs-theme="dark"] .timeline-detail-label {
  color: rgba(255, 255, 255, 0.5);
}

.timeline-detail-notes {
  margin-top: 0.5rem;
  color: var(--tblr-secondary);
  max-height: 3rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-bs-theme="dark"] .timeline-detail-notes {
  color: rgba(255, 255, 255, 0.6);
}

/* Document preview */
.timeline-doc-preview {
  margin-bottom: 0.5rem;
  border-radius: var(--tblr-border-radius);
  overflow: hidden;
  max-height: 120px;
}

.timeline-doc-preview img {
  width: 100%;
  height: auto;
  object-fit: cover;
  max-height: 120px;
}

/* End of timeline marker */
#timelineEnd {
  border-top: 1px dashed var(--tblr-border-color);
  margin-top: 1.5rem;
  padding-top: 1rem;
  position: relative;
}

#timelineEnd::before {
  content: '';
  display: block;
  width: 10px;
  height: 10px;
  background: var(--tblr-border-color);
  border-radius: 50%;
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
}

[data-bs-theme="dark"] #timelineEnd {
  border-color: rgba(255, 255, 255, 0.2);
}

[data-bs-theme="dark"] #timelineEnd::before {
  background: rgba(255, 255, 255, 0.3);
}

/* Mobile responsiveness */
@media (max-width: 767.98px) {
  .timeline-item {
    padding-left: 1.5rem;
  }

  .timeline-marker {
    width: 10px;
    height: 10px;
    left: -1.5rem;
    margin-right: -1.5rem;
  }

  .timeline-item.is-last .timeline-marker {
    border-left-width: 5px;
    border-right-width: 5px;
    border-bottom-width: 8px;
  }

  .timeline-item:not(.is-last)::before {
    left: 4px;
  }

  .timeline-card-header {
    padding: 0.625rem 0.75rem;
  }

  .timeline-card-body {
    padding: 0 0.75rem 0.625rem 0.75rem;
  }

  .timeline-icon {
    width: 24px;
    height: 24px;
  }

  .timeline-icon iconify-icon,
  .timeline-icon i {
    font-size: 12px;
  }
}

/* Loading states */
#timelineLoading,
#timelineSentinel {
  padding: 2rem;
}

/* Empty state */
#timeline-tab .empty {
  padding: 3rem 1rem;
}

#timeline-tab .empty-icon i {
  font-size: 3rem;
  opacity: 0.3;
}

/* ============================================ */
/* PREGNANCY VIEW - PRENATAL VISITS FEED       */
/* ============================================ */

/* Feed Container */
.prenatal-feed {
  position: relative;
  padding: 1rem;
}

/* Visit Item */
.prenatal-feed-item {
  position: relative;
  padding-left: 1.75rem;
  padding-bottom: 1rem;
}

.prenatal-feed-item:last-child {
  padding-bottom: 0;
}

/* Dashed timeline line - starts from first marker center, ends at last marker */
.prenatal-feed-item:not(.is-last)::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 12px;
  bottom: -6px;
  width: 0;
  border-left: 2px dashed var(--tblr-border-color);
}

[data-bs-theme="dark"] .prenatal-feed-item:not(.is-last)::before {
  border-left-color: rgba(255, 255, 255, 0.2);
}

/* Header row with marker and date */
.prenatal-feed-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Timeline marker - empty circle with 2px border */
.prenatal-feed-marker {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid var(--tblr-primary);
  z-index: 1;
  position: relative;
  left: -1.75rem;
  margin-right: -1.75rem;
}

/* First marker is filled */
.prenatal-feed-item.is-first .prenatal-feed-marker {
  background: var(--tblr-primary);
}

/* Last marker is a triangle pointing up */
.prenatal-feed-item.is-last .prenatal-feed-marker {
  width: 0;
  height: 0;
  border-radius: 0;
  border: none;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 10px solid var(--tblr-primary);
  background: transparent;
}

/* Date badge */
.prenatal-feed-date-badge {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--tblr-secondary);
}

[data-bs-theme="dark"] .prenatal-feed-date-badge {
  color: rgba(255, 255, 255, 0.6);
}

/* Visit Card - clickable link */
.prenatal-feed-card {
  display: block;
  margin-left: 0;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.prenatal-feed-card:hover {
  text-decoration: none;
  color: inherit;
}

/* Chevron indicator */
.prenatal-feed-chevron {
  color: var(--tblr-secondary);
  opacity: 0.5;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.prenatal-feed-card:hover .prenatal-feed-chevron {
  opacity: 1;
  transform: translateX(2px);
}

/* Card content */
.prenatal-feed-content {
  background: var(--tblr-bg-surface);
  border: 1px solid var(--tblr-border-color);
  border-radius: var(--tblr-border-radius);
  padding: 0.875rem 1rem;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

[data-bs-theme="dark"] .prenatal-feed-content {
  background: #232a31;
  border-color: rgba(255, 255, 255, 0.08);
}

.prenatal-feed-card:hover .prenatal-feed-content {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-color: var(--tblr-primary);
}

[data-bs-theme="dark"] .prenatal-feed-card:hover .prenatal-feed-content {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  border-color: rgba(32, 107, 196, 0.5);
}

/* Chief complaint */
.prenatal-feed-complaint {
  font-size: 0.9375rem;
  line-height: 1.4;
}

/* Details section */
.prenatal-feed-details {
  font-size: 0.875rem;
}

.prenatal-feed-detail-row {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.prenatal-feed-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: var(--tblr-secondary);
  font-weight: 500;
}

[data-bs-theme="dark"] .prenatal-feed-label {
  color: rgba(255, 255, 255, 0.5);
}

.prenatal-feed-value {
  color: var(--tblr-body-color);
}

/* Notes with show more */
.prenatal-feed-notes {
  position: relative;
}

.prenatal-feed-notes-text {
  font-size: 0.875rem;
  color: var(--tblr-secondary);
  line-height: 1.5;
  max-height: 3.75rem; /* ~2.5 lines */
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.prenatal-feed-notes-text.expanded {
  max-height: none;
}

[data-bs-theme="dark"] .prenatal-feed-notes-text {
  color: rgba(255, 255, 255, 0.6);
}

.prenatal-feed-show-more {
  background: none;
  border: none;
  padding: 0;
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  color: var(--tblr-primary);
  cursor: pointer;
  font-weight: 500;
}

.prenatal-feed-show-more:hover {
  text-decoration: underline;
}

/* Mobile responsiveness */
@media (max-width: 991.98px) {
  .prenatal-feed {
    padding: 0.75rem;
  }

  .prenatal-feed-item {
    padding-left: 1.5rem;
  }

  .prenatal-feed-marker {
    width: 10px;
    height: 10px;
    left: -1.5rem;
    margin-right: -1.5rem;
  }

  .prenatal-feed-item.is-last .prenatal-feed-marker {
    border-left-width: 5px;
    border-right-width: 5px;
    border-bottom-width: 8px;
  }

  .prenatal-feed-item:not(.is-last)::before {
    left: 4px;
  }

  .prenatal-feed-content {
    padding: 0.75rem;
  }
}

/* ============================================ */
/* PREGNANCY VIEW - ULTRASOUND TABLE & PANEL   */
/* ============================================ */

.ultrasound-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.ultrasound-row.table-active {
  background-color: rgba(32, 107, 196, 0.1) !important;
}

[data-bs-theme="dark"] .ultrasound-row.table-active {
  background-color: rgba(32, 107, 196, 0.2) !important;
}

#ultrasound-detail-panel {
  animation: slideDown 0.2s ease;
  background: var(--tblr-bg-surface-secondary);
}

[data-bs-theme="dark"] #ultrasound-detail-panel {
  background: #1a1f25;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Ultrasound edit form */
#ultrasound-edit-form .info-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--tblr-secondary);
  margin-bottom: 0.25rem;
}

#ultrasound-edit-form .form-control {
  font-size: 0.875rem;
}

/* ============================================ */
/* PREGNANCY VIEW - UNIFIED CARD STYLES        */
/* ============================================ */

.pregnancy-card .info-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--tblr-border-color);
}

.pregnancy-card .info-section-body {
  padding: 1.25rem;
}

.pregnancy-card .info-section-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--tblr-border-color);
  background: var(--tblr-bg-surface-secondary);
}

[data-bs-theme="dark"] .pregnancy-card .info-section-footer {
  background: rgba(0, 0, 0, 0.15);
}

/* Dark mode borders for pregnancy card */
[data-bs-theme="dark"] .pregnancy-card .info-section-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .pregnancy-card .info-section-footer {
  border-top-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .pregnancy-card .border-top {
  border-top-color: rgba(255, 255, 255, 0.1) !important;
}

[data-bs-theme="dark"] .pregnancy-status-row {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* High risk pregnancy indicator */
.pregnancy-card.high-risk {
  border-left: 3px solid var(--tblr-danger);
}

.pregnancy-card.high-risk .info-section-header {
  background: rgba(var(--tblr-danger-rgb), 0.05);
}

/* Status colors in pregnancy header */
.pregnancy-status-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--tblr-border-color);
}

.pregnancy-status-row .avatar {
  flex-shrink: 0;
}

.pregnancy-ga-display {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
}

/* EDD countdown */
.edd-countdown {
  text-align: right;
}

.edd-countdown .edd-date {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--tblr-primary);
}

.edd-countdown .edd-remaining {
  font-size: 0.875rem;
  color: var(--tblr-secondary);
}

.edd-countdown .edd-overdue {
  color: var(--tblr-danger);
}

/* Inline editing for pregnancy details */
.pregnancy-details-view,
.pregnancy-details-edit {
  transition: opacity 0.15s ease;
}

/* Info grid for pregnancy details */
.pregnancy-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}

.pregnancy-info-grid .info-item {
  min-width: 0;
}

/* Mobile adjustments */
@media (max-width: 767.98px) {
  .pregnancy-status-row {
    flex-wrap: wrap;
  }

  .edd-countdown {
    text-align: left;
    width: 100%;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--tblr-border-color);
  }

  .pregnancy-ga-display {
    font-size: 1.25rem;
  }

  [data-bs-theme="dark"] .edd-countdown {
    border-top-color: rgba(255, 255, 255, 0.1);
  }
}
