:root {
  --primary: #0066CC;
  --primary-dark: #004C99;
  --primary-light: #E6F0FA;
  --danger: #DC2626;
  --danger-light: #FEE2E2;
  --success: #059669;
  --success-light: #D1FAE5;
  --warning: #D97706;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --border: #E2E8F0;
  --text: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.app-container { display: flex; flex-direction: column; min-height: 100vh; }

/* Header */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo { display: flex; align-items: center; gap: 12px; }
.logo-text { font-weight: 700; font-size: 1.25rem; }

.nav-status { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; color: var(--text-secondary); }
.status-dot { width: 8px; height: 8px; background: var(--success); border-radius: 50%; }

/* Main Content */
.main-content {
  flex: 1;
  padding: 32px 24px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Upload Section */
.upload-section { display: flex; justify-content: center; align-items: flex-start; padding-top: 40px; }

.upload-card {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  padding: 48px;
  max-width: 600px;
  width: 100%;
}

.upload-header { text-align: center; margin-bottom: 32px; }
.upload-header h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 8px; }
.upload-header p { color: var(--text-secondary); }

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.upload-zone:hover { border-color: var(--primary); background: var(--primary-light); }
.upload-icon { color: var(--text-muted); margin-bottom: 8px; }
.upload-primary { font-weight: 600; }
.upload-secondary { font-size: 0.875rem; color: var(--text-secondary); }
.upload-formats { font-size: 0.75rem; color: var(--text-muted); margin-top: 8px; }

.selected-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 16px;
}

.file-name { font-weight: 500; color: var(--primary-dark); }
.remove-file { background: none; border: none; font-size: 1.25rem; color: var(--primary); cursor: pointer; }

.analyze-btn, .patients-btn, .bulk-analyze-btn {
  width: 100%;
  margin-top: 24px;
  padding: 16px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.analyze-btn:hover:not(:disabled), .bulk-analyze-btn:hover:not(:disabled) { background: var(--primary-dark); }
.analyze-btn:disabled, .bulk-analyze-btn:disabled { background: #CBD5E1; cursor: not-allowed; }

.patients-btn {
  background: var(--surface);
  color: var(--primary);
  border: 2px solid var(--primary);
}
.patients-btn:hover { background: var(--primary-light); }

.divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.divider span { padding: 0 16px; }

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Bulk Upload Section */
.bulk-upload-section { margin-top: 0; }

.bulk-upload-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg);
}

.bulk-upload-zone:hover {
  border-color: var(--success);
  background: var(--success-light);
}

.bulk-upload-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.bulk-upload-content svg { color: var(--success); flex-shrink: 0; }

.bulk-text { display: flex; flex-direction: column; }
.bulk-primary { font-weight: 600; color: var(--text); }
.bulk-secondary { font-size: 0.875rem; color: var(--text-secondary); }

/* Bulk Files List */
.bulk-files-list {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.bulk-files-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.bulk-files-header span { font-weight: 500; font-size: 0.875rem; }

.clear-bulk-btn {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 0.875rem;
  cursor: pointer;
  font-weight: 500;
}
.clear-bulk-btn:hover { text-decoration: underline; }

.bulk-files-items {
  max-height: 200px;
  overflow-y: auto;
}

.bulk-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.bulk-file-item:last-child { border-bottom: none; }

.bulk-file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.bulk-file-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bulk-file-status {
  flex-shrink: 0;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
}

.bulk-file-status.pending { background: var(--bg); color: var(--text-muted); }
.bulk-file-status.processing { background: #FEF3C7; color: var(--warning); }
.bulk-file-status.complete { background: var(--success-light); color: var(--success); }
.bulk-file-status.error { background: var(--danger-light); color: var(--danger); }

.remove-bulk-file {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0 4px;
}
.remove-bulk-file:hover { color: var(--danger); }

.bulk-analyze-btn {
  background: var(--success);
  margin-top: 16px;
}
.bulk-analyze-btn:hover:not(:disabled) { background: #047857; }

/* Progress Bar */
.bulk-progress {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.875rem;
}

.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--success);
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-details {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.progress-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.progress-item.success { color: var(--success); }
.progress-item.error { color: var(--danger); }

/* Success Toast */
.success-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--success);
  color: white;
  padding: 16px 24px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 1000;
}
.success-toast button { background: none; border: none; color: white; font-size: 1.25rem; cursor: pointer; }

/* Patients Section */
.patients-section { animation: fadeIn 0.3s ease; }

.patients-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.patients-header h2 { font-size: 1.5rem; flex: 1; }

.search-box input {
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  width: 280px;
  font-family: inherit;
}
.search-box input:focus { outline: none; border-color: var(--primary); }

.patients-stats { margin-bottom: 24px; }
.stat-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 20px 24px;
  display: inline-flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.stat-number { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.875rem; color: var(--text-secondary); }

.patients-list { display: grid; gap: 16px; }

.patient-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--border);
}
.patient-card:hover { border-color: var(--primary); box-shadow: 0 4px 12px rgba(0,102,204,0.1); }

.patient-info { display: flex; flex-direction: column; gap: 4px; }
.patient-name { font-weight: 600; font-size: 1.1rem; }
.patient-meta { font-size: 0.875rem; color: var(--text-secondary); display: flex; gap: 16px; flex-wrap: wrap; }

.patient-actions { display: flex; gap: 8px; }

.view-btn, .delete-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}
.view-btn { background: var(--primary); color: white; }
.view-btn:hover { background: var(--primary-dark); }
.delete-btn { background: var(--danger-light); color: var(--danger); }
.delete-btn:hover { background: var(--danger); color: white; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state svg { margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { color: var(--text-secondary); margin-bottom: 8px; }

/* Results Section */
.results-section { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.results-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.back-btn, .print-btn, .secondary-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  color: var(--text-secondary);
}
.back-btn:hover, .print-btn:hover, .secondary-btn:hover { border-color: var(--primary); color: var(--primary); }

.summary-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border-radius: 16px;
  padding: 28px 32px;
  margin-bottom: 20px;
}
.summary-card h2 { font-size: 0.875rem; font-weight: 600; letter-spacing: 0.05em; opacity: 0.9; margin-bottom: 12px; }
.summary-card p { font-size: 1.125rem; line-height: 1.7; }

.alerts-card {
  background: var(--danger-light);
  border: 1px solid var(--danger);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
}
.alerts-card h2 { font-size: 1rem; color: var(--danger); margin-bottom: 12px; }
.alerts-card ul { list-style: none; }
.alerts-card li { padding: 8px 0; color: var(--danger); font-weight: 500; border-bottom: 1px solid rgba(220,38,38,0.2); }
.alerts-card li:last-child { border-bottom: none; }

/* Tabs */
.category-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  padding: 6px;
  border-radius: 10px;
  margin-bottom: 24px;
  overflow-x: auto;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.tab-btn {
  flex: 1;
  padding: 12px 20px;
  background: none;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
  color: var(--text-secondary);
}
.tab-btn:hover { color: var(--text); background: var(--bg); }
.tab-btn.active { background: var(--primary); color: white; }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.3s ease; }

/* Data Grid */
.data-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; }

.data-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  border: 1px solid var(--border);
}
.data-card.full-width { grid-column: 1 / -1; }
.data-card h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.data-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.data-row:last-child { border-bottom: none; }
.data-row .label { color: var(--text-secondary); }

.data-card ul { list-style: none; }
.data-card li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.data-card li:last-child { border-bottom: none; }
.data-card li::before { content: "•"; color: var(--primary); font-weight: bold; margin-right: 10px; }

.data-card p { color: var(--text); line-height: 1.7; }

/* Tables */
.data-card table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-card th, .data-card td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); }
.data-card th { font-weight: 600; color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; background: var(--bg); }
.data-card tr.flagged { background: #FEF3C7; }
.data-card tr.flagged td { color: var(--warning); font-weight: 500; }

/* Vitals */
.vital { text-align: center; padding: 12px; background: var(--bg); border-radius: 8px; margin-bottom: 8px; }
.vital-value { font-size: 1.25rem; font-weight: 700; color: var(--primary); display: block; }
.vital-label { font-size: 0.75rem; color: var(--text-muted); }

#vitals-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; }

/* SOAP Notes */
.soap-section { background: var(--bg); padding: 16px; border-radius: 8px; margin-bottom: 12px; }
.soap-section:last-child { margin-bottom: 0; }
.soap-section h4 { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; color: var(--primary); margin-bottom: 8px; }
.soap-section p { font-size: 0.875rem; line-height: 1.6; }

/* Allergies */
.allergy-item { background: var(--danger-light); padding: 12px; border-radius: 8px; margin-bottom: 8px; }
.allergy-item:last-child { margin-bottom: 0; }
.allergy-item strong { color: var(--danger); }

/* Imaging */
.imaging-item { background: var(--bg); padding: 16px; border-radius: 8px; margin-bottom: 12px; }
.imaging-item:last-child { margin-bottom: 0; }
.imaging-item h4 { font-size: 0.875rem; font-weight: 600; margin-bottom: 8px; }
.imaging-item p { font-size: 0.875rem; color: var(--text-secondary); }

/* Error Toast */
.error-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--danger);
  color: white;
  padding: 16px 24px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 1000;
}
.error-toast button { background: none; border: none; color: white; font-size: 1.25rem; cursor: pointer; }

/* Footer */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  text-align: center;
}
.footer p { font-size: 0.8rem; color: var(--text-muted); }

/* Responsive */
@media (max-width: 768px) {
  .upload-card { padding: 32px 24px; }
  .data-grid { grid-template-columns: 1fr; }
  .patients-header { flex-direction: column; align-items: flex-start; }
  .search-box input { width: 100%; }
  .patient-card { flex-direction: column; align-items: flex-start; gap: 16px; }
  .patient-actions { width: 100%; }
  .patient-actions button { flex: 1; }
  .bulk-upload-content { flex-direction: column; text-align: center; }
}

@media print {
  .header, .footer, .back-btn, .print-btn, .category-tabs, .secondary-btn { display: none !important; }
  .tab-panel { display: block !important; page-break-inside: avoid; margin-bottom: 24px; }
}

/* Past Visits & Notes Styles */
.past-visits-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.visit-card {
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all 0.2s;
}

.visit-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0,102,204,0.1);
}

.visit-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.visit-card-header:hover {
  background: var(--primary-light);
}

.visit-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.visit-type {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.visit-type-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.visit-type-badge.surgery {
  background: #DBEAFE;
  color: #1D4ED8;
}

.visit-type-badge.office {
  background: #D1FAE5;
  color: #059669;
}

.visit-type-badge.hospital {
  background: #FEE2E2;
  color: #DC2626;
}

.visit-type-badge.emergency {
  background: #FEF3C7;
  color: #D97706;
}

.visit-meta {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.visit-toggle {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform 0.2s;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.visit-toggle:hover {
  background: var(--primary-light);
}

.visit-toggle.expanded {
  transform: rotate(180deg);
}

.visit-card-content {
  display: none;
  padding: 20px;
}

.visit-card-content.expanded {
  display: block;
  animation: fadeIn 0.3s ease;
}

.visit-section {
  margin-bottom: 20px;
}

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

.visit-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--primary);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.visit-section-content {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text);
}

.visit-section-content p {
  margin-bottom: 8px;
}

.visit-section-content p:last-child {
  margin-bottom: 0;
}

.visit-vitals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.visit-vital-item {
  background: var(--bg);
  padding: 10px;
  border-radius: 8px;
  text-align: center;
}

.visit-vital-value {
  font-weight: 600;
  color: var(--primary);
  font-size: 1.1rem;
}

.visit-vital-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.visit-diagnoses {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.visit-diagnosis-tag {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.visit-medications-list {
  margin-top: 8px;
}

.visit-medication-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.visit-medication-item:last-child {
  border-bottom: none;
}

.visit-medication-name {
  font-weight: 500;
}

.visit-medication-details {
  color: var(--text-secondary);
}

.visit-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.visit-empty-state svg {
  margin-bottom: 16px;
  opacity: 0.5;
}

.visits-filter {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

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

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

.physician-signature {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-style: italic;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Duplicate Status Styling */
.bulk-file-status.duplicate {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid var(--danger);
  font-weight: 600;
}

.bulk-file-item.duplicate {
  background: var(--danger-light);
  border: 2px solid var(--danger);
  border-radius: 6px;
}

.bulk-file-item.duplicate .bulk-file-name {
  color: var(--danger);
}

.progress-item.duplicate {
  color: var(--warning);
}

.progress-item.duplicate::before {
  content: "⚠ ";
}

/* Make Physical Exam card full width on Clinical tab */
#tab-clinical .data-grid .data-card:nth-child(2) {
  grid-column: 1 / -1;
}

/* Make Physical Exam card full width on Clinical tab */
#tab-clinical .data-grid .data-card:nth-child(2) {
  grid-column: 1 / -1;
}
css/* Style Physical Exam like SOAP notes */
#physical-exam-data {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#physical-exam-data .data-row {
  background: var(--bg);
  padding: 16px 20px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#physical-exam-data .data-row .label {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

#physical-exam-data .data-row .label::after {
  content: none;
}/* Source Citation Modal */
.source-modal {
  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: 1000;
}

.source-modal-content {
  background: var(--surface);
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.source-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.source-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text);
}

.source-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.source-modal-close:hover {
  color: var(--text);
}

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

.source-item-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary-light);
}

.source-citations {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.source-citation-item {
  background: var(--bg);
  border-radius: 8px;
  padding: 16px;
  border-left: 4px solid var(--primary);
}

.source-citation-section {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 8px;
  letter-spacing: 0.03em;
}

.source-citation-excerpt {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  font-style: italic;
}

.source-citation-excerpt::before {
  content: '"';
  color: var(--primary);
  font-size: 1.2rem;
}

.source-citation-excerpt::after {
  content: '"';
  color: var(--primary);
  font-size: 1.2rem;
}

.source-original-section {
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.source-original-section h4 {
  margin: 0 0 12px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.view-original-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.view-original-btn:hover {
  background: var(--primary-dark);
}

/* Original Document Modal */
.document-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
}

.document-modal-content {
  background: var(--surface);
  border-radius: 12px;
  width: 95%;
  max-width: 900px;
  height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.document-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.document-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text);
}

.document-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.document-modal-close:hover {
  color: var(--text);
}

.document-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  background: var(--bg);
}

#original-document-content {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--text);
  margin: 0;
}

/* Clickable source items */
.has-source {
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}

.has-source:hover {
  color: var(--primary);
}

.has-source::after {
  content: '🔗';
  font-size: 0.7rem;
  margin-left: 6px;
  opacity: 0.5;
}

.has-source:hover::after {
  opacity: 1;
}

/* Clickable items in lists */
#pmh-list li.has-source,
#surgical-list li.has-source,
#family-history-list li.has-source,
#allergies-list .allergy-item.has-source,
#medications-table tr.has-source {
  cursor: pointer;
}

#pmh-list li.has-source:hover,
#surgical-list li.has-source:hover,
#family-history-list li.has-source:hover {
  background: var(--primary-light);
  margin-left: -8px;
  padding-left: 8px;
  border-radius: 4px;
}

#allergies-list .allergy-item.has-source:hover {
  background: var(--primary-light);
  border-radius: 4px;
}

#medications-table tr.has-source:hover {
  background: var(--primary-light);
}

/* Data row clickable */
.data-row.has-source {
  cursor: pointer;
  padding: 4px 8px;
  margin: -4px -8px;
  border-radius: 4px;
}

.data-row.has-source:hover {
  background: var(--primary-light);
}

/* No source available message */
.no-sources {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 20px;
}/* Highlighted text in original document */
.source-highlight {
  background: #FFA500;
  color: #000;
  padding: 2px 0;
  border-radius: 2px;
}

#original-document-content .source-highlight {
  background: #FFA500;
  color: #000;
  padding: 2px 4px;
  border-radius: 3px;
  animation: highlightPulse 2s ease-in-out;
}

@keyframes highlightPulse {
  0% { background: #FFD700; }
  50% { background: #FFA500; }
  100% { background: #FFA500; }
}/* ===== NOTES & TASKS WORKSPACE ===== */

.workspace-tab {
  background: linear-gradient(135deg, #10B981, #059669) !important;
  color: white !important;
}

.workspace-tab:hover {
  background: linear-gradient(135deg, #059669, #047857) !important;
}

.workspace-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  padding: 20px 0;
}

.workspace-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border);
}

.workspace-card h3 {
  margin: 0 0 16px 0;
  font-size: 1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.workspace-card h3 .ai-icon {
  font-size: 1.2rem;
}

/* Note Input */
.note-input-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note-category-select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.note-textarea {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  background: var(--bg);
  color: var(--text);
}

.note-textarea:focus,
.note-category-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.add-note-btn {
  padding: 12px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.add-note-btn:hover {
  background: var(--primary-dark);
}

/* Task Input */
.task-input-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-input {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  background: var(--bg);
  color: var(--text);
}

.task-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.task-options {
  display: flex;
  gap: 12px;
}

.task-priority-select,
.task-due-date {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  background: var(--bg);
  color: var(--text);
}

.add-task-btn {
  padding: 12px 20px;
  background: #10B981;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.add-task-btn:hover {
  background: #059669;
}

/* AI Suggestions */
.ai-suggestions-card {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
  border: 1px solid #C7D2FE;
}

.ai-suggestions-card h3 {
  color: #4338CA;
  justify-content: flex-start;
}

.refresh-suggestions-btn {
  margin-left: auto;
  padding: 6px 12px;
  background: #4338CA;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s;
}

.refresh-suggestions-btn:hover {
  background: #3730A3;
}

.ai-suggestions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: white;
  border-radius: 8px;
  border: 1px solid #C7D2FE;
}

.ai-suggestion-item .suggestion-text {
  flex: 1;
  font-size: 0.9rem;
  color: #1E1B4B;
}

.ai-suggestion-item .suggestion-reason {
  font-size: 0.75rem;
  color: #6366F1;
  margin-top: 4px;
}

.accept-suggestion-btn {
  padding: 6px 12px;
  background: #10B981;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
}

.accept-suggestion-btn:hover {
  background: #059669;
}

.dismiss-suggestion-btn {
  padding: 6px 12px;
  background: #EF4444;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
}

.dismiss-suggestion-btn:hover {
  background: #DC2626;
}

.loading-suggestions {
  color: #6366F1;
  font-style: italic;
  text-align: center;
  padding: 20px;
}

/* Notes List */
.notes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.note-item {
  padding: 16px;
  background: var(--bg);
  border-radius: 8px;
  border-left: 4px solid var(--primary);
}

.note-item.follow-up {
  border-left-color: #F59E0B;
}

.note-item.observation {
  border-left-color: #10B981;
}

.note-item.question {
  border-left-color: #6366F1;
}

.note-item.urgent {
  border-left-color: #EF4444;
  background: #FEF2F2;
}

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

.note-category {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 4px;
}

.note-item.follow-up .note-category {
  background: #FEF3C7;
  color: #D97706;
}

.note-item.observation .note-category {
  background: #D1FAE5;
  color: #059669;
}

.note-item.question .note-category {
  background: #E0E7FF;
  color: #4338CA;
}

.note-item.urgent .note-category {
  background: #FEE2E2;
  color: #DC2626;
}

.note-timestamp {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.note-content {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
}

.note-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.delete-note-btn {
  padding: 4px 10px;
  background: none;
  color: #EF4444;
  border: 1px solid #EF4444;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
}

.delete-note-btn:hover {
  background: #FEE2E2;
}

.empty-notes,
.empty-tasks {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 20px;
}

/* Tasks List */
.tasks-filter {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.task-filter-btn {
  padding: 6px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

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

.task-filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.task-item.completed {
  opacity: 0.6;
}

.task-item.completed .task-text {
  text-decoration: line-through;
}

.task-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.task-checkbox:hover {
  border-color: #10B981;
}

.task-item.completed .task-checkbox {
  background: #10B981;
  border-color: #10B981;
  color: white;
}

.task-checkbox::after {
  content: '✓';
  font-size: 12px;
  opacity: 0;
}

.task-item.completed .task-checkbox::after {
  opacity: 1;
}

.task-details {
  flex: 1;
}

.task-text {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 6px;
}

.task-meta {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.task-priority {
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.task-priority.low {
  background: #D1FAE5;
  color: #059669;
}

.task-priority.medium {
  background: #FEF3C7;
  color: #D97706;
}

.task-priority.high {
  background: #FEE2E2;
  color: #DC2626;
}

.task-due-date-display {
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-due-date-display.overdue {
  color: #EF4444;
  font-weight: 500;
}

.delete-task-btn {
  padding: 4px 8px;
  background: none;
  color: var(--text-muted);
  border: none;
  font-size: 1rem;
  cursor: pointer;
}

.delete-task-btn:hover {
  color: #EF4444;
}

/* Responsive */
@media (max-width: 900px) {
  .workspace-container {
    grid-template-columns: 1fr;
  }
  
  .ai-suggestions-card {
    grid-column: 1;
  }
}
/* ===== AI ASSISTANT TAB ===== */

.ai-assistant-tab {
  background: linear-gradient(135deg, #6366F1, #4F46E5) !important;
  color: white !important;
}

.ai-assistant-tab:hover {
  background: linear-gradient(135deg, #4F46E5, #4338CA) !important;
}

.ai-assistant-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 400px);
  min-height: 500px;
  max-height: 700px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.ai-chat-header {
  padding: 20px 24px;
  background: linear-gradient(135deg, #6366F1, #4F46E5);
  color: white;
}

.ai-chat-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-chat-title .ai-icon {
  font-size: 1.5rem;
}

.ai-chat-title h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.ai-chat-subtitle {
  margin: 8px 0 0 0;
  font-size: 0.85rem;
  opacity: 0.9;
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg);
}

.ai-message {
  display: flex;
  gap: 12px;
  max-width: 85%;
}

.ai-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ai-message.assistant {
  align-self: flex-start;
}

.ai-message-content {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.ai-message.user .ai-message-content {
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.ai-message.assistant .ai-message-content {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.ai-message-content p {
  margin: 0 0 10px 0;
}

.ai-message-content p:last-child {
  margin-bottom: 0;
}

.ai-message-content ul, .ai-message-content ol {
  margin: 10px 0;
  padding-left: 20px;
}

.ai-message-content li {
  margin-bottom: 5px;
}

.ai-message-content strong {
  color: var(--primary);
}

.ai-chat-input-container {
  padding: 16px 20px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.ai-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.ai-suggestion-chip {
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.ai-suggestion-chip:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.ai-chat-input-wrapper {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.ai-chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 0.9rem;
  font-family: inherit;
  resize: none;
  max-height: 120px;
  background: var(--bg);
  color: var(--text);
}

.ai-chat-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

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

.ai-send-btn:hover {
  background: var(--primary-dark);
}

.ai-send-btn:disabled {
  background: var(--border);
  cursor: not-allowed;
}

.ai-typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}

.ai-typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.ai-typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.ai-typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .ai-assistant-container {
    height: calc(100vh - 300px);
    min-height: 400px;
  }
  
  .ai-chat-suggestions {
    display: none;
  }
  
  .ai-message {
    max-width: 95%;
  }
}
/* ===== EPIC INTEGRATION ===== */

.epic-section {
  margin-top: 20px;
  width: 100%;
}

.epic-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 16px 0;
}

.epic-divider::before,
.epic-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}

.epic-divider span {
  padding: 0 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.epic-connect-btn {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, #E11D48, #BE123C);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s;
}

.epic-connect-btn:hover {
  background: linear-gradient(135deg, #BE123C, #9F1239);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.3);
}

.epic-connect-btn svg {
  stroke: white;
}

/* Epic Modal */
.epic-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1002;
}

.epic-modal-content {
  background: var(--surface);
  border-radius: 16px;
  width: 95%;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.epic-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, #E11D48, #BE123C);
  color: white;
}

.epic-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.epic-header-title svg {
  stroke: white;
}

.epic-header-title h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.epic-modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.epic-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

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

/* Connection Status */
.epic-connection-status {
  text-align: center;
  padding: 20px;
}

.epic-status-disconnected .status-icon,
.epic-status-connected .status-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.epic-connection-status h4 {
  margin: 0 0 8px 0;
  font-size: 1.1rem;
  color: var(--text);
}

.epic-connection-status p {
  margin: 0 0 20px 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.epic-login-btn {
  padding: 14px 32px;
  background: linear-gradient(135deg, #E11D48, #BE123C);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.epic-login-btn:hover {
  background: linear-gradient(135deg, #BE123C, #9F1239);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.3);
}

.epic-sandbox-note {
  margin-top: 16px !important;
  font-size: 0.8rem !important;
  color: var(--text-muted) !important;
  font-style: italic;
}

.epic-disconnect-btn {
  padding: 10px 24px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.epic-disconnect-btn:hover {
  background: #FEE2E2;
  border-color: #EF4444;
  color: #DC2626;
}

/* Patient Search */
.epic-patient-search {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin-top: 24px;
}

.epic-patient-search h4 {
  margin: 0 0 16px 0;
  font-size: 1rem;
  color: var(--text);
}

.epic-search-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.epic-search-row {
  display: flex;
  gap: 16px;
}

.epic-search-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.epic-search-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.epic-search-field input {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  background: var(--bg);
  color: var(--text);
}

.epic-search-field input:focus {
  outline: none;
  border-color: #E11D48;
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.1);
}

.epic-search-btn {
  padding: 14px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s;
  margin-top: 8px;
}

.epic-search-btn:hover {
  background: var(--primary-dark);
}

.epic-search-btn:disabled {
  background: var(--border);
  cursor: not-allowed;
}

/* Search Results */
.epic-search-results {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin-top: 24px;
}

.epic-search-results h4 {
  margin: 0 0 16px 0;
  font-size: 1rem;
  color: var(--text);
}

.epic-results-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.epic-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

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

.epic-result-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.epic-result-name {
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
}

.epic-result-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.epic-import-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg, #E11D48, #BE123C);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.epic-import-btn:hover {
  background: linear-gradient(135deg, #BE123C, #9F1239);
}

/* Import Progress */
.epic-import-progress {
  text-align: center;
  padding: 40px 20px;
}

.epic-import-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: #E11D48;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

.epic-import-progress p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* No Results */
.epic-no-results {
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
}

.epic-no-results svg {
  width: 48px;
  height: 48px;
  stroke: var(--text-muted);
  margin-bottom: 12px;
}

/* Sample Patients for Sandbox */
.epic-sample-patients {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.epic-sample-patients h5 {
  margin: 0 0 12px 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.epic-sample-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.epic-sample-chip {
  padding: 8px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.epic-sample-chip:hover {
  background: #FEE2E2;
  border-color: #E11D48;
  color: #E11D48;
}

@media (max-width: 600px) {
  .epic-search-row {
    flex-direction: column;
  }
  
  .epic-result-item {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .epic-import-btn {
    width: 100%;
  }
}

/* ===== CERNER INTEGRATION ===== */

.cerner-connect-btn {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, #00A9E0, #0077C8);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s;
  margin-top: 10px;
}

.cerner-connect-btn:hover {
  background: linear-gradient(135deg, #0077C8, #005A9E);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 169, 224, 0.3);
}

.cerner-connect-btn svg {
  stroke: white;
}

/* Cerner Modal */
.cerner-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1002;
}

.cerner-modal-content {
  background: var(--surface);
  border-radius: 16px;
  width: 95%;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.cerner-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, #00A9E0, #0077C8);
  color: white;
}

.cerner-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cerner-header-title svg {
  stroke: white;
}

.cerner-header-title h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.cerner-modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.cerner-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

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

/* Cerner Connection Status */
.cerner-connection-status {
  text-align: center;
  padding: 20px;
}

.cerner-status-disconnected .status-icon,
.cerner-status-connected .status-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.cerner-connection-status h4 {
  margin: 0 0 8px 0;
  font-size: 1.1rem;
  color: var(--text);
}

.cerner-connection-status p {
  margin: 0 0 20px 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.cerner-login-btn {
  padding: 14px 32px;
  background: linear-gradient(135deg, #00A9E0, #0077C8);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.cerner-login-btn:hover {
  background: linear-gradient(135deg, #0077C8, #005A9E);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 169, 224, 0.3);
}

.cerner-sandbox-note {
  margin-top: 16px !important;
  font-size: 0.8rem !important;
  color: var(--text-muted) !important;
  font-style: italic;
}

.cerner-disconnect-btn {
  padding: 10px 24px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.cerner-disconnect-btn:hover {
  background: #FEE2E2;
  border-color: #EF4444;
  color: #DC2626;
}

/* Cerner Patient Search */
.cerner-patient-search {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin-top: 24px;
}

.cerner-patient-search h4 {
  margin: 0 0 16px 0;
  font-size: 1rem;
  color: var(--text);
}

.cerner-search-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cerner-search-row {
  display: flex;
  gap: 16px;
}

.cerner-search-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cerner-search-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cerner-search-field input {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  background: var(--bg);
  color: var(--text);
}

.cerner-search-field input:focus {
  outline: none;
  border-color: #00A9E0;
  box-shadow: 0 0 0 3px rgba(0, 169, 224, 0.1);
}

.cerner-search-btn {
  padding: 14px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s;
  margin-top: 8px;
}

.cerner-search-btn:hover {
  background: var(--primary-dark);
}

.cerner-search-btn:disabled {
  background: var(--border);
  cursor: not-allowed;
}

/* Cerner Search Results */
.cerner-search-results {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin-top: 24px;
}

.cerner-search-results h4 {
  margin: 0 0 16px 0;
  font-size: 1rem;
  color: var(--text);
}

.cerner-results-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cerner-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.cerner-result-item:hover {
  border-color: #00A9E0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.cerner-result-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cerner-result-name {
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
}

.cerner-result-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.cerner-import-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg, #00A9E0, #0077C8);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.cerner-import-btn:hover {
  background: linear-gradient(135deg, #0077C8, #005A9E);
}

/* Cerner Import Progress */
.cerner-import-progress {
  text-align: center;
  padding: 40px 20px;
}

.cerner-import-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: #00A9E0;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

.cerner-import-progress p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Cerner Sample Patients */
.cerner-sample-patients {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.cerner-sample-patients h5 {
  margin: 0 0 12px 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cerner-sample-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cerner-sample-chip {
  padding: 8px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.cerner-sample-chip:hover {
  background: #E0F4FC;
  border-color: #00A9E0;
  color: #0077C8;
}

@media (max-width: 600px) {
  .cerner-search-row {
    flex-direction: column;
  }
  
  .cerner-result-item {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .cerner-import-btn {
    width: 100%;
  }
}

/* ===== AUDIT LOGS SECTION ===== */

.audit-btn {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-right: 16px;
}

.audit-btn:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  transform: translateY(-1px);
}

#audit-section {
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.audit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.audit-header h2 {
  font-size: 24px;
  font-weight: 600;
  color: #1e293b;
}

.audit-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
  padding: 20px 24px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  min-width: 150px;
}

.stat-number {
  font-size: 32px;
  font-weight: 700;
    color: white;
}

.stat-label {
  font-size: 14px;
  opacity: 0.9;
  color: white;
}

.audit-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.audit-filters select,
.audit-filters input {
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  min-width: 180px;
}

.audit-filters select:focus,
.audit-filters input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.audit-table-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.audit-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.audit-table th {
  background: #f8fafc;
  padding: 16px 20px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
}

.audit-table th:last-child {
  border-right: none;
}

.audit-table td {
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #f1f5f9;
  font-size: 14px;
  color: #334155;
  vertical-align: top;
  word-wrap: break-word;
}

.audit-table td:last-child {
  border-right: none;
}

.audit-table tr:hover {
  background: #f8fafc;
}

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

/* Column widths */
.audit-table th:nth-child(1),
.audit-table td:nth-child(1) {
  width: 180px;
}

.audit-table th:nth-child(2),
.audit-table td:nth-child(2) {
  width: 120px;
}

.audit-table th:nth-child(3),
.audit-table td:nth-child(3) {
  width: 150px;
}

.audit-table th:nth-child(4),
.audit-table td:nth-child(4) {
  width: 140px;
}

.audit-table th:nth-child(5),
.audit-table td:nth-child(5) {
  width: auto;
}

.action-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.action-badge.analyzed {
  background: #dcfce7;
  color: #166534;
}

.action-badge.viewed {
  background: #dbeafe;
  color: #1e40af;
}

.action-badge.deleted {
  background: #fee2e2;
  color: #991b1b;
}

.action-badge.list-viewed {
  background: #f3e8ff;
  color: #6b21a8;
}

.action-badge.document {
  background: #fef3c7;
  color: #92400e;
}

.no-logs {
  text-align: center;
  padding: 40px;
  color: #64748b;
}

/* ===== LOGIN SECTION ===== */

.login-section {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 80px);
  padding: 24px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.login-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  padding: 48px;
  width: 100%;
  max-width: 440px;
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  margin-bottom: 16px;
}

.login-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
}

.login-header p {
  color: #64748b;
  font-size: 14px;
}

.login-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  width: 100%;
}

.epic-login-btn {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: white;
}

.epic-login-btn:hover {
  background: linear-gradient(135deg, #b91c1c, #991b1b);
  transform: translateY(-1px);
}

.cerner-login-btn {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: white;
}

.cerner-login-btn:hover {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  transform: translateY(-1px);
}

.dev-login-btn {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
}

.dev-login-btn:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  transform: translateY(-1px);
}

.login-divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.login-divider span {
  padding: 0 16px;
  color: #94a3b8;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.dev-login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-input {
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s ease;
}

.login-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.login-footer {
  margin-top: 32px;
  text-align: center;
}

.login-footer p {
  color: #64748b;
  font-size: 12px;
}

/* User info in header */
.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: 16px;
}

.user-name {
  font-weight: 500;
  color: #1e293b;
}

.user-role {
  font-size: 12px;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 4px;
}

.logout-btn {
  background: #fee2e2;
  color: #dc2626;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logout-btn:hover {
  background: #fecaca;
}

/* Hide header buttons when logged out */
.header-auth-hidden {
  display: none !important;
}

/* ===== SESSION TIMEOUT ===== */

.session-warning {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  padding: 12px 24px;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.session-warning-content {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  font-weight: 500;
}

.session-extend-btn {
  background: white;
  color: #d97706;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.session-extend-btn:hover {
  background: #fef3c7;
  transform: scale(1.02);
}

.session-expired-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10001;
}

.session-expired-content {
  background: white;
  padding: 40px;
  border-radius: 16px;
  text-align: center;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.session-expired-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.session-expired-content h3 {
  font-size: 24px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 12px;
}

.session-expired-content p {
  color: #64748b;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.session-relogin-btn {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border: none;
  padding: 12px 32px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.session-relogin-btn:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
}

/* ===== PROGRESS OVERLAY ===== */

.progress-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.progress-content {
  background: white;
  padding: 40px 50px;
  border-radius: 16px;
  text-align: center;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.progress-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #e2e8f0;
  border-top-color: #3b82f6;
  border-radius: 50%;
  margin: 0 auto 24px;
  animation: spin 1s linear infinite;
}

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

.progress-steps {
  text-align: left;
  margin-bottom: 20px;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  color: #94a3b8;
  font-size: 14px;
  transition: all 0.3s ease;
}

.progress-step.active {
  color: #3b82f6;
  font-weight: 500;
}

.progress-step.complete {
  color: #22c55e;
}

.step-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.progress-step.active .step-icon {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.step-text {
  flex: 1;
}

.progress-estimate {
  color: #64748b;
  font-size: 13px;
  margin-top: 8px;
}

/* ===== APPOINTMENTS SECTION ===== */

.appointments-section {
  margin-bottom: 30px;
}

.appointments-section h3,
.past-visits-section h3 {
  margin-bottom: 15px;
  color: #1e293b;
  font-size: 18px;
}

.appointments-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.appointments-empty-state {
  padding: 20px;
  text-align: center;
  color: #64748b;
  background: #f8fafc;
  border-radius: 8px;
}

.appointment-card {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 15px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  transition: box-shadow 0.2s;
}

.appointment-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.appointment-date {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: #3b82f6;
  min-width: 200px;
}

.appointment-icon {
  font-size: 20px;
}

.appointment-details {
  flex: 1;
}

.appointment-description {
  font-weight: 500;
  color: #1e293b;
  margin-bottom: 5px;
}

.appointment-provider {
  font-size: 14px;
  color: #64748b;
}

.appointment-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  margin-top: 8px;
}

.appointment-status.status-booked {
  background: #dbeafe;
  color: #1d4ed8;
}

.appointment-status.status-completed {
  background: #dcfce7;
  color: #16a34a;
}

.appointment-status.status-cancelled {
  background: #fee2e2;
  color: #dc2626;
}

/* ===== DEMO MODE STYLES ===== */

.demo-login-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  border: none !important;
}

.demo-login-btn:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  transform: translateY(-2px);
}

.demo-banner {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 8px;
  margin-bottom: 24px;
  font-weight: 500;
  flex-wrap: wrap;
  gap: 12px;
}

.exit-demo-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.exit-demo-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}