/* ============================================
   RehabDox - Main Stylesheet
   Modern Healthcare Light Theme
   Updated: December 2024
   ============================================ */

:root {
    /* Primary Brand Colors - Healthcare Blue */
    --primary-color: #2563EB;
    --primary-hover: #1D4ED8;
    --primary-light: #DBEAFE;
    --primary-dark: #1E40AF;

    /* Secondary Colors - Teal/Cyan for wellness */
    --secondary-color: #06B6D4;
    --secondary-hover: #0891B2;
    --secondary-light: #CFFAFE;

    /* Accent Colors */
    --accent-emerald: #10B981;
    --accent-emerald-light: #D1FAE5;
    --accent-coral: #F97316;
    --accent-coral-light: #FFEDD5;

    /* Background Colors - Clean, Clinical */
    --body-bg: #F9FAFB;
    --card-bg: #FFFFFF;
    --bg-secondary: #F3F4F6;
    --bg-tertiary: #E5E7EB;
    --bg-light: #FAFAFA;

    /* Text Colors - High Readability */
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --text-white: #FFFFFF;

    /* Status & Semantic Colors */
    --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 Colors */
    --border-color: #E5E7EB;
    --border-medium: #D1D5DB;
    --border-focus: #2563EB;
    --border-disabled: #D1D5DB;

    /* Sidebar - Modern Light Theme */
    --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;

    /* Shadows */
    --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);

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-2xl: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 200ms ease-in-out;
    --transition-slow: 300ms ease-in-out;

    /* Spacing Scale */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;
    --space-3xl: 48px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--body-bg);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
}

/* ============================================
   Login Page - Modern Healthcare Design
   ============================================ */

.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;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.login-header .logo i {
    font-size: 36px;
    color: white;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    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 Selection UI */
.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;
    color: var(--text-primary);
    font-size: 16px;
    margin-bottom: 4px;
}

.tenant-option .tenant-subdomain {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ============================================
   Main Layout - Modern Light Theme
   ============================================ */

#mainApp {
    display: flex;
    min-height: 100vh;
    background: var(--body-bg);
}

/* Sidebar - Light Theme */
.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;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    background: var(--card-bg);
}

.sidebar-header .logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.sidebar-header .logo i {
    font-size: 20px;
    color: white;
}

.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;
    color: var(--text-primary);
    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-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 {
    color: var(--primary-color);
}

.sidebar-nav .nav-item.active i {
    color: var(--primary-color);
}

.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;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 50%;
    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;
    color: var(--text-primary);
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

/* Sidebar Footer Buttons - Light Theme */
.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; }

/* Billing access: visible for super-admin, admin, and biller */
body:not(.super-admin):not(.admin):not(.biller) .requires-billing-access { display: none !important; }

/* Hide clinical actions from Biller and Read-Only */
body.biller .requires-clinical,
body.read-only .requires-clinical { display: none !important; }

/* Read-only users can only view, not modify */
body.read-only .requires-write { display: none !important; }

/* Biller-specific: hide patient editing and appointment creation */
body.biller .hide-from-biller { display: none !important; }

/* Read-only: hide all edit/create buttons */
body.read-only .hide-from-biller { display: none !important; }

/* Therapist/Clinician-specific: hide appointment management and patient editing */
body.clinician .hide-from-therapist { display: none !important; }

/* Show only for therapists - hidden by default, shown only for clinician role */
.show-only-therapist { display: none !important; }
body.clinician .show-only-therapist { display: block !important; }

/* Dashboard CSS Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
    align-items: start;
}

/* Appointments spans 2 columns */
.dashboard-grid .grid-appointments {
    grid-column: span 2;
}

/* Sidebar spans column 3, all rows */
.dashboard-grid .grid-sidebar {
    grid-column: 3;
    grid-row: 1 / span 3;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Responsive: stack on smaller screens */
@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-grid .grid-appointments,
    .dashboard-grid .grid-sidebar {
        grid-column: 1;
        grid-row: auto;
    }
}

/* Main Content - Light Theme */
.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);
}

.header-search {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.header-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.header-search input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 14px;
    transition: all var(--transition-fast);
    background: var(--bg-secondary);
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--card-bg);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.header-search input:focus + i,
.header-search:focus-within i {
    color: var(--primary-color);
}

.header-search input::placeholder {
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* Super Admin Clinic Filter */
.clinic-filter-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 8px;
}

.clinic-filter-label {
    font-size: 13px;
    font-weight: 500;
    color: #92400e;
    white-space: nowrap;
}

.clinic-filter-container .form-select {
    min-width: 180px;
    font-size: 13px;
    border-color: #fbbf24;
}

/* Hide clinic filter for non-super-admin by default */
body:not(.super-admin) .requires-super-admin {
    display: none !important;
}

.content-area {
    flex: 1;
    padding: 24px;
}

/* ============================================
   Pages - Modern Healthcare Design
   ============================================ */

.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: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.page-header .text-muted {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ============================================
   Cards - Modern Healthcare Design
   ============================================ */

.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;
    color: var(--text-primary);
}

.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-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary);
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
}

/* ============================================
   Tables - Modern Healthcare Design
   ============================================ */

.table {
    margin: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    background: var(--bg-light);
}

.table td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.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 Variants */
.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);
}

/* Selected Row */
.table tbody tr.selected,
.table tbody tr.table-active {
    background-color: var(--primary-light) !important;
}

/* Table inside cards */
.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;
}

/* ============================================
   Status Badges - Modern Healthcare Design
   ============================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.01em;
    transition: all var(--transition-fast);
}

/* Appointment Status Badges */
.status-scheduled {
    background: var(--info-bg);
    color: var(--info-text);
    border: 1px solid rgba(30, 64, 175, 0.2);
}

.status-confirmed {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid rgba(6, 95, 70, 0.2);
}

.status-checkedin {
    background: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid rgba(146, 64, 14, 0.2);
}

.status-inprogress {
    background: #E0E7FF;
    color: #3730A3;
    border: 1px solid rgba(55, 48, 163, 0.2);
}

.status-completed {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid rgba(6, 95, 70, 0.2);
}

.status-noshow {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid rgba(153, 27, 27, 0.2);
}

.status-cancelled {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* Patient Status Badges */
.status-active {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid rgba(6, 95, 70, 0.2);
}

.status-discharged {
    background: #fce4ec;
    color: #c2185b;
    border: 1px solid rgba(194, 24, 91, 0.2);
}

.status-no-episode {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid rgba(21, 101, 192, 0.2);
}

.status-inactive {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* General Status Badges */
.status-pending {
    background: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid rgba(146, 64, 14, 0.2);
}

.status-approved {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid rgba(6, 95, 70, 0.2);
}

.status-denied {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid rgba(153, 27, 27, 0.2);
}

/* Bootstrap Badge Overrides */
.badge {
    font-weight: 500;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.badge.bg-primary {
    background: var(--primary-color) !important;
}

.badge.bg-success {
    background: var(--success-color) !important;
}

.badge.bg-warning {
    background: var(--warning-color) !important;
    color: white !important;
}

.badge.bg-danger {
    background: var(--danger-color) !important;
}

.badge.bg-info {
    background: var(--info-color) !important;
}

.badge.bg-secondary {
    background: var(--text-secondary) !important;
}

.badge.bg-light {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

/* ============================================
   Buttons - Modern Healthcare Design
   ============================================ */

.btn {
    font-weight: 500;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-size: 14px;
    line-height: 1.5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.25);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

/* Secondary Button - Outline Style */
.btn-secondary {
    background: var(--card-bg);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--text-muted);
    color: var(--text-primary);
}

/* Outline Primary */
.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Success Button */
.btn-success {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
    border-color: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.25);
}

/* Danger Button */
.btn-danger {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #DC2626;
    border-color: #DC2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.25);
}

/* Outline Danger */
.btn-outline-danger {
    background: transparent;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

.btn-outline-danger:hover {
    background: var(--danger-bg);
    border-color: var(--danger-color);
    color: var(--danger-text);
}

/* Warning Button */
.btn-warning {
    background: var(--warning-color);
    border-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background: #D97706;
    border-color: #D97706;
}

/* Info Button */
.btn-info {
    background: var(--info-color);
    border-color: var(--info-color);
    color: white;
}

.btn-info:hover {
    background: #2563EB;
    border-color: #2563EB;
}

/* Light Button */
.btn-light {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-light:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-medium);
}

/* Action Buttons */
.btn-action {
    padding: 6px 10px;
    margin-right: 4px;
    border-radius: var(--radius-md);
}

.btn-action:last-child {
    margin-right: 0;
}

/* Button Sizes */
.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
    border-radius: var(--radius-lg);
}

/* Disabled State */
.btn:disabled,
.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ============================================
   Calendar - Modern Healthcare Design
   ============================================ */

#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;
    color: var(--text-primary);
}

.fc .fc-button {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.fc .fc-button-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.fc .fc-button-primary:not(:disabled):hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
}

.fc .fc-button-primary:not(:disabled).fc-button-active {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.fc .fc-day-today {
    background: var(--primary-light) !important;
}

.fc .fc-col-header-cell {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.05em;
}

.fc .fc-daygrid-day-number {
    color: var(--text-primary);
    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;
}

/* Calendar Events - Block Display */
.fc-event,
.fc-daygrid-event,
.fc-daygrid-block-event {
    border-radius: 4px !important;
    padding: 4px 6px !important;
    font-size: 11px !important;
    cursor: pointer;
    border-width: 2px !important;
    border-style: solid !important;
    border-color: #000 !important;
    margin-bottom: 3px !important;
}

/* Event content styling */
.fc-daygrid-block-event .fc-event-main {
    padding: 2px 4px;
}

/* Hide default time display since we show it in title */
.fc-event-time {
    display: none !important;
}

/* Event title - multi-line with first line bold */
.fc-event-title {
    white-space: pre-line !important;
    line-height: 1.4 !important;
    color: #fff !important;
}

.fc-event-title::first-line {
    font-weight: 700;
}

/* Calendar Legend */
#calendarLegend {
    background: var(--card-bg);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.legend-item {
    margin-right: 16px;
}

/* Calendar Event Status Ribbons */
.fc-event.has-status-ribbon,
.fc-daygrid-event.has-status-ribbon,
.fc-timegrid-event.has-status-ribbon {
    position: relative;
    overflow: visible;
}

.calendar-event-ribbon {
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    padding: 2px 4px;
    font-size: 9px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-radius: 0 0 4px 4px;
    z-index: 1;
    line-height: 1.2;
}

/* Missing Notes - Red/Danger */
.calendar-ribbon-missing-notes {
    background: #DC2626;
    color: #ffffff;
}

/* Requires Signature - Purple */
.calendar-ribbon-requires-signature {
    background: #7C3AED;
    color: #ffffff;
}

/* Completed - Green/Success */
.calendar-ribbon-completed {
    background: #059669;
    color: #ffffff;
}

/* Adjust event padding when ribbon is present */
.fc-event.has-status-ribbon .fc-event-main,
.fc-daygrid-event.has-status-ribbon .fc-event-main {
    padding-bottom: 14px;
}

/* Status legend items */
.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;
}

/* ============================================
   Patient Autocomplete - KEY STYLING
   ============================================ */

.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);
}

.patient-result-main {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.patient-result-main strong {
    font-size: 14px;
    color: var(--text-primary);
}

.patient-result-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.selected-patient-card {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 12px 16px;
}

.selected-patient-card strong {
    color: #0369a1;
}

/* ============================================
   Clinical Notes
   ============================================ */

.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 Editor Customization */
.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;
}

/* Tabbed Clinical Notes Modal */
#tabbedClinicalNoteModal .modal-header {
    border-bottom: none;
    padding-bottom: 0;
}

#tabbedClinicalNoteModal .nav-tabs {
    border-bottom: 2px solid var(--border-color);
}

#tabbedClinicalNoteModal .nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 8px 16px;
    transition: all 0.2s ease;
}

#tabbedClinicalNoteModal .nav-tabs .nav-link:hover {
    color: var(--primary-color);
    border-color: transparent;
}

#tabbedClinicalNoteModal .nav-tabs .nav-link.active {
    color: var(--primary-color);
    background-color: transparent;
    border-bottom-color: var(--primary-color);
}

#tabbedClinicalNoteModal .tab-content {
    padding-top: 1rem;
}

#tabbedClinicalNoteModal .signed-note-view .note-content,
#tabbedClinicalNoteModal .draft-note-view .note-content {
    max-height: 60vh;
    overflow-y: auto;
}

/* Signature placeholder styling */
.signature-placeholder {
    border-bottom: 2px solid #333 !important;
    min-width: 250px !important;
    height: 50px !important;
    display: inline-block !important;
    margin: 10px 0;
}

/* ============================================
   Providers Grid - Modern Healthcare Design
   ============================================ */

.provider-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 24px;
    text-align: center;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.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;
    color: var(--text-primary);
}

.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;
}

.provider-card .btn {
    margin-top: 8px;
}

/* ============================================
   Patient Detail Modal - Modern Healthcare Design
   ============================================ */

.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;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 50%;
    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;
    color: var(--text-primary);
    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);
}

/* ============================================
   Alerts - Modern Healthcare Design
   ============================================ */

/* Bootstrap Alert Overrides */
.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;
}

/* Alert Items */
.alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    transition: background-color var(--transition-fast);
}

.alert-item:hover {
    background-color: var(--bg-light);
    margin: 0 -12px;
    padding: 12px;
    border-radius: var(--radius-md);
}

.alert-item:last-child {
    border-bottom: none;
}

.alert-item i {
    font-size: 18px;
    color: var(--text-muted);
}

.alert-item span {
    flex: 1;
    color: var(--text-secondary);
}

.alert-item strong {
    font-size: 18px;
    color: var(--text-primary);
}

/* A/R Aging */
.aging-bucket {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.aging-bucket:last-child {
    border-bottom: none;
}

/* ============================================
   Form Styles - Modern Healthcare Design
   ============================================ */

.form-label {
    font-weight: 500;
    font-size: 13px;
    color: var(--text-primary);
    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);
    background-color: var(--card-bg);
}

.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;
    color: var(--text-primary);
}

/* Form Validation States */
.form-control.is-valid {
    border-color: var(--success-color);
}

.form-control.is-valid:focus {
    border-color: var(--success-color);
    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 {
    border-color: var(--danger-color);
    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;
}

/* Checkbox and Radio */
.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 Groups */
.input-group-text {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

/* ============================================
   Modal Styles - Modern Healthcare Design
   ============================================ */

.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: 20px 24px;
    background: var(--bg-light);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 18px;
}

.modal-header .btn-close {
    opacity: 0.5;
    transition: opacity var(--transition-fast);
}

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 24px;
    color: var(--text-primary);
}

.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;
}

.modal-xl {
    max-width: 1140px;
}

.modal-lg {
    max-width: 800px;
}

/* Modal Animation */
.modal.fade .modal-dialog {
    transform: scale(0.95) translateY(-20px);
    transition: transform var(--transition-slow);
}

.modal.show .modal-dialog {
    transform: scale(1) translateY(0);
}

/* ============================================
   Toast - Modern Healthcare Design
   Enhanced for better readability
   ============================================ */

.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;
    border-bottom-width: 2px;
}

.toast-header .btn-close {
    font-size: 1rem;
    padding: 8px;
}

.toast-body {
    padding: 16px;
    font-size: 1.05rem;
    line-height: 1.5;
    font-weight: 500;
}

/* Toast Container Positioning */
.toast-container {
    z-index: 9999;
}

/* Success Toast - Green theme */
.toast.toast-success {
    background: #d4edda !important;
    border-color: #28a745 !important;
}

.toast.toast-success .toast-header {
    background: #28a745;
    color: #ffffff;
    border-bottom-color: #1e7e34;
}

.toast.toast-success .toast-body {
    color: #155724;
    background: #d4edda;
}

/* Danger/Error Toast - Red theme */
.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: #ffffff;
    border-bottom-color: #c82333;
}

.toast.toast-danger .toast-body,
.toast.toast-error .toast-body {
    color: #721c24;
    background: #f8d7da;
}

/* Warning Toast - Yellow/Orange theme */
.toast.toast-warning {
    background: #fff3cd !important;
    border-color: #ffc107 !important;
}

.toast.toast-warning .toast-header {
    background: #e0a800;
    color: #000000;
    border-bottom-color: #d39e00;
}

.toast.toast-warning .toast-body {
    color: #856404;
    background: #fff3cd;
}

/* Info Toast - Blue theme */
.toast.toast-info {
    background: #d1ecf1 !important;
    border-color: #17a2b8 !important;
}

.toast.toast-info .toast-header {
    background: #17a2b8;
    color: #ffffff;
    border-bottom-color: #138496;
}

.toast.toast-info .toast-body {
    color: #0c5460;
    background: #d1ecf1;
}

/* Primary Toast - Blue theme */
.toast.toast-primary {
    background: #cce5ff !important;
    border-color: #007bff !important;
}

.toast.toast-primary .toast-header {
    background: #007bff;
    color: #ffffff;
    border-bottom-color: #0069d9;
}

.toast.toast-primary .toast-body {
    color: #004085;
    background: #cce5ff;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 767.98px) {
    .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;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@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;
    }
}

/* ============================================
   Global Loading Overlay
   ============================================ */

.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;
}

/* ============================================
   Initial App Loading Screen - Light Theme
   ============================================ */

.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;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.app-loading-logo {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    animation: pulse 2s infinite;
    box-shadow: 0 12px 40px rgba(37, 99, 235, 0.3);
}

.app-loading-logo i {
    font-size: 50px;
    color: white;
}

.app-loading-title {
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--text-primary);
    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);
    }
}

/* ============================================
   Admin Dashboard - Redesign
   ============================================ */

/* Clickable summary 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);
}

/* Compact dashboard widgets */
.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-content {
    display: flex;
    flex-direction: column;
}

.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 */
.dashboard-header-compact {
    padding: 0.5rem 0;
}

.dashboard-header-compact h4 {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Dashboard card compact */
.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;
}

/* Orange and Purple colors for new widgets */
.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;
}

.stat-icon-sm.bg-orange {
    background-color: #f97316 !important;
}

.stat-icon-sm.bg-purple {
    background-color: #8b5cf6 !important;
}

/* Orange and Purple button variants */
.btn-outline-orange {
    color: #ea580c;
    border-color: #ea580c;
}

.btn-outline-orange:hover {
    color: #fff;
    background-color: #ea580c;
    border-color: #ea580c;
}

.btn-outline-purple {
    color: #7c3aed;
    border-color: #7c3aed;
}

.btn-outline-purple:hover {
    color: #fff;
    background-color: #7c3aed;
    border-color: #7c3aed;
}

/* Dashboard widget item card (for use in cards) */
.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-widget-item .item-action {
    font-size: 0.75rem;
}

/* Dashboard section cards */
.dashboard-section {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.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 */
.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;
    }
}

/* Care episode details row */
.episode-details-row {
    background-color: #f8fafc;
}

.episode-details-row td {
    padding: 0 !important;
}

.care-episode-row {
    cursor: pointer;
}

.care-episode-row:hover {
    background-color: #f1f5f9;
}

/* Badge improvements */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
}

/* Action buttons in tables */
.btn-action {
    padding: 0.35rem 0.5rem;
    font-size: 0.875rem;
}

.btn-group-sm > .btn {
    padding: 0.35rem 0.5rem;
}

/* Table row hover effect */
.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* Loading spinner in buttons */
.btn .spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Dashboard empty state */
.text-center.text-muted.py-3 {
    padding: 2rem !important;
    font-size: 0.95rem;
}

/* Responsive adjustments for dashboard */
@media (max-width: 768px) {
    .dashboard-section .card-body {
        max-height: 300px;
    }

    .stat-card.dashboard-widget.clickable {
        margin-bottom: 0.5rem;
    }

    .btn-group-sm > .btn {
        padding: 0.25rem 0.4rem;
        font-size: 0.8rem;
    }
}

/* Smooth scrolling for section navigation */
html {
    scroll-behavior: smooth;
}

/* ============================================
   Reports Section Styles
   ============================================ */

/* Report Card */
.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;
}

/* Visit Grid Styles */
.visit-grid-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    max-height: calc(100vh - 400px);
    min-height: 300px;
}

.visit-grid-table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
}

.visit-grid-table thead {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #fff;
}

.visit-grid-table th {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 8px 6px;
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
    position: sticky;
    top: 0;
}

/* Frozen columns (Patient, Therapist) */
.visit-grid-table th.frozen,
.visit-grid-table td.frozen {
    position: sticky;
    background: #fff;
    z-index: 10;
}

.visit-grid-table th.frozen {
    z-index: 25;
}

.visit-grid-table th.frozen-patient,
.visit-grid-table td.frozen-patient {
    left: 0;
    min-width: 180px;
    max-width: 180px;
}

.visit-grid-table th.frozen-therapist,
.visit-grid-table td.frozen-therapist {
    left: 180px;
    min-width: 100px;
    max-width: 100px;
}

.visit-grid-table td {
    border: 1px solid #e2e8f0;
    padding: 6px;
    text-align: center;
    vertical-align: middle;
    background: #fff;
}

/* Clickable cells */
.visit-grid-table td.clickable {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.visit-grid-table td.clickable:hover {
    background-color: #f0f9ff;
}

/* Day column cells */
.visit-grid-table td.day-cell {
    min-width: 28px;
    max-width: 28px;
    padding: 4px 2px;
    font-weight: 600;
}

/* Visit code colors */
.visit-code {
    display: inline-block;
    min-width: 22px;
    height: 22px;
    line-height: 22px;
    padding: 0 4px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 10px;
    text-align: center;
    white-space: nowrap;
}

/* Appointment Type Colors - V (Visit/Follow Up) = Green */
.visit-code-V {
    background-color: #dcfce7;
    color: #166534;
}

/* Appointment Type Colors - E (Initial Evaluation) = Blue */
.visit-code-E {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Appointment Type Colors - I (Re-Evaluation/Interim) = Purple */
.visit-code-I {
    background-color: #f3e8ff;
    color: #6b21a8;
}

/* Appointment Type Colors - D (Discharge) = Orange */
.visit-code-D {
    background-color: #ffedd5;
    color: #9a3412;
}

/* Status Indicator Colors - (C) Cancelled = Gray */
.visit-code-cancelled {
    background-color: #e5e7eb;
    color: #6b7280;
}

/* Status Indicator Colors - (M) Missed = Red */
.visit-code-missed {
    background-color: #fee2e2;
    color: #b91c1c;
}

.visit-code-A {
    background-color: #fef9c3;
    color: #854d0e;
}

.visit-code-C {
    background-color: #fee2e2;
    color: #b91c1c;
}

.visit-code-F {
    background-color: #cffafe;
    color: #0e7490;
}

.visit-code-H {
    background-color: #ccfbf1;
    color: #0f766e;
}

.visit-code-N {
    background-color: #e5e7eb;
    color: #4b5563;
}

.visit-code-R {
    background-color: #ffedd5;
    color: #c2410c;
}

/* Legend codes */
.visit-code-legend {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 11px;
    margin-right: 2px;
}

/* Summary columns */
.visit-grid-table td.summary-cell {
    background-color: #f8fafc;
    font-weight: 600;
}

/* Row hover */
.visit-grid-table tbody tr:hover td {
    background-color: #f0f9ff;
}

.visit-grid-table tbody tr:hover td.frozen {
    background-color: #e0f2fe;
}

/* Alternating rows */
.visit-grid-table tbody tr:nth-child(even) td {
    background-color: #fafafa;
}

.visit-grid-table tbody tr:nth-child(even):hover td {
    background-color: #f0f9ff;
}

/* Patient and therapist name cells */
.patient-name-cell {
    text-align: left !important;
    font-weight: 500;
}

.patient-name-link {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
}

.patient-name-link:hover {
    text-decoration: underline;
}

.therapist-name-link {
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
}

.therapist-name-link:hover {
    color: var(--primary-color);
}

/* Insurance cell */
.insurance-cell {
    font-size: 10px;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Report header info */
.report-header-info {
    font-size: 14px;
}

/* Report footer */
.report-footer {
    font-size: 13px;
}

.report-legend {
    line-height: 2;
}

/* Print styles for reports */
@media print {
    .sidebar,
    .main-header,
    .page-header,
    .btn,
    .card-header .btn-group,
    #reportsListView,
    .report-card {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    .card {
        border: none !important;
        box-shadow: none !important;
    }

    .visit-grid-wrapper {
        max-height: none !important;
        overflow: visible !important;
    }

    .visit-grid-table {
        font-size: 10px;
    }

    .visit-grid-table th,
    .visit-grid-table td {
        padding: 4px 3px;
    }

    .visit-code {
        width: 18px;
        height: 18px;
        line-height: 18px;
        font-size: 9px;
    }

    .report-footer {
        display: block !important;
    }

    @page {
        size: landscape;
        margin: 0.5cm;
    }
}

/* Full width mode for reports (hides sidebar) */
.main-content.report-fullwidth {
    margin-left: 0 !important;
    width: 100% !important;
}

.main-content.report-fullwidth .visit-grid-wrapper {
    max-height: calc(100vh - 320px);
}

/* Responsive adjustments for reports */
@media (max-width: 768px) {
    .visit-grid-wrapper {
        max-height: calc(100vh - 350px);
    }

    .visit-grid-table {
        font-size: 11px;
    }

    .visit-grid-table th.frozen-patient,
    .visit-grid-table td.frozen-patient {
        min-width: 120px;
        max-width: 120px;
    }

    .visit-grid-table th.frozen-therapist,
    .visit-grid-table td.frozen-therapist {
        left: 120px;
        min-width: 80px;
        max-width: 80px;
    }
}

/* ============================================
   Cancelled Appointment Styling
   ============================================ */
.cancelled-appointment {
    opacity: 0.7;
    text-decoration: line-through;
    position: relative;
}

.cancelled-appointment::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 5px,
        rgba(0, 0, 0, 0.05) 5px,
        rgba(0, 0, 0, 0.05) 10px
    );
    pointer-events: none;
}

/* Cancelled appointment indicator banner */
.cancelled-appointment-banner {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cancelled-appointment-banner i {
    font-size: 1.2em;
}

/* ============================================
   Missed Appointment Styling (RED theme)
   ============================================ */
.missed-appointment {
    opacity: 0.9;
    position: relative;
}

.missed-appointment::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 5px,
        rgba(198, 40, 40, 0.1) 5px,
        rgba(198, 40, 40, 0.1) 10px
    );
    pointer-events: none;
}

/* Missed appointment badge (red for urgency) */
.bg-missed {
    background-color: #C62828 !important;
    color: #ffffff !important;
}

/* Missed appointment badge - rescheduled (light red) */
.bg-missed-rescheduled {
    background-color: #EF9A9A !important;
    color: #B71C1C !important;
}

/* Missed appointment indicator banner (red theme) */
.missed-appointment-banner {
    background-color: #ffebee;
    border: 1px solid #ffcdd2;
    color: #c62828;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.missed-appointment-banner i {
    font-size: 1.2em;
}

/* ============================================
   Dashboard Appointment Row Click
   ============================================ */
.dashboard-appointment-row {
    transition: background-color 0.15s ease-in-out;
}

.dashboard-appointment-row:hover {
    background-color: rgba(37, 99, 235, 0.08) !important;
}

.dashboard-appointment-row:active {
    background-color: rgba(37, 99, 235, 0.15) !important;
}

/* ============================================
   System-Wide Font Size Reduction
   For a more professional, compact appearance
   ============================================ */

/* Base font size reduction */
html {
    font-size: 14px;
}

body {
    font-size: 0.875rem; /* 14px */
    line-height: 1.45;
}

/* Headings - reduced proportionally */
h1, .h1 {
    font-size: 1.5rem !important; /* 21px instead of 24px */
}

h2, .h2 {
    font-size: 1.35rem !important; /* 18.9px instead of 20px */
}

h3, .h3 {
    font-size: 1.15rem !important; /* 16.1px instead of 18px */
}

h4, .h4 {
    font-size: 1rem !important; /* 14px instead of 16px */
}

h5, .h5 {
    font-size: 0.95rem !important; /* 13.3px instead of 14px */
}

h6, .h6 {
    font-size: 0.85rem !important; /* 11.9px instead of 12px */
}

/* Form elements */
.form-control, .form-select {
    font-size: 0.875rem;
    padding: 0.375rem 0.65rem;
}

.form-label {
    font-size: 0.8125rem; /* 13px */
    margin-bottom: 0.25rem;
}

.form-check-label {
    font-size: 0.8125rem;
}

.input-group-text {
    font-size: 0.8125rem;
    padding: 0.375rem 0.6rem;
}

/* Buttons */
.btn {
    font-size: 0.8125rem;
    padding: 0.35rem 0.75rem;
}

.btn-sm {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
}

.btn-lg {
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
}

/* Tables */
.table {
    font-size: 0.8125rem;
}

.table th,
.table td {
    padding: 0.5rem 0.65rem;
}

.table-sm th,
.table-sm td {
    padding: 0.3rem 0.5rem;
}

/* Cards */
.card-title {
    font-size: 0.95rem;
}

.card-body {
    padding: 0.85rem;
}

.card-header,
.card-footer {
    padding: 0.6rem 0.85rem;
    font-size: 0.875rem;
}

/* Modal */
.modal-title {
    font-size: 1.05rem;
}

.modal-body {
    font-size: 0.875rem;
}

.modal-header,
.modal-footer {
    padding: 0.75rem 1rem;
}

/* Badges */
.badge {
    font-size: 0.7rem;
    padding: 0.25em 0.5em;
}

/* Alerts */
.alert {
    font-size: 0.8125rem;
    padding: 0.6rem 0.85rem;
}

/* Dropdowns */
.dropdown-item {
    font-size: 0.8125rem;
    padding: 0.35rem 1rem;
}

.dropdown-header {
    font-size: 0.75rem;
}

/* List groups */
.list-group-item {
    font-size: 0.875rem;
    padding: 0.5rem 0.85rem;
}

/* Sidebar navigation */
.sidebar .nav-link {
    font-size: 0.8125rem;
    padding: 0.55rem 0.85rem;
}

.sidebar-header h4 {
    font-size: 1rem !important;
}

/* Calendar events - smaller text */
.fc-event-title {
    font-size: 0.7rem;
    line-height: 1.2;
}

.fc-daygrid-event {
    font-size: 0.7rem;
}

.fc-timegrid-event .fc-event-title {
    font-size: 0.7rem;
}

/* Dashboard widgets */
.dashboard-stat {
    font-size: 0.875rem;
}

.dashboard-stat .stat-value {
    font-size: 1.3rem;
}

.dashboard-stat .stat-label {
    font-size: 0.75rem;
}

/* Tabs */
.nav-tabs .nav-link {
    font-size: 0.8125rem;
    padding: 0.45rem 0.85rem;
}

.nav-pills .nav-link {
    font-size: 0.8125rem;
    padding: 0.4rem 0.75rem;
}

/* Pagination */
.page-link {
    font-size: 0.8125rem;
    padding: 0.35rem 0.65rem;
}

/* Breadcrumbs */
.breadcrumb {
    font-size: 0.8125rem;
}

/* Tooltips and popovers */
.tooltip-inner {
    font-size: 0.75rem;
}

.popover-body {
    font-size: 0.8125rem;
}

/* Toast notifications - larger font for readability */
.toast {
    font-size: 1rem;
}

/* Small and text utilities */
small, .small {
    font-size: 0.75rem;
}

.text-muted {
    font-size: inherit;
}

/* FullCalendar specific sizing */
.fc .fc-toolbar-title {
    font-size: 1.1rem;
}

.fc .fc-button {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
}

.fc .fc-col-header-cell-cushion {
    font-size: 0.75rem;
}

.fc .fc-daygrid-day-number {
    font-size: 0.75rem;
}

/* Accordion */
.accordion-button {
    font-size: 0.875rem;
    padding: 0.65rem 1rem;
}

.accordion-body {
    font-size: 0.875rem;
    padding: 0.85rem;
}

/* Progress bars */
.progress {
    height: 0.5rem;
}

/* Legends and labels */
.legend-item {
    font-size: 0.75rem;
}

/* Selected patient card */
.selected-patient-card {
    font-size: 0.875rem;
}

/* Patient search results */
.patient-search-result {
    font-size: 0.8125rem;
    padding: 0.45rem 0.65rem;
}

/* Trumbowyg editor */
.trumbowyg-box {
    font-size: 0.875rem;
}

/* Care episode cards */
.care-episode-card {
    font-size: 0.875rem;
}

/* Reports */
.report-title {
    font-size: 1.15rem;
}

.report-table {
    font-size: 0.8rem;
}

/* Minimize margins and padding globally */
.mb-3 {
    margin-bottom: 0.75rem !important;
}

.mb-4 {
    margin-bottom: 1rem !important;
}

.p-3 {
    padding: 0.75rem !important;
}

.p-4 {
    padding: 1rem !important;
}

/* Compact row spacing */
.row.g-3 {
    --bs-gutter-y: 0.75rem;
    --bs-gutter-x: 0.75rem;
}

/* More compact fs-5 and fs-6 */
.fs-5 {
    font-size: 1rem !important;
}

.fs-6 {
    font-size: 0.875rem !important;
}




.urgency-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

.urgency-warning {
    background-color: #fd7e14; /* Orange */
    box-shadow: 0 0 4px rgba(253, 126, 20, 0.5);
}

.urgency-critical {
    background-color: #dc3545; /* Red */
    box-shadow: 0 0 4px rgba(220, 53, 69, 0.5);
}

/* ============================================
   PATIENT VALIDATION STYLES
   ============================================ */

/* Validation badge in patient list */
.validation-badge {
    transition: all 0.2s ease;
}

.validation-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Highlight for missing/invalid fields */
.validation-highlight {
    border-color: #fd7e14 !important;
    background-color: rgba(253, 126, 20, 0.1) !important;
    box-shadow: 0 0 0 0.2rem rgba(253, 126, 20, 0.25) !important;
}

/* Validation status card for dashboard */
.validation-summary-card {
    border-left: 4px solid #fd7e14;
}

.validation-summary-card.complete {
    border-left-color: #28a745;
}

.validation-summary-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.validation-summary-card .stat-label {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Incomplete profiles indicator */
.incomplete-profiles-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.incomplete-profiles-badge .badge-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #fd7e14;
    color: white;
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Section highlight animation */
@keyframes sectionHighlight {
    0% {
        background-color: rgba(253, 126, 20, 0.2);
    }
    100% {
        background-color: transparent;
    }
}

.section-highlighted {
    animation: sectionHighlight 2s ease-out;
}

/* ============================================
   Patient Filter Buttons (Modern UI)
   ============================================ */

.patient-filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-start;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin: 0;
}

.filter-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    border: 2px solid transparent;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-light);
    color: var(--text-secondary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.filter-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.filter-btn:active {
    transform: translateY(0);
}

.filter-btn-check {
    display: none;
    width: 16px;
    height: 16px;
    align-items: center;
    justify-content: center;
}

.filter-btn-check i {
    font-size: 0.75rem;
}

.filter-btn.selected .filter-btn-check {
    display: inline-flex;
}

/* Status Filter Button Colors */
.filter-btn-active {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #c8e6c9;
}

.filter-btn-active:hover {
    background: #c8e6c9;
    border-color: #a5d6a7;
}

.filter-btn-active.selected {
    background: #2e7d32;
    color: #fff;
    border-color: #2e7d32;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.35);
}

.filter-btn-discharged {
    background: #fce4ec;
    color: #c2185b;
    border-color: #f8bbd9;
}

.filter-btn-discharged:hover {
    background: #f8bbd9;
    border-color: #f48fb1;
}

.filter-btn-discharged.selected {
    background: #c2185b;
    color: #fff;
    border-color: #c2185b;
    box-shadow: 0 2px 8px rgba(194, 24, 91, 0.35);
}

.filter-btn-no-episode {
    background: #e3f2fd;
    color: #1565c0;
    border-color: #bbdefb;
}

.filter-btn-no-episode:hover {
    background: #bbdefb;
    border-color: #90caf9;
}

.filter-btn-no-episode.selected {
    background: #1565c0;
    color: #fff;
    border-color: #1565c0;
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.35);
}

.filter-btn-archived {
    background: #eceff1;
    color: #546e7a;
    border-color: #cfd8dc;
}

.filter-btn-archived:hover {
    background: #cfd8dc;
    border-color: #b0bec5;
}

.filter-btn-archived.selected {
    background: #546e7a;
    color: #fff;
    border-color: #546e7a;
    box-shadow: 0 2px 8px rgba(84, 110, 122, 0.35);
}

/* Profile Filter Button Colors */
.filter-btn-all {
    background: #f5f5f5;
    color: #616161;
    border-color: #e0e0e0;
}

.filter-btn-all:hover {
    background: #eeeeee;
    border-color: #bdbdbd;
}

.filter-btn-all.selected {
    background: #616161;
    color: #fff;
    border-color: #616161;
    box-shadow: 0 2px 8px rgba(97, 97, 97, 0.35);
}

.filter-btn-incomplete {
    background: #fff8e1;
    color: #f57c00;
    border-color: #ffecb3;
}

.filter-btn-incomplete:hover {
    background: #ffecb3;
    border-color: #ffe082;
}

.filter-btn-incomplete.selected {
    background: #f57c00;
    color: #fff;
    border-color: #f57c00;
    box-shadow: 0 2px 8px rgba(245, 124, 0, 0.35);
}

.filter-btn-complete {
    background: #e0f2f1;
    color: #00796b;
    border-color: #b2dfdb;
}

.filter-btn-complete:hover {
    background: #b2dfdb;
    border-color: #80cbc4;
}

.filter-btn-complete.selected {
    background: #00796b;
    color: #fff;
    border-color: #00796b;
    box-shadow: 0 2px 8px rgba(0, 121, 107, 0.35);
}

/* Active Filters Count Badge */
.filter-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--primary-color);
    color: #fff;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-left: auto;
    align-self: flex-end;
}

.filter-clear-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-clear-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.filter-clear-btn i {
    font-size: 0.625rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .patient-filters-row {
        flex-direction: column;
        gap: 1rem;
    }

    .filter-btn-group {
        flex-wrap: wrap;
    }

    .filter-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }

    .filter-count-badge {
        margin-left: 0;
        align-self: flex-start;
    }
}

/* ============================================
   Location Switcher (Multi-Location Support) - Light Theme
   ============================================ */

.sidebar-location {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
    background: var(--bg-secondary);
}

.location-current {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.location-current:hover {
    background: var(--bg-light);
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.location-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
}

.location-info {
    flex: 1;
    min-width: 0;
}

.location-label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.location-name {
    display: block;
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.location-arrow {
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: transform var(--transition-fast);
}

.location-current:hover .location-arrow {
    color: var(--primary-color);
}

/* Location List in Modal */
.location-list {
    max-height: 400px;
    overflow-y: auto;
}

.location-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--card-bg);
}

.location-item:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.location-item.active {
    border-color: var(--primary-color);
    background: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.location-item-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: var(--radius-xl);
    color: white;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.location-item-info {
    flex: 1;
    min-width: 0;
}

.location-item-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.location-item-address {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.location-item-badge {
    flex-shrink: 0;
}

.location-item .check-icon {
    color: var(--success-color);
    font-size: 1.25rem;
    display: none;
}

.location-item.active .check-icon {
    display: block;
}

/* Location Management List */
.location-management-list .location-item {
    cursor: default;
}

.location-management-list .location-item:hover {
    border-color: var(--border-color);
    background: transparent;
}

.location-management-actions {
    display: flex;
    gap: 0.5rem;
}

.location-management-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Location primary badge */
.badge-primary-location {
    background: var(--success-color);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.badge-inactive-location {
    background: var(--secondary-color);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Scheduling Button in Calendar Header */
.btn-schedule-appointment {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.btn-schedule-appointment:hover {
    background: #16a34a;
    border-color: #16a34a;
    color: white;
}

/* ============================================
   Appointment Modal - Three State Workflow
   ============================================ */

/* Patient Required Highlight (Orange) */
.appt-patient-required {
    position: relative;
}

.appt-patient-required::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid #f97316;
    border-radius: 10px;
    animation: pulseOrange 2s infinite;
    pointer-events: none;
}

.appt-patient-required .form-control {
    border-color: #f97316;
    background-color: #fff7ed;
}

.appt-patient-required .form-control:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.25);
}

@keyframes pulseOrange {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4);
    }
    50% {
        box-shadow: 0 0 8px 4px rgba(249, 115, 22, 0.2);
    }
}

/* Available Slots Container */
.appt-slots-container {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    min-height: 350px;
    max-height: 450px;
    overflow-y: auto;
}

.appt-slots-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    color: var(--text-muted);
    text-align: center;
}

.appt-slots-placeholder i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.appt-slots-placeholder p {
    font-size: 14px;
    margin: 0;
}

/* Slots Loading State */
.appt-slots-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
}

/* Slots List */
.appt-slots-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Slot Card */
.slot-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.slot-card:hover {
    border-color: var(--primary-color);
    background: #f0f9ff;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.slot-card.selected {
    border-color: var(--primary-color);
    background: #dbeafe;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.slot-card .slot-time {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 110px;
}

.slot-card .slot-provider {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.slot-card .provider-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.slot-card .provider-name {
    font-size: 13px;
    color: var(--text-secondary);
}

.slot-card .slot-location {
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
}

.slot-card .slot-check {
    display: none;
    color: var(--primary-color);
    font-size: 18px;
}

.slot-card.selected .slot-check {
    display: block;
}

/* Empty Slots State */
.appt-slots-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--text-muted);
    text-align: center;
    padding: 24px;
}

.appt-slots-empty i {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* Preview Panel */
.appt-preview-panel {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #86efac;
    border-radius: 12px;
    padding: 20px;
    margin-top: 16px;
}

.appt-preview-panel h6 {
    color: #166534;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.appt-preview-panel h6 i {
    font-size: 20px;
}

.preview-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.preview-item {
    display: flex;
    flex-direction: column;
}

.preview-item .preview-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #4ade80;
    font-weight: 600;
    margin-bottom: 2px;
}

.preview-item .preview-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.preview-item.full-width {
    grid-column: span 2;
}

/* Preview Actions */
.preview-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #86efac;
}

.preview-actions .btn {
    flex: 1;
}

/* Modal State Transitions */
#appointmentModal .form-section,
#appointmentModal .slots-section {
    transition: opacity 0.3s ease;
}

#appointmentModal .form-section.state-preview,
#appointmentModal .slots-section.state-preview {
    opacity: 0.6;
    pointer-events: none;
}

/* Duration field disabled state */
#appointmentModal #apptDuration:disabled {
    background-color: #f1f5f9;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Selected Patient Card in Modal */
#appointmentModal .selected-patient-card {
    background: #ecfeff;
    border: 1px solid #06b6d4;
    border-radius: 8px;
    padding: 12px;
}

#appointmentModal .selected-patient-card .patient-name {
    font-weight: 600;
    color: #0891b2;
    font-size: 14px;
}

#appointmentModal .selected-patient-card .patient-details {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Two-Panel Layout - only apply to main row, not nested rows */
#appointmentModal .modal-body > .row {
    min-height: 400px;
}

#appointmentModal .form-panel {
    border-right: 1px solid var(--border-color);
    padding-right: 24px;
}

#appointmentModal .slots-panel {
    padding-left: 24px;
}

/* Responsive for Modal */
@media (max-width: 991.98px) {
    #appointmentModal .form-panel {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-right: 12px;
        padding-bottom: 20px;
        margin-bottom: 20px;
    }

    #appointmentModal .slots-panel {
        padding-left: 12px;
    }

    .preview-details {
        grid-template-columns: 1fr;
    }

    .preview-item.full-width {
        grid-column: span 1;
    }
}

/* Slot Date Header */
.slot-date-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 8px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

/* Slot Groups by Time Period */
.slot-group {
    margin-bottom: 16px;
}

.slot-group-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding-left: 4px;
}

/* Quick Filter Buttons */
.slot-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.slot-filter-btn {
    padding: 6px 12px;
    font-size: 12px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.slot-filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.slot-filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* ============================================
   Dropdown Menus - Modern Light Theme
   ============================================ */

.dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 8px 0;
    background: var(--card-bg);
    animation: dropdownFadeIn 0.15s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.dropdown-item.active,
.dropdown-item:active {
    background: var(--primary-light);
    color: var(--primary-color);
}

.dropdown-item i {
    margin-right: 8px;
    color: var(--text-muted);
}

.dropdown-item:hover i {
    color: var(--primary-color);
}

.dropdown-divider {
    border-top-color: var(--border-color);
    margin: 8px 0;
}

.dropdown-header {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   Nav Tabs & Pills - Modern Healthcare Theme
   ============================================ */

.nav-tabs {
    border-bottom: 2px solid var(--border-color);
}

.nav-tabs .nav-link {
    color: var(--text-secondary);
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 20px;
    font-weight: 500;
    transition: all var(--transition-fast);
    margin-bottom: -2px;
}

.nav-tabs .nav-link:hover {
    color: var(--text-primary);
    border-color: transparent;
    background: var(--bg-secondary);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background: transparent;
    border-color: transparent transparent var(--primary-color) transparent;
    border-bottom-width: 3px;
}

.nav-pills .nav-link {
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.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 - Modern Healthcare Theme
   ============================================ */

.pagination {
    gap: 4px;
}

.page-link {
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.page-link:hover {
    background: var(--bg-secondary);
    border-color: var(--border-medium);
    color: var(--text-primary);
}

.page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.page-item.disabled .page-link {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-muted);
}

/* ============================================
   Progress Bars - Modern Healthcare Theme
   ============================================ */

.progress {
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-full);
    height: 8px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.progress-bar.bg-success {
    background: linear-gradient(90deg, var(--success-color) 0%, #059669 100%) !important;
}

.progress-bar.bg-warning {
    background: linear-gradient(90deg, var(--warning-color) 0%, #D97706 100%) !important;
}

.progress-bar.bg-danger {
    background: linear-gradient(90deg, var(--danger-color) 0%, #DC2626 100%) !important;
}

/* ============================================
   Tooltips & Popovers - Modern Healthcare Theme
   ============================================ */

.tooltip-inner {
    background: var(--text-primary);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    font-size: 13px;
    box-shadow: var(--shadow-md);
}

.popover {
    border: 1px solid 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;
    color: var(--text-primary);
}

.popover-body {
    color: var(--text-secondary);
}

/* ============================================
   Accordion - Modern Healthcare Theme
   ============================================ */

.accordion-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg) !important;
    margin-bottom: 8px;
    overflow: hidden;
}

.accordion-item:first-of-type,
.accordion-item:last-of-type {
    border-radius: var(--radius-lg) !important;
}

.accordion-button {
    background: var(--card-bg);
    color: var(--text-primary);
    font-weight: 500;
    padding: 16px 20px;
}

.accordion-button:not(.collapsed) {
    background: var(--bg-light);
    color: var(--primary-color);
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.accordion-button::after {
    transition: transform var(--transition-normal);
}

.accordion-body {
    padding: 20px;
    color: var(--text-secondary);
}

/* ============================================
   List Groups - Modern Healthcare Theme
   ============================================ */

.list-group-item {
    border-color: var(--border-color);
    padding: 14px 20px;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.list-group-item:first-child {
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
}

.list-group-item:last-child {
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

.list-group-item-action:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.list-group-item.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* ============================================
   Scrollbar Styling - Modern Light Theme
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-medium) var(--bg-secondary);
}

/* ============================================
   Print Styles Override for Light Theme
   ============================================ */

@media print {
    body {
        background: white !important;
        color: black !important;
    }

    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }

    .btn {
        border: 1px solid #ddd !important;
    }
}

/* ============================================
   Recording Session Modal Styles
   ============================================ */

/* Recording Timer Container */
.recording-timer-container {
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.recording-timer-container.recording-active {
    border-color: #dc3545;
    background-color: #fff5f5 !important;
}

.recording-timer-container.recording-paused {
    border-color: #ffc107;
    background-color: #fffbeb !important;
}

/* Recording Pulse Animation */
.recording-pulse-container {
    position: relative;
    display: inline-block;
}

.recording-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(220, 53, 69, 0.3);
    animation: pulse-ring 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* Recording Status Badge Colors */
#recordingStatusBadge.status-not-started {
    background-color: #6c757d !important;
}

#recordingStatusBadge.status-recording {
    background-color: #dc3545 !important;
    animation: badge-pulse 1.5s ease-in-out infinite;
}

#recordingStatusBadge.status-paused {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

@keyframes badge-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Recording Modal Responsive Adjustments */
@media (max-width: 768px) {
    #recordSessionModal .row > .col-md-4 {
        margin-bottom: 0.5rem;
    }

    #recordingTimer {
        font-size: 3rem !important;
    }

    #recordingControlButtons .btn-lg {
        padding: 0.75rem 1.5rem !important;
    }
}

/* Recording Progress Modal */
#recordingProgressModal .modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

#recordingProgressModal .progress-bar {
    transition: width 0.5s ease-in-out;
}

#recordingProgressModal #progressMessage {
    transition: opacity 0.3s ease;
}

#recordingProgressModal .badge {
    font-weight: 500;
    padding: 0.5em 1em;
}

/* Progress animation pulse effect when waiting */
@keyframes progress-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.85;
    }
}

#recordingProgressModal .progress-bar-animated {
    animation: progress-bar-stripes 1s linear infinite, progress-pulse 2s ease-in-out infinite;
}

/* ============================================
   Bootstrap Modal Scrolling Fix
   Ensures modal body scrolls while header/footer stay fixed
   ============================================ */

/* Ensure modal can extend and body scrolls properly */
.modal-dialog-scrollable {
    max-height: calc(100vh - 1rem);
}

.modal-dialog-scrollable .modal-content {
    max-height: calc(100vh - 1rem);
    overflow: hidden;
}

.modal-dialog-scrollable .modal-body {
    overflow-y: auto;
}

/* For centered dialogs with scrollable content */
.modal-dialog-centered.modal-dialog-scrollable {
    min-height: calc(100% - 1rem);
}

/* Ensure proper height constraints for different modal sizes */
.modal-xl.modal-dialog-scrollable .modal-body,
.modal-lg.modal-dialog-scrollable .modal-body,
.modal-md.modal-dialog-scrollable .modal-body,
.modal-sm.modal-dialog-scrollable .modal-body {
    max-height: calc(100vh - 200px); /* Account for header, footer, and margins */
    overflow-y: auto;
}

/* Fix for modals without modal-dialog-scrollable class - apply scrolling behavior globally */
.modal-body {
    overflow-y: auto;
    max-height: calc(100vh - 210px);
}

/* Ensure modal header and footer stay fixed */
.modal-header,
.modal-footer {
    flex-shrink: 0;
}

/* Smooth scrolling for modal content */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: var(--bg-secondary, #f1f1f1);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--text-muted, #888);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary, #555);
}

/* ============================================
   Appointment Wizard Styles
   Step-by-Step Booking Modal
   ============================================ */

/* Wizard Progress Indicator */
.wizard-progress {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
    padding: 0 10px;
}

.wizard-step .step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.wizard-step .step-label {
    font-size: 12px;
    color: #64748b;
    margin-top: 6px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.wizard-step.active .step-circle {
    background: var(--primary-color, #2563eb);
    color: white;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.wizard-step.active .step-label {
    color: var(--primary-color, #2563eb);
    font-weight: 600;
}

.wizard-step.completed .step-circle {
    background: var(--success-color, #10b981);
    color: white;
}

.wizard-step.completed .step-label {
    color: var(--success-color, #10b981);
}

.wizard-connector {
    flex: 1;
    height: 3px;
    background: #e2e8f0;
    margin: 0 8px;
    margin-top: -18px;
    border-radius: 2px;
    transition: background 0.3s ease;
}

.wizard-connector.completed {
    background: var(--success-color, #10b981);
}

/* Wizard Summary Header */
.wizard-summary {
    background: linear-gradient(to right, #fafafa, #f5f5f5);
}

.wizard-summary .summary-item {
    font-size: 14px;
}

.wizard-summary .btn-link {
    color: var(--primary-color, #2563eb);
    text-decoration: none;
}

.wizard-summary .btn-link:hover {
    color: var(--primary-hover, #1d4ed8);
}

/* Wizard Step Content */
.wizard-step-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Appointment Type Cards */
.appt-type-card {
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.appt-type-card:hover {
    border-color: var(--primary-color, #2563eb);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.appt-type-card.selected {
    border-color: var(--primary-color, #2563eb);
    background: var(--primary-light, #dbeafe);
}

.appt-type-card.selected .type-icon {
    transform: scale(1.1);
}

/* Schedule Choice Cards */
.schedule-choice-card {
    cursor: pointer;
    border: 2px solid #e2e8f0;
    transition: all 0.2s ease;
}

.schedule-choice-card:hover {
    border-color: var(--primary-color, #2563eb);
    background: var(--bg-light, #fafafa);
    transform: translateX(4px);
}

.schedule-choice-card:hover .bi-chevron-right {
    color: var(--primary-color, #2563eb) !important;
}

/* Slot Cards in Wizard */
.slot-card {
    cursor: pointer;
    border: 1px solid #e2e8f0;
    transition: all 0.15s ease;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 6px;
    background: white;
}

.slot-card:hover {
    border-color: var(--primary-color, #2563eb);
    background: var(--primary-light, #dbeafe);
}

.slot-card.selected {
    border-color: var(--primary-color, #2563eb);
    background: var(--primary-light, #dbeafe);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* Recent Patient Cards */
.recent-patient-card {
    cursor: pointer;
    border: 1px solid #e2e8f0;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.15s ease;
    background: white;
}

.recent-patient-card:hover {
    border-color: var(--primary-color, #2563eb);
    background: var(--primary-light, #dbeafe);
}

/* Selected Patient Card */
.selected-patient-card .card {
    transition: all 0.2s ease;
}

.selected-patient-card .patient-avatar {
    transition: transform 0.2s ease;
}

.selected-patient-card:hover .patient-avatar {
    transform: scale(1.05);
}

/* Duration Button Group */
#durationButtonGroup .btn {
    flex: 1;
    font-size: 13px;
    padding: 8px 4px;
}

#durationButtonGroup .btn-check:checked + .btn {
    background: var(--primary-color, #2563eb);
    border-color: var(--primary-color, #2563eb);
    color: white;
}

/* Recurring Date List Items */
.recurring-date-item {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.recurring-date-item:last-child {
    border-bottom: none;
}

.recurring-date-item.unavailable {
    background: #fef2f2;
    color: #991b1b;
}

.recurring-date-item.available {
    background: #f0fdf4;
}

/* Review Card Styling */
#wizardStep4 .card {
    overflow: hidden;
}

#wizardStep4 .card-body {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border-radius: inherit;
}

/* Responsive adjustments for wizard */
@media (max-width: 768px) {
    .wizard-step .step-label {
        display: none;
    }
    
    .wizard-step .step-circle {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .wizard-connector {
        margin-top: -16px;
    }
    
    .appt-type-card .card-body {
        padding: 16px 12px;
    }
    
    .appt-type-card .type-icon {
        width: 48px !important;
        height: 48px !important;
    }
    
    .schedule-choice-card .choice-icon {
        width: 50px !important;
        height: 50px !important;
    }
    
    .schedule-choice-card .card-body {
        padding: 16px !important;
    }
    
    #wizardStep3 .row {
        flex-direction: column;
    }
    
    #wizardStep3 .col-md-4,
    #wizardStep3 .col-md-8 {
        width: 100%;
    }
}

/* Wizard Navigation Buttons */
#wizardNextBtn, #wizardBackBtn {
    min-width: 100px;
    transition: all 0.2s ease;
}

#wizardNextBtn:not(:disabled):hover {
    transform: translateX(2px);
}

#wizardBackBtn:hover {
    transform: translateX(-2px);
}

/* Patient Search Results in Wizard */
#patientSearchResults {
    position: absolute;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 1050;
    margin-top: 4px;
}

#patientSearchResults .patient-result-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
}

#patientSearchResults .patient-result-item:hover {
    background: var(--primary-light, #dbeafe);
}

#patientSearchResults .patient-result-item:last-child {
    border-bottom: none;
}

/* Fix for selected patient card - ensure border-radius is respected */
.selected-patient-card .card {
    overflow: hidden;
}

.selected-patient-card .card-body {
    background: transparent;
}

/* Ensure wizard cards have proper overflow handling */
#wizardStep1 .card {
    overflow: hidden;
}
