/* ============================================
   Home Health EHR - Main Stylesheet
   Modern Healthcare Light Theme
   Based on iMEHR Design System
   ============================================ */

:root {
    --primary-color: #6366F1;
    --primary-hover: #4F46E5;
    --primary-light: #EEF2FF;
    --primary-dark: #4338CA;
    --secondary-color: #06B6D4;
    --secondary-hover: #0891B2;
    --secondary-light: #CFFAFE;
    --accent-emerald: #10B981;
    --accent-emerald-light: #D1FAE5;
    --accent-coral: #F97316;
    --accent-coral-light: #FFEDD5;
    --body-bg: #F9FAFB;
    --card-bg: #FFFFFF;
    --bg-secondary: #F3F4F6;
    --bg-tertiary: #E5E7EB;
    --bg-light: #FAFAFA;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --text-white: #FFFFFF;
    --success-color: #10B981;
    --success-bg: #D1FAE5;
    --success-text: #065F46;
    --warning-color: #F59E0B;
    --warning-bg: #FEF3C7;
    --warning-text: #92400E;
    --danger-color: #EF4444;
    --danger-bg: #FEE2E2;
    --danger-text: #991B1B;
    --info-color: #3B82F6;
    --info-bg: #DBEAFE;
    --info-text: #1E40AF;
    --pending-bg: #FEF3C7;
    --pending-text: #854D0E;
    --border-color: #E5E7EB;
    --border-medium: #D1D5DB;
    --border-focus: #2563EB;
    --border-disabled: #D1D5DB;
    --sidebar-bg: #FFFFFF;
    --sidebar-border: #E5E7EB;
    --sidebar-text: #4B5563;
    --sidebar-text-muted: #9CA3AF;
    --sidebar-hover-bg: #F3F4F6;
    --sidebar-active-bg: #DBEAFE;
    --sidebar-active-text: #2563EB;
    --sidebar-active-border: #2563EB;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-2xl: 16px;
    --radius-full: 9999px;
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 200ms ease-in-out;
    --transition-slow: 300ms ease-in-out;
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;
    --space-3xl: 48px;
    /* Home Health Specific */
    --hh-visit-scheduled: #3B82F6;
    --hh-visit-in-progress: #8B5CF6;
    --hh-visit-completed: #10B981;
    --hh-visit-missed: #EF4444;
    --hh-visit-cancelled: #6B7280;
    --hh-visit-rescheduled: #F59E0B;
    --hh-episode-active: #10B981;
    --hh-episode-pending: #F59E0B;
    --hh-episode-discharged: #BE185D;
    --hh-episode-on-hold: #6B7280;
    --hh-discipline-sn: #3B82F6;
    --hh-discipline-pt: #10B981;
    --hh-discipline-ot: #8B5CF6;
    --hh-discipline-st: #F59E0B;
    --hh-discipline-msw: #EC4899;
    --hh-discipline-aide: #06B6D4;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--body-bg);
    color: var(--text-primary);
    margin: 0; padding: 0;
    font-size: 13px; line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Typography */
h1, h2, h3, h4, h5, h6 { font-weight: 600; line-height: 1.3; color: var(--text-primary); margin-bottom: 0.5rem; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.5rem; } h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; } h5 { font-size: 1rem; } h6 { font-size: 0.875rem; }
p { margin-bottom: 0.75rem; color: var(--text-secondary); }
small, .small { font-size: 0.8125rem; }
.text-xs { font-size: 0.6875rem; } .text-sm { font-size: 0.8125rem; }
.text-base { font-size: 0.875rem; } .text-lg { font-size: 1rem; } .text-xl { font-size: 1.125rem; }

/* ============================================
   Login Page
   ============================================ */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 50%, #BFDBFE 100%);
    padding: 20px; position: relative;
}
.login-page::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%232563EB' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}
.login-card {
    background: var(--card-bg); border-radius: var(--radius-2xl); box-shadow: var(--shadow-xl);
    padding: 40px; width: 100%; max-width: 420px;
    border: 1px solid var(--border-color); position: relative; z-index: 1;
}
.login-header { text-align: center; margin-bottom: 32px; }
.login-header .logo {
    width: 72px; height: 72px; border-radius: var(--radius-xl);
    display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
}
.login-header .logo .logo-img { height: 90px; object-fit: contain; border-radius: var(--radius-xl); }
.login-header h1 { font-size: 28px; font-weight: 700; margin: 0 0 8px; letter-spacing: -0.5px; }
.login-header p.text-muted { color: var(--text-secondary); font-size: 14px; }
.login-footer { text-align: center; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border-color); }
.login-footer small { color: var(--text-muted); font-size: 12px; }

/* Tenant/Agency Selection */
.tenant-list { display: flex; flex-direction: column; gap: 12px; }
.tenant-option {
    display: block; width: 100%; padding: 16px 20px; background: var(--body-bg);
    border: 2px solid var(--border-color); border-radius: 12px; text-align: left;
    cursor: pointer; transition: all 0.2s ease;
}
.tenant-option:hover {
    border-color: var(--primary-color); background: #f0f7ff;
    transform: translateY(-2px); box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}
.tenant-option .tenant-name { font-weight: 600; font-size: 16px; margin-bottom: 4px; }
.tenant-option .tenant-subdomain { font-size: 13px; color: var(--text-secondary); }

/* ============================================
   Main Layout
   ============================================ */
#mainApp { display: flex; min-height: 100vh; background: var(--body-bg); }

/* Sidebar */
.sidebar {
    width: 260px; background: var(--sidebar-bg); color: var(--sidebar-text);
    display: flex; flex-direction: column; position: fixed; height: 100vh; z-index: 1000;
    transition: transform var(--transition-slow);
    border-right: 1px solid var(--sidebar-border); box-shadow: var(--shadow-sm);
}
.sidebar-header { padding: 20px; border-bottom: 1px solid var(--border-color); background: var(--card-bg); }
.sidebar-header .logo { text-align: center; border-radius: var(--radius-lg); }
.sidebar-header .logo .sidebar-logo-img { height: 40px; object-fit: contain; border-radius: var(--radius-lg); }
.logo-text { font-size: 20px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.5px; }

.sidebar-tenant {
    padding: 16px 20px; background: var(--bg-secondary);
    display: flex; flex-direction: column; border-bottom: 1px solid var(--border-color);
}
.sidebar-tenant strong { font-size: 14px; font-weight: 600; }
.sidebar-tenant span { font-size: 12px; color: var(--text-muted); }

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; background: var(--card-bg); }
.sidebar-nav .nav-section-label {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-muted); padding: 12px 16px 4px; margin-top: 8px;
}
.sidebar-nav .nav-item {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px;
    color: var(--sidebar-text); text-decoration: none; border-radius: var(--radius-lg);
    margin-bottom: 4px; transition: all var(--transition-fast);
    border-left: 3px solid transparent; font-weight: 500;
}
.sidebar-nav .nav-item:hover { background: var(--sidebar-hover-bg); color: var(--text-primary); }
.sidebar-nav .nav-item.active {
    background: var(--sidebar-active-bg); color: var(--sidebar-active-text);
    border-left-color: var(--sidebar-active-border); font-weight: 600;
}
.sidebar-nav .nav-item i { font-size: 18px; width: 24px; text-align: center; color: var(--text-muted); transition: color var(--transition-fast); }
.sidebar-nav .nav-item:hover i, .sidebar-nav .nav-item.active i { color: var(--primary-color); }
.sidebar-nav .nav-item .badge { margin-left: auto; font-size: 10px; padding: 3px 8px; }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid var(--border-color); background: var(--bg-secondary); }
.user-info { display: flex; align-items: center; gap: 12px; }
.user-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 16px; color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}
.user-details { display: flex; flex-direction: column; }
.user-name { font-weight: 600; font-size: 14px; }
.user-role { font-size: 12px; color: var(--text-muted); }
.sidebar-footer .btn-outline-light { color: var(--text-secondary); border-color: var(--border-color); background: var(--card-bg); }
.sidebar-footer .btn-outline-light:hover { color: var(--primary-color); border-color: var(--primary-color); background: var(--primary-light); }

/* ============================================
   Role-Based Visibility
   ============================================ */
body:not(.super-admin) .requires-super-admin { display: none !important; }
body:not(.admin):not(.super-admin) .requires-admin { display: none !important; }
body.scheduler .requires-clinical,
body.billing .requires-clinical,
body.read-only .requires-clinical { display: none !important; }
body.scheduler .hide-from-scheduler { display: none !important; }
body.billing .hide-from-billing { display: none !important; }
body.read-only .requires-write { display: none !important; }
body.read-only .hide-from-read-only { display: none !important; }
body.clinician .hide-from-clinician { display: none !important; }
.show-only-clinician { display: none !important; }
body.clinician .show-only-clinician { display: block !important; }
body.aide .requires-clinical-write { display: none !important; }
body:not(.super-admin):not(.admin):not(.billing) .requires-billing-access { display: none !important; }

/* ============================================
   Main Content & Header
   ============================================ */
.main-content {
    flex: 1; margin-left: 260px; display: flex; flex-direction: column;
    min-height: 100vh; background: var(--body-bg);
}
.main-header {
    background: var(--card-bg); padding: 16px 24px; display: flex;
    align-items: center; gap: 20px; border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-sm);
}
.page-title { flex: 1; font-size: 1.5rem; font-weight: 700; }
.header-actions { display: flex; gap: 12px; }
.content-area { flex: 1; padding: 24px; }

/* Agency Filter */
.agency-filter-container {
    display: flex; align-items: center; gap: 8px; padding: 6px 12px;
    background: #fef3c7; border: 1px solid #fbbf24; border-radius: 8px;
}
.agency-filter-label { font-size: 13px; font-weight: 500; color: #92400e; white-space: nowrap; }
.agency-filter-container .form-select { min-width: 180px; font-size: 13px; border-color: #fbbf24; }

/* Header Patient Search */
.header-patient-search { position: relative; width: 320px; min-width: 200px; flex-shrink: 1; }
.header-search-wrapper { position: relative; display: flex; align-items: center; }
.header-search-icon { position: absolute; left: 12px; color: var(--text-muted); font-size: 14px; pointer-events: none; z-index: 1; }
.header-search-input {
    padding-left: 36px !important; padding-right: 60px !important; height: 38px;
    font-size: 13px !important; border-radius: var(--radius-full) !important;
    background-color: var(--bg-secondary) !important; border-color: transparent !important;
    transition: all var(--transition-fast); width: 100%;
}
.header-search-input:hover { background-color: var(--bg-tertiary) !important; }
.header-search-input:focus { background-color: var(--card-bg) !important; border-color: var(--primary-color) !important; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important; }
.header-search-shortcut {
    position: absolute; right: 10px; font-size: 11px; padding: 2px 6px;
    background: var(--bg-tertiary); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); color: var(--text-muted); pointer-events: none;
}
.header-search-results {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 1060; margin-top: 6px;
    min-width: 360px; background: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); max-height: 400px; overflow-y: auto;
}
.header-search-results .autocomplete-item { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border-color); transition: background var(--transition-fast); }
.header-search-results .autocomplete-item:last-child { border-bottom: none; }
.header-search-results .autocomplete-item:hover,
.header-search-results .autocomplete-item.active { background: var(--primary-light); }
.header-search-result-name { font-weight: 600; font-size: 14px; }
.header-search-result-mrn { font-size: 12px; color: var(--primary-color); margin-left: 8px; font-weight: 500; }
.header-search-result-details { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.header-search-results .autocomplete-loading,
.header-search-results .autocomplete-empty { padding: 12px 14px; font-size: 13px; color: var(--text-muted); }

/* ============================================
   Pages
   ============================================ */
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.page-header { display: flex; justify-content: flex-end; align-items: center; margin-bottom: 24px; }
.page-header .text-muted { color: var(--text-secondary); font-size: 14px; }

/* ============================================
   Dashboard Grid
   ============================================ */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px; align-items: start; }
.dashboard-grid .grid-main { grid-column: span 2; }
.dashboard-grid .grid-sidebar { grid-column: 3; grid-row: 1 / span 3; display: flex; flex-direction: column; gap: 5px; }
.dashboard-stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }

/* ============================================
   Cards
   ============================================ */
.card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); transition: box-shadow var(--transition-normal), transform var(--transition-normal); }
.card:hover { box-shadow: var(--shadow-md); }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border-color); background: var(--bg-light); border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
.card-header h5 { margin: 0; font-size: 16px; font-weight: 600; }
.card-body { padding: 20px; }
.card-footer { padding: 16px 20px; border-top: 1px solid var(--border-color); background: var(--bg-light); border-radius: 0 0 var(--radius-xl) var(--radius-xl); }

/* Stat Cards */
.stat-card {
    background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-xl);
    padding: 20px; display: flex; align-items: center; gap: 16px;
    box-shadow: var(--shadow-sm); transition: all var(--transition-normal);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card.small-stat { padding: 16px 20px; }
.stat-icon {
    width: 52px; height: 52px; border-radius: var(--radius-xl);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 22px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.stat-icon.bg-primary { background: linear-gradient(135deg, var(--primary-color) 0%, #1D4ED8 100%); }
.stat-icon.bg-success { background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%); }
.stat-icon.bg-warning { background: linear-gradient(135deg, var(--warning-color) 0%, #D97706 100%); }
.stat-icon.bg-danger { background: linear-gradient(135deg, var(--danger-color) 0%, #DC2626 100%); }
.stat-icon.bg-info { background: linear-gradient(135deg, var(--info-color) 0%, #1D4ED8 100%); }
.stat-icon.bg-teal { background: linear-gradient(135deg, var(--secondary-color) 0%, #0891B2 100%); }
.stat-content { display: flex; flex-direction: column; }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; font-weight: 500; }

/* ============================================
   Tables
   ============================================ */
.table { margin: 0; width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
    font-weight: 600; font-size: 11px; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.06em; padding: 10px 14px; border-bottom: 1px solid var(--border-color);
    white-space: nowrap; background: var(--bg-secondary);
}
.table td { padding: 12px 14px; vertical-align: middle; border-bottom: 1px solid var(--border-color); font-size: 13px; }
.table tbody tr { transition: background-color var(--transition-fast); }
.table tbody tr:hover { background: rgba(37, 99, 235, 0.04); }
.table tbody tr:last-child td { border-bottom: none; }
.table-striped tbody tr:nth-of-type(odd) { background-color: var(--bg-light); }
.table-striped tbody tr:nth-of-type(odd):hover { background-color: rgba(37, 99, 235, 0.06); }
.table tbody tr.selected, .table tbody tr.table-active { background-color: var(--primary-light) !important; }
.card .table { margin: 0; }
.card .table th:first-child, .card .table td:first-child { padding-left: 20px; }
.card .table th:last-child, .card .table td:last-child { padding-right: 20px; }
.table-hover tbody tr:hover { background-color: #f8fafc; }

/* ============================================
   Status Badges
   ============================================ */
.status-badge {
    display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 6px;
    font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.03em; border: none;
}
.status-scheduled { background: #EFF6FF; color: #1E40AF; }
.status-confirmed { background: #F0FDF4; color: #166534; }
.status-in-route, .status-enroute { background: #FEF3C7; color: #92400E; }
.status-in-progress, .status-inprogress { background: #EDE9FE; color: #5B21B6; }
.status-completed { background: #ECFDF5; color: #047857; }
.status-missed, .status-no-show, .status-noshow { background: #FEE2E2; color: #991B1B; }
.status-cancelled { background: #F3F4F6; color: #6B7280; }
.status-rescheduled { background: #FEF3C7; color: #92400E; }
.status-active, .status-episode-active { background: #ECFDF5; color: #047857; }
.status-discharged, .status-episode-discharged { background: #FCE7F3; color: #BE185D; }
.status-inactive, .status-on-hold, .status-episode-on-hold { background: #F3F4F6; color: #6B7280; }
.status-pending, .status-episode-pending, .status-oasis-draft { background: #FEF3C7; color: #92400E; }
.status-approved, .status-oasis-completed { background: #ECFDF5; color: #047857; }
.status-denied { background: #FEE2E2; color: #991B1B; }
.status-expired { background: #F3F4F6; color: #6B7280; }
.status-episode-recertification, .status-oasis-locked { background: #DBEAFE; color: #1D4ED8; }
.status-oasis-transmitted { background: #EDE9FE; color: #5B21B6; }

/* Bootstrap Badge Overrides */
.badge {
    font-weight: 500; font-size: 11px; padding: 10px 12px; border-radius: 100px;
    letter-spacing: 0.02em; border: none; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.badge.bg-primary { background: #EEF2FF !important; color: #4338CA !important; }
.badge.bg-success { background: #ECFDF5 !important; color: #047857 !important; }
.badge.bg-warning { background: #FFFBEB !important; color: #B45309 !important; }
.badge.bg-danger { background: #FEF2F2 !important; color: #B91C1C !important; }
.badge.bg-info { background: #EFF6FF !important; color: #1D4ED8 !important; }
.badge.bg-secondary { background: #F3F4F6 !important; color: #4B5563 !important; }
.badge.bg-light { background: #F9FAFB !important; color: #6B7280 !important; border: 1px solid #E5E7EB !important; }
.badge.bg-dark { background: #1F2937 !important; color: #F9FAFB !important; }

/* Discipline Badges */
.discipline-badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: var(--radius-full); font-size: 11px; font-weight: 600; }
.discipline-sn, .discipline-rn { background: #DBEAFE; color: #1E40AF; }
.discipline-pt { background: #D1FAE5; color: #065F46; }
.discipline-ot { background: #EDE9FE; color: #5B21B6; }
.discipline-st { background: #FEF3C7; color: #92400E; }
.discipline-msw { background: #FCE7F3; color: #9D174D; }
.discipline-aide, .discipline-hha { background: #CFFAFE; color: #155E75; }
.discipline-lpn { background: #E0E7FF; color: #3730A3; }

/* Visit Status Badge Colors */
.visit-badge-scheduled { background: #EFF6FF; color: #1E40AF; }
.visit-badge-en-route { background: #FEF3C7; color: #92400E; }
.visit-badge-in-progress { background: #EDE9FE; color: #5B21B6; }
.visit-badge-completed { background: #ECFDF5; color: #047857; }
.visit-badge-missed { background: #FEE2E2; color: #991B1B; }
.visit-badge-cancelled { background: #F3F4F6; color: #6B7280; }
.visit-badge-rescheduled { background: #FEF3C7; color: #92400E; }

/* ============================================
   Episode Status Cards
   ============================================ */
.episode-card {
    background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-xl);
    padding: 20px; box-shadow: var(--shadow-sm); transition: all var(--transition-normal); position: relative;
}
.episode-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.episode-card .episode-indicator { position: absolute; top: 0; left: 0; width: 4px; height: 100%; border-radius: var(--radius-xl) 0 0 var(--radius-xl); }
.episode-card .episode-indicator.active { background: var(--hh-episode-active); }
.episode-card .episode-indicator.pending { background: var(--hh-episode-pending); }
.episode-card .episode-indicator.discharged { background: var(--hh-episode-discharged); }
.episode-card .episode-indicator.on-hold { background: var(--hh-episode-on-hold); }
.episode-card .episode-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.episode-card .episode-dates { font-size: 12px; color: var(--text-muted); display: flex; gap: 16px; margin-bottom: 12px; }
.episode-card .episode-disciplines { display: flex; gap: 6px; flex-wrap: wrap; }
.episode-card .episode-visits-summary {
    display: flex; gap: 12px; font-size: 12px; color: var(--text-secondary);
    padding-top: 12px; border-top: 1px solid var(--border-color); margin-top: 12px;
}
.episode-card .episode-visits-summary .visit-count { font-weight: 600; color: var(--text-primary); }

/* ============================================
   Buttons
   ============================================ */
.btn {
    font-weight: 500; padding: 8px 16px; border-radius: 10px; transition: all 0.2s ease;
    font-size: 13px; line-height: 1.4; display: inline-flex; align-items: center;
    justify-content: center; border: none; cursor: pointer; white-space: nowrap;
}
.btn i, .btn .bi { font-size: 13px; line-height: 1; }
.btn:focus { box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); outline: none; }
.btn-primary { background: linear-gradient(135deg, #6366F1, #4F46E5); color: white; box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2); }
.btn-primary:hover { background: linear-gradient(135deg, #4F46E5, #4338CA); color: white; box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35); transform: translateY(-1px); }
.btn-primary:active { background: #4338CA; transform: translateY(0); }
.btn-primary:disabled { background: #A5B4FC; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary { background: #F8FAFC; border: 1px solid #E2E8F0; color: #475569; }
.btn-secondary:hover { background: #F1F5F9; border-color: #CBD5E1; color: #334155; }
.btn-outline-primary { background: transparent; border: 1.5px solid #6366F1; color: #6366F1; }
.btn-outline-primary:hover { background: #EEF2FF; border-color: #4F46E5; color: #4F46E5; }
.btn-success { background: linear-gradient(135deg, #10B981, #059669); color: white; box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2); }
.btn-success:hover { background: linear-gradient(135deg, #059669, #047857); color: white; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35); transform: translateY(-1px); }
.btn-outline-success { background: transparent; border: 1.5px solid #10B981; color: #10B981; }
.btn-outline-success:hover { background: #ECFDF5; border-color: #059669; color: #059669; }
.btn-danger { background: linear-gradient(135deg, #F43F5E, #E11D48); color: white; box-shadow: 0 2px 4px rgba(244, 63, 94, 0.2); }
.btn-danger:hover { background: linear-gradient(135deg, #E11D48, #BE123C); color: white; box-shadow: 0 4px 12px rgba(244, 63, 94, 0.35); transform: translateY(-1px); }
.btn-outline-danger { background: transparent; border: 1.5px solid #F43F5E; color: #F43F5E; }
.btn-outline-danger:hover { background: #FFF1F2; border-color: #E11D48; color: #E11D48; }
.btn-warning { background: linear-gradient(135deg, #F59E0B, #D97706); color: white; box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2); }
.btn-warning:hover { background: linear-gradient(135deg, #D97706, #B45309); color: white; transform: translateY(-1px); }
.btn-info { background: linear-gradient(135deg, #0EA5E9, #0284C7); color: white; box-shadow: 0 2px 4px rgba(14, 165, 233, 0.2); }
.btn-info:hover { background: linear-gradient(135deg, #0284C7, #0369A1); color: white; transform: translateY(-1px); }
.btn-outline-info { background: transparent; border: 1.5px solid #0EA5E9; color: #0EA5E9; }
.btn-outline-info:hover { background: #F0F9FF; border-color: #0284C7; color: #0284C7; }
.btn-light { background: #FFFFFF; border: 1.5px solid #E2E8F0; color: #475569; }
.btn-light:hover { background: #F8FAFC; border-color: #CBD5E1; color: #334155; }
.btn-outline-secondary { background: transparent; border: 1.5px solid #CBD5E1; color: #64748B; }
.btn-outline-secondary:hover { background: #F8FAFC; border-color: #94A3B8; color: #475569; }
.btn-action { padding: 6px 12px; margin-right: 4px; border-radius: 8px; }
.btn-action:last-child { margin-right: 0; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; gap: 5px; }
.btn-sm i, .btn-sm .bi { font-size: 11px; }
.btn-lg { padding: 12px 24px; font-size: 15px; border-radius: 12px; }
.btn:disabled, .btn.disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn .spinner-border-sm { width: 1rem; height: 1rem; border-width: 0.15em; }
.btn-group-sm > .btn { padding: 0.35rem 0.5rem; }

/* Orange & Purple Variants */
.btn-outline-orange { color: #EA580C; border: 1.5px solid #FB923C !important; background: transparent; }
.btn-outline-orange:hover { background-color: #FFF7ED; border-color: #EA580C !important; }
.btn-outline-purple { color: #7C3AED; border: 1.5px solid #A78BFA !important; background: transparent; }
.btn-outline-purple:hover { background-color: #F5F3FF; border-color: #7C3AED !important; }
.btn-orange { background: linear-gradient(135deg, #F97316, #EA580C); color: white; }
.btn-orange:hover { background: linear-gradient(135deg, #EA580C, #C2410C); color: white; transform: translateY(-1px); }
.btn-purple { background: linear-gradient(135deg, #8B5CF6, #7C3AED); color: white; }
.btn-purple:hover { background: linear-gradient(135deg, #7C3AED, #6D28D9); color: white; transform: translateY(-1px); }

/* ============================================
   Forms
   ============================================ */
.form-label { font-weight: 500; font-size: 13px; margin-bottom: 6px; }
.form-label.required::after { content: '*'; color: var(--danger-color); margin-left: 4px; font-weight: 600; }
.form-control, .form-select {
    border-radius: var(--radius-md); border: 1px solid var(--border-color);
    padding: 10px 12px; font-size: 14px; background-color: var(--card-bg);
    color: var(--text-primary); transition: all var(--transition-fast);
}
.form-control:hover, .form-select:hover { border-color: var(--border-medium); }
.form-control:focus, .form-select:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.form-control::placeholder { color: var(--text-muted); }
.form-control:disabled, .form-select:disabled { background-color: var(--bg-secondary); color: var(--text-muted); cursor: not-allowed; }
.form-control-plaintext { padding: 10px 0; font-weight: 500; }
.form-control.is-valid { border-color: var(--success-color); }
.form-control.is-valid:focus { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1); }
.form-control.is-invalid { border-color: var(--danger-color); background-color: var(--danger-bg); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1); }
.invalid-feedback { color: var(--danger-text); font-size: 12px; margin-top: 4px; }
.valid-feedback { color: var(--success-text); font-size: 12px; margin-top: 4px; }
.form-check-input { border-color: var(--border-medium); }
.form-check-input:checked { background-color: var(--primary-color); border-color: var(--primary-color); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }
.form-check-label { color: var(--text-primary); }
.input-group-text { background-color: var(--bg-secondary); border-color: var(--border-color); color: var(--text-secondary); }
.form-section-header { font-size: 14px; font-weight: 600; padding-bottom: 8px; margin-bottom: 16px; border-bottom: 2px solid var(--primary-light); }

/* ============================================
   Modals
   ============================================ */
.modal-backdrop { background-color: rgba(0, 0, 0, 0.5); }
.modal-backdrop.show { opacity: 1; }
.modal-content { border-radius: var(--radius-xl); border: none; box-shadow: var(--shadow-xl); background: var(--card-bg); }
.modal-header { border-bottom: 1px solid var(--border-color); padding: 16px 24px; background: var(--primary-color); color: #fff; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
.modal-header .modal-title { font-weight: 600; font-size: 18px; color: #fff; }
.modal-header .btn-close { opacity: 0.7; transition: opacity var(--transition-fast); filter: brightness(0) invert(1); }
.modal-header .btn-close:hover { opacity: 1; }
.modal-header.bg-primary { background-color: var(--primary-color) !important; }
.modal-header.bg-success { background-color: var(--success-color) !important; }
.modal-header.bg-info { background-color: var(--info-color) !important; }
.modal-header.bg-warning { background-color: var(--warning-color) !important; color: var(--text-primary); }
.modal-header.bg-warning .modal-title { color: var(--text-primary); }
.modal-header.bg-warning .btn-close { filter: none; }
.modal-header.bg-light { background: var(--bg-light) !important; color: var(--text-primary); }
.modal-header.bg-light .modal-title { color: var(--text-primary); }
.modal-header.bg-light .btn-close { filter: none; }
.modal-body { padding: 24px; }
.modal-footer { border-top: 1px solid var(--border-color); padding: 16px 24px; background: var(--bg-light); border-radius: 0 0 var(--radius-xl) var(--radius-xl); gap: 12px; }
/* All modals scrollable: body scrolls, header/footer stay fixed */
.modal-dialog { display: flex; flex-direction: column; max-height: calc(100vh - 3.5rem); }
.modal-dialog .modal-content { display: flex; flex-direction: column; max-height: calc(100vh - 3.5rem); overflow: hidden; }
.modal-dialog .modal-content > form { display: flex; flex-direction: column; flex: 1 1 auto; overflow: hidden; min-height: 0; }
.modal-dialog .modal-body { overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.modal-dialog .modal-header { flex-shrink: 0; }
.modal-dialog .modal-footer { flex-shrink: 0; }
.modal-xl { max-width: 1140px; }
.modal-lg { max-width: 800px; }
.modal.fade .modal-dialog { transform: scale(0.95) translateY(-20px); transition: transform var(--transition-slow); }
.modal.show .modal-dialog { transform: scale(1) translateY(0); }

/* Tabbed Modals */
.modal .nav-tabs { border-bottom: 2px solid var(--border-color); }
.modal .nav-tabs .nav-link { border: none; border-bottom: 3px solid transparent; margin-bottom: -2px; color: var(--text-secondary); font-weight: 500; padding: 8px 16px; }
.modal .nav-tabs .nav-link:hover { color: var(--primary-color); }
.modal .nav-tabs .nav-link.active { color: var(--primary-color); background-color: transparent; border-bottom-color: var(--primary-color); }

/* ============================================
   Toasts
   ============================================ */
.toast { border-radius: var(--radius-lg); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25); min-width: 350px; max-width: 500px; }
.toast.show-toast { border-width: 2px; border-style: solid; }
.toast-header { padding: 12px 16px; font-weight: 700; font-size: 1.1rem; }
.toast-body { padding: 16px; font-size: 1.05rem; line-height: 1.5; font-weight: 500; }
.toast-container { z-index: 9999; }
.toast.toast-success { background: #d4edda !important; border-color: #28a745 !important; }
.toast.toast-success .toast-header { background: #28a745; color: #fff; }
.toast.toast-success .toast-body { color: #155724; }
.toast.toast-danger, .toast.toast-error { background: #f8d7da !important; border-color: #dc3545 !important; }
.toast.toast-danger .toast-header, .toast.toast-error .toast-header { background: #dc3545; color: #fff; }
.toast.toast-danger .toast-body, .toast.toast-error .toast-body { color: #721c24; }
.toast.toast-warning { background: #fff3cd !important; border-color: #ffc107 !important; }
.toast.toast-warning .toast-header { background: #e0a800; color: #000; }
.toast.toast-warning .toast-body { color: #856404; }
.toast.toast-info { background: #d1ecf1 !important; border-color: #17a2b8 !important; }
.toast.toast-info .toast-header { background: #17a2b8; color: #fff; }
.toast.toast-info .toast-body { color: #0c5460; }

/* ============================================
   Alerts
   ============================================ */
.alert { border-radius: var(--radius-lg); border: none; border-left: 4px solid; padding: 16px 20px; font-size: 14px; display: flex; align-items: flex-start; gap: 12px; }
.alert-success { background: var(--success-bg); color: var(--success-text); border-left-color: var(--success-color); }
.alert-danger { background: var(--danger-bg); color: var(--danger-text); border-left-color: var(--danger-color); }
.alert-warning { background: var(--warning-bg); color: var(--warning-text); border-left-color: var(--warning-color); }
.alert-info { background: var(--info-bg); color: var(--info-text); border-left-color: var(--info-color); }
.alert-primary { background: var(--primary-light); color: var(--primary-dark); border-left-color: var(--primary-color); }
.alert .btn-close { padding: 16px; opacity: 0.5; }
.alert .btn-close:hover { opacity: 1; }

/* ============================================
   Clinical Notes & Documentation
   ============================================ */
.note-content {
    background: #fafafa; border: 1px solid var(--border-color); border-radius: 8px;
    padding: 24px; min-height: 300px; font-size: 14px; line-height: 1.7;
}
.note-content h1, .note-content h2, .note-content h3,
.note-content h4, .note-content h5, .note-content h6 { margin-top: 24px; margin-bottom: 12px; }
.note-content h1:first-child, .note-content h2:first-child { margin-top: 0; }
.note-content table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.note-content th, .note-content td { border: 1px solid #ddd; padding: 8px 12px; text-align: left; }
.note-content th { background: #f5f5f5; font-weight: 600; }
.trumbowyg-box { border-radius: 8px; border-color: var(--border-color); }
.trumbowyg-editor { min-height: 400px; font-size: 14px; line-height: 1.6; padding: 16px; }
.trumbowyg-button-pane { background: #f8fafc; }
.signature-placeholder { border-bottom: 2px solid #333 !important; min-width: 250px !important; height: 50px !important; display: inline-block !important; margin: 10px 0; }

/* ============================================
   Patient Detail & Autocomplete
   ============================================ */
.patient-header { display: flex; align-items: flex-start; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border-color); margin-bottom: 20px; }
.patient-avatar-lg {
    width: 80px; height: 80px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; font-weight: 700; color: white; box-shadow: 0 6px 20px rgba(37, 99, 235, 0.25);
}
.patient-info h3 { margin: 0 0 4px; font-size: 24px; font-weight: 600; }
.patient-info .mrn { color: var(--text-secondary); font-size: 14px; margin-bottom: 8px; font-family: 'Roboto Mono', 'SF Mono', monospace; }
.patient-meta { display: flex; gap: 20px; font-size: 13px; color: var(--text-muted); }
.patient-meta i { margin-right: 4px; color: var(--primary-color); }
.patient-link { color: var(--primary-color) !important; }
.patient-link:hover { color: var(--primary-dark) !important; text-decoration: underline !important; }
.patient-autocomplete-container { position: relative; }
.patient-search-results {
    position: absolute; top: 100%; left: 0; right: 0; background: var(--card-bg);
    border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    max-height: 350px; overflow-y: auto; z-index: 1050; margin-top: 4px;
}
.patient-search-result { padding: 12px 16px; cursor: pointer; border-bottom: 1px solid var(--border-color); transition: background 0.15s; }
.patient-search-result:last-child { border-bottom: none; }
.patient-search-result:hover { background: rgba(59, 130, 246, 0.08); }
.selected-patient-card { background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 8px; padding: 12px 16px; }
.selected-patient-card strong { color: #0369a1; }

/* Generic Autocomplete (for modals/forms) */
.autocomplete-wrapper { position: relative; }
.autocomplete-wrapper .autocomplete-results {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 1060; margin-top: 2px;
    background: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg); max-height: 280px; overflow-y: auto;
}
.autocomplete-results .autocomplete-item {
    padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast); font-size: 13px;
}
.autocomplete-results .autocomplete-item:last-child { border-bottom: none; }
.autocomplete-results .autocomplete-item:hover,
.autocomplete-results .autocomplete-item.active { background: var(--primary-light); }
.autocomplete-results .autocomplete-item .ac-name { font-weight: 600; font-size: 13px; }
.autocomplete-results .autocomplete-item .ac-mrn { font-size: 11px; color: var(--primary-color); margin-left: 6px; font-weight: 500; }
.autocomplete-results .autocomplete-item .ac-details { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.autocomplete-results .autocomplete-loading,
.autocomplete-results .autocomplete-empty,
.autocomplete-results .autocomplete-hint { padding: 10px 12px; font-size: 12px; color: var(--text-muted); }
.autocomplete-selected-card {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-top: 6px;
    background: var(--primary-light); border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-md); font-size: 13px;
}
.autocomplete-selected-card .ac-clear-btn {
    margin-left: auto; background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 2px 6px; border-radius: 4px; font-size: 14px;
}
.autocomplete-selected-card .ac-clear-btn:hover { background: rgba(0,0,0,0.08); color: var(--text-primary); }

/* ============================================
   Provider Cards
   ============================================ */
.provider-card {
    background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-xl);
    padding: 24px; text-align: center; box-shadow: var(--shadow-sm); transition: all var(--transition-normal);
}
.provider-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary-light); }
.provider-avatar {
    width: 80px; height: 80px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px; font-size: 28px; font-weight: 700; color: white; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}
.provider-card h5 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.provider-card .specialty { color: var(--text-secondary); font-size: 13px; margin-bottom: 4px; }
.provider-card .credentials { color: var(--text-muted); font-size: 12px; margin-bottom: 12px; }

/* ============================================
   Dashboard Widgets
   ============================================ */
.stat-card.dashboard-widget.clickable { cursor: pointer; transition: all 0.3s ease; }
.stat-card.dashboard-widget.clickable:hover { transform: translateY(-4px); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); }
.stat-card.dashboard-widget.clickable:active { transform: translateY(-2px); }
.stat-card.dashboard-widget.compact { padding: 0.5rem 0.75rem; min-height: auto; }
.stat-card.dashboard-widget.compact .stat-icon-sm { width: 32px; height: 32px; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; border-radius: 8px; color: white; flex-shrink: 0; }
.stat-card.dashboard-widget.compact .stat-value { font-size: 1.25rem; font-weight: 700; line-height: 1.2; }
.stat-card.dashboard-widget.compact .stat-label { font-size: 0.7rem; color: var(--text-secondary); white-space: nowrap; }
.dashboard-header-compact { padding: 0.5rem 0; }
.dashboard-header-compact h4 { font-size: 1.25rem; font-weight: 600; }
.dashboard-card-compact { max-height: 280px; }
.dashboard-card-compact .card-body { max-height: 220px; overflow-y: auto; }
.dashboard-card-compact .card-header h6 { font-size: 0.85rem; font-weight: 600; }
.grid-sidebar .dashboard-card-compact + .dashboard-card-compact { margin-top: 5px; }
.dashboard-widget-item { border: 1px solid var(--border-color); border-radius: 8px; padding: 0.5rem; margin-bottom: 0.5rem; background: white; transition: all 0.2s ease; }
.dashboard-widget-item:hover { border-color: var(--primary-color); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); }
.dashboard-widget-item:last-child { margin-bottom: 0; }
.dashboard-widget-item .item-title { font-weight: 600; font-size: 0.85rem; margin-bottom: 0.25rem; }
.dashboard-widget-item .item-subtitle { font-size: 0.75rem; color: var(--text-secondary); }
.dashboard-section { border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); }
.dashboard-section .card-header { padding: 1rem 1.25rem; font-weight: 600; }
.dashboard-section .card-body { padding: 0; max-height: 400px; overflow-y: auto; }
.dashboard-section .table { margin-bottom: 0; }
.dashboard-section .table th { background-color: #f8fafc; font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); border-bottom: 2px solid var(--border-color); padding: 0.75rem 1rem; }
.dashboard-section .table td { padding: 0.75rem 1rem; vertical-align: middle; }
.section-highlight { animation: sectionHighlight 2s ease-out; }
@keyframes sectionHighlight { 0% { box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.5); } 100% { box-shadow: none; } }

/* Color utilities */
.bg-orange { background-color: #f97316 !important; }
.bg-orange-light { background-color: #fff7ed !important; }
.text-orange { color: #ea580c !important; }
.bg-purple { background-color: #8b5cf6 !important; }
.bg-purple-light { background-color: #f5f3ff !important; }
.text-purple { color: #7c3aed !important; }
.bg-info-light { background-color: #ecfeff !important; }
.text-info { color: #0891b2 !important; }
.bg-teal { background-color: #06B6D4 !important; }
.bg-teal-light { background-color: #CFFAFE !important; }
.text-teal { color: #0891B2 !important; }
.stat-icon-sm.bg-orange { background-color: #f97316 !important; }
.stat-icon-sm.bg-purple { background-color: #8b5cf6 !important; }
.stat-icon-sm.bg-teal { background-color: #06B6D4 !important; }
.bg-amber { background-color: #f59e0b !important; }
.bg-amber-light { background-color: #fffbeb !important; }
.text-amber { color: #d97706 !important; }
.bg-pink { background-color: #ec4899 !important; }
.bg-pink-light { background-color: #fdf2f8 !important; }
.text-pink { color: #db2777 !important; }
.stat-icon-sm.bg-amber { background-color: #f59e0b !important; }
.stat-icon-sm.bg-pink { background-color: #ec4899 !important; }

/* ============================================
   Visit Schedule & Route View
   ============================================ */
.visit-schedule-card { border: 1px solid var(--border-color); border-radius: var(--radius-xl); background: var(--card-bg); overflow: hidden; }
.visit-schedule-card .visit-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border-color); transition: background var(--transition-fast); cursor: pointer; }
.visit-schedule-card .visit-item:last-child { border-bottom: none; }
.visit-schedule-card .visit-item:hover { background: rgba(37, 99, 235, 0.04); }
.visit-item .visit-time { font-size: 12px; font-weight: 600; min-width: 70px; }
.visit-item .visit-patient { flex: 1; }
.visit-item .visit-patient-name { font-weight: 600; font-size: 13px; }
.visit-item .visit-patient-address { font-size: 11px; color: var(--text-muted); }
.visit-item .visit-type { font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: var(--radius-full); }

.route-map-container { height: 400px; border-radius: var(--radius-xl); overflow: hidden; border: 1px solid var(--border-color); }
.route-sidebar { max-height: 400px; overflow-y: auto; }
.route-stop { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border-color); transition: background var(--transition-fast); }
.route-stop:hover { background: var(--bg-light); }
.route-stop-number { width: 28px; height: 28px; border-radius: 50%; background: var(--primary-color); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.route-stop-info .stop-patient { font-weight: 600; font-size: 13px; }
.route-stop-info .stop-address { font-size: 11px; color: var(--text-muted); }
.route-stop-info .stop-time { font-size: 12px; color: var(--text-secondary); font-weight: 500; }

/* ============================================
   OASIS & Plan of Care
   ============================================ */
.oasis-section { border: 1px solid var(--border-color); border-radius: var(--radius-lg); margin-bottom: 16px; }
.oasis-section-header { padding: 12px 16px; background: var(--bg-secondary); border-bottom: 1px solid var(--border-color); border-radius: var(--radius-lg) var(--radius-lg) 0 0; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.oasis-section-header h6 { margin: 0; font-weight: 600; font-size: 14px; }
.oasis-section-body { padding: 16px; }
.oasis-field { margin-bottom: 16px; }
.oasis-field-label { font-weight: 600; font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.oasis-field-code { font-family: 'Roboto Mono', 'SF Mono', monospace; font-size: 11px; color: var(--primary-color); margin-left: 4px; }

.poc-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-bottom: 24px; }
.poc-discipline-card { border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 16px; background: var(--card-bg); }
.poc-discipline-card .discipline-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.poc-discipline-card .visit-frequency { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.poc-discipline-card .visit-progress { height: 6px; background: var(--bg-tertiary); border-radius: var(--radius-full); overflow: hidden; }
.poc-discipline-card .visit-progress-bar { height: 100%; border-radius: var(--radius-full); transition: width 0.3s ease; }

/* ============================================
   Schedule Filters
   ============================================ */
.schedule-filters-card { border: 1px solid var(--border-color); border-radius: var(--radius-xl); background: var(--card-bg); box-shadow: var(--shadow-sm); }
.schedule-filters-card .card-body { padding: 16px 20px; }
.schedule-filter-btn { background: var(--bg-light); border: 1px solid var(--border-color); color: var(--text-primary); font-weight: 500; font-size: 13px; padding: 8px 14px; border-radius: var(--radius-lg); transition: all var(--transition-fast); display: flex; align-items: center; gap: 6px; }
.schedule-filter-btn:hover { background: var(--bg-secondary); border-color: var(--border-medium); }
.schedule-filter-btn:focus { box-shadow: 0 0 0 3px var(--primary-light); border-color: var(--primary-color); }
.schedule-filter-btn i { color: var(--text-muted); font-size: 14px; }
.schedule-filter-btn:hover i { color: var(--primary-color); }
.schedule-filter-btn.has-filters, .schedule-filter-btn.active { background: var(--primary-light); border-color: var(--primary-color); color: var(--primary-color); }
.schedule-filter-btn.has-filters i, .schedule-filter-btn.active i { color: var(--primary-color); }
.schedule-filter-menu { border: 1px solid var(--border-color); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 12px; margin-top: 4px; }
.schedule-filter-option { padding: 8px 12px; margin: 2px 0; border-radius: var(--radius-md); transition: background var(--transition-fast); padding-left: 2rem; }
.schedule-filter-option:hover { background: var(--bg-secondary); }
.schedule-filter-option .form-check-input:checked { background-color: var(--primary-color); border-color: var(--primary-color); }

/* ============================================
   Calendar (FullCalendar)
   ============================================ */
#calendar { min-height: 600px; }
.fc { --fc-border-color: var(--border-color); --fc-today-bg-color: rgba(37, 99, 235, 0.05); --fc-neutral-bg-color: var(--bg-light); --fc-page-bg-color: var(--card-bg); }
.fc .fc-toolbar-title { font-size: 18px; font-weight: 600; }
.fc .fc-button { padding: 7px 14px; font-size: 13px; font-weight: 500; border-radius: 10px; }
.fc .fc-button-primary { background: linear-gradient(135deg, #6366F1, #4F46E5); border: none; }
.fc .fc-button-primary:not(:disabled):hover { background: linear-gradient(135deg, #4F46E5, #4338CA); transform: translateY(-1px); }
.fc .fc-button-primary:not(:disabled).fc-button-active { background: #4338CA; }
.fc .fc-day-today { background: var(--primary-light) !important; }
.fc .fc-col-header-cell { background: var(--bg-secondary); font-weight: 600; text-transform: uppercase; font-size: 12px; letter-spacing: 0.05em; }
.fc .fc-daygrid-day-number { font-weight: 500; }
.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number { background: var(--primary-color); color: white; border-radius: 50%; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; }
.fc-event, .fc-daygrid-event, .fc-daygrid-block-event { border-radius: 6px !important; padding: 0 !important; font-size: 11px !important; cursor: pointer; border: 1px solid rgba(0, 0, 0, 0.1) !important; margin: 2px 0 4px 0 !important; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); overflow: hidden !important; }
.fc-event:hover { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); transform: translateY(-1px); }
.fc-daygrid-block-event .fc-event-main { padding: 6px 8px; overflow: hidden; }
.fc-event-time { display: none !important; }
.fc-event-title { display: none !important; }
.event-content-modern { display: flex; flex-direction: column; gap: 2px; position: relative; }
.event-clinician { font-weight: 600; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-patient { font-weight: 500; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0.85; }
.event-type { font-size: 9px; font-weight: 600; background: rgba(0, 0, 0, 0.08); padding: 2px 6px; border-radius: 4px; }
.event-time { font-size: 9px; font-weight: 500; margin-top: 3px; opacity: 0.9; }
.calendar-event-ribbon { position: absolute; bottom: 0; left: 0; right: 0; padding: 3px 6px; font-size: 8px; font-weight: 700; text-align: center; text-transform: uppercase; letter-spacing: 0.5px; border-radius: 0 0 8px 8px; z-index: 1; }
.calendar-ribbon-missed { background: linear-gradient(135deg, #EF4444, #DC2626); color: #fff; }
.calendar-ribbon-completed { background: linear-gradient(135deg, #10B981, #059669); color: #fff; }
.calendar-ribbon-missing-notes { background: linear-gradient(135deg, #EF4444, #DC2626); color: #fff; }
.calendar-ribbon-requires-signature { background: linear-gradient(135deg, #8B5CF6, #7C3AED); color: #fff; }
#calendarLegend { background: var(--card-bg); padding: 12px 16px; border-radius: 8px; border: 1px solid var(--border-color); }
.legend-item { margin-right: 16px; }
.status-legend-item { display: inline-flex; align-items: center; margin-right: 12px; }
.status-legend-color { width: 12px; height: 12px; border-radius: 2px; margin-right: 6px; display: inline-block; }

/* ============================================
   Reports
   ============================================ */
.report-card { cursor: pointer; transition: all 0.2s ease; border: 1px solid var(--border-color); }
.report-card:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); border-color: var(--primary-color); }
.report-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; }

/* ============================================
   Loading Overlay & App Loading Screen
   ============================================ */
.global-loader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); display: flex; align-items: center; justify-content: center; z-index: 9999; backdrop-filter: blur(2px); }
.global-loader.d-none { display: none !important; }
.loader-content { background: var(--card-bg); padding: 40px 60px; border-radius: 16px; text-align: center; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }
.loader-content .spinner-border { width: 3rem; height: 3rem; }
.loader-text { color: var(--text-secondary); font-size: 14px; margin-bottom: 0; }

.app-loading-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 50%, #BFDBFE 100%);
    display: flex; align-items: center; justify-content: center;
    z-index: 10000; transition: opacity 0.3s ease, visibility 0.3s ease;
}
.app-loading-screen::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%232563EB' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}
.app-loading-screen.d-none { opacity: 0; visibility: hidden; pointer-events: none; }
.app-loading-content { text-align: center; position: relative; z-index: 1; }
.app-loading-logo { width: 100px; height: 100px; border-radius: 24px; display: flex; align-items: center; justify-content: center; margin: 0 auto 24px; animation: pulse 2s infinite; }
.app-loading-logo .app-loading-logo-img { width: 100px; height: 100px; object-fit: contain; border-radius: 24px; }
.app-loading-title { font-size: 36px; font-weight: 700; margin: 0 0 8px; letter-spacing: -0.5px; }
.app-loading-subtitle { font-size: 16px; color: var(--text-secondary); margin: 0; }
.app-loading-status { font-size: 14px; color: var(--text-muted); margin-bottom: 0; }
.app-loading-screen .spinner-border { color: var(--primary-color) !important; }
@keyframes pulse { 0%, 100% { transform: scale(1); box-shadow: 0 12px 40px rgba(37, 99, 235, 0.3); } 50% { transform: scale(1.05); box-shadow: 0 16px 50px rgba(37, 99, 235, 0.4); } }

/* ============================================
   Tabs, Pagination, Progress, Accordion
   ============================================ */
.nav-tabs { border-bottom: 2px solid var(--border-color); }
.nav-tabs .nav-link { border: none; border-bottom: 3px solid transparent; margin-bottom: -2px; color: var(--text-secondary); font-weight: 500; padding: 10px 16px; font-size: 13px; }
.nav-tabs .nav-link:hover { color: var(--primary-color); }
.nav-tabs .nav-link.active { color: var(--primary-color); background-color: transparent; border-bottom-color: var(--primary-color); font-weight: 600; }
.nav-pills .nav-link { border-radius: var(--radius-lg); color: var(--text-secondary); font-weight: 500; padding: 8px 16px; font-size: 13px; }
.nav-pills .nav-link:hover { background: var(--bg-secondary); color: var(--text-primary); }
.nav-pills .nav-link.active { background: var(--primary-color); color: white; }
.pagination .page-link { border-color: var(--border-color); color: var(--text-secondary); font-size: 13px; padding: 8px 14px; }
.pagination .page-link:hover { background: var(--primary-light); border-color: var(--primary-color); color: var(--primary-color); }
.pagination .page-item.active .page-link { background: var(--primary-color); border-color: var(--primary-color); color: white; }
.pagination .page-item.disabled .page-link { color: var(--text-muted); background: var(--bg-light); }
.progress { height: 8px; border-radius: var(--radius-full); background: var(--bg-tertiary); overflow: hidden; }
.progress-bar { border-radius: var(--radius-full); transition: width 0.3s ease; }
.accordion-button { font-weight: 600; background: var(--bg-light); font-size: 14px; padding: 14px 20px; }
.accordion-button:not(.collapsed) { color: var(--primary-color); background: var(--primary-light); box-shadow: none; }
.accordion-button:focus { box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); }
.accordion-item { border-color: var(--border-color); border-radius: var(--radius-lg) !important; margin-bottom: 8px; overflow: hidden; }
.accordion-body { padding: 20px; }

/* Dropdown Overrides */
.dropdown-menu { border: 1px solid var(--border-color); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 8px; }
.dropdown-item { border-radius: var(--radius-md); padding: 8px 12px; font-size: 13px; transition: background var(--transition-fast); }
.dropdown-item:hover { background: var(--primary-light); color: var(--primary-color); }
.dropdown-item.active, .dropdown-item:active { background: var(--primary-color); color: white; }
.dropdown-divider { border-color: var(--border-color); margin: 4px 0; }

/* Tooltip / Popover */
.tooltip-inner { background: var(--text-primary); border-radius: var(--radius-md); font-size: 12px; padding: 6px 12px; }
.popover { border-color: var(--border-color); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.popover-header { background: var(--bg-light); border-bottom-color: var(--border-color); font-weight: 600; }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); height: 100vh; height: 100dvh; max-height: -webkit-fill-available; }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .sidebar-nav { flex: 1; overflow-y: auto; min-height: 0; }
    .sidebar-footer { flex-shrink: 0; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
    .header-patient-search { width: 200px; min-width: 150px; }
    .header-search-shortcut { display: none !important; }
    .header-search-input { padding-right: 12px !important; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-grid .grid-main, .dashboard-grid .grid-sidebar { grid-column: 1; grid-row: auto; }
    .mobile-menu-toggle { display: flex; align-items: center; justify-content: center; }
}
@media (max-width: 767.98px) {
    .main-header { flex-wrap: wrap; }
    .header-patient-search { order: 10; width: 100%; min-width: unset; }
    .header-search-results { min-width: unset; }
    .content-area { padding: 16px; }
    .page-header { flex-direction: column; gap: 16px; align-items: flex-start; }
    .stat-card { flex-direction: column; text-align: center; }
    .patient-header { flex-direction: column; text-align: center; }
    .patient-meta { flex-direction: column; gap: 8px; }
    .dashboard-stats-row { grid-template-columns: 1fr 1fr; }
    .episode-card .episode-visits-summary { flex-direction: column; gap: 4px; }
    .poc-summary { grid-template-columns: 1fr; }
    .dashboard-section .card-body { max-height: 300px; }
    .btn-group-sm > .btn { padding: 0.25rem 0.4rem; font-size: 0.8rem; }
}
@media (max-width: 575.98px) {
    .dashboard-stats-row { grid-template-columns: 1fr; }
}

/* Sidebar Overlay & Mobile Toggle */
.sidebar-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.4); z-index: 999; backdrop-filter: blur(2px); }
.sidebar-overlay.show { display: block; }
.mobile-menu-toggle { display: none; background: none; border: none; font-size: 20px; color: var(--text-primary); cursor: pointer; padding: 8px; border-radius: var(--radius-md); }
.mobile-menu-toggle:hover { background: var(--bg-secondary); }

/* ============================================
   Print
   ============================================ */
@media print {
    .sidebar, .main-header, .modal-header .btn-close, .modal-footer { display: none !important; }
    .main-content { margin-left: 0; }
    .modal { position: static; display: block; }
    .modal-dialog { margin: 0; max-width: 100%; }
    .modal-content { border: none; box-shadow: none; }
    .note-content { border: none; background: white; }
}

/* ============================================
   Empty State
   ============================================ */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state-icon { font-size: 48px; color: var(--bg-tertiary); margin-bottom: 16px; }
.empty-state-title { font-size: 18px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.empty-state-text { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; max-width: 400px; margin-left: auto; margin-right: auto; }

/* ============================================
   Utilities
   ============================================ */
.cursor-pointer { cursor: pointer; }
.border-left-primary { border-left: 3px solid var(--primary-color) !important; }
.border-left-success { border-left: 3px solid var(--success-color) !important; }
.border-left-warning { border-left: 3px solid var(--warning-color) !important; }
.border-left-danger { border-left: 3px solid var(--danger-color) !important; }
.border-left-info { border-left: 3px solid var(--info-color) !important; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.no-wrap { white-space: nowrap; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
::selection { background: rgba(99, 102, 241, 0.2); color: var(--text-primary); }

/* ============================================
   Messaging
   ============================================ */
.thread-item { transition: background-color 0.15s ease; }
.thread-item:hover { background-color: #f0f2f5; }
.thread-item.active-thread { background-color: var(--primary-light); border-left: 3px solid var(--primary-color); }
.thread-item.unread-thread { background-color: #fefce8; }
.thread-item.unread-thread.active-thread { background-color: var(--primary-light); }
.min-width-0 { min-width: 0; }

/* Messaging sidebar nav badge */
.sidebar-nav .nav-item .badge {
    font-size: 0.65rem;
    padding: 0.2em 0.45em;
    min-width: 18px;
}

/* Message bubbles */
.msg-bubble { box-shadow: 0 1px 2px rgba(0,0,0,0.08); }

/* Messaging responsive overrides */
@@media (max-width: 767.98px) {
    #messagingPage .row { height: auto !important; min-height: auto !important; }
    #threadListPanel, #conversationPanel { height: calc(100vh - 140px) !important; }
}

/* ============================================
   PDGM Score Card
   ============================================ */

.pdgm-score-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}

.pdgm-score-card.pdgm-no-score {
    background: var(--bg-light);
    border-style: dashed;
}

.pdgm-dimensions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.pdgm-dimension {
    text-align: center;
    min-width: 100px;
}

.pdgm-dim-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.pdgm-dim-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
}

.pdgm-dim-subtitle {
    font-size: 10px;
    color: var(--text-secondary);
}

.pdgm-arrow {
    color: var(--text-secondary);
    font-size: 14px;
    padding: 0 4px;
}

.pdgm-compact .badge {
    font-size: 11px;
    padding: 4px 8px;
}

/* ============================================
   OASIS Assessment Form
   ============================================ */

.oasis-layout {
    display: flex;
    gap: 20px;
    min-height: calc(100vh - 200px);
}

.oasis-sidebar {
    width: 250px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    align-self: flex-start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.oasis-sidebar .nav-link {
    padding: 8px 12px;
    color: var(--text-primary);
    border-radius: var(--radius-md);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
}

.oasis-sidebar .nav-link:hover {
    background: var(--bg-light);
}

.oasis-sidebar .nav-link.active {
    background: rgba(var(--primary-rgb, 106, 90, 205), 0.1);
    color: var(--primary-color);
    font-weight: 600;
    border-left-color: var(--primary-color);
}

.oasis-sidebar .section-check {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 10px;
}

.oasis-sidebar .section-check.complete {
    background: var(--success-color);
    color: #fff;
}

.oasis-sidebar .section-check.incomplete {
    background: var(--bg-light);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.oasis-main {
    flex: 1;
    min-width: 0;
}

.oasis-section-panel {
    display: none;
}

.oasis-section-panel.active {
    display: block;
}

.oasis-item {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.oasis-item:last-child {
    border-bottom: none;
}

.oasis-item-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.oasis-item-code {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: monospace;
    margin-right: 8px;
}

.oasis-item-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.oasis-action-bar {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 2px solid var(--border-color);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}

.oasis-header-bar {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

/* ============================================
   Reporting Charts (Pure CSS)
   ============================================ */

.report-chart-bar {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
}

.report-chart-bar .bar-label {
    min-width: 120px;
    font-size: 13px;
    color: var(--text-primary);
    text-align: right;
}

.report-chart-bar .bar-track {
    flex: 1;
    height: 24px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.report-chart-bar .bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
    min-width: 2px;
}

.report-chart-bar .bar-value {
    min-width: 50px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.report-kpi-card {
    text-align: center;
    padding: 20px 12px;
}

.report-kpi-card .kpi-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}

.report-kpi-card .kpi-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.report-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.report-stat-row:last-child {
    border-bottom: none;
}

.report-stat-row .stat-label {
    color: var(--text-secondary);
}

.report-stat-row .stat-value {
    font-weight: 600;
    color: var(--text-primary);
}

.report-color-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

/* ============================================
   Orders Page
   ============================================ */

.order-priority-stat { font-weight: 600; }
.order-priority-stat.text-stat { color: var(--danger-color); }

.signature-box {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    background: var(--bg-light);
}

.signature-box input {
    font-family: 'Brush Script MT', 'Segoe Script', cursive;
    font-size: 24px;
    text-align: center;
    border: none;
    border-bottom: 2px solid var(--primary-color);
    background: transparent;
    width: 100%;
    padding: 8px;
}

.signature-box input:focus {
    outline: none;
    border-bottom-color: var(--primary-color);
}

/* Responsive OASIS sidebar */
@@media (max-width: 991.98px) {
    .oasis-layout { flex-direction: column; }
    .oasis-sidebar {
        width: 100%;
        position: static;
        max-height: none;
        display: flex;
        overflow-x: auto;
        gap: 4px;
        padding-bottom: 8px;
    }
    .oasis-sidebar .nav-link {
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    .oasis-sidebar .nav-link.active {
        border-left-color: transparent;
        border-bottom-color: var(--primary-color);
    }
}

/* Responsive PDGM */
@@media (max-width: 767.98px) {
    .pdgm-dimensions { flex-direction: column; }
    .pdgm-arrow { transform: rotate(90deg); }
    .pdgm-dimension { min-width: auto; }
}
