/* ========================================
   STANDARDIZED LAYOUT SYSTEM
   Based on clinic-dashboard layout
   ======================================== */

/* Standard Header - Fixed 82px with border */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 82px;
    background: white;
    border-bottom: 1px solid var(--border);
    z-index: 100; /* Medium z-index */
}

/* Standard Dashboard Content Wrapper */
/* Standard Dashboard Content Wrapper */
.dashboard-content {
    position: relative;  /* Changed from fixed to relative */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: block;
}

.dashboard-content.loaded {
    display: block;
    width: 100%;
}

/* Standard Dashboard Layout (sidebar + main content) */
.dashboard-layout {
    display: flex;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    max-width: none;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: white;
    border-right: 1px solid var(--border);
    padding: 0 0 2rem 0;
    margin: 0;
    flex-shrink: 0;
    height: 100%;
    overflow-x: hidden;
}

/* Main content area */
.main-content {
    flex: 1;
    overflow-y: auto;  /* Change from visible to auto for scrolling */
    overflow-x: hidden;
    height: 100%;
    position: relative;
    padding-top: 82px;
    margin: 0;
    max-width: none;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

/* SPA Loading States */
.page-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 1rem;
}

.page-loading .loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.page-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    gap: 1rem;
}

.page-error .error-icon {
    width: 64px;
    height: 64px;
    color: var(--danger);
}

/* ========================================
   BUTTONS - Base styling for consistency
   ======================================== */

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.btn-primary {
    background: var(--primary);
    color: white;
    font-weight: 500;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: white;
    color: var(--text-dark);
    border: 1px solid var(--border);
    font-weight: 500;
}

.btn-secondary:hover {
    background: var(--bg-light);
}

.btn-cancel {
    background: transparent;
    color: #dc2626;
    border: 1px solid #dc2626;
    font-weight: 500;
}

.btn-cancel:hover {
    background: rgba(220, 38, 38, 0.05);
    color: #b91c1c;
    border-color: #b91c1c;
}

.btn-edit {
    background: #f0f9ff;
    color: #0369a1;
    border: 1px solid #bae6fd;
    font-weight: 500;
}

.btn-edit:hover {
    background: #dbeafe;
    color: #1e40af;
    border-color: #93c5fd;
}

.btn-icon {
    padding: 0.75rem;
    min-width: auto;
}

/* EXACT BUTTON STYLES FROM CALENDAR FOR MODAL - HIGH SPECIFICITY */
.modal-footer .btn-secondary,
.modal-footer-right .btn-secondary,
.patient-info-column .btn-secondary {
    padding: 10px 20px !important;
    background: white !important;
    color: #374151 !important;
    border: 1px solid #d1d5db !important;
    border-radius: 8px !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

.modal-footer .btn-secondary:hover,
.modal-footer-right .btn-secondary:hover,
.patient-info-column .btn-secondary:hover {
    background: #f9fafb !important;
}

.modal-footer .btn-primary,
.modal-footer-right .btn-primary {
    padding: 10px 20px !important;
    background: #2563eb !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

.modal-footer .btn-primary:hover,
.modal-footer-right .btn-primary:hover {
    background: #1d4ed8 !important;
}

/* Danger button styles for modal footers */
.modal-footer .btn-danger,
.modal-footer-right .btn-danger {
    padding: 10px 20px !important;
    background: rgba(239, 68, 68, 0.2) !important;
    color: #b91c1c !important;
    border: 1.5px solid #ef4444 !important;
    border-radius: 8px !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

.modal-footer .btn-danger:hover,
.modal-footer-right .btn-danger:hover {
    background: rgba(239, 68, 68, 0.3) !important;
}

/* Button icon styling for modal */
.modal-footer .btn-icon {
    width: 16px !important;
    height: 16px !important;
    margin-right: 8px !important;
}

/* View Full Patient Profile button styling */
.patient-info-column .btn-secondary {
    width: 100% !important;
    margin-top: 12px !important;
}

/* Editable fields hover cursor - EXACTLY like calendar */
.info-field[id*="edit-"]:hover {
    cursor: pointer !important;
}

.info-field[id*="edit-"]:not(.editing):hover {
    cursor: pointer !important;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-success {
    background: rgba(16, 185, 129, 0.2);
    color: #047857;
    border: 1.5px solid #10b981;
    font-weight: 500;
}

.btn-success:hover {
    background: rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #b91c1c;
    border: 1.5px solid #ef4444;
    font-weight: 500;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

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

/* ========================================
   STATUS BADGES - Standardized across all pages
   ======================================== */

.status-badge {
    display: inline-block;
    padding: 0.5rem 0.875rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.25px;
}

.status-active {
    background: rgba(34, 197, 94, 0.15);
    color: #15803d;
    border: 1px solid #22c55e;
}

.status-confirmed {
    background: rgba(16, 185, 129, 0.15);
    color: #047857;
    border: 1px solid #10b981;
}

.status-notified {
    background: rgba(168, 85, 247, 0.15);
    color: #6d28d9;
    border: 1px solid #8b5cf6;
}

.status-waitlist {
    background: rgba(6, 182, 212, 0.15);
    color: #0e7490;
    border: 1px solid #06b6d4;
}

.status-expired {
    background: rgba(107, 114, 128, 0.15);
    color: #374151;
    border: 1px solid #6b7280;
}

.status-cancelled {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
    border: 1px solid #ef4444;
}

.status-inactive {
    background: rgba(107, 114, 128, 0.15);
    color: #374151;
    border: 1px solid #6b7280;
}

.status-pending {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
    border: 1px solid #f59e0b;
}

.status-owner {
    background: rgba(139, 92, 246, 0.15);
    color: #6d28d9;
    border: 1px solid #8b5cf6;
}

.status-accepted {
    background: rgba(16, 185, 129, 0.15);
    color: #047857;
    border: 1px solid #10b981;
}

.status-booked {
    background: rgba(37, 99, 235, 0.15);
    color: #1d4ed8;
    border: 1px solid #3b82f6;
}

.status-past {
    background: rgba(156, 163, 175, 0.15);
    color: #374151;
    border: 1px solid #9ca3af;
}

.status-requested {
    background: rgba(251, 191, 36, 0.15);
    color: #b45309;
    border: 1px solid #fbbf24;
}

.status-completed {
    background: rgba(37, 99, 235, 0.15);
    color: #1e40af;
    border: 1px solid #3b82f6;
}

.status-noshow {
    background: rgba(148, 163, 184, 0.2);
    color: #475569;
    border: 1px solid #94a3b8;
}

.status-held {
    background: rgba(168, 85, 247, 0.15);
    color: #6b21a8;
    border: 1px solid #a855f7;
}

.status-default {
    background: rgba(107, 114, 128, 0.15);
    color: #374151;
    border: 1px solid #6b7280;
}

/* Unclaimed Appointment Styles */
.appointment-card.unclaimed {
    border: 2px dashed #fbbf24;
    background: rgba(251, 191, 36, 0.05);
}

.unclaimed-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(251, 191, 36, 0.15);
    border-bottom: 1px solid #fbbf24;
    margin: -16px -16px 16px -16px;
    border-radius: 10px 10px 0 0;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.unclaimed-banner span {
    color: #b45309;
    font-size: 0.875rem;
    font-weight: 500;
}

.unclaimed-banner .unclaimed-actions {
    display: flex;
    gap: 0.5rem;
}

.unclaimed-banner .btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* ========================================
   FORMS - Base styling for consistency
   ======================================== */

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s;
    background: white;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input.readonly {
    background: var(--bg-light);
    cursor: not-allowed;
    color: var(--text-light);
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.form-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.form-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 1rem 0;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-dark);
}

.checkbox-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    position: relative;
}

.form-checkbox:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.form-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* ========================================
   NAVIGATION - Base styling
   ======================================== */

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 2rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}

.nav-item:hover {
    background: var(--bg-light);
}

.nav-item.active {
    color: var(--primary);
    background: #eff6ff;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
}

.nav-icon {
    width: 20px;
    height: 20px;
    opacity: 0.7;
}

/* Tab Navigation */
.settings-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border);
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.settings-tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    padding: 0.75rem 1.5rem;
    border: none;
    background: none;
    color: var(--text-light);
    font-weight: 500;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: color 0.2s;
}

.tab:hover {
    color: var(--text-dark);
}

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

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

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Dropdown Menus */
.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    position: relative;
}

.user-menu #userName {
    white-space: nowrap;
    overflow: visible;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    display: none;
    z-index: 1000;
}

.user-dropdown.show {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: var(--bg-light);
}

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

/* ========================================
   CARDS - Base styling for consistency
   ======================================== */

/* Summary Card - Base style for dashboard cards */
.summary-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: visible;
    margin-bottom: 0.75rem;
    min-height: fit-content;
}

.summary-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.2s ease;
    display: none; /* Hide the colored accent indicator */
}

.summary-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.summary-card:hover::before {
    opacity: 0; /* Keep it hidden even on hover */
    display: none;
}

/* Summary Card Accent Colors */
.next-appointment-card::before {
    background: var(--primary);
}

.waitlist-highlights::before,
.waitlist-card::before {
    background: var(--success);
}

.recent-activity::before,
.notifications-card::before {
    background: var(--warning);
}

.saved-clinics::before {
    background: var(--success);
}

/* Card Header */
.card-header {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Card Preview */
.card-preview {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-preview-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    width: 100%;
}

/* Stat Cards */
.stat-card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Basic Cards */
.card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 2rem;
}

/* Clickable Cards */
.clickable-card {
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
    border: 1px solid var(--border);
}

.clickable-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--border);
}

.click-icon {
    opacity: 0.3;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(0) scale(1);
}

.clickable-card:hover .click-icon {
    opacity: 1;
    transform: translateX(6px) scale(1.1);
    color: var(--primary);
}

/* ========================================
   MODALS - Base styling
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    max-height: 85vh; /* Limit height to 85% of viewport */
    overflow: hidden; /* Keep rounded corners */
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

/* Legacy modal support */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex !important;
    opacity: 1;
}

/* Ensure smooth transition when removing show class */
.modal:not(.show) {
    opacity: 0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    margin: 0;
    flex-shrink: 0;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    max-height: calc(85vh - 140px); /* Account for header and footer */
}

.modal-footer {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    background: white; /* Ensure footer has background */
    border-radius: 0 0 12px 12px;
    flex-shrink: 0; /* Prevent footer from shrinking */
    position: sticky;
    bottom: 0;
    z-index: 1;
}

/* Better scrollbar styling for modal body */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Modal Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Modal Components */
.modal-section {
    margin-bottom: 24px;
}

.modal-section-title {
    margin: 0 0 16px 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-section-title svg {
    width: 20px;
    height: 20px;
    color: #3b82f6;
}

.modal-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.modal-input,
.modal-select,
.modal-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    box-sizing: border-box;
}

.modal-input:focus,
.modal-select:focus,
.modal-textarea:focus {
    border-color: #3b82f6;
    outline: none;
}

.modal-textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.modal-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.modal-info-box {
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.modal-info-box-title {
    margin: 0 0 12px 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-info-box-title svg {
    width: 18px;
    height: 18px;
}

.modal-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.modal-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
    cursor: pointer;
}

.modal-checkbox-label {
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
    cursor: pointer;
    user-select: none;
}

/* ========================================
   UNIFIED ADD APPOINTMENT MODAL
   Used across all pages (dashboard, calendar, etc.)
   ======================================== */

.add-appointment-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
    padding: 20px;
    box-sizing: border-box;
}

.add-appointment-modal {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s ease;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
}

.add-appointment-modal .modal-header {
    padding: 24px 24px 0 24px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.add-appointment-modal .modal-body {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
    max-height: none;
}

.add-appointment-modal .modal-section:first-child {
    margin-top: 0;
}

.add-appointment-modal .modal-footer-right {
    padding: 20px 24px;
    border-top: 1px solid #f1f5f9;
    background: white;
    flex-shrink: 0;
}

/* Responsive adjustments for add appointment modal */
@media (max-width: 768px) {
    .add-appointment-overlay {
        padding: 10px;
    }
    
    .add-appointment-modal {
        max-height: 95vh;
    }
    
    .add-appointment-modal .modal-header {
        padding: 16px 16px 0 16px;
    }
    
    .add-appointment-modal .modal-body {
        padding: 16px;
    }
    
    .add-appointment-modal .modal-footer-right {
        padding: 16px;
    }
}

.modal-footer-split {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 20px 24px;
    border-top: 1px solid #f1f5f9;
    background: white;
    flex-shrink: 0;
}

.modal-footer-right {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ========================================
   TIER UPGRADE MODAL
   ======================================== */

.tier-upgrade-modal {
    z-index: 10001;
}

.tier-upgrade-content {
    max-width: 480px;
    animation: slideIn 0.3s ease;
}

.tier-upgrade-header {
    background: #f5f3ff;
    border-bottom: 1px solid #ddd6fe;
}

.tier-upgrade-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tier-upgrade-title-row .modal-title {
    margin: 0;
    color: #5b21b6;
}

.upgrade-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.upgrade-badge svg {
    stroke: white;
}

.tier-upgrade-body {
    padding: 1.5rem !important;
}

.tier-upgrade-intro {
    color: var(--text-secondary, #64748b);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.tier-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tier-feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.tier-feature-list li svg {
    width: 20px;
    height: 20px;
    stroke: #22c55e;
    flex-shrink: 0;
    margin-top: 2px;
}

.tier-feature-list li span {
    font-size: 0.9rem;
    color: var(--text-secondary, #475569);
    line-height: 1.4;
}

.tier-feature-list li strong {
    color: var(--text-dark, #1e293b);
}

.tier-upgrade-footer {
    justify-content: flex-end;
    background: #fafafa;
}

.tier-upgrade-footer .btn-primary {
    display: inline-flex;
    align-items: center;
}

.tier-upgrade-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 1.5rem;
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-light, #94a3b8);
    background: #f8fafc;
    border-top: 1px solid var(--border);
}

.tier-upgrade-hint svg {
    stroke: var(--text-light, #94a3b8);
}

.tier-upgrade-hint strong {
    color: var(--text-secondary, #64748b);
}

/* ========================================
   NOTIFICATION SYSTEM
   ======================================== */

.notification-bell {
    position: relative !important;
    z-index: 99999999 !important; /* Ensure bell is on top layer */
    display: inline-block !important; /* Ensure proper positioning context */
}

.notification-trigger {
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-trigger:hover {
    background: var(--bg-light);
}

.notification-icon {
    width: 28px;
    height: 28px;
    color: var(--text-dark);
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    border: 2px solid white;
    animation: badgePulse 2s infinite;
}

.notification-badge.hidden {
    display: none;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.75rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 380px;
    max-width: 90vw;
    display: none;
    z-index: 101;
    overflow: hidden;
}

.notification-dropdown.show {
    display: block !important;
    animation: slideDown 0.2s ease;
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    margin-top: 0.75rem !important;
    transform: none !important;
    left: auto !important;
    bottom: auto !important;
}

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

.notification-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-count {
    background: var(--bg-light);
    color: var(--text-light);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.mark-all-read {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.mark-all-read:hover {
    background: var(--bg-light);
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.notification-list::-webkit-scrollbar {
    width: 6px;
}

.notification-list::-webkit-scrollbar-track {
    background: transparent;
}

.notification-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.notification-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

.notification-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.notification-item:hover {
    background: var(--bg-light);
}

.notification-item.unread {
    background: #f0f9ff;
    border-left: 3px solid var(--primary);
}

.notification-content {
    display: flex;
    gap: 0.75rem;
}

.notification-icon-wrapper {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-icon-wrapper.appointment {
    background: #dbeafe;
    color: var(--primary);
}

.notification-icon-wrapper.waitlist {
    background: #fef3c7;
    color: var(--warning);
}

.notification-icon-wrapper.cancelled {
    background: #fee2e2;
    color: var(--danger);
}

.notification-icon-wrapper.reminder {
    background: #e0e7ff;
    color: #6366f1;
}

.notification-icon-wrapper svg {
    width: 20px;
    height: 20px;
}

.notification-details {
    flex: 1;
    min-width: 0;
}

.notification-message {
    font-size: 0.925rem;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.notification-message strong {
    font-weight: 600;
}

.notification-time {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Mark as read link - shows on hover */
.notification-mark-read {
    font-size: 1rem;
    color: var(--primary);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    margin-top: 4px;
    font-weight: 500;
}

.notification-mark-read:hover {
    text-decoration: underline;
    color: var(--primary-dark, #1d4ed8);
}

.notification-item:hover .notification-mark-read {
    opacity: 1;
}

.notification-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.view-all-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.view-all-link:hover {
    background: var(--bg-light);
}

.notification-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-light);
}

.notification-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.notification-delete {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: all 0.2s ease;
    z-index: 10;
}

.notification-dropdown .notification-item:hover .notification-delete {
    display: flex;
}

.notification-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.notification-delete:active {
    transform: translateY(-50%) scale(0.95);
}

.notification-delete svg {
    width: 16px;
    height: 16px;
    pointer-events: none;
}

.notification-dropdown .notification-item {
    padding-right: 3rem !important;
    position: relative !important;
}

.notification-dropdown .notification-content {
    padding-right: 1.5rem !important;
}

/* Notification animations */
@keyframes bellRing {
    0%, 100% { transform: rotate(0deg); }
    10%, 30%, 50%, 70% { transform: rotate(-10deg); }
    20%, 40%, 60%, 80% { transform: rotate(10deg); }
}

@keyframes newNotificationPulse {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.notification-toast {
    animation: slideInRight 0.3s ease;
}

.notification-toast.success {
    border-left: 3px solid var(--success) !important;
}

.notification-toast.info {
    border-left: 3px solid var(--primary) !important;
}

.notification-toast.warning {
    border-left: 3px solid var(--warning) !important;
}

/* ========================================
   SHARED COMPONENTS
   ======================================== */

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: none;
}

.alert.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

/* Detail Value Containers */
.detail-value-container {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    background: white;
    transition: all 0.2s ease;
    margin-bottom: 0.75rem;
}

.detail-value-container:last-child {
    margin-bottom: 0;
}

.detail-value-container.clickable {
    cursor: pointer;
}

.detail-value-container.clickable:hover {
    border-color: var(--primary);
    background: var(--bg-light);
}

.detail-value {
    display: flex;
    align-items: center;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.875rem;
}

.detail-value svg {
    color: var(--text-light);
    flex-shrink: 0;
    margin-right: 0.5rem;
}

.detail-section {
    margin-bottom: 1.5rem;
}

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

.detail-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 1rem 0;
}

.detail-section-title svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.copy-hint {
    font-size: 0.75rem;
    color: var(--primary);
    opacity: 0;
    transition: opacity 0.2s;
    margin-left: auto;
}

.detail-value-container.clickable:hover .copy-hint {
    opacity: 1;
}

.detail-value-container.copy-success {
    animation: copyPulse 0.6s ease;
    background: rgba(16, 185, 129, 0.1) !important;
}

@keyframes copyPulse {
    0% {
        transform: scale(1);
        background: rgba(16, 185, 129, 0);
    }
    50% {
        transform: scale(1.02);
        background: rgba(16, 185, 129, 0.2);
    }
    100% {
        transform: scale(1);
        background: rgba(16, 185, 129, 0.1);
    }
}

/* Logo */
.logo {
    font-size: 2rem;
    font-weight: bold;
    background: var(--bg-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.logo-icon svg {
    width: 100%;
    height: 100%;
    stroke: #2563eb;
    stroke-width: 2;
    fill: none;
}

/* Utility Classes */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    text-decoration: none;
    margin-bottom: 1rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--primary);
}

.help-text {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 2rem 0;
}

.input-group {
    display: flex;
    gap: 0.5rem;
}

.input-group .form-input {
    flex: 1;
}

.btn-copy {
    background: white;
    border: 1px solid var(--border);
    color: var(--text-dark);
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-copy:hover {
    background: var(--bg-light);
}

.section-title {
    margin: 0 0 16px 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Date Header */
.date-header-wrapper {
    display: flex;
    flex-direction: column;
    animation: dateSlideIn 0.5s ease;
}

.date-header-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-icon svg {
    width: 50px;
    height: 50px;
}

.date-header-day {
    font-size: 3.25rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.date-header-full {
    font-size: 2rem;
    font-weight: 500;
    color: var(--text-dark);
    line-height: 1.2;
    margin-top: 0.25rem;
}

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

/* Loading States */
.loading-small {
    text-align: center;
    color: var(--text-light);
    padding: 1rem;
}

.empty-text {
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 640px) {
    .modal-form-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-footer-split {
        flex-direction: column;
    }
    
    .modal-footer-right {
        justify-content: stretch;
    }
    
    .modal-footer-right .btn {
        flex: 1;
    }
}


/* Main content area for SPA pages */
/* .main-content > * {
    height: 100%;
    overflow-y: visible;
} */

.main-content > #dashboardContent {
    min-height: calc(100vh - 82px);
    overflow-y: visible;
    padding: 0;
}

.main-content .loading-container,
.main-content .page-loading {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* ========================================
   STANDARDIZED LOADING OVERLAY
   Used across all pages for consistency
   ======================================== */
.page-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f7fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.page-loading-content {
    text-align: center;
    color: var(--text-dark);
}

.page-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

.page-loading-text {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--text-dark);
}

.page-loading-subtext {
    font-size: 0.875rem;
    margin: 0;
    color: var(--text-light);
}

.dashboard-content-inner {
    max-width: none !important;
    width: 100%;
}

/* Calendar SPA Integration - Override generic styles */
.main-content .calendar-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    overflow: visible;
}

.main-content .calendar-main {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.main-content .calendar-main .month-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.main-content .calendar-main .calendar-grid {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Ensure calendar header is visible */
.main-content .calendar-header {
    flex-shrink: 0;
}

/* Fix week view when active */
.main-content .week-view {
    display: none;
    height: 100%;
}

.main-content .week-view.active {
    display: block;
}

/* Danger Button */
.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #b91c1c;
    border: 1.5px solid #ef4444;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(220, 38, 38, 0.2);
}

.btn-danger:disabled {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border-color: #fca5a5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Save Button Animation States */
.btn .btn-text {
    display: inline;
}

.btn .btn-success-text {
    display: none;
}

.btn.saving {
    opacity: 0.7;
    pointer-events: none;
}

.btn.saved {
    background: var(--success) !important;
    color: white !important;
}

.btn.saved .btn-text {
    display: none;
}

.btn.saved .btn-success-text,
.btn.created .btn-success-text {
    display: inline !important;
    animation: successPulse 0.4s ease;
}

.btn.created {
    background: var(--success) !important;
    color: white !important;
}

.btn.created .btn-text {
    display: none;
}

@keyframes successPulse {
    0% {
        transform: scale(0.9);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ====================================
   APPOINTMENT DETAILS MODAL STYLES
   Add this to components.css (NO DUPLICATES - only new styles)
   ==================================== */

/* MODIFY EXISTING: Override modal-content width for appointment details modal */
#detailsOverlay .modal-content {
    max-width: 900px;
    width: 95%;
}

/* NEW: Modal Header Top (doesn't exist yet) */
.modal-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

/* NEW: Modal Subtitle (doesn't exist yet) */
.modal-subtitle {
    margin: 0;
    color: var(--text-light);
    font-size: 0.875rem;
}

/* NEW: Header Section Titles (doesn't exist yet) */
.header-section-titles {
    display: grid;
    grid-template-columns: 40% 60%;
    gap: 24px;
    align-items: center;
    padding: 0px 32px 16px 32px;
    padding-right: 80px; /* Extra padding for scrollbar space */
    border-bottom: 1px solid #f1f5f9;
    background: white;
}

/* NEW: Two Column Layout (doesn't exist yet) */
.two-column-layout {
    display: grid;
    grid-template-columns: 40% 60%;
    gap: 24px;
}

.patient-info-column,
.appointment-details-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* NEW: Section Titles (doesn't exist yet) */

.section-icon {
    width: 20px;
    height: 20px;
    color: #3b82f6;
}

/* NEW: Info Fields (doesn't exist yet) */
.info-field {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    background: white;
    margin-bottom: 12px;
    transition: all 0.2s;
    position: relative;
}

.info-field.clickable {
    cursor: pointer;
}

.info-field.clickable:hover {
    border-color: #3b82f6;
    background: #f0f9ff;
}

.info-field.warning {
    border-color: #fbbf24;
    background: #fffbeb;
}

.field-value.warning-text {
    color: #dc2626;
    font-weight: 600;
}

.info-field.editing {
    border-color: #3b82f6;
    background: #f0f9ff;
}

/* NEW: Field Labels and Values (doesn't exist yet) - EXACT MATCH TO CALENDAR */
.field-label {
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    color: #64748b !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px !important;
    display: block;
}

.field-value {
    color: #1e293b;
    font-size: 0.875rem;
    font-weight: 500;
}

.field-value.warning-text {
    color: #dc2626;
    font-weight: 600;
}

/* NEW: Edit Hint (doesn't exist yet) */
.info-field .edit-hint {
    position: absolute;
    top: 12px;
    right: 12px;
    color: #94a3b8;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.info-field:hover .edit-hint {
    opacity: 1;
}

/* NEW: Status Section (doesn't exist yet) */
.status-section {
    margin-top: 16px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.status-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* NEW: Status Badges (doesn't exist yet) */
.badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-confirmed {
    background: rgba(16, 185, 129, 0.15);
    color: #047857;
    border: 1px solid #10b981;
}

.badge-completed {
    background: rgba(37, 99, 235, 0.15);
    color: #1d4ed8;
    border: 1px solid #3b82f6;
}

.badge-cancelled {
    background: rgba(249, 115, 22, 0.15);
    color: #c2410c;
    border: 1px solid #f97316;
}

.badge-no_show {
    background: rgba(107, 114, 128, 0.15);
    color: #374151;
    border: 1px solid #6b7280;
}

.badge-waitlist {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
    border: 1px solid #f59e0b;
}

.badge-provisional {
    background: rgba(234, 88, 12, 0.2);
    color: #9a3412;
    border: 1px solid #ea580c;
}

.badge-expires {
    background: rgba(251, 146, 60, 0.15);
    color: #c2410c;
    border: 1px solid #ea580c;
}

/* NEW: Edit Input Styling (doesn't exist yet) */
.info-field input[type="date"],
.info-field input[type="time"],
.info-field select,
.info-field textarea {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    width: 100%;
    font-family: inherit;
}

.info-field textarea {
    min-height: 80px;
    resize: vertical;
}

.info-field input:focus,
.info-field select:focus,
.info-field textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* NEW: Responsive - Stack on mobile */
@media (max-width: 768px) {
    .two-column-layout {
        grid-template-columns: 1fr;
    }
    
    .header-section-titles {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px 24px;
    }
    
    #detailsOverlay .modal-content {
        width: 100%;
        max-width: 100%;
    }
}

/* Slide-in animation for patient details page (only when coming from patients list) */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.patient-details-container.slide-in {
    animation: slideInFromRight 0.4s ease-out;
}

/* ========================================
   MODAL APPOINTMENT LIST STYLES
   Shared by calendar.js and clinic-dashboard.js
   ======================================== */

/* Appointments list container inside modals */
.modal-appointments-list,
.day-appointments-list,
.provider-appointments-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Individual appointment item in modal list */
.modal-appointment-item,
.appointment-card-modal,
.provider-modal-appointment-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    cursor: pointer;
}

.modal-appointment-item:hover,
.appointment-card-modal:hover,
.provider-modal-appointment-item:hover {
    background: #eff6ff;
    border-color: var(--primary);
    transform: translateX(4px);
}

/* Time block in appointment item */
.modal-appointment-time,
.appointment-time-block,
.provider-modal-time {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--primary);
    min-width: 85px;
    flex-shrink: 0;
}

.appointment-time-large {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
}

/* Info block in appointment item */
.modal-appointment-info,
.appointment-info-block,
.provider-modal-info {
    flex: 1;
    min-width: 0;
}

.modal-appointment-patient,
.patient-name,
.provider-modal-patient {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.modal-appointment-visit-type,
.provider-modal-visit-type {
    font-size: 0.875rem;
    color: var(--text-light);
}

.modal-appointment-reason,
.appointment-reason,
.provider-modal-reason {
    font-size: 0.8125rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* Contact info in appointment item */
.appointment-contact {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-start;
    margin-top: 0.375rem;
}

.contact-info {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    color: var(--text-light);
    width: 100%;
}

.contact-item {
    display: flex;
    align-items: center;
    white-space: nowrap;
    justify-content: flex-start;
    width: 100%;
}

.contact-item svg {
    flex-shrink: 0;
    margin-right: 4px;
}

/* Cancelled appointment styling */
.appointment-card-modal.cancelled,
.modal-appointment-item.cancelled {
    opacity: 0.6;
}

/* Empty day state */
.empty-day {
    padding: 1.5rem;
    text-align: center;
}

.empty-day p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* ========================================
   APPOINTMENT MODAL (Calendar-style)
   Shared by calendar.js and clinic-dashboard.js
   ======================================== */

   .appointment-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.appointment-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.appointment-modal .appointment-details {
    background: white;
    border-radius: 12px;
    padding: 1.25rem 2.5rem 2.5rem;
    max-width: 800px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .appointment-modal.show {
        padding: 1rem;
    }

    .appointment-modal .appointment-details {
        padding: 0.75rem 1.5rem 1.5rem;
        max-width: 100%;
    }
}

/* Toast Notification Styles - Shared globally */
.copy-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-dark);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: toastSlideIn 0.3s ease, toastSlideOut 0.3s ease 2.7s;
    z-index: 2000;
}

.copy-toast svg {
    flex-shrink: 0;
}

@keyframes toastSlideIn {
    from {
        transform: translate(-50%, 100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translate(-50%, 0);
        opacity: 1;
    }
    to {
        transform: translate(-50%, 100%);
        opacity: 0;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

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

/* ========================================
   HELP CHAT POPUP - Messaging Style
   ======================================== */

   .help-chat-popup {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 520px;
    max-height: calc(100vh - 48px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
    z-index: 10000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: helpChatSlideIn 0.3s ease;
}

.help-chat-popup.show {
    display: flex;
}

@keyframes helpChatSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.help-chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.help-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #2563eb;
    color: white;
    flex-shrink: 0;
}

.help-chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.help-chat-avatar {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-chat-avatar svg {
    width: 20px;
    height: 20px;
}

.help-chat-title {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0;
}

.help-chat-subtitle {
    font-size: 0.6875rem;
    opacity: 0.85;
    margin: 2px 0 0 0;
}

.help-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
}

.help-chat-menu-btn,
.help-chat-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    color: white;
    transition: background 0.2s;
}

.help-chat-menu-btn:hover,
.help-chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.help-chat-menu-btn svg,
.help-chat-close svg {
    width: 18px;
    height: 18px;
}

/* Dropdown menu */
.help-chat-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    display: none;
    z-index: 10;
    overflow: hidden;
}

.help-chat-menu.show {
    display: block;
}

.help-chat-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: none;
    color: var(--text-dark);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
}

.help-chat-menu button:hover {
    background: var(--bg-light);
}

.help-chat-menu button svg {
    width: 16px;
    height: 16px;
    color: var(--text-light);
}

.help-chat-menu button:last-child {
    color: var(--danger);
}

.help-chat-menu button:last-child svg {
    color: var(--danger);
}

/* Chat body */
.help-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
}

/* Welcome message */
.help-chat-welcome {
    text-align: center;
    padding: 30px 20px;
    margin: auto;
}

.help-chat-welcome .welcome-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.help-chat-welcome .welcome-icon svg {
    width: 100%;
    height: 100%;
}

.help-chat-welcome h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 8px 0;
}

.help-chat-welcome p {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 0;
    line-height: 1.5;
}

/* Messages container */
.help-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Individual message bubble */
.help-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.875rem;
    line-height: 1.5;
    position: relative;
}

.help-message.sent {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.help-message.received {
    background: white;
    color: var(--text-dark);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border);
}

.help-message-text {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.help-message-time {
    font-size: 0.625rem;
    opacity: 0.7;
    margin-top: 4px;
    display: block;
}

.help-message.sent .help-message-time {
    text-align: right;
}

/* Sent confirmation */
.help-message-status {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 4px;
    font-size: 0.625rem;
    opacity: 0.8;
}

.help-message-status svg {
    width: 12px;
    height: 12px;
}

/* Footer / Input area */
.help-chat-footer {
    padding: 12px;
    background: white;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.help-chat-email-bar {
    margin-bottom: 10px;
}

.help-chat-email-bar .form-input {
    font-size: 0.8125rem;
    padding: 8px 12px;
}

.help-chat-email-bar.hidden {
    display: none;
}

.help-email-error {
    color: #ef4444;
    font-size: 0.6875rem;
    margin: 4px 0 0 0;
    display: none;
}

.help-email-error.show {
    display: block;
}

.help-chat-input-bar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.help-chat-input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 0.875rem;
    resize: none;
    max-height: 100px;
    min-height: 40px;
    line-height: 1.4;
    font-family: inherit;
}

.help-chat-input:focus {
    outline: none;
    border-color: var(--primary);
}

.help-chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.help-chat-send-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.help-chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.help-chat-send-btn svg {
    width: 18px;
    height: 18px;
}

/* End conversation modal */
.help-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.help-modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 360px;
    width: 90%;
    text-align: center;
}

.help-modal-content h3 {
    margin: 0 0 8px 0;
    font-size: 1.125rem;
    color: var(--text-dark);
}

.help-modal-content p {
    margin: 0 0 20px 0;
    font-size: 0.875rem;
    color: var(--text-light);
}

.help-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.help-modal-actions .btn {
    width: 100%;
    justify-content: center;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .help-chat-popup {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .help-modal-actions {
        flex-direction: column;
    }
}

/* ========================================
   HERO CARD - Shared across pages
   Blue style with icon and stats
   ======================================== */
.hero-card {
    background: #2563eb;
    border-radius: 14px;
    padding: 1.5rem 2rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 2rem;
    flex-shrink: 0;
}

.hero-card .hero-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.hero-card .hero-icon-box {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 0.875rem;
    backdrop-filter: blur(10px);
}

.hero-card .hero-icon-box svg {
    width: 32px;
    height: 32px;
}

.hero-card .hero-details .hero-count {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.hero-card .hero-details .hero-sub {
    font-size: 0.9rem;
    opacity: 0.9;
}

.hero-card .hero-stats-right {
    display: flex;
    gap: 1rem;
}

.hero-card .hero-stat {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
}

.hero-card .hero-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.hero-card .hero-stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    opacity: 0.85;
}

/* Hero card responsive */
@media (max-width: 768px) {
    .hero-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin: 1rem;
        padding: 1.25rem;
    }

    .hero-card .hero-stats-right {
        width: 100%;
        justify-content: flex-start;
    }

    .hero-card .hero-stat {
        flex: 1;
        padding: 0.5rem 0.75rem;
    }
}