/**
 * Sagala Satwa - Visual Design System
 * Based on DESIGN.md (Medical Emerald, High Clinical Density, Strict WCAG AAA)
 */

:root {
  /* Brand & Clinical Core */
  --color-primary: #0D9488;
  --color-primary-hover: #0F766E;
  --color-primary-active: #115E59;
  --color-primary-light: #CCFBF1;
  --color-primary-foreground: #FFFFFF;

  /* Secondary & Module Anchors */
  --color-secondary: #3B82F6;
  --color-secondary-light: #EFF6FF;
  --color-secondary-foreground: #1E3A8A;

  /* Operational Module Accents */
  --color-module-dashboard: #0D9488;
  --color-module-dashboard-light: #CCFBF1;
  --color-module-patients: #F97316;
  --color-module-patients-light: #FFEDD5;
  --color-module-customers: #3B82F6;
  --color-module-customers-light: #EFF6FF;
  --color-module-queue: #06B6D4;
  --color-module-queue-light: #CFFAFE;
  --color-module-vet: #0D9488;
  --color-module-grooming: #8B5CF6;
  --color-module-grooming-light: #F3E8FF;
  --color-module-hotel: #6366F1;
  --color-module-hotel-light: #EEF2FF;
  --color-module-inpatient: #EC4899;
  --color-module-inpatient-light: #FCE7F3;
  --color-module-recalls: #059669;
  --color-module-recalls-light: #ECFDF5;
  --color-module-epidemiology: #0EA5E9;
  --color-module-epidemiology-light: #F0F9FF;
  --color-module-pharmacy: #10B981;
  --color-module-pharmacy-light: #D1FAE5;
  --color-module-billing: #F59E0B;
  --color-module-billing-light: #FEF3C7;
  --color-module-expenses: #E11D48;
  --color-module-expenses-light: #FFE4E6;
  --color-module-settings: #7C3AED;
  --color-module-settings-light: #EDE9FE;
  --color-module-audit: #4F46E5;
  --color-module-audit-light: #EEF2FF;

  /* Standard Warning Fallback Token */
  --color-warning: #D97706;

  /* Clinical Triage & Alerts */
  --color-alert-critical: #DC2626;
  --color-alert-critical-hover: #B91C1C;
  --color-alert-critical-bg: #FEF2F2;
  --color-alert-critical-border: #F87171;
  --color-alert-critical-text: #991B1B;

  --color-alert-warning: #D97706;
  --color-alert-warning-bg: #FFFBEB;
  --color-alert-warning-border: #FCD34D;
  --color-alert-warning-text: #92400E;

  --color-alert-success: #059669;
  --color-alert-success-bg: #ECFDF5;
  --color-alert-success-border: #6EE7B7;
  --color-alert-success-text: #065F46;

  --color-alert-info: #0284C7;
  --color-alert-info-bg: #F0F9FF;
  --color-alert-info-border: #7DD3FC;
  --color-alert-info-text: #075985;

  /* Neutrals, Surfaces & Canvas */
  --color-background: #F8FAFC;
  --color-surface: #FFFFFF;
  --color-surface-sunken: #F1F5F9;
  --color-card-bg: var(--color-surface-sunken); /* #F1F5F9 - SSOT Master Gray Card Background */
  --color-card-header-bg: var(--color-surface-sunken);
  --color-card-footer-bg: var(--color-surface-sunken);
  --color-card-border: var(--color-border);
  --color-surface-hover: #F8FAFC;
  --color-surface-disabled: #E2E8F0;

  /* Control Heights & Focus Rings (SSOT) */
  --control-height: 32px;
  --control-height-sm: 28px;
  --control-height-xs: 24px;
  --control-height-touch: 42px;
  --ring-focus: 0 0 0 3px rgba(5, 150, 105, 0.20);

  /* Borders & Dividers */
  --color-border: #E2E8F0;
  --color-border-subtle: #F1F5F9;
  --color-border-strong: #CBD5E1;
  --color-border-focus: #0D9488;

  /* Text & Content Hierarchy */
  --color-text-primary: #0F172A;
  --color-text-secondary: #475569;
  --color-text-muted: #64748B;
  --color-text-subtle: #94A3B8;
  --color-text-inverse: #FFFFFF;
  --color-text-disabled: #94A3B8;

  /* Financial Specifics */
  --color-dp-badge-bg: #FEF3C7;
  --color-dp-badge-text: #92400E;
  --color-dp-badge-border: #F59E0B;
  --color-paid-badge-bg: #DCFCE7;
  --color-paid-badge-text: #166534;
  --color-refund-badge-bg: #F3E8FF;
  --color-refund-badge-text: #6B21A8;

  /* Typography Families */
  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Shapes & Radii */
  --rounded-none: 0px;
  --rounded-xs: 2px;
  --rounded-sm: 4px;
  --rounded-md: 6px;
  --rounded-lg: 8px;
  --rounded-xl: 12px;
  --rounded-2xl: 16px;
  --rounded-full: 9999px;

  /* Spacing Scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* Elevation & Shadows */
  --shadow-level-0: none;
  --shadow-level-1: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  --shadow-level-2: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-level-3: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.06);
  --shadow-level-4: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.08);

  /* Layout Consts */
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 64px;
  --topbar-height: 56px;

  /* Motion & Transition Tokens (SSOT) */
  --transition-fast:   120ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 300ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Z-Index Hierarchy Stack (SSOT) */
  --z-base:       0;
  --z-sticky:     10; /* Sticky Table Header & Tab Bar */
  --z-topbar:     30; /* Topbar Navigation */
  --z-dropdown:   40; /* Dropdown Select & Autocomplete Menu */
  --z-backdrop:   50; /* Modal Overlay Gelap */
  --z-modal:      60; /* Jendela Modal Dialog */
  --z-toast:      70; /* Notifikasi Toast Melayang */
  --z-tooltip:    80; /* Tooltip Petunjuk */

  /* Density Scaling Tokens (SSOT World-Class) */
  --density-multiplier: 1.0;
  --table-cell-padding-y: 8px;
  --table-cell-padding-x: 12px;
  --table-row-height: 40px;
}

/* ==========================================================================
   Triage & Night-Shift Dark Mode Semantic Readiness (SSOT)
   ========================================================================== */
:root[data-theme="dark"] {
  --color-canvas-bg:        #090d16;
  --color-surface:          #111827;
  --color-card-bg:          #1e293b;
  --color-surface-sunken:   #1e293b;
  --color-surface-elevated: #1f2937;

  --color-border:           #334155;
  --color-border-subtle:    #1e293b;
  --color-border-strong:    #475569;
  --color-border-hover:     #64748b;

  --color-text-primary:     #f8fafc;
  --color-text-secondary:   #cbd5e1;
  --color-text-muted:       #94a3b8;
  --color-text-disabled:    #64748b;

  --color-primary:          #10b981;
  --color-primary-hover:    #059669;
  --color-primary-active:   #047857;
  --ring-focus:             0 0 0 3px rgba(16, 185, 129, 0.35);
}

/* ==========================================================================
   Clinical Density Switching Architecture (Desktop High-Density vs Touch)
   ========================================================================== */
[data-density="compact"] {
  --control-height: 28px !important;
  --table-cell-padding-y: 4px !important;
  --table-row-height: 32px !important;
}

[data-density="compact"] .table-app td,
[data-density="compact"] .queue-table td {
  padding: 4px 10px !important;
  font-size: 12px !important;
}

[data-density="comfortable"] {
  --control-height: 38px !important;
  --table-cell-padding-y: 12px !important;
  --table-row-height: 48px !important;
}

[data-density="comfortable"] .table-app td,
[data-density="comfortable"] .queue-table td {
  padding: 12px 16px !important;
  font-size: 14px !important;
}

/* Global Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background-color: var(--color-background);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Thin Aesthetic Scrollbar (SSOT) */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Standard Headings (H1 - H6) & Weight Tokens */
h1, .h1 { font-size: 24px; font-weight: 700; line-height: 30px; letter-spacing: -0.02em; color: var(--color-text-primary); margin: 0; }
h2, .h2 { font-size: 20px; font-weight: 700; line-height: 26px; letter-spacing: -0.02em; color: var(--color-text-primary); margin: 0; }
h3, .h3 { font-size: 16px; font-weight: 600; line-height: 22px; letter-spacing: -0.01em; color: var(--color-text-primary); margin: 0; }
h4, .h4 { font-size: 14px; font-weight: 600; line-height: 20px; letter-spacing: 0em; color: var(--color-text-primary); margin: 0; }
h5, .h5 { font-size: 13px; font-weight: 600; line-height: 18px; letter-spacing: 0em; color: var(--color-text-primary); margin: 0; }
h6, .h6 { font-size: 12px; font-weight: 600; line-height: 16px; letter-spacing: 0.02em; color: var(--color-text-secondary); margin: 0; }

.font-normal { font-weight: 400 !important; }
.font-medium { font-weight: 500 !important; }
.font-semibold { font-weight: 600 !important; }
.font-bold { font-weight: 700 !important; }
.font-extrabold { font-weight: 800 !important; }

/* ==========================================================================
   SSOT 7 ENHANCED WEB ADMIN COMPONENTS (Modern & Professional)
   ========================================================================== */

/* 1. Skeleton Wave & Shimmer Loading (Perceived Performance) */
@keyframes skeleton-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--rounded-sm);
  display: inline-block;
}

.skeleton-text {
  height: 14px;
  width: 100%;
  border-radius: 4px;
}

.skeleton-title {
  height: 20px;
  width: 60%;
  border-radius: 4px;
}

.skeleton-box {
  width: 100%;
  height: 80px;
  border-radius: var(--rounded-md);
}

.skeleton-circle {
  border-radius: 50%;
  width: 36px;
  height: 36px;
}

/* 2. Empty State Component Anatomy (Zero-Data UX) */
.empty-state,
.empty-state-standard {
  padding: 36px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.empty-state-icon,
.empty-state-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-surface-sunken);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.empty-state-icon .icon-svg,
.empty-state-icon svg,
.empty-state-icon-circle .icon-svg,
.empty-state-icon-circle svg {
  width: 24px;
  height: 24px;
}

.empty-state-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.35;
}

.empty-state-desc {
  font-size: 12px;
  color: var(--color-text-muted);
  max-width: 360px;
  margin-top: 4px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

.empty-state-action {
  margin-top: 14px;
}

/* 3. Keyboard Shortcut Badges (<kbd>) */
kbd, .kbd-shortcut {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-bottom: 2px solid #94a3b8;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 5px;
  color: #475569;
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
}

/* 4. Integrated Search & Toolbar Action Bar */
.toolbar-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.search-input-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  color: var(--color-text-muted);
  pointer-events: none;
}

.search-input-wrapper input {
  width: 100%;
  padding-left: 32px !important;
}

/* ==========================================================================
   WORLD-CLASS ELITE SAAS & CLINICAL EMR COMPONENTS
   ========================================================================== */

/* 1. Stripe-Grade Filter Chips Bar */
.filter-chips-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-primary-50);
  border: 1px solid var(--color-primary-100);
  color: var(--color-primary-active);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  line-height: 1.4;
}

.filter-chip-remove {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary-hover);
  border-radius: 50%;
  width: 14px;
  height: 14px;
}
.filter-chip-remove:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--color-text-primary);
}

.filter-clear-all {
  font-size: 11px;
  color: var(--color-text-muted);
  cursor: pointer;
  text-decoration: underline;
  margin-left: 4px;
}
.filter-clear-all:hover {
  color: var(--color-alert-critical);
}

/* 2. Sortable Table Column Headers */
.th-sortable {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.th-sortable:hover {
  background-color: var(--color-border) !important;
  color: var(--color-text-primary) !important;
}
.sort-indicator {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 4px;
  opacity: 0.35;
  transition: opacity 0.15s ease, color 0.15s ease;
}
.th-sortable:hover .sort-indicator {
  opacity: 0.8;
}
.th-sortable.is-sorted .sort-indicator {
  opacity: 1;
  color: var(--color-primary);
}

/* Sticky Action Column on Small Screen Scroll */
.table-sticky-actions {
  position: sticky;
  right: 0;
  background: inherit;
  z-index: 5;
  box-shadow: -4px 0 6px -2px rgba(0, 0, 0, 0.05);
}

/* 3. Clinical Safety UX: Hard-Stop Interruption Barrier */
@keyframes critical-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.45);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(225, 29, 72, 0);
  }
}

.modal-critical-hardstop {
  border: 2px solid var(--color-alert-critical) !important;
  animation: critical-pulse 2s infinite ease-in-out;
}

.modal-critical-header {
  background-color: var(--color-alert-critical) !important;
  color: #ffffff !important;
  padding: 14px 18px;
}

.emergency-override-box {
  background: #FFF1F2;
  border: 1px solid #FECDD3;
  border-radius: var(--rounded-md);
  padding: 12px 14px;
  margin-top: 14px;
}

/* 4. Resilient Offline & Network Reconnect Banner */
.network-alert-banner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 999999;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.network-alert-banner.is-offline {
  background: #FEF3C7;
  color: #92400E;
  border-bottom: 1px solid #FCD34D;
}

.network-alert-banner.is-reconnected {
  background: #DCFCE7;
  color: #166534;
  border-bottom: 1px solid #86EFAC;
}

/* 5. Dual-Engine Printing Standardization */
@media print {
  .no-print, .topbar, .sidebar, .btn, .modal-backdrop {
    display: none !important;
  }
  
  .print-avoid-break {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  body.is-printing-formal-a4 {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt !important;
  }
}

/* Typography Utility Classes */
.text-display {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.text-title-lg {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.text-title-md {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.text-title-sm {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0em;
}

.text-body-regular {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}

.text-body-medium {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.text-body-bold {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.text-caption {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.text-micro {
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.text-code-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

/* Application Layout Structure */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.topbar {
  height: var(--topbar-height);
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
  z-index: 30;
  box-shadow: var(--shadow-level-1);
  gap: var(--space-3);
  white-space: nowrap;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text-primary);
  flex-shrink: 0;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0;
}

.topbar-brand:focus,
.topbar-brand:focus-visible,
.topbar-brand:active {
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.topbar-logo-mark {
  width: 34px;
  height: 34px;
  border-radius: var(--rounded-lg);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-active) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 2px 4px rgba(13, 148, 136, 0.25);
  flex-shrink: 0;
}

.brand-text-container {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.2;
}

.brand-tagline {
  font-size: 10px;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

.topbar-center {
  flex: 1 1 auto;
  max-width: 820px;
  min-width: 200px;
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.search-bar-trigger {
  width: 100%;
  height: 32px;
  background-color: var(--color-surface-sunken);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-md);
  padding: 0 var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.search-bar-trigger:hover {
  background-color: var(--color-surface);
  border-color: var(--color-primary);
}

.search-placeholder {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 12px;
  min-width: 0;
}

.search-placeholder span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kbd-shortcut {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--rounded-sm);
  color: var(--color-text-secondary);
  flex-shrink: 0;
  margin-left: var(--space-2);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* User Profile Avatar & Floating Dropdown SSOT */
.user-profile-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.user-avatar-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px 3px 4px;
  height: 34px;
  border-radius: var(--rounded-lg);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  box-sizing: border-box;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.user-avatar-btn:hover {
  background-color: var(--color-surface-sunken);
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-sm);
}

.user-avatar-circle {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-avatar-icon {
  width: 14px;
  height: 14px;
}

.user-status-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--color-success);
  border: 1.5px solid var(--color-surface);
}

.user-avatar-info {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  height: 32px;
  border-radius: var(--rounded-md);
  background-color: var(--color-surface-sunken);
  text-align: left;
}

.user-name-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-primary);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-avatar-btn .chevron-icon {
  transition: transform 0.15s ease;
}

.user-avatar-btn[aria-expanded="true"] .chevron-icon {
  transform: rotate(180deg);
}

/* Floating Dropdown Card */
.user-profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-lg);
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.12), 0 8px 10px -4px rgba(0, 0, 0, 0.06);
  padding: 12px;
  z-index: 1100;
  box-sizing: border-box;
}

.dropdown-user-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 10px;
}

.dropdown-avatar-large {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dropdown-avatar-large .icon-svg {
  width: 20px;
  height: 20px;
}

.dropdown-user-meta {
  min-width: 0;
  flex: 1;
}

.dropdown-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-role {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-brand {
  font-size: 10px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.dropdown-divider {
  height: 1px;
  background-color: var(--color-border);
  margin: 8px 0;
}

.dropdown-menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.dropdown-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--rounded-md);
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.dropdown-menu-item:hover {
  background-color: var(--color-surface-sunken);
  color: var(--color-primary);
}

.dropdown-menu-item .icon-svg {
  width: 15px;
  height: 15px;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.role-select-native {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  font-family: var(--font-sans) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--color-primary-active) !important;
  cursor: pointer !important;
  outline: none !important;
  padding: 0 2px !important;
  width: auto !important;
  height: auto !important;
  background-image: none !important;
  appearance: auto !important;
  -webkit-appearance: auto !important;
  -moz-appearance: auto !important;
}

.dropdown-menu-item:hover .icon-svg {
  color: var(--color-primary);
}

.dropdown-menu-item.role-item {
  cursor: default;
  align-items: flex-start;
}

.dropdown-menu-item.role-item:hover {
  background-color: transparent;
  color: inherit;
}

.dropdown-role-select {
  width: 100%;
  height: 28px;
  padding: 2px 8px;
  border-radius: var(--rounded-sm);
  border: 1px solid var(--color-border);
  background-color: var(--color-surface-sunken);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-primary);
  outline: none;
  cursor: pointer;
  transition: border-color 0.12s ease;
}

.dropdown-role-select:focus {
  border-color: var(--color-primary);
}

.dropdown-menu-item.item-danger {
  color: var(--color-alert-critical);
}

.dropdown-menu-item.item-danger .icon-svg {
  color: var(--color-alert-critical);
}

.dropdown-menu-item.item-danger:hover {
  background-color: rgba(225, 29, 72, 0.08);
  color: var(--color-alert-critical);
}

#system-status-pill {
  min-width: auto !important;
  height: 22px;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  flex-shrink: 0;
}

.app-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar Navigation */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  transition: width 0.2s ease;
}

.nav-section-title {
  padding: var(--space-3) var(--space-4) var(--space-1);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-text-subtle);
  letter-spacing: 0.05em;
}

.nav-menu {
  list-style: none;
  padding: var(--space-2) var(--space-2);
}

.nav-item {
  margin-bottom: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 9px var(--space-3);
  border-radius: var(--rounded-md);
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
}

.nav-link:hover {
  background-color: var(--color-surface-hover);
  color: var(--color-text-primary);
}

.nav-link.active {
  background-color: var(--color-primary-light);
  color: var(--color-primary-active);
  font-weight: 600;
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-svg {
  display: inline-block;
  vertical-align: -0.15em;
  width: 1em;
  height: 1em;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.icon-xs, .icon-svg-xs { width: 12px !important; height: 12px !important; }
.icon-sm, .icon-svg-sm { width: 14px !important; height: 14px !important; }
.icon-md, .icon-svg-md { width: 16px !important; height: 16px !important; }
.icon-lg, .icon-svg-lg { width: 20px !important; height: 20px !important; }
.icon-xl, .icon-svg-xl { width: 24px !important; height: 24px !important; }

/* ==========================================================================
   SSOT Filter & Control Bar Component (.filter-toolbar)
   Standardized Sunken Control Pill (Clean Clinical Density)
   ========================================================================== */
.filter-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3); /* 12px */
  flex-wrap: wrap;
  background-color: var(--color-surface-sunken); /* #F1F5F9 */
  padding: var(--space-3); /* 12px */
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-md); /* 6px */
  margin-bottom: var(--space-4); /* 16px */
}

.filter-toolbar-dense {
  padding: var(--space-2) var(--space-3); /* 8px 12px */
  margin-bottom: var(--space-3); /* 12px */
  gap: var(--space-2); /* 8px */
}

.filter-toolbar .search-input-wrapper {
  flex: 1;
  min-width: 220px;
}

/* ==========================================================================
   Page & View Headers (.view-header)
   SSOT Master Header Contract for Sagala Satwa
   ========================================================================== */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.view-header-title-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.view-header-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
  line-height: 26px;
  letter-spacing: -0.02em;
}

.view-header-subtitle {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 18px;
  margin: 0;
}

.view-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.card-table-body {
  padding: var(--space-4); /* 16px mutlak */
}

/* Main Content Stage */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
  background-color: var(--color-background);
}

/* Critical Medical Alert Banner */
.alert-banner-severe {
  background-color: var(--color-alert-critical-bg);
  border: 2px solid var(--color-alert-critical);
  border-radius: var(--rounded-md);
  padding: var(--space-3) var(--space-4);
  color: var(--color-alert-critical-text);
  box-shadow: 0 0 14px rgba(220, 38, 38, 0.2);
  margin-bottom: var(--space-5);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  animation: pulse-glow 3s infinite ease-in-out;
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 10px rgba(220, 38, 38, 0.15); }
  50% { box-shadow: 0 0 18px rgba(220, 38, 38, 0.35); }
  100% { box-shadow: 0 0 10px rgba(220, 38, 38, 0.15); }
}

.alert-banner-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.alert-banner-content {
  flex: 1;
}

.alert-banner-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 2px;
}

.alert-banner-body {
  font-size: 12px;
  line-height: 1.4;
}

/* Container Panels & Layout Cards (Pure White Canvas) */
.card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-lg);
  box-shadow: var(--shadow-level-1);
  margin-bottom: var(--space-4);
  overflow: hidden;
}

.card-header {
  padding: var(--space-3) var(--space-4);
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header .card-title,
.card-header .text-title-sm,
.card-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.35;
  margin: 0;
}

.card-header.sunken {
  background-color: var(--color-surface-sunken);
}

.card-body {
  padding: var(--space-4);
}

.card-footer {
  padding: var(--space-3) var(--space-4);
  background-color: var(--color-surface-sunken);
  border-top: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}

/* Table Card Footer Grounding Contract (SSOT Section 7.4) */
.card-footer.sunken {
  min-height: 48px;
  padding: 12px 20px;
  background-color: var(--color-surface-sunken);
  border-top: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}

.card-footer.sunken .footer-summary-text {
  color: var(--color-text-secondary);
  font-weight: 600;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* SSOT Card Widgets & KPI Cards (Abu-abu Slate-100 Konsisten seperti Screenshot) */
.kpi-card,
.metric-card,
.card-widget,
.sub-card,
.queue-kpi-card,
.role-kpi-card,
.pl-kpi-card,
.card-gray {
  background-color: var(--color-card-bg) !important;
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-md);
}

/* SSOT KPI Card Component & Color Accents */
.kpi-card {
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.kpi-card-primary, .kpi-primary { border-left: 4px solid var(--color-primary) !important; }
.kpi-card-success, .kpi-success { border-left: 4px solid #059669 !important; }
.kpi-card-warning, .kpi-warning { border-left: 4px solid #D97706 !important; }
.kpi-card-danger, .kpi-danger, .kpi-critical { border-left: 4px solid #DC2626 !important; }
.kpi-card-info, .kpi-info { border-left: 4px solid #2563EB !important; }
.kpi-card-purple, .kpi-purple { border-left: 4px solid #7C3AED !important; }
.kpi-card-secondary, .kpi-secondary { border-left: 4px solid var(--color-secondary) !important; }

/* KPI Card Typography */
.kpi-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  margin: 0;
}
.kpi-value, .kpi-val {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
  color: var(--color-text-primary);
}
.kpi-sub {
  font-size: 11px;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--control-height);
  min-height: var(--control-height);
  padding: 0 14px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--rounded-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
  box-sizing: border-box;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-primary-foreground);
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-primary:active {
  background-color: var(--color-primary-active);
}

.btn-secondary {
  background-color: var(--color-surface);
  color: var(--color-text-primary);
  border-color: var(--color-border-strong);
}

.btn-secondary:hover {
  background-color: var(--color-surface-hover);
  border-color: var(--color-text-secondary);
}

.btn-critical {
  background-color: var(--color-alert-critical);
  color: var(--color-text-inverse);
  border-color: var(--color-alert-critical);
}

.btn-critical:hover {
  background-color: var(--color-alert-critical-hover);
  border-color: var(--color-alert-critical-hover);
}

.btn-warning {
  background-color: #F59E0B;
  color: #FFFFFF;
  border-color: #D97706;
}

.btn-warning:hover {
  background-color: #D97706;
  border-color: #B45309;
}

.btn-success {
  background-color: #10B981;
  color: #FFFFFF;
  border-color: #059669;
}

.btn-success:hover {
  background-color: #059669;
  border-color: #047857;
}

.btn-danger {
  background-color: #EF4444;
  color: #FFFFFF;
  border-color: #DC2626;
}

.btn-danger:hover {
  background-color: #DC2626;
  border-color: #B91C1C;
}

.btn-ghost {
  background-color: transparent;
  color: var(--color-text-secondary);
  border-color: transparent;
}

.btn-ghost:hover {
  background-color: var(--color-surface-sunken);
  color: var(--color-text-primary);
  border-color: transparent;
}

.btn-ghost:active {
  background-color: var(--color-border);
}

.btn-outline,
.btn-outline-primary {
  background-color: var(--color-surface);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline:hover,
.btn-outline-primary:hover {
  background-color: var(--color-primary-subtle);
  border-color: var(--color-primary-hover);
  color: var(--color-primary-hover);
}

.btn-outline:active,
.btn-outline-primary:active {
  background-color: #d1fae5;
}

.btn-outline-danger {
  background-color: var(--color-surface);
  color: #DC2626;
  border-color: #DC2626;
}

.btn-outline-danger:hover {
  background-color: #FEF2F2;
  border-color: #B91C1C;
  color: #B91C1C;
}

.btn-outline-danger:active {
  background-color: #FEE2E2;
}

.btn-sm {
  height: var(--control-height-sm);
  min-height: var(--control-height-sm);
  padding: 0 10px;
  font-size: 12px;
}

.btn-xs {
  height: var(--control-height-xs);
  min-height: var(--control-height-xs);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--rounded-sm);
  line-height: 1;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* Modal Close & Icon-Only Button Standards (SSOT Chapter 4.3 - 4.5) */
.modal-close,
.btn-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--rounded-md);
  background: transparent;
  color: var(--color-text-muted);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-sizing: border-box;
  user-select: none;
}

.modal-close:hover,
.btn-close:hover {
  background-color: var(--color-surface-sunken);
  color: var(--color-text-primary);
  border-color: var(--color-border);
}

.modal-close:active,
.btn-close:active {
  background-color: var(--color-border);
  transform: scale(0.95);
}

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

.modal-close-inverse,
.modal-close-white {
  color: #ffffff !important;
}

.modal-close-inverse:hover,
.modal-close-white:hover {
  background-color: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
}

.modal-close-inverse:active,
.modal-close-white:active {
  background-color: rgba(255, 255, 255, 0.3) !important;
}

.modal-close-floating {
  position: absolute;
  top: -12px;
  right: -12px;
  background: #000000;
  color: #ffffff;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 20px;
  border: 2px solid #ffffff;
  box-shadow: var(--shadow-md);
  z-index: 10;
}

.modal-close-floating:hover {
  background: #1e293b;
  color: #ffffff;
  border-color: #ffffff;
}

.btn-close-sm,
.modal-close-sm {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  font-size: 18px;
}

.btn-close-xs,
.modal-close-xs {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  font-size: 16px;
}

/* Icon-Only Buttons (1:1 aspect ratio square hit target) */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--control-height);
  height: var(--control-height);
  min-width: var(--control-height);
  min-height: var(--control-height);
  padding: 0 !important;
  border-radius: var(--rounded-md);
  flex-shrink: 0;
}

.btn-icon.btn-sm {
  width: var(--control-height-sm);
  height: var(--control-height-sm);
  min-width: var(--control-height-sm);
  min-height: var(--control-height-sm);
  padding: 0 !important;
}

.btn-icon.btn-xs {
  width: var(--control-height-xs);
  height: var(--control-height-xs);
  min-width: var(--control-height-xs);
  min-height: var(--control-height-xs);
  padding: 0 !important;
}

/* Filter Chips & Segmented Buttons */
.filter-chip,
.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  height: var(--control-height-sm);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--rounded-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.filter-chip:hover,
.filter-btn:hover {
  background: var(--color-surface-sunken);
  color: var(--color-text-primary);
  border-color: var(--color-border-strong);
}

.filter-chip.active,
.filter-btn.active {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 700;
}

kbd, .kbd-shortcut {
  display: inline-block;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text-primary);
  background-color: var(--color-surface-sunken);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--rounded-sm);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}

/* Badges & Chips */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--rounded-full);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge-micro {
  font-size: 10px;
  font-weight: 700;
  padding: 1.5px 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--rounded-full);
}

.badge-pill {
  border-radius: var(--rounded-full);
}

.badge-success {
  background-color: var(--color-alert-success-bg);
  color: var(--color-alert-success-text);
  border-color: var(--color-alert-success-border);
}

.badge-warning {
  background-color: var(--color-alert-warning-bg);
  color: var(--color-alert-warning-text);
  border-color: var(--color-alert-warning-border);
}

.badge-critical,
.badge-danger {
  background-color: var(--color-alert-critical-bg);
  color: var(--color-alert-critical-text);
  border-color: var(--color-alert-critical-border);
}

.badge-info {
  background-color: var(--color-alert-info-bg);
  color: var(--color-alert-info-text);
  border-color: var(--color-alert-info-border);
}

.badge-primary {
  background-color: var(--color-primary-light);
  color: var(--color-primary-active);
  border-color: var(--color-primary);
}

.badge-secondary {
  background-color: var(--color-secondary-light);
  color: var(--color-secondary-foreground);
  border-color: var(--color-secondary);
}

.badge-purple {
  background-color: #F5F3FF;
  color: #6D28D9;
  border-color: #DDD6FE;
}

.badge-neutral {
  background-color: var(--color-surface-sunken);
  color: var(--color-text-secondary);
  border-color: var(--color-border);
}

.badge-pet-active {
  background-color: var(--color-alert-success-bg);
  color: var(--color-alert-success-text);
  border: 1px solid var(--color-alert-success-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1.5px 6px;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--rounded-full);
  white-space: nowrap;
}

.badge-pet-deceased {
  background-color: var(--color-alert-critical-bg);
  color: var(--color-alert-critical-text);
  border: 1px solid var(--color-alert-critical-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1.5px 6px;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--rounded-full);
  white-space: nowrap;
}

.badge-pet-inactive {
  background-color: var(--color-surface-sunken);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1.5px 6px;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--rounded-full);
  white-space: nowrap;
}

/* Form Elements & Inputs */
.form-group {
  margin-bottom: var(--space-3);
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.form-label.required::after {
  content: ' *';
  color: var(--color-alert-critical);
}

.form-label-optional,
.label-optional {
  font-size: 10px;
  font-weight: 400;
  color: var(--color-text-muted);
  margin-left: 4px;
}

.form-control,
input.form-control,
input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="search"],
input[type="email"],
input[type="password"] {
  width: 100%;
  height: var(--control-height);
  padding: 0 10px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--rounded-md);
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--color-text-primary);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

/* Standardized Dropdown (Select) Height based on Skala Prognosis (32px) */
select.form-control,
select.form-select,
.form-select,
.form-group select,
.modal-body select,
.soap-card select,
.card select,
.filter-group select,
select:not(.role-select-native) {
  width: 100%;
  height: var(--control-height);
  font-size: 13px;
  padding: 0 28px 0 10px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--rounded-md);
  font-family: var(--font-sans);
  color: var(--color-text-primary);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}

select option,
.form-control option,
.form-select option {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-primary);
  background-color: var(--color-surface);
  padding: 4px 8px;
}

.form-control-sm,
.form-select-sm,
select.form-control-sm,
input.form-control-sm {
  height: var(--control-height-sm);
  font-size: 12px;
  padding: 0 10px;
}

.form-control:focus,
.form-select:focus,
select.form-control:focus,
select:not(.role-select-native):focus,
input:focus,
textarea.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}

textarea.form-control {
  height: auto;
  min-height: 72px;
  padding: 8px var(--space-3);
  resize: vertical;
}

/* Data Tables & Universal Sticky Scroll Containers */
.data-table-wrapper,
.table-responsive {
  position: relative;
  width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-md);
  max-height: calc(100vh - 240px);
  min-height: auto;
  background: var(--color-surface);
}

.data-table,
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  color: var(--color-text-primary);
  text-align: left;
}

.data-table thead th,
.data-table th,
.table-compact th,
.table thead th,
.table th {
  position: sticky !important;
  top: 0 !important;
  z-index: 10 !important;
  background-color: var(--color-surface-sunken) !important;
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 0 var(--color-border);
  white-space: nowrap !important;
  vertical-align: middle;
}

.data-table thead th.table-sticky-actions,
.table thead th.table-sticky-actions {
  z-index: 15 !important;
}

/* SSOT: Table Action Column Optical Centering Contract (Section 12.8) */
.col-actions,
th.col-actions,
td.col-actions,
.data-table th.col-actions,
.data-table td.col-actions,
.table th.col-actions,
.table td.col-actions {
  width: 1% !important;
  white-space: nowrap !important;
  text-align: center !important;
  vertical-align: middle !important;
}

.action-btn-group,
.action-cell,
td.col-actions > div,
.data-table td.col-actions > div,
.table td.col-actions > div {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  vertical-align: middle !important;
}

.action-btn-group > *,
td.col-actions > div > *,
td.col-actions > button,
td.col-actions > a {
  margin: 0 !important;
}

.data-table td.col-nowrap,
.table td.col-nowrap,
.col-id,
.col-nowrap,
.text-code-mono {
  white-space: nowrap !important;
}

/* Custom Table Modules: Zero Text Wrapping on Headers */
.queue-table th,
.anesthesia-log-table th,
.lab-results-table th,
.fefo-allocation-table th {
  white-space: nowrap !important;
}

.data-table td .badge,
.table td .badge,
.table-compact td .badge,
.badge-status {
  min-width: 74px;
  justify-content: center;
  text-align: center;
}

.data-table td,
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border-subtle);
  vertical-align: middle;
  transition: background-color 0.12s ease;
}

.data-table tr:hover td,
.table-hover tr:hover td,
.table tr:hover td {
  background-color: var(--color-surface-hover);
}

.data-table tr:last-child td,
.table tr:last-child td {
  border-bottom: none;
}

/* Optimization Components: Pagination Bar & Offline Outbox */
.pagination-bar {
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--color-text-secondary);
  background-color: var(--color-surface-sunken);
  border-top: 1px solid var(--color-border);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.offline-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--rounded-full);
  background-color: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.offline-sync-badge:hover {
  opacity: 0.85;
}

/* Pet Table Identity Cluster (SSOT Polish) */
.pet-table-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pet-table-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: var(--rounded-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.pet-table-identity:hover .pet-table-avatar {
  transform: scale(1.05);
}

.pet-table-avatar.avatar-cat {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  border: 1px solid rgba(5, 150, 105, 0.25);
}

.pet-table-avatar.avatar-dog {
  background-color: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.pet-table-avatar.avatar-rabbit {
  background-color: #f3e8ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}

.pet-table-avatar.avatar-bird {
  background-color: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.pet-table-avatar.avatar-other {
  background-color: var(--color-surface-sunken);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.pet-table-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pet-table-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pet-table-name-link {
  font-weight: 700;
  font-size: 13px;
  color: var(--color-text-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
  cursor: pointer;
}

.pet-table-name-link:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.badge-sex-male {
  background-color: #e0f2fe !important;
  color: #0369a1 !important;
  border: 1px solid #bae6fd !important;
  font-weight: 700 !important;
}

.badge-sex-female {
  background-color: #fce7f3 !important;
  color: #be185d !important;
  border: 1px solid #fbcfe8 !important;
  font-weight: 700 !important;
}

/* Modal Dialog Component */
.modal-backdrop,
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  padding: var(--space-4);
  box-sizing: border-box;
}

.modal-backdrop.open,
.modal-overlay.open {
  display: flex !important;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-dialog,
.modal-container {
  background-color: var(--color-surface);
  border-radius: var(--rounded-lg);
  box-shadow: var(--shadow-level-4);
  width: 90%;
  max-width: 640px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-border);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s ease;
  box-sizing: border-box;
}

.modal-dialog.modal-sm, .modal-container.modal-sm { max-width: 480px; width: 92%; }
.modal-dialog.modal-md, .modal-container.modal-md { max-width: 640px; width: 92%; }
.modal-dialog.modal-lg, .modal-container.modal-lg { max-width: 980px; width: 94%; }
.modal-dialog.modal-xl, .modal-container.modal-xl { max-width: 1040px; width: 96%; }
.modal-dialog.modal-fullscreen-responsive, .modal-container.modal-fullscreen-responsive {
  max-width: 96vw;
  width: 96vw;
  height: 92vh;
  max-height: 92vh;
}

.form-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.form-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 768px) {
  .form-grid-2, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; }
}

.modal-backdrop.open .modal-dialog,
.modal-backdrop.open .modal-container,
.modal-overlay.open .modal-dialog,
.modal-overlay.open .modal-container {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 14px 24px;
  min-height: 56px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background-color: var(--color-surface);
  color: var(--color-text-primary);
}

.modal-header .modal-title,
.modal-header .text-title-sm,
.modal-header h3,
.modal-title {
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 1.3;
  margin: 0;
  color: var(--color-text-primary);
}

/* Modal Header Icon Badge (SSOT Section 9.1 Focal Accent Color Isolation) */
.modal-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: var(--rounded-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-icon-badge svg,
.modal-icon-badge .icon-svg {
  width: 18px;
  height: 18px;
}

/* Module Semantic Accent Variants */
.modal-icon-badge.module-hotel {
  background: #EEF2FF;
  color: #4F46E5;
}
.modal-icon-badge.module-grooming {
  background: #E0F2FE;
  color: #0284C7;
}
.modal-icon-badge.module-inpatient {
  background: #EFF6FF;
  color: #2563EB;
}
.modal-icon-badge.module-medical {
  background: #ECFDF5;
  color: #059669;
}
.modal-icon-badge.module-billing {
  background: #ECFDF5;
  color: #059669;
}
.modal-icon-badge.module-warning {
  background: #FEF3C7;
  color: #D97706;
}
.modal-icon-badge.module-danger {
  background: #FEE2E2;
  color: #DC2626;
}
.modal-icon-badge.module-system {
  background: #F1F5F9;
  color: #475569;
}

/* Module Themed Badges */
.badge.badge-module-hotel {
  background: #EEF2FF;
  color: #4F46E5;
  border: 1px solid #C7D2FE;
}
.badge.badge-module-grooming {
  background: #E0F2FE;
  color: #0284C7;
  border: 1px solid #BAE6FD;
}
.badge.badge-module-inpatient {
  background: #EFF6FF;
  color: #2563EB;
  border: 1px solid #BFDBFE;
}
.badge.badge-module-medical {
  background: #ECFDF5;
  color: #059669;
  border: 1px solid #A7F3D0;
}
.badge.badge-module-billing {
  background: #ECFDF5;
  color: #059669;
  border: 1px solid #A7F3D0;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(100vh - 160px);
}

.modal-footer {
  padding: 12px 24px;
  min-height: 64px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background-color: var(--color-surface-sunken);
  flex-shrink: 0;
}

.text-tabular {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.text-right {
  text-align: right;
}

/* Toast Notifications Container */
#toast-container {
  position: fixed;
  top: calc(var(--topbar-height) + 16px);
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 400px;
  padding: 12px 16px;
  border-radius: var(--rounded-md);
  font-size: 13px;
  box-shadow: var(--shadow-level-3);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background-color: var(--color-surface);
  border-left: 4px solid var(--color-border-strong);
  animation: toast-slide-in 0.25s ease-out;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

@keyframes toast-slide-in {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-success {
  border-left-color: var(--color-alert-success);
  background-color: #F0FDF4;
  color: #14532D;
}

.toast-error {
  border-left-color: var(--color-alert-critical);
  background-color: #FEF2F2;
  color: #7F1D1D;
}

.toast-warning {
  border-left-color: var(--color-alert-warning);
  background-color: #FFFBEB;
  color: #78350F;
}

.toast-info {
  border-left-color: var(--color-alert-info);
  background-color: #F0F9FF;
  color: #0C4A6E;
}

.btn-toast-action {
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid currentColor;
  color: inherit;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--rounded-sm);
  cursor: pointer;
  white-space: nowrap;
  margin-left: 6px;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.btn-toast-action:hover {
  background: currentColor;
  color: #FFFFFF;
}

.btn-loading {
  position: relative;
  pointer-events: none !important;
  opacity: 0.8;
}

.btn-loading .icon-svg {
  animation: spin 0.9s linear infinite;
}

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

/* Global Loading Spinner Overlay */
#global-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 3px;
  background-color: transparent;
  z-index: 99999;
  display: none;
}

#global-loader.active {
  display: block;
  background: linear-gradient(90deg, var(--color-primary) 0%, #38BDF8 50%, var(--color-primary) 100%);
  background-size: 200% 100%;
  animation: loading-bar 1.2s infinite linear;
}

@keyframes loading-bar {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ==========================================================================
   Story 1.4: Pet Profile Command Center & Sticky Medical Alert Banner
   ========================================================================== */

/* Sticky Critical Medical Alert Banner with Glowing Red Pulse */
@keyframes alertPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.65), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(248, 113, 113, 0), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(248, 113, 113, 0), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  }
}

@keyframes alertIconShake {
  0%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(-8deg); }
  20%, 40% { transform: rotate(8deg); }
  50% { transform: rotate(0deg); }
}

.alert-banner-severe {
  background-color: #FEE2E2;
  border: 2px solid #DC2626;
  border-radius: var(--rounded-lg);
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  animation: alertPulse 2s infinite ease-in-out;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: all 0.2s ease;
}

.alert-banner-severe .alert-banner-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
  animation: alertIconShake 2.5s infinite ease-in-out;
}

.alert-banner-severe .alert-banner-content {
  flex: 1;
}

.alert-banner-severe .alert-banner-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 14px;
  color: #991B1B;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-banner-severe .alert-banner-body {
  font-size: 13px;
  color: #7F1D1D;
  line-height: 1.5;
}

.alert-banner-severe .alert-banner-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-weight: 500;
}

/* Command Center Header Card */
.pet-command-header {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-xl);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-level-1);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pet-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.pet-identity-cluster {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pet-taxonomy-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--rounded-xl);
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(13, 148, 136, 0.2);
}

.pet-name-title {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 800;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pet-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pet-header-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 16px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border-subtle);
  font-size: 13px;
}

.pet-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pet-meta-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-text-muted);
  letter-spacing: 0.03em;
}

.pet-meta-value {
  color: var(--color-text-primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Health Snapshot Widgets (3 Cards) */
.prevention-widgets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.prevention-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-lg);
  padding: 16px;
  box-shadow: var(--shadow-level-1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.prevention-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-level-2);
}

.prevention-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.prevention-card-title {
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.prevention-dates {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--color-text-secondary);
  background: var(--color-surface-sunken);
  padding: 8px 10px;
  border-radius: var(--rounded-md);
}

/* Comprehensive Pet History Navigation with Sticky Header & Scroll Snap */
.pet-tabs-sticky-wrapper {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-surface);
  margin: -16px -20px 16px -20px;
  padding: 14px 20px 0 20px;
  border-bottom: 2px solid var(--color-border);
}

.pet-history-tabs-nav-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.pet-history-tabs-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.tabs-scroll-fade-right {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 2px;
  width: 32px;
  background: linear-gradient(to right, transparent, var(--color-surface));
  pointer-events: none;
  opacity: 0.9;
}

.pet-tab-btn {
  padding: 8px 14px;
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: var(--rounded-md) var(--rounded-md) 0 0;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s ease, background-color 0.15s ease;
  position: relative;
  scroll-snap-align: start;
  flex-shrink: 0;
}

.pet-tab-btn:hover {
  color: var(--color-primary);
  background-color: var(--color-surface-hover);
}

.pet-tab-btn.active {
  color: var(--color-primary);
  font-weight: 700;
}

.pet-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-primary);
  border-radius: 2px;
}

.tab-count-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--rounded-full);
  background: var(--color-surface-sunken);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.pet-tab-btn.active .tab-count-badge {
  background: var(--color-primary-light);
  color: var(--color-primary-active);
  border-color: var(--color-primary);
}

.tab-count-badge.has-items {
  background: var(--color-primary-light);
  color: var(--color-primary-active);
  border-color: var(--color-primary);
  font-weight: 800;
}

.pet-tab-panel {
  display: none;
}

.pet-tab-panel.active {
  display: block;
  animation: fadeInTab 0.2s ease-out;
}

@keyframes fadeInTab {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Medical Alert & Condition Lists in Profile */
.medical-badge-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.medical-record-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Responsive & Tablet Ergonomics */
@media (max-width: 1024px) {
  .sidebar {
    width: var(--sidebar-collapsed-width);
  }
  .sidebar .nav-text,
  .sidebar .nav-section-title {
    display: none;
  }
  .sidebar .nav-link {
    justify-content: center;
    padding: 12px;
  }
  .btn, .role-select-native {
    min-height: 44px; /* Touch target requirement */
  }
}

/* ==========================================================================
   Story 1.5: Audit Trail & Database Hardening Styles
   ========================================================================== */

/* Action Badges */
.badge-action-insert {
  background-color: #D1FAE5;
  color: #047857;
  border: 1px solid #A7F3D0;
  font-weight: 600;
}

.badge-action-update {
  background-color: #DBEAFE;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
  font-weight: 600;
}

.badge-action-delete,
.badge-action-void,
.badge-action-soft_delete,
.badge-action-soft-delete {
  background-color: #FEE2E2;
  color: #B91C1C;
  border: 1px solid #FECACA;
  font-weight: 600;
}

.badge-action-approve {
  background-color: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
  font-weight: 600;
}

/* Audit Log View Container & Toolbars */
#view-audit-log {
  display: none;
}

.audit-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--color-surface-sunken);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-md);
  margin-bottom: 16px;
}

.audit-filters-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.audit-filter-select,
.audit-filter-input {
  height: 34px;
  padding: 0 10px;
  font-family: var(--font-sans);
  font-size: 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--rounded-md);
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
}

.audit-filter-select:focus,
.audit-filter-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-light);
}

/* Database Integrity Status Panel */
.integrity-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.integrity-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.integrity-badge-healthy {
  background-color: #D1FAE5;
  color: #047857;
  border: 1px solid #A7F3D0;
  padding: 3px 8px;
  border-radius: var(--rounded-full);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.integrity-badge-warning {
  background-color: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
  padding: 3px 8px;
  border-radius: var(--rounded-full);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* JSON Diff Modal Styles */
.diff-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .diff-container {
    grid-template-columns: 1fr;
  }
}

.diff-box {
  background: #0F172A;
  border: 1px solid #334155;
  border-radius: var(--rounded-md);
  padding: 12px;
  overflow-x: auto;
  max-height: 380px;
}

.diff-box-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.diff-box-title.old {
  color: #F87171;
}

.diff-box-title.new {
  color: #34D399;
}

.diff-code {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: #E2E8F0;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
}

.audit-id-cell {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--color-primary-dark);
  font-size: 12px;
}

.audit-record-cell {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-secondary);
}

.admin-only {
  display: none;
}

/* ==========================================================================
   Live Queue Board & Sequential Ticket Management Styles (Story 2.1)
   ========================================================================== */
.queue-board-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.queue-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.queue-kpi-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.queue-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.queue-kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.queue-kpi-val {
  font-size: 24px;
  font-weight: 800;
  font-family: var(--font-sans);
  color: var(--color-text-primary);
  line-height: 1.1;
}

.queue-ticket-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: var(--rounded-sm);
  background: var(--color-primary-light);
  color: var(--color-primary-active);
  border: 1px solid var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  line-height: 1.2;
  box-sizing: border-box;
}

.queue-actions-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.queue-actions-group .btn {
  flex-shrink: 0;
}

/* Priority Level Badges */
.badge-priority-emergency {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #DC2626;
  font-weight: 800;
  animation: pulse-emergency 1.5s infinite;
}

@keyframes pulse-emergency {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(220, 38, 38, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
  }
}

.badge-priority-urgent {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #F59E0B;
  font-weight: 700;
}

.badge-priority-routine {
  background: #E0F2FE;
  color: #0369A1;
  border: 1px solid #0284C7;
  font-weight: 600;
}

.badge-priority-minor {
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #CBD5E1;
  font-weight: 600;
}

.badge-priority-elective {
  background: #F3E8FF;
  color: #6B21A8;
  border: 1px solid #A855F7;
  font-weight: 600;
}

/* Queue Status Badges */
.badge-queue-waiting {
  background: #DBEAFE;
  color: #1E40AF;
  border: 1px solid #3B82F6;
  font-weight: 700;
}

.badge-queue-called {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #F59E0B;
  font-weight: 700;
  animation: pulse-called 1.8s infinite;
}

@keyframes pulse-called {
  0% { background: #FEF3C7; }
  50% { background: #FDE68A; }
  100% { background: #FEF3C7; }
}

.badge-queue-in-consultation {
  background: #F3E8FF;
  color: #7E22CE;
  border: 1px solid #A855F7;
  font-weight: 700;
}

.badge-queue-completed {
  background: #DCFCE7;
  color: #15803D;
  border: 1px solid #22C55E;
  font-weight: 700;
}

.badge-queue-skipped {
  background: #F1F5F9;
  color: #64748B;
  border: 1px solid #CBD5E1;
  font-weight: 600;
}

/* Waiting Duration Telemetry */
.timer-waiting {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: var(--rounded-sm);
  background: var(--color-surface-sunken);
  color: var(--color-text-secondary);
}

.timer-waiting.warning {
  background: #FFFBEB;
  color: #B45309;
}

.timer-waiting.danger {
  background: #FEF2F2;
  color: #B91C1C;
  font-weight: 700;
}

.queue-table th {
  white-space: nowrap;
}

.queue-table td {
  vertical-align: middle;
}

/* Story 2.2: Nurse Triage & Vital Signs Telemetry Styles */
.badge-hypothermia {
  background: #DBEAFE;
  color: #1E40AF;
  border: 1px solid #3B82F6;
  font-weight: 700;
}

.badge-normal {
  background: #DCFCE7;
  color: #166534;
  border: 1px solid #22C55E;
  font-weight: 600;
}

.badge-fever {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #F59E0B;
  font-weight: 700;
}

.badge-severe-pyrexia {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #EF4444;
  font-weight: 800;
  animation: pulse-pyrexia 1.5s infinite;
}

@keyframes pulse-pyrexia {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.badge-triage-complete {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #3B82F6;
  font-weight: 700;
}

/* Touch-optimized button and segmented controls for tablet (>= 44x44px) */
.btn-touch {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--rounded-md);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}

.triage-segmented-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-segmented {
  min-width: 44px;
  min-height: 44px;
  padding: 8px 12px;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  color: var(--color-text-primary);
  border-radius: var(--rounded-md);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.btn-segmented:hover {
  border-color: var(--color-primary);
  background: var(--color-surface-hover);
}

.btn-segmented.active {
  background: var(--color-primary);
  color: #FFFFFF;
  border-color: #0F766E;
  box-shadow: 0 2px 4px rgba(13, 148, 136, 0.25);
  font-weight: 700;
}

.triage-score-desc {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 6px;
  padding: 6px 10px;
  background: var(--color-surface-sunken);
  border-radius: var(--rounded-sm);
  border-left: 3px solid var(--color-primary);
}

.triage-temp-feedback {
  margin-top: 6px;
  padding: 8px 12px;
  border-radius: var(--rounded-md);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

/* ==========================================================================
   VISUAL TELEMETRY, INTERACTIVE BCS 1-9 & CSU PAIN METER (Story 2.2 & UX Optimizations)
   ========================================================================== */

/* 1. Body Condition Score (WSAVA 1-9) Visual Cards & Category Zones */
.bcs-zone-legend {
  display: grid;
  grid-template-columns: 3fr 2fr 2fr 2fr;
  gap: 6px;
  margin-bottom: 8px;
}

.bcs-zone-pill {
  padding: 4px 6px;
  border-radius: var(--rounded-xs);
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  user-select: none;
}

.bcs-zone-under {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.bcs-zone-ideal {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.bcs-zone-over {
  background: #ffedd5;
  color: #9a3412;
  border: 1px solid #fed7aa;
}

.bcs-zone-obese {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.bcs-grid-container {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 6px;
  margin: 6px 0;
}

@media (max-width: 768px) {
  .bcs-grid-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

.btn-segmented.bcs-card {
  flex-direction: column;
  padding: 6px 4px;
  min-width: 0;
  min-height: 52px;
  justify-content: center;
  align-items: center;
  text-align: center;
  border-radius: var(--rounded-md);
  position: relative;
  overflow: hidden;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  gap: 2px;
}

.btn-segmented.bcs-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px -2px rgba(0, 0, 0, 0.1);
}

.bcs-card-num {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-primary);
}

.bcs-card-label {
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  color: var(--color-text-secondary);
}

/* BCS Semantic Cluster Styling */
.btn-segmented.bcs-card[data-zone="under"]:hover {
  border-color: #f59e0b;
}
.btn-segmented.bcs-card[data-zone="under"].active {
  background: #fffbeb !important;
  color: #92400e !important;
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3) !important;
}
.btn-segmented.bcs-card[data-zone="under"].active .bcs-card-num,
.btn-segmented.bcs-card[data-zone="under"].active .bcs-card-label {
  color: #b45309 !important;
}

.btn-segmented.bcs-card[data-zone="ideal"]:hover {
  border-color: #059669;
}
.btn-segmented.bcs-card[data-zone="ideal"].active {
  background: #ecfdf5 !important;
  color: #065f46 !important;
  border-color: #059669 !important;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.3) !important;
}
.btn-segmented.bcs-card[data-zone="ideal"].active .bcs-card-num,
.btn-segmented.bcs-card[data-zone="ideal"].active .bcs-card-label {
  color: #059669 !important;
}

.btn-segmented.bcs-card[data-zone="over"]:hover {
  border-color: #ea580c;
}
.btn-segmented.bcs-card[data-zone="over"].active {
  background: #fff7ed !important;
  color: #9a3412 !important;
  border-color: #ea580c !important;
  box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.3) !important;
}
.btn-segmented.bcs-card[data-zone="over"].active .bcs-card-num,
.btn-segmented.bcs-card[data-zone="over"].active .bcs-card-label {
  color: #c2410c !important;
}

.btn-segmented.bcs-card[data-zone="obese"]:hover {
  border-color: #dc2626;
}
.btn-segmented.bcs-card[data-zone="obese"].active {
  background: #fef2f2 !important;
  color: #991b1b !important;
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.3) !important;
}
.btn-segmented.bcs-card[data-zone="obese"].active .bcs-card-num,
.btn-segmented.bcs-card[data-zone="obese"].active .bcs-card-label {
  color: #dc2626 !important;
}

/* 2. Interactive Pain Scale (CSU 0-4) Visual Meter & Expression Cards */
.pain-meter-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 6px 0;
}

.pain-gauge-wrapper {
  position: relative;
  padding: 8px 4px;
}

.pain-gauge-track {
  height: 8px;
  width: 100%;
  border-radius: 9999px;
  background: linear-gradient(to right, #10b981 0%, #0ea5e9 25%, #f59e0b 50%, #ea580c 75%, #ef4444 100%);
  position: relative;
  display: flex;
  align-items: center;
}

.pain-gauge-indicator {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  margin: 0;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #10b981;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -50%);
  transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease;
  pointer-events: none;
}

.pain-card-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

@media (max-width: 640px) {
  .pain-card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.btn-segmented.pain-card {
  flex-direction: column;
  padding: 8px 6px;
  min-height: 54px;
  justify-content: center;
  align-items: center;
  text-align: center;
  border-radius: var(--rounded-md);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  gap: 3px;
}

.btn-segmented.pain-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px -2px rgba(0, 0, 0, 0.1);
}

.pain-card-score {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-primary);
}

.pain-card-label {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  color: var(--color-text-secondary);
}

/* Pain Level Semantic Active States */
.btn-segmented.pain-card[data-pain="0"].active {
  background: #ecfdf5 !important;
  color: #065f46 !important;
  border-color: #10b981 !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3) !important;
}
.btn-segmented.pain-card[data-pain="0"].active .pain-card-score,
.btn-segmented.pain-card[data-pain="0"].active .pain-card-label {
  color: #059669 !important;
}

.btn-segmented.pain-card[data-pain="1"].active {
  background: #f0f9ff !important;
  color: #0369a1 !important;
  border-color: #0ea5e9 !important;
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.3) !important;
}
.btn-segmented.pain-card[data-pain="1"].active .pain-card-score,
.btn-segmented.pain-card[data-pain="1"].active .pain-card-label {
  color: #0284c7 !important;
}

.btn-segmented.pain-card[data-pain="2"].active {
  background: #fffbeb !important;
  color: #92400e !important;
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3) !important;
}
.btn-segmented.pain-card[data-pain="2"].active .pain-card-score,
.btn-segmented.pain-card[data-pain="2"].active .pain-card-label {
  color: #b45309 !important;
}

.btn-segmented.pain-card[data-pain="3"].active {
  background: #fff7ed !important;
  color: #9a3412 !important;
  border-color: #ea580c !important;
  box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.3) !important;
}
.btn-segmented.pain-card[data-pain="3"].active .pain-card-score,
.btn-segmented.pain-card[data-pain="3"].active .pain-card-label {
  color: #c2410c !important;
}

.btn-segmented.pain-card[data-pain="4"].active {
  background: #fef2f2 !important;
  color: #991b1b !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3) !important;
}
.btn-segmented.pain-card[data-pain="4"].active .pain-card-score,
.btn-segmented.pain-card[data-pain="4"].active .pain-card-label {
  color: #dc2626 !important;
}

/* 3. Smart Vital Alerts & Telemetry Badges */
.vital-smart-alert-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--rounded-md);
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
  line-height: 1.4;
}

.vital-smart-alert-banner.critical {
  background: #fff1f2;
  border: 1.5px solid #fecdd3;
  color: #9f1239;
  animation: vitalPulseCritical 2s infinite ease-in-out;
}

.vital-smart-alert-banner.warning {
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  color: #92400e;
}

.vital-metric-badge {
  font-size: 10px !important;
  font-weight: 700 !important;
  border-radius: var(--rounded-full) !important;
  padding: 1.5px 6px !important;
  letter-spacing: 0.02em;
  text-transform: uppercase !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
  width: fit-content;
  margin-top: 2px;
}

.soap-metric-card.critical {
  background: #fff1f2 !important;
  border-color: #fecdd3 !important;
  animation: vitalCardPulseCritical 2.5s infinite ease-in-out;
}

.soap-metric-card.warning {
  background: #fffbeb !important;
  border-color: #fde68a !important;
}

@keyframes vitalPulseCritical {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
  }
}

@keyframes vitalCardPulseCritical {
  0%, 100% {
    border-color: #fecdd3;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3);
  }
  50% {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
  }
}


/* Story 2.3: Clinical SOAP Consultation Workspace & Sticky Segmented Tabs */
.soap-tab-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--color-surface);
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-md);
  margin-bottom: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: var(--shadow-sm);
}

.soap-tab-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.soap-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--rounded-md);
  cursor: pointer;
  transition: all 0.15s ease;
  height: var(--control-height-sm);
  min-height: var(--control-height-sm);
  white-space: nowrap;
}

.soap-tab-btn.btn-secondary {
  background-color: var(--color-surface);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-strong);
}

.soap-tab-btn.btn-secondary:hover {
  background-color: var(--color-surface-hover);
  border-color: var(--color-text-secondary);
}

.soap-tab-btn.btn-primary,
.soap-tab-btn.active {
  background-color: var(--color-primary) !important;
  color: #ffffff !important;
  border-color: var(--color-primary) !important;
  font-weight: 600;
  box-shadow: none;
}

.soap-tab-btn.btn-primary .badge-micro,
.soap-tab-btn.active .badge-micro {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

.soap-tab-panel {
  display: none;
}

.soap-tab-panel.active {
  display: block;
}

.soap-grid.show-all .soap-tab-panel {
  display: block !important;
}

/* Outpatient Consultation View Filter Tabs */
.vet-filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--color-surface-sunken);
  padding: 3px;
  border-radius: var(--rounded-md);
  border: 1px solid var(--color-border);
}

.vet-filter-btn {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--rounded-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  height: var(--control-height-sm);
}

.vet-filter-btn:hover {
  color: var(--color-text-primary);
}

.vet-filter-btn.active {
  background: #ffffff;
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

.soap-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.soap-quadrant-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}

.soap-quadrant-card:hover {
  box-shadow: var(--shadow-md);
}

.soap-quadrant-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--color-surface-sunken);
  border-bottom: 1px solid var(--color-border);
}

.soap-quadrant-badge {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: var(--rounded-sm);
  text-transform: uppercase;
}

.badge-soap-s {
  background: rgba(13, 148, 136, 0.15);
  color: #0F766E;
  border: 1px solid rgba(13, 148, 136, 0.4);
}

.badge-soap-o {
  background: rgba(59, 130, 246, 0.15);
  color: #1D4ED8;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.badge-soap-a {
  background: rgba(245, 158, 11, 0.15);
  color: #B45309;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-soap-p {
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.soap-quadrant-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.soap-metric-card {
    background: var(--color-bg-secondary, #f1f5f9) !important;
    background-color: var(--color-bg-secondary, #f1f5f9) !important;
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-md);
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: var(--shadow-xs);
  transition: all 0.15s ease;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.soap-metric-label {
  font-size: 11px;
  color: var(--color-text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.soap-metric-val {
  font-size: 16px !important;
  font-weight: 700;
  color: var(--color-text-primary);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.soap-kbd {
  display: inline-block;
  padding: 2px 5px;
  font-size: 10px;
  font-family: var(--font-mono);
  line-height: 1;
  color: var(--color-text-primary);
  background-color: var(--color-surface-sunken);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.15);
}

/* ==========================================================================
   20-Organ Physical Examination Matrix & Master Diagnoses (Story 2.4)
   ========================================================================== */
.triage-layout-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-card-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-lg);
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.form-card-section:last-child {
  margin-bottom: 0;
}

.rx-calc-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: var(--rounded-md);
  background-color: var(--color-primary-light);
  color: var(--color-primary-active);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(13, 148, 136, 0.2);
}

.form-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.organ-matrix-wrapper {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-lg);
  padding: 12px;
  max-height: 440px;
  overflow-y: auto;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.organ-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 12px;
}

@media (max-width: 768px) {
  .organ-grid {
    grid-template-columns: 1fr;
  }
}

.organ-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-md);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.15s ease;
}

.organ-card.organ-card-abnormal {
  background: #FEF2F2;
  border-color: #FECACA;
}

.organ-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.organ-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: normal;
  line-height: 1.35;
}

.organ-card-abnormal .organ-title {
  color: #991B1B;
  font-weight: 700;
}

.organ-toggle-group {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.btn-organ-toggle {
  border: 1px solid var(--color-border);
  background: var(--color-surface-sunken);
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  min-width: 32px;
  text-align: center;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
}

.btn-organ-toggle:hover {
  background: var(--color-surface);
  color: var(--color-text-primary);
}

.btn-organ-toggle.active-n {
  background: #ECFDF5;
  color: #065F46;
  border-color: #A7F3D0;
  box-shadow: 0 1px 2px rgba(6, 95, 70, 0.1);
}

.btn-organ-toggle.active-ab {
  background: #FEF2F2;
  color: #991B1B;
  border-color: #FECACA;
  box-shadow: 0 1px 2px rgba(153, 27, 27, 0.1);
}

.btn-organ-toggle.active-ne {
  background: #F1F5F9;
  color: #475569;
  border-color: #CBD5E1;
}

.organ-anomaly-drawer {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed #FECACA;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.organ-anomaly-input {
  width: 100%;
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid #FCA5A5;
  border-radius: var(--rounded-sm);
  background: #FFFFFF;
  color: #7F1D1D;
  outline: none;
}

.organ-anomaly-input:focus {
  border-color: var(--color-alert-red);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

.organ-anomaly-input.is-invalid {
  border-color: #DC2626;
  background: #FFF1F2;
}

.organ-anomaly-label {
  font-size: 10px;
  font-weight: 700;
  color: #DC2626;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* SOAP Prescription Input Row Compact Layout */
.soap-rx-row-compact {
  display: grid;
  grid-template-columns: 1.4fr 1.1fr 1.8fr 85px 80px;
  gap: 8px;
  margin-bottom: 8px;
  align-items: flex-end;
}

@media (max-width: 900px) {
  .soap-rx-row-compact {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .soap-rx-row-compact {
    grid-template-columns: 1fr 1fr;
  }
}

/* Story 2.5: Medical Finalization & Permanent Locking */
.finalize-alert-box {
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: var(--rounded-md);
  padding: 12px 14px;
}

.badge-locked-final {
  background: #DC2626 !important;
  color: #FFFFFF !important;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.form-soap-locked input:disabled,
.form-soap-locked textarea:disabled,
.form-soap-locked select:disabled {
  background-color: var(--color-surface-sunken) !important;
  color: var(--color-text-secondary) !important;
  cursor: not-allowed !important;
  border-color: var(--color-border) !important;
}

/* Story 3.1: Surgical Records & Serial Anesthesia Monitoring */
.surgery-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-lg);
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.15s ease-in-out;
}

.surgery-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.anesthesia-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.anesthesia-log-table th {
  background: var(--color-surface-sunken);
  color: var(--color-text-secondary);
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  white-space: nowrap;
}

.anesthesia-log-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--color-border-subtle);
  vertical-align: middle;
}

.anesthesia-log-table input.form-control-xs,
.anesthesia-log-table select.form-control-xs {
  font-size: 12px;
  padding: 4px 6px;
  height: 28px;
  border-radius: var(--rounded-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-primary);
}

.anesthesia-log-table input.form-control-xs:focus,
.anesthesia-log-table select.form-control-xs:focus {
  border-color: var(--color-primary);
  outline: none;
}

.badge-procedure {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--rounded-sm);
  background: #E0F2FE;
  color: #0369A1;
}

.badge-asa {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--rounded-xs);
  background: #FEF3C7;
  color: #92400E;
}

.badge-steril-done {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1.5px 8px;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--rounded-full);
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-steril-intact {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1.5px 8px;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--rounded-full);
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #CBD5E1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Story 3.3: Vaccination Tracker & Certificate Styles */
.vaccine-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-lg);
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.15s ease-in-out;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vaccine-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.vaccine-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.vaccine-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vaccine-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.vaccine-badge-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.badge-vac-uptodate {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
  font-weight: 700;
  font-size: 10px;
  border-radius: var(--rounded-full);
  padding: 1.5px 8px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.badge-vac-duesoon {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
  font-weight: 700;
  font-size: 10px;
  border-radius: var(--rounded-full);
  padding: 1.5px 8px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.badge-vac-due {
  background: #FFEDD5;
  color: #C2410C;
  border: 1px solid #FED7AA;
  font-weight: 700;
  font-size: 10px;
  border-radius: var(--rounded-full);
  padding: 1.5px 8px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.badge-vac-overdue {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FECACA;
  font-weight: 700;
  font-size: 10px;
  border-radius: var(--rounded-full);
  padding: 1.5px 8px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.vaccine-meta-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  background: var(--color-surface-sunken);
  padding: 8px 12px;
  border-radius: var(--rounded-md);
  font-size: 12px;
}

.vaccine-meta-item {
  display: flex;
  flex-direction: column;
}

.vaccine-meta-label {
  color: var(--color-text-muted);
  font-size: 10px;
  text-transform: uppercase;
}

.vaccine-meta-val {
  font-weight: 600;
  color: var(--color-text-secondary);
}

/* Story 3.4: Deworming & Parasite Control Styles */
.parasite-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-lg);
  padding: 14px 16px;
  margin-bottom: 12px;
  transition: all 0.15s ease-in-out;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.parasite-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.parasite-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.parasite-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.parasite-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.parasite-badge-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.parasite-meta-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  background: var(--color-surface-sunken);
  padding: 8px 12px;
  border-radius: var(--rounded-md);
  font-size: 12px;
}

.parasite-meta-item {
  display: flex;
  flex-direction: column;
}

.parasite-meta-label {
  color: var(--color-text-muted);
  font-size: 10px;
  text-transform: uppercase;
}

.parasite-meta-val {
  font-weight: 600;
  color: var(--color-text-secondary);
}

/* Compliance status badges for Deworming and Parasite Control */
.badge-compliance-uptodate {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
  font-weight: 700;
  font-size: 11px;
}

.badge-compliance-duesoon {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
  font-weight: 700;
  font-size: 11px;
}

.badge-compliance-due {
  background: #FFEDD5;
  color: #C2410C;
  border: 1px solid #FED7AA;
  font-weight: 700;
  font-size: 11px;
}

.badge-compliance-overdue {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FECACA;
  font-weight: 700;
  font-size: 11px;
}

.badge-compliance-never {
  background: #F1F5F9;
  color: #64748B;
  border: 1px solid #CBD5E1;
  font-weight: 700;
  font-size: 11px;
}

/* Print Rules for Vaccination Certificate */
@media print {
  body * {
    visibility: hidden;
  }
  #modal-vaccination-certificate,
  #modal-vaccination-certificate * {
    visibility: visible;
  }
  #modal-vaccination-certificate {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: #ffffff !important;
    display: block !important;
    z-index: 999999;
  }
  #modal-vaccination-certificate .no-print {
    display: none !important;
  }
  #modal-vaccination-certificate .modal-dialog {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }
}

/* Print Rules for Patient Medical ID Card (Smart Health Pass) */
@media print {
  #modal-print-pet-card,
  #modal-print-pet-card * {
    visibility: visible !important;
  }
  #modal-print-pet-card {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: #ffffff !important;
    display: block !important;
    z-index: 999999;
  }
  #modal-print-pet-card .modal-header,
  #modal-print-pet-card .modal-footer,
  #modal-print-pet-card .no-print {
    display: none !important;
  }
  #modal-print-pet-card .modal-dialog {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }
}

/* Diagnostic Lab & Imaging Management (Story 3.5) */
.badge-lab-normal {
  background: #DCFCE7;
  color: #166534;
  border: 1px solid #BBF7D0;
  font-weight: 700;
  font-size: 11px;
}

.badge-lab-high {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FECACA;
  font-weight: 800;
  font-size: 11px;
}

.badge-lab-low {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
  font-weight: 800;
  font-size: 11px;
}

.badge-lab-abnormal {
  background: #FEE2E2;
  color: #B91C1C;
  border: 1px solid #FCA5A5;
  font-weight: 800;
  font-size: 11px;
}

.lab-order-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-lg);
  padding: 14px 16px;
  margin-bottom: 14px;
  transition: all 0.2s ease;
}

.lab-order-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.lab-results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 10px;
}

.lab-results-table th {
  background: var(--color-surface-sunken);
  color: var(--color-text-secondary);
  font-weight: 700;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid var(--color-border);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.lab-results-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.lab-results-table tr:hover td {
  background: rgba(13, 148, 136, 0.03);
}

.imaging-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.imaging-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-lg);
  overflow: hidden;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.imaging-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.imaging-thumb-container {
  width: 100%;
  height: 140px;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.imaging-thumb-container img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.imaging-thumb-container:hover img {
  transform: scale(1.05);
}

.imaging-card-body {
  padding: 10px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.param-input-row {
  display: grid;
  grid-template-columns: 2fr 1.5fr 2fr 1fr 2fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  padding: 6px 8px;
  background: var(--color-surface-sunken);
  border-radius: var(--rounded-md);
  border: 1px solid var(--color-border);
}

/* Tablet & Touchscreen Ergonomics (Pointer: Coarse) */
@media (pointer: coarse) {
  .btn {
    min-height: 42px;
    height: 42px;
    padding: 0 16px;
    font-size: 14px;
  }
  .btn-sm {
    min-height: 38px;
    height: 38px;
    padding: 0 14px;
    font-size: 13px;
  }
  .btn-xs {
    min-height: 34px;
    height: 34px;
    padding: 0 12px;
    font-size: 12px;
  }
  .pet-tab-btn {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 13px;
  }
  .nav-link {
    min-height: 44px;
    padding: 10px 14px;
  }
  .form-control, .form-select {
    min-height: 42px;
    font-size: 14px;
  }
  .queue-actions-group {
    gap: 8px;
  }
  .modal-close {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }
  .tab-count-badge {
    padding: 2px 7px;
    font-size: 11px;
  }
}

/* Story 4.1: Doctor e-Prescription & Pharmacy Formulary Autocomplete */
.rx-composer-section {
  position: relative;
}

.rx-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 250px;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-md);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  z-index: 1050;
}

.rx-autocomplete-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.15s ease;
}

.rx-autocomplete-item:hover {
  background-color: var(--color-surface-sunken);
}

.rx-autocomplete-item.out-of-stock {
  opacity: 0.7;
  background-color: #FEF2F2;
}

.rx-autocomplete-item.out-of-stock:hover {
  background-color: #FEE2E2;
}

.pet-prescription-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-lg);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.pet-prescription-header {
  padding: 12px 16px;
  background: var(--color-surface-sunken);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pharmacy-queue-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-lg);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease;
}

.pharmacy-queue-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

/* Story 4.2: Pencegahan Interaktif Kontraindikasi Alergi Obat */
@keyframes alert-vibrate {
  0% { transform: translate(0, 0) rotate(0deg); }
  20% { transform: translate(-2px, 1px) rotate(-1deg); }
  40% { transform: translate(2px, -1px) rotate(1deg); }
  60% { transform: translate(-1px, -1px) rotate(0deg); }
  80% { transform: translate(1px, 1px) rotate(1deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes alert-pulse-glow {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5); }
  70% { box-shadow: 0 0 0 12px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

.modal-allergy-emergency .modal-header {
  background-color: #DC2626 !important;
  color: #FFFFFF !important;
  border-bottom: none;
}

.modal-allergy-emergency .modal-header .modal-title {
  color: #FFFFFF !important;
  font-weight: 700;
}

.modal-allergy-emergency .modal-header .modal-close {
  color: #FFFFFF !important;
  opacity: 0.85;
}
.modal-allergy-emergency .modal-header .modal-close:hover {
  opacity: 1;
}

.allergy-vibrate-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-color: #FEE2E2;
  color: #DC2626;
  animation: alert-vibrate 0.6s infinite ease-in-out, alert-pulse-glow 1.5s infinite;
  margin-bottom: 12px;
}

.allergy-warning-box {
  background-color: #FEF2F2;
  border: 1px solid #F87171;
  border-radius: var(--rounded-lg);
  padding: 14px 16px;
  margin-bottom: 16px;
  color: #991B1B;
}

.allergy-override-accordion {
  border: 1px solid #FCA5A5;
  border-radius: var(--rounded-md);
  background-color: #FFF5F5;
  margin-top: 14px;
  overflow: hidden;
}

.allergy-override-header {
  padding: 10px 14px;
  background-color: #FEE2E2;
  color: #991B1B;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  font-size: 13px;
}

.allergy-override-header:hover {
  background-color: #FECACA;
}

.allergy-override-body {
  padding: 14px;
  border-top: 1px solid #FCA5A5;
  background-color: #FFFDFD;
}

.btn-emergency-override {
  background-color: #DC2626;
  color: #FFFFFF;
  border: 1px solid #B91C1C;
  font-weight: 600;
}
.btn-emergency-override:hover:not(:disabled) {
  background-color: #B91C1C;
  color: #FFFFFF;
}
.btn-emergency-override:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.allergy-override-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FCA5A5;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* ==========================================================================
   Story 4.3: FEFO Dispensing & Prescription Label Printing Styles
   ========================================================================== */

.pharmacy-queue-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-lg);
  padding: 14px 16px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.pharmacy-queue-card:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-md);
}

.fefo-item-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-md);
  padding: 12px 14px;
  margin-bottom: 10px;
}

.fefo-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.fefo-allocation-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 6px;
}

.fefo-allocation-table th {
  background: var(--color-surface-sunken);
  color: var(--color-text-secondary);
  font-weight: 600;
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--color-border);
}

.fefo-allocation-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--color-border-subtle);
}

.fefo-batch-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #EFF6FF;
  color: #1E40AF;
  border: 1px solid #BFDBFE;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 600;
}

.fefo-split-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
}

/* Thermal & Sticker Label Card Styles */
.rx-label-print-area {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rx-label-card {
  background: #FFFFFF;
  color: #111827;
  border: 2px dashed #9CA3AF;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  font-family: var(--font-sans);
  line-height: 1.4;
  position: relative;
}

.rx-label-header {
  text-align: center;
  border-bottom: 1.5px solid #111827;
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.rx-label-brand {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #0F172A;
  text-transform: uppercase;
}

.rx-label-subbrand {
  font-size: 10px;
  color: #4B5563;
  margin-top: 2px;
}

.rx-label-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 8px;
  border-bottom: 1px solid #E5E7EB;
  padding-bottom: 6px;
}

.rx-label-patient {
  font-size: 12px;
  margin-bottom: 8px;
  background: #F9FAFB;
  padding: 6px 8px;
  border-radius: 4px;
}

.rx-label-medicine {
  border-left: 3px solid var(--color-primary);
  padding-left: 8px;
  margin-bottom: 10px;
}

.rx-label-medname {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}

.rx-label-batch {
  font-size: 11px;
  font-family: var(--font-mono);
  color: #4B5563;
  margin-top: 2px;
}

.rx-label-instruction {
  background: #FEF9C3;
  border: 1px solid #FDE047;
  border-radius: 4px;
  padding: 8px 10px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #713F12;
}

.rx-label-footer {
  text-align: center;
  font-size: 10px;
  color: #6B7280;
  border-top: 1px solid #E5E7EB;
  padding-top: 6px;
  margin-top: 8px;
}

@media print {
  @page {
    size: 80mm auto;
    margin: 4mm;
  }
  body {
    background: #FFF !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  body * {
    visibility: hidden !important;
  }
  .modal, .modal-container, .modal-body {
    overflow: visible !important;
    max-height: none !important;
    position: static !important;
  }
  .rx-label-print-area, .rx-label-print-area * {
    visibility: visible !important;
  }
  .rx-label-print-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100% !important;
    max-width: 80mm;
    margin: 0 auto;
  }
  .rx-label-card {
    border: 1px solid #111827 !important;
    box-shadow: none !important;
    margin: 0 0 8mm 0 !important;
    max-width: 100% !important;
  }
  .rx-label-card:not(:last-child) {
    page-break-after: always;
    break-after: page;
  }
}

/* ========================================================
 * STORY 4.4: BELANJA STOK MASUK MANDIRI & DASBOR KEDALUWARSA
 * ======================================================== */

/* Pharmacy Sub-Tabs Navigation */

/* Queue Sub-Tabs Navigation (SSOT Aligned with Pharmacy) */
.queue-tabs-nav-container {
  margin-bottom: 16px;
}
.queue-tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 8px;
  overflow-x: auto;
}
.queue-tab-btn {
  padding: 8px 16px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: var(--rounded-md);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}
.queue-tab-btn:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background-color: var(--color-surface-hover);
}
.queue-tab-btn.active {
  color: #ffffff;
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  font-weight: 700;
}
.queue-tab-btn .tab-count-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--rounded-full);
  background: var(--color-surface-sunken);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}
.queue-tab-btn.active .tab-count-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-color: transparent;
}
.queue-actions-group {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  flex-direction: row;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
}
.queue-table td.col-actions,
.queue-table th.col-actions {
  white-space: nowrap !important;
  min-width: 130px;
  text-align: center;
}

.pharmacy-tabs-nav-container {
  margin-bottom: 16px;
}
.pharmacy-tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 8px;
  overflow-x: auto;
}
.pharmacy-tab-btn {
  padding: 8px 16px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: var(--rounded-md);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}
.pharmacy-tab-btn:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background-color: var(--color-surface-hover);
}
.pharmacy-tab-btn.active {
  color: #ffffff;
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  font-weight: 700;
}
.pharmacy-tab-btn .tab-count-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--rounded-full);
  background: var(--color-surface-sunken);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}
.pharmacy-tab-btn.active .tab-count-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-color: transparent;
}
.pharmacy-subtab-panel {
  display: none;
}
.pharmacy-subtab-panel.active {
  display: block;
}

/* Expiry Alerts KPI Cards */
.expiry-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.kpi-card {
  padding: 16px;
  border-radius: var(--rounded-md);
  border: 1px solid var(--color-border);
}
.kpi-card-expired {
  border-left: 5px solid #EF4444;
  background: #FEF2F2;
}
.kpi-card-soon {
  border-left: 5px solid #F59E0B;
  background: #FFFBEB;
}
.kpi-card-safe {
  border-left: 5px solid #10B981;
  background: #ECFDF5;
}

/* Expiry Status Badges */
.badge-expiry-expired {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--rounded-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge-expiry-soon {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FCD34D;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--rounded-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge-expiry-safe {
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #6EE7B7;
  font-weight: 600;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--rounded-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Salon Grooming Component Styles (Story 5.1) */
.badge-grooming-registered {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #93C5FD;
  font-weight: 600;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--rounded-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge-grooming-progress {
  background: #F3E8FF;
  color: #6B21A8;
  border: 1px solid #C084FC;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--rounded-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge-grooming-ready {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FCD34D;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--rounded-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge-grooming-completed {
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #6EE7B7;
  font-weight: 600;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--rounded-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.checklist-chip-label:hover {
  border-color: var(--color-module-grooming) !important;
  background: var(--color-module-grooming-light) !important;
}

/* Story 5.2: Grooming Visual Photo Verification Styles */
.grooming-photo-box {
  border: 2px dashed var(--color-border);
  border-radius: var(--rounded-md);
  padding: 12px;
  background: var(--color-surface-sunken);
  text-align: center;
  position: relative;
  transition: all 0.2s ease-in-out;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 160px;
}
.grooming-photo-box:hover {
  border-color: var(--color-module-grooming);
  background: #FAF5FF;
}
.grooming-photo-preview-thumb {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: var(--rounded-sm);
  cursor: pointer;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}
.grooming-photo-preview-thumb:hover {
  transform: scale(1.02);
}

/* Story 5.3: WhatsApp Preview Modal & Copy Box Styles */
.wa-message-box {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #14532d;
  border-radius: var(--rounded-md);
  padding: 12px;
}
.wa-message-box:focus {
  border-color: #25D366;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.2);
}

/* Story 5.4: Pet Hotel Room Cards, Badges & Vaccination Guard Styles */
.hotel-rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.hotel-room-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-md);
  padding: 14px;
  transition: all 0.2s ease-in-out;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.hotel-room-card:hover {
  border-color: var(--color-module-hotel);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
  transform: translateY(-2px);
}
.hotel-room-card.status-occupied {
  background: #f8fafc;
  border-left: 4px solid #f59e0b;
}
.hotel-room-card.status-available {
  border-left: 4px solid #10b981;
}
.hotel-room-card.status-maintenance {
  border-left: 4px solid #94a3b8;
  opacity: 0.8;
}
.hotel-room-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.hotel-room-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text);
}
.hotel-room-rate {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-module-hotel);
  margin-top: 4px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.badge-hotel-booked {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  font-weight: 600;
}
.badge-hotel-checkedin {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  font-weight: 600;
}
.badge-hotel-checkedout {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  font-weight: 600;
}
.badge-hotel-cancelled {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  font-weight: 600;
}
.vaccine-guard-banner {
  border-radius: var(--rounded-md);
  padding: 10px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 8px;
  margin-bottom: 12px;
  font-size: 13px;
}
.vaccine-guard-pass {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}
.vaccine-guard-warn {
  background-color: #fffbeb;
  border: 1px solid #fef3c7;
  color: #b45309;
}
.vaccine-guard-fail {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}
.hotel-price-summary-box {
  background: #f8fafc;
  border: 1px dashed var(--color-border);
  border-radius: var(--rounded-md);
  padding: 12px 16px;
  margin-top: 14px;
}
.hotel-price-summary-box .price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 13px;
}
.hotel-price-summary-box .price-total {
  border-top: 1px solid var(--color-border);
  padding-top: 8px;
  margin-top: 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-module-hotel);
}

/* Story 5.5: Hotel Daily Care & Observation Logs */
.hotel-daily-logs-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}
.hotel-daily-log-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-md);
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: all 0.15s ease-in-out;
}
.hotel-daily-log-card:hover {
  border-color: var(--color-module-hotel);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}
.hotel-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  border-bottom: 1px dashed var(--color-border);
  padding-bottom: 6px;
}
.hotel-log-time-tag {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  color: var(--color-module-hotel);
  display: flex;
  align-items: center;
  gap: 4px;
}
.hotel-log-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 10px;
  font-size: 12px;
  margin-bottom: 8px;
}
.hotel-log-metric-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface-sunken);
  padding: 4px 8px;
  border-radius: var(--rounded-sm);
}
.hotel-log-metric-label {
  color: var(--color-text-muted);
  font-size: 11px;
}
.hotel-log-behavior-box {
  background: #f8fafc;
  border-left: 3px solid var(--color-module-hotel);
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 0 var(--rounded-sm) var(--rounded-sm) 0;
  color: var(--color-text-secondary);
  font-style: italic;
}

/* Feeding badges */
.badge-feeding-habis {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  font-size: 11px;
  font-weight: 600;
}
.badge-feeding-sebagian {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  font-size: 11px;
  font-weight: 600;
}
.badge-feeding-tidakdimakan {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  font-size: 11px;
  font-weight: 600;
}

/* Water badges */
.badge-water-normal {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  font-size: 11px;
  font-weight: 600;
}
.badge-water-banyak {
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
  font-size: 11px;
  font-weight: 600;
}
.badge-water-sedikit {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  font-size: 11px;
  font-weight: 600;
}
.badge-water-tidakminum {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  font-size: 11px;
  font-weight: 600;
}

/* Stool / Feses badges */
.badge-stool-normal {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  font-size: 11px;
  font-weight: 600;
}
.badge-stool-lembek {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  font-size: 11px;
  font-weight: 600;
}
.badge-stool-cairdiare {
  background: #fed7aa;
  color: #9a3412;
  border: 1px solid #fdba74;
  font-size: 11px;
  font-weight: 600;
}
.badge-stool-berdarah {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  font-size: 11px;
  font-weight: 700;
}
.badge-stool-konstipasi {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  font-size: 11px;
  font-weight: 600;
}

/* Urine badges */
.badge-urine-normal {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  font-size: 11px;
  font-weight: 600;
}
.badge-urine-sedikit {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  font-size: 11px;
  font-weight: 600;
}
.badge-urine-banyak {
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
  font-size: 11px;
  font-weight: 600;
}
.badge-urine-berdarah {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  font-size: 11px;
  font-weight: 700;
}
.badge-urine-tidakpipis {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  font-size: 11px;
  font-weight: 600;
}

/* ==========================================================================
   Inpatient Care & Ward Cockpit Styles (Story 6.1)
   ========================================================================== */
.inpatient-cockpit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.inpatient-cockpit-metric {
  background: var(--color-surface-sunken);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.15s ease;
}

.inpatient-cockpit-metric:hover {
  border-color: var(--color-module-inpatient);
  background: var(--color-surface);
}

.inpatient-cockpit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inpatient-cockpit-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.inpatient-cockpit-values {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.inpatient-cockpit-stat {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.inpatient-cockpit-progress {
  height: 6px;
  background: #e2e8f0;
  border-radius: var(--rounded-full);
  overflow: hidden;
  display: flex;
}

.inpatient-cockpit-progress-fill {
  height: 100%;
  transition: width 0.3s ease;
}

/* Cage Visual Map Matrix in Modal */
.cage-map-zone {
  margin-bottom: 20px;
}

.cage-map-zone-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--color-border);
}

.cage-map-zone-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.cage-map-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.cage-map-cell {
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-md);
  padding: 10px;
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 96px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  text-align: left;
}

.cage-map-cell:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.cage-map-cell.status-available {
  border-color: #a7f3d0;
  background: #f0fdf4;
}
.cage-map-cell.status-available:hover {
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.cage-map-cell.status-occupied {
  border-color: #fecaca;
  background: #fef2f2;
}
.cage-map-cell.status-occupied:hover {
  border-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.cage-map-cell.status-needs-cleaning {
  border-color: #fde68a;
  background: #fffbeb;
}
.cage-map-cell.status-needs-cleaning:hover {
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.cage-map-cell-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}

.cage-map-cell-id {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.2;
}

.cage-map-cell-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: var(--rounded-sm);
  text-transform: uppercase;
}

.cage-map-cell-body {
  font-size: 11px;
  color: var(--color-text-secondary);
  line-height: 1.3;
}

.cage-map-cell-patient {
  font-weight: 700;
  color: #991b1b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.cage-map-cell-footer {
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px dashed rgba(0,0,0,0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
}

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

.inpatient-cage-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}

.inpatient-cage-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.inpatient-cage-card.status-available {
  border-left: 4px solid #10b981;
}

.inpatient-cage-card.status-occupied {
  border-left: 4px solid #ef4444;
}

.inpatient-cage-card.status-needs-cleaning {
  border-left: 4px solid #f59e0b;
}

.inpatient-cage-card.is-isolation {
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.2);
}

.inpatient-cage-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-bg-subtle);
}

.inpatient-cage-body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inpatient-cage-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Badges for Room Types */
.badge-room-general {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--rounded-full);
}

.badge-room-isolation {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--rounded-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-isolation-tag {
  background: #dc2626;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--rounded-sm);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.patient-occupied-box {
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: var(--rounded-sm);
  padding: 10px 12px;
}

.inpatient-filter-btn.active {
  background: var(--color-module-inpatient);
  color: #fff;
  border-color: var(--color-module-inpatient);
}

/* ==========================================================================
   Story 6.2: Lembar Observasi Shift & Tanda Vital Inpatient Styles
   ========================================================================== */
.badge-temp-hypothermia {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--rounded-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-temp-fever {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--rounded-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-temp-normal {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  font-weight: 600;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--rounded-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.shift-badge-pagi {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  font-weight: 700;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--rounded-sm);
}

.shift-badge-siang {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  font-weight: 700;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--rounded-sm);
}

.shift-badge-malam {
  background: #f3e8ff;
  color: #6b21a8;
  border: 1px solid #e9d5ff;
  font-weight: 700;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--rounded-sm);
}

.inpatient-temp-alert-box {
  padding: 10px 14px;
  border-radius: var(--rounded-md);
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.inpatient-temp-alert-box.alert-hypothermia {
  background: #eff6ff;
  border: 1.5px solid #3b82f6;
  color: #1e40af;
}

.inpatient-temp-alert-box.alert-fever {
  background: #fef2f2;
  border: 1.5px solid #ef4444;
  color: #991b1b;
}

.inpatient-temp-alert-box.alert-normal {
  background: #ecfdf5;
  border: 1.5px solid #10b981;
  color: #065f46;
}

/* Story 6.3: Lembar Checklist Eksekusi Injeksi & Terapi Obat Dokter */
.badge-treatment-pending {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--rounded-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-treatment-administered {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--rounded-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-treatment-skipped {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--rounded-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-treatment-overdue, .badge-overdue {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #f87171;
  font-weight: 800;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--rounded-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  animation: pulse-overdue 2s infinite;
}

@keyframes pulse-overdue {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

.treatment-route-badge {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-weight: 700;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--rounded-xs);
  text-transform: uppercase;
}

.treatment-card-row {
  transition: background-color var(--transition-fast);
}

.treatment-card-row:hover {
  background-color: #f8fafc;
}

/* Story 6.4: Official Inpatient Medical Discharge Summary & Print Layout */
.discharge-summary-sheet {
  background: #ffffff;
  color: #1e293b;
  font-family: var(--font-sans);
  line-height: 1.45;
  box-sizing: border-box;
}

@media print {
  body.is-printing-discharge * {
    visibility: hidden !important;
  }

  body.is-printing-discharge #modal-inpatient-discharge-summary-print,
  body.is-printing-discharge #modal-inpatient-discharge-summary-print .modal-container,
  body.is-printing-discharge #modal-inpatient-discharge-summary-print .modal-body,
  body.is-printing-discharge #inpatient-discharge-print-sheet,
  body.is-printing-discharge #inpatient-discharge-print-sheet * {
    visibility: visible !important;
  }

  body.is-printing-discharge #modal-inpatient-discharge-summary-print {
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #ffffff !important;
    display: block !important;
    overflow: visible !important;
  }

  body.is-printing-discharge #modal-inpatient-discharge-summary-print .modal-container {
    max-width: 100% !important;
    width: 100% !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    position: static !important;
  }

  body.is-printing-discharge #modal-inpatient-discharge-summary-print .modal-header,
  body.is-printing-discharge #modal-inpatient-discharge-summary-print .modal-footer {
    display: none !important;
  }

  body.is-printing-discharge #modal-inpatient-discharge-summary-print .modal-body {
    padding: 0 !important;
    background: #ffffff !important;
    overflow: visible !important;
    position: static !important;
  }

  body.is-printing-discharge #inpatient-discharge-print-sheet {
    border: none !important;
    box-shadow: none !important;
    padding: 10mm 15mm !important;
    width: 100% !important;
    max-width: 100% !important;
    position: static !important;
  }

  body.is-printing-discharge {
    background: #ffffff !important;
  }

  /* Story 7.1: Down Payment Official Receipt Voucher (UX-DR9) Print Rules */
  body.is-printing-deposit-receipt * {
    visibility: hidden !important;
  }

  body.is-printing-deposit-receipt #modal-deposit-receipt,
  body.is-printing-deposit-receipt #modal-deposit-receipt .modal-container,
  body.is-printing-deposit-receipt #modal-deposit-receipt .modal-body,
  body.is-printing-deposit-receipt #deposit-receipt-print-area,
  body.is-printing-deposit-receipt #deposit-receipt-print-area * {
    visibility: visible !important;
  }

  body.is-printing-deposit-receipt #modal-deposit-receipt {
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #ffffff !important;
    display: block !important;
    overflow: visible !important;
  }

  body.is-printing-deposit-receipt #modal-deposit-receipt .modal-container,
  body.is-printing-deposit-receipt #modal-deposit-receipt .modal-dialog {
    max-width: 100% !important;
    width: 100% !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    position: static !important;
  }

  body.is-printing-deposit-receipt #modal-deposit-receipt .modal-header,
  body.is-printing-deposit-receipt #modal-deposit-receipt .modal-footer {
    display: none !important;
  }

  body.is-printing-deposit-receipt #modal-deposit-receipt .modal-body {
    padding: 0 !important;
    background: #ffffff !important;
    overflow: visible !important;
    position: static !important;
  }

  body.is-printing-deposit-receipt #deposit-receipt-print-area {
    border: 2px dashed #D97706 !important;
    box-shadow: none !important;
    padding: 15mm !important;
    width: 100% !important;
    max-width: 100% !important;
    position: static !important;
    background: #FFFBEB !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.is-printing-deposit-receipt {
    background: #ffffff !important;
  }
}

/* Story 7.1: Down Payment Voucher Slip UI Styles (UX-DR9) */
.deposit-receipt-voucher {
  max-width: 540px;
  margin: 0 auto;
  border: 2px dashed #D97706;
  background: #FFFBEB;
  border-radius: 8px;
  padding: 24px;
  color: #78350F;
  font-family: var(--font-sans);
  position: relative;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.08);
}

.deposit-receipt-voucher .voucher-header {
  text-align: center;
  border-bottom: 1px dashed #D97706;
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.deposit-receipt-voucher .voucher-brand {
  margin: 0;
  color: #92400E;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.deposit-receipt-voucher .voucher-subtitle {
  font-size: 12px;
  color: #B45309;
  font-weight: 600;
  margin-top: 3px;
  letter-spacing: 0.5px;
}

.deposit-receipt-voucher .voucher-number {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 15px;
  margin-top: 8px;
  color: #78350F;
  background: #FEF3C7;
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  border: 1px solid #FDE68A;
}

.deposit-receipt-voucher .voucher-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 20px;
  margin-bottom: 16px;
  font-size: 13px;
}

.deposit-receipt-voucher .voucher-meta-item {
  display: flex;
  flex-direction: column;
}

.deposit-receipt-voucher .voucher-label {
  font-size: 11px;
  color: #92400E;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 2px;
}

.deposit-receipt-voucher .voucher-value {
  font-weight: 600;
  color: #451A03;
}

.deposit-receipt-voucher .voucher-amount-card {
  background: #FEF3C7;
  border: 1px solid #FCD34D;
  border-radius: 6px;
  padding: 14px 18px;
  text-align: center;
  margin-bottom: 16px;
}

.deposit-receipt-voucher .voucher-amount-label {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  color: #92400E;
  letter-spacing: 0.5px;
}

.deposit-receipt-voucher .voucher-amount-val {
  font-size: 26px;
  font-weight: 800;
  color: #B45309;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.deposit-receipt-voucher .voucher-footer {
  border-top: 1px dashed #D97706;
  padding-top: 12px;
  font-size: 12px;
  color: #92400E;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.badge-status-reserved {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FCD34D;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
}

/* Story 7.2: Unified Billing Status Badges & Table Styling */
.badge-unpaid {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
}

.badge-partial {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
}

.badge-paid {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
}

.badge-voided {
  background: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #FECACA;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
}

.invoice-item-row:hover {
  background-color: #F8FAFC;
}

@media print {
  body.is-printing-invoice * {
    visibility: hidden;
  }
  body.is-printing-invoice #printable-invoice-voucher, 
  body.is-printing-invoice #printable-invoice-voucher * {
    visibility: visible;
  }
  body.is-printing-invoice #printable-invoice-voucher {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 10px;
    border: none !important;
  }
  body.is-printing-invoice .modal-backdrop {
    position: static;
    background: transparent !important;
  }
  body.is-printing-invoice .modal-dialog {
    max-width: 100% !important;
    margin: 0 !important;
  }
  body.is-printing-invoice .modal-header, 
  body.is-printing-invoice .modal-footer, 
  body.is-printing-invoice .btn-close {
    display: none !important;
  }
}

/* ===================================================
   Story 7.4: Thermal ESC/POS Receipt Styling (58mm / 80mm)
   =================================================== */
.thermal-receipt-container {
  background: #ffffff;
  color: #000000;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  margin: 0 auto;
  transition: width 0.2s ease, padding 0.2s ease;
  user-select: text;
}

.thermal-paper-58mm {
  width: 280px;
  max-width: 100%;
  font-size: 11px;
  line-height: 1.35;
  padding: 12px 10px;
}

.thermal-paper-80mm {
  width: 380px;
  max-width: 100%;
  font-size: 12px;
  line-height: 1.4;
  padding: 16px 14px;
}

.thermal-divider {
  border-top: 1px dashed #333333;
  margin: 6px 0;
}

.thermal-double-divider {
  border-top: 2px double #000000;
  margin: 6px 0;
}

.thermal-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2px;
  word-break: break-word;
}

.thermal-row-bold {
  font-weight: 700;
}

.thermal-center {
  text-align: center;
}

.thermal-item-title {
  font-weight: 600;
  margin-top: 3px;
}

.thermal-item-sub {
  display: flex;
  justify-content: space-between;
  color: #222222;
  margin-bottom: 3px;
}

.thermal-size-toggle {
  display: inline-flex;
  border-radius: 6px;
  background: #F1F5F9;
  padding: 3px;
  gap: 4px;
}

.thermal-size-btn {
  border: none;
  background: transparent;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  color: #475569;
  transition: background 0.15s ease, color 0.15s ease;
}

.thermal-size-btn.active {
  background: #ffffff;
  color: #0F172A;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

@media print {
  @page {
    margin: 0;
  }
  body.is-printing-thermal * {
    visibility: hidden;
  }
  body.is-printing-thermal #thermal-receipt-preview,
  body.is-printing-thermal #thermal-receipt-preview * {
    visibility: visible;
  }
  body.is-printing-thermal #thermal-receipt-preview {
    position: absolute;
    left: 0;
    top: 0;
    margin: 0;
    padding: 0;
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
  }
  body.is-printing-thermal.thermal-print-58mm #thermal-receipt-preview {
    width: 48mm !important;
    max-width: 48mm !important;
    font-size: 10px !important;
    line-height: 1.25 !important;
  }
  body.is-printing-thermal.thermal-print-80mm #thermal-receipt-preview {
    width: 72mm !important;
    max-width: 72mm !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
  }
  body.is-printing-thermal .modal-backdrop {
    position: static;
    background: transparent !important;
  }
  body.is-printing-thermal .modal-dialog {
    max-width: 100% !important;
    margin: 0 !important;
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
  }
  body.is-printing-thermal .modal-header,
  body.is-printing-thermal .modal-footer,
  body.is-printing-thermal .btn-close,
  body.is-printing-thermal .thermal-size-toggle {
    display: none !important;
  }
}

/* ===================================================
   Story 7.5: Void Invoice & Refund Receipt Styling
   =================================================== */
.void-warning-box {
  background: #FFF1F2;
  border: 1px solid #FECDD3;
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 13px;
  color: #9F1239;
  line-height: 1.45;
}

.refund-slip-container {
  background: #ffffff;
  border: 1px dashed #CBD5E1;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  color: #0F172A;
  box-sizing: border-box;
}

/* Print Rules for Official Refund Slip */
@media print {
  body.is-printing-refund * {
    visibility: hidden;
  }
  body.is-printing-refund #modal-refund-receipt,
  body.is-printing-refund #modal-refund-receipt .refund-slip-container,
  body.is-printing-refund #modal-refund-receipt .refund-slip-container * {
    visibility: visible;
  }
  body.is-printing-refund #modal-refund-receipt {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: #ffffff !important;
    display: block !important;
    z-index: 999999;
  }
  body.is-printing-refund #modal-refund-receipt .modal-dialog {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
  }
  body.is-printing-refund #modal-refund-receipt .modal-header,
  body.is-printing-refund #modal-refund-receipt .modal-footer,
  body.is-printing-refund #modal-refund-receipt .btn-close {
    display: none !important;
  }
  body.is-printing-refund #modal-refund-receipt .modal-body {
    padding: 0 !important;
    background: transparent !important;
  }
  body.is-printing-refund #refund-receipt-card {
    box-shadow: none !important;
    border: 1px dashed #64748B !important;
    width: 100% !important;
    max-width: 500px !important;
    margin: 0 auto !important;
  }
}

/* ==========================================================================
   Story 8.1: Role-Based Dynamic KPI Dashboard
   ========================================================================== */
.role-dashboard-banner {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-md);
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}
.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.dashboard-kpi-grid .kpi-card,
.role-kpi-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 124px;
  box-sizing: border-box;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.dashboard-kpi-grid .kpi-card:hover,
.role-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.role-kpi-val {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--color-text-primary);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.role-kpi-val.is-currency {
  font-size: 20px;
}
.role-kpi-sub {
  font-size: 11px;
  color: var(--color-text-secondary);
  margin-top: 4px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.role-kpi-action {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  height: 18px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.role-sample-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-md);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Story 8.2: Operational Expenses & P&L Styles
   ========================================================================== */
.pl-kpi-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pl-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.badge-category-utility {
  background: #E0F2FE;
  color: #0369A1;
}
.badge-category-maintenance {
  background: #FEF3C7;
  color: #92400E;
}
.badge-category-salary {
  background: #DCFCE7;
  color: #15803D;
}
.badge-category-medicalwaste {
  background: #FEE2E2;
  color: #B91C1C;
}
.badge-category-laundry {
  background: #F3E8FF;
  color: #7E22CE;
}
.badge-category-supplies {
  background: #FFEDD5;
  color: #C2410C;
}
.badge-category-other {
  background: #F1F5F9;
  color: #475569;
}

/* ==========================================================================
   Story 8.3: Patient Compliance Recall Badges & WhatsApp Preview
   ========================================================================== */
.badge-recall-vaccination {
  background: #E0F2FE;
  color: #0369A1;
  border: 1px solid #BAE6FD;
}
.badge-recall-deworming {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
}
.badge-recall-fleatick {
  background: #FFEDD5;
  color: #C2410C;
  border: 1px solid #FED7AA;
}
.badge-recall-postopcheck {
  background: #F3E8FF;
  color: #7E22CE;
  border: 1px solid #E9D5FF;
}
.badge-recall-general {
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #E2E8F0;
}
.badge-urgency-overdue {
  background: #FEE2E2;
  color: #B91C1C;
  font-weight: 700;
  border: 1px solid #FECACA;
}
.badge-urgency-duesoon {
  background: #FEF3C7;
  color: #B45309;
  font-weight: 700;
  border: 1px solid #FDE68A;
}
.whatsapp-chat-box {
  background: #ECE5DD;
  background-image: radial-gradient(#d4cdc5 1px, transparent 0);
  background-size: 16px 16px;
  border-radius: var(--rounded-md);
  padding: 16px;
  border: 1px solid #D1D5DB;
}
.whatsapp-bubble {
  background: #DCF8C6;
  border-radius: 8px 8px 0 8px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.6;
  color: #111827;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ==========================================================================
   Story 8.4: Tiered Database Backup Badges & UI
   ========================================================================== */
.badge-tier-daily {
  background: #E0F2FE;
  color: #0369A1;
  border: 1px solid #BAE6FD;
  font-weight: 700;
}
.badge-tier-weekly {
  background: #F3E8FF;
  color: #7E22CE;
  border: 1px solid #E9D5FF;
  font-weight: 700;
}
.badge-tier-monthly {
  background: #DCFCE7;
  color: #15803D;
  border: 1px solid #BBF7D0;
  font-weight: 700;
}
.badge-backup-success {
  background: #DCFCE7;
  color: #15803D;
  font-weight: 600;
}
.badge-backup-healthy {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
  font-weight: 800;
}

/* ==========================================================================
   Section 7.5: Pet Table Identity & Micro-Pill Sex Badges (SSOT)
   ========================================================================== */
.pet-table-identity-stacked {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.pet-table-name-link {
  font-weight: 600;
  font-size: 13px;
  color: var(--color-primary);
  text-decoration: none;
  line-height: 1.3;
}

.pet-table-name-link:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

.badge-sex-male {
  background: #E0F2FE;
  color: #0369A1;
  border: 1px solid #BAE6FD;
  font-weight: 600;
}

.badge-sex-female {
  background: #FCE7F3;
  color: #BE185D;
  border: 1px solid #FBCFE8;
  font-weight: 600;
}

/* ==========================================================================
   Pagination & Large Table Controls (Pillar 1)
   ========================================================================== */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  font-size: 12px;
  color: var(--color-text-secondary);
}

.pagination-info {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: var(--control-height-sm);
  padding: 0 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-md);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  user-select: none;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--color-surface-hover);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.pagination-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: var(--color-border);
}

.pagination-btn.active {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
}

/* ==========================================================================
   Offline Outbox Badge Indicator (Pillar 3)
   ========================================================================== */
.offline-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--control-height-sm);
  padding: 0 10px;
  background: var(--color-alert-warning-bg);
  border: 1px solid var(--color-alert-warning-border);
  border-radius: var(--rounded-full);
  color: var(--color-alert-warning-text);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.offline-sync-badge:hover {
  background: #FEF3C7;
  border-color: var(--color-alert-warning);
}

.offline-sync-badge.syncing {
  background: var(--color-secondary-light);
  border-color: var(--color-secondary);
  color: var(--color-secondary-foreground);
  animation: pulse-sync 1.5s infinite;
}

@keyframes pulse-sync {
  0% { opacity: 1; }
  50% { opacity: 0.6; }
  100% { opacity: 1; }
}

/* Executive Dashboard Chart Styles */
.bar-chart-rect {
  transition: height 0.3s ease, y 0.3s ease, fill 0.2s ease;
  cursor: pointer;
}
.bar-chart-rect:hover {
  fill: #047857;
}
.donut-slice {
  transition: stroke-width 0.2s ease, opacity 0.2s ease;
  cursor: pointer;
}
.donut-slice:hover {
  opacity: 0.85;
  stroke-width: 24;
}

/* ==========================================================================
   Zero-Subpixel Native Skeleton Shimmer System (Pilar 2 Performance)
   ========================================================================== */
@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--rounded-md);
  display: inline-block;
  pointer-events: none;
  user-select: none;
}

.skeleton-text {
  height: 14px;
  margin-bottom: 6px;
  border-radius: 4px;
}

.skeleton-title {
  height: 20px;
  width: 60%;
  margin-bottom: 12px;
  border-radius: 4px;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--rounded-full);
  flex-shrink: 0;
}

.skeleton-button {
  height: var(--control-height);
  width: 100px;
  border-radius: var(--rounded-md);
}

.skeleton-card {
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-lg);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-table-row {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  align-items: center;
}

.skeleton-cell {
  height: 14px;
  flex: 1;
  border-radius: 4px;
}

/* Shimmer Skeleton TR for native TBODY */
.skeleton-tr td {
  padding: 12px 14px;
  vertical-align: middle;
  border-bottom: 1px solid var(--color-border-subtle);
}

.skeleton-tr .skeleton-cell {
  height: 14px;
  border-radius: 4px;
  display: block;
}

.skeleton-table {
  background: var(--color-surface);
  border-radius: var(--rounded-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

/* Optimistic UI Indicator */
.optimistic-syncing {
  position: relative;
  opacity: 0.85;
  pointer-events: none;
}
.optimistic-syncing::after {
  content: '↻ Menyinkronkan...';
  position: absolute;
  top: 2px;
  right: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: 1px 6px;
  border-radius: var(--rounded-xs);
  z-index: 10;
}

/* ==========================================================================
   Sagala Satwa — Modern Workstation Floating Card Login
   Architecture: Floating Master Card on #f8fafc canvas with True Alpha Pets Dock
   ========================================================================== */
.auth-login-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--canvas-bg, #f8fafc);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  overflow-y: auto;
  padding: 24px 16px;
  box-sizing: border-box;
}

/* Master Card Container */
.auth-master-card {
  display: flex;
  width: 100%;
  max-width: 980px;
  min-height: 580px;
  background: #ffffff;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
}

/* ==========================================================================
   LEFT PANEL: BRAND & SERVICES (Medical Emerald SSOT)
   ========================================================================== */
.auth-brand-panel {
  width: 48%;
  background: linear-gradient(150deg, #059669 0%, #047857 55%, #064e3b 100%);
  padding: 38px 36px 0;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #ffffff;
  box-sizing: border-box;
}

/* Watermark Paw Prints in Left Panel */
.auth-paw-mark {
  position: absolute;
  color: #ffffff;
  opacity: 0.06;
  pointer-events: none;
  z-index: 1;
}
.auth-paw-mark-1 { top: 8%; right: 10%; width: 80px; height: 80px; transform: rotate(18deg); }
.auth-paw-mark-2 { top: 38%; right: 6%; width: 60px; height: 60px; transform: rotate(-12deg); }

.auth-brand-top-content {
  position: relative;
  z-index: 2;
}

.auth-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.auth-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
}

.auth-brand-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1.15;
  margin-bottom: 4px;
  color: #ffffff;
}

.auth-brand-subtitle {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #a7f3d0;
  margin-bottom: 12px;
}

.auth-brand-description {
  font-size: 13px;
  line-height: 1.5;
  color: #ecfdf5;
  margin-bottom: 16px;
  max-width: 380px;
  opacity: 0.92;
  font-weight: 400;
}

/* 4 Core Pillars: Sleek Micro-Pills */
.auth-services-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.auth-service-col {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 4px 9px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  backdrop-filter: blur(4px);
}

.auth-service-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-service-icon svg {
  width: 13px;
  height: 13px;
}

.auth-service-name {
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
}

/* Pets Mascot Bottom Dock with True Transparent Cutout */
.auth-pets-footer-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 240px;
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.auth-pets-visual {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 88%;
  height: 235px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  user-select: none;
  pointer-events: none;
}

.auth-pets-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.25));
}

.auth-tagline {
  position: absolute;
  bottom: 10px;
  right: 8px;
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  z-index: 3;
  letter-spacing: 0.2px;
}

/* ==========================================================================
   RIGHT PANEL: CLEAN LOGIN FORM COCKPIT
   ========================================================================== */
.auth-login-panel {
  width: 52%;
  background: #ffffff;
  padding: 44px 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  box-sizing: border-box;
}

.auth-small-brand {
  font-size: 12px;
  font-weight: 700;
  color: #059669;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.auth-welcome-text {
  display: none;
}

.auth-login-heading {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.4px;
  margin-bottom: 6px;
  line-height: 1.2;
}

.auth-login-desc {
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 24px;
}

/* Modern Form Field Groups */
.auth-input-group {
  margin-bottom: 16px;
  position: relative;
}

.auth-input-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  width: 17px;
  height: 17px;
  z-index: 2;
}

.auth-input-wrapper:focus-within .auth-input-icon {
  color: #059669;
}

.auth-input-group .auth-field {
  width: 100% !important;
  height: 40px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  padding: 0 40px 0 40px !important;
  font-size: 13px !important;
  color: #0f172a !important;
  background: #ffffff !important;
  outline: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
  font-family: var(--font-sans) !important;
  box-sizing: border-box !important;
}

.auth-input-group .auth-field:focus {
  border-color: #059669 !important;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15) !important;
}

.auth-input-eye {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s ease;
  z-index: 2;
}

.auth-input-eye:hover {
  color: #059669;
}

/* Options: Remember Me & Forgot Password */
.auth-options-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0 20px;
  font-size: 12px;
}

.auth-remember-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #475569;
  cursor: pointer;
  user-select: none;
}

.auth-remember-wrap input {
  accent-color: #059669;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.auth-forgot-link {
  color: #059669;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease;
}

.auth-forgot-link:hover {
  text-decoration: underline;
}

/* Primary Emerald Action Button */
.auth-login-btn {
  width: 100%;
  height: 40px;
  border: none;
  border-radius: 6px;
  background: #059669;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.auth-login-btn:hover {
  background: #047857;
  box-shadow: 0 4px 8px rgba(5, 150, 105, 0.3);
}

.auth-login-btn:hover .auth-btn-arrow {
  transform: translateX(3px);
}

.auth-btn-arrow {
  display: inline-flex;
  align-items: center;
  transition: transform 0.2s ease;
}

/* Divider "atau" */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 18px 0;
  color: #94a3b8;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.auth-divider span {
  padding: 0 12px;
}

/* Google SSO Button */
.auth-google-btn {
  width: 100%;
  height: 40px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.15s ease, border-color 0.15s ease;
  box-sizing: border-box;
}

.auth-google-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.auth-panel-footer {
  margin-top: 22px;
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 880px) {
  .auth-master-card {
    flex-direction: column;
    max-width: 460px;
  }

  .auth-brand-panel {
    width: 100%;
    min-height: 280px;
    padding: 32px 26px 0;
  }

  .auth-brand-title {
    font-size: 28px;
  }

  .auth-brand-subtitle {
    font-size: 11px;
    letter-spacing: 2px;
  }

  .auth-pets-footer-wrap {
    height: 180px;
  }

  .auth-pets-visual {
    height: 175px;
  }

  .auth-login-panel {
    width: 100%;
    padding: 32px 24px;
  }

  .auth-login-heading {
    font-size: 22px;
  }
}