/* Diagnostic Confidence Widget - Medora Theme */

/* ==========================================
   HEALTHSCRIBE AI COPILOT DASHBOARD STYLES  
   MEDICAL-GRADE PROFESSIONAL APPEARANCE
   ========================================== */

.copilot-dashboard.medical-grade {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    padding: 0;
    margin: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ==========================================
   MEDORA HEADER - UNIFIED MEDICAL-GRADE BRANDING
   ========================================== */

.copilot-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #1f2937;
    padding: 20px;
    border-bottom: 2px solid #e1e5e9;
    margin-bottom: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.medora-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.medora-branding h2 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.header-subtitle {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    font-style: italic;
}

.copilot-score {
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-label {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

.score-value {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 4px 8px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 13px;
}

.score-value.grade-A { background: #f8f9fa; border-color: #6c757d; }
.score-value.grade-B { background: #f8f9fa; border-color: #6c757d; }
.score-value.grade-C { background: #f8f9fa; border-color: #adb5bd; }
.score-value.grade-D { background: #f8f9fa; border-color: #adb5bd; }
.score-value.grade-F { background: #f8f9fa; border-color: #adb5bd; }

.score-status {
    font-size: 12px;
    opacity: 0.8;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 8px;
}

.metric-item {
    text-align: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.metric-label {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 4px;
    font-weight: 500;
}

.metric-value {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
}

.recommendations-list {
    space-y: 8px;
}

.recommendation-item {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 4px solid;
}

.recommendation-item.alert {
    background: #f8f9fa;
    border-left-color: #6c757d;
}

.recommendation-item.warning {
    background: #f8f9fa;
    border-left-color: #6c757d;
}

.recommendation-item.info {
    background: #f8f9fa;
    border-left-color: #6c757d;
}

.recommendation-item.success {
    background: #f8f9fa;
    border-left-color: #6c757d;
}

.rec-priority {
    background: #6c757d;
    color: white;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 8px;
    min-width: 45px;
    text-align: center;
    flex-shrink: 0;
}

.rec-priority.high { background: #495057; }
.rec-priority.medium { background: #6c757d; }
.rec-priority.low { background: #adb5bd; color: #495057; }

.rec-text {
    color: #2c3e50;
    font-size: 14px;
    line-height: 1.4;
}

.alert-item {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 4px solid;
}

.alert-item.critical {
    background: #ffebee;
    border-left-color: #f44336;
}

.alert-item.warning {
    background: #fff3e0;
    border-left-color: #ff9800;
}

.alert-item.info {
    background: #e3f2fd;
    border-left-color: #2196f3;
}

.alert-category {
    font-weight: 600;
    font-size: 12px;
    color: #37474f;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.alert-text {
    color: #2c3e50;
    font-size: 14px;
    margin-bottom: 4px;
    line-height: 1.4;
}

.alert-confidence {
    font-size: 12px;
    color: #6c757d;
}

.research-insights {
    space-y: 12px;
}

.research-item {
    padding: 14px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    margin-bottom: 12px;
}

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

.research-category {
    background: #6c757d;
    color: white;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 3px;
}

.research-priority {
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
}

.research-priority.high { background: #ffcdd2; color: #c62828; }
.research-priority.medium { background: #ffe0b2; color: #f57c00; }
.research-priority.low { background: #f3e5f5; color: #7b1fa2; }

.research-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    margin-bottom: 6px;
}

.research-description {
    color: #37474f;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.research-terms {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.search-term {
    background: #f8f9fa;
    color: #495057;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #dee2e6;
}

.search-term-link {
    background: #f8f9fa;
    color: #495057;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 3px;
    border: 1px solid #dee2e6;
    text-decoration: none;
    margin-right: 4px;
    margin-bottom: 4px;
    display: inline-block;
    transition: all 0.2s ease;
    font-weight: 500;
}

.search-term-link:hover {
    background: #e9ecef;
    color: #2c3e50;
    border-color: #adb5bd;
    text-decoration: none;
}

/* ==========================================
   CLINICAL LITERATURE ASSISTANT STYLES - SOAP MATCHING
   ========================================== */

.section-header.research {
    color: #1d4ed8 !important;
}

.section-count.priority-high {
    background: #fef2f2;
    color: #b91c1c;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #fecaca;
}

.section-count.priority-medium {
    background: #fffbeb;
    color: #d97706;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #fed7aa;
}

.clinical-item.research .item-text {
    color: #4b5563 !important;
}

.clinical-item.research-sources {
    background: #f8f9fa;
    border-radius: 4px;
    margin-top: 8px;
}

.clinical-item.research-sources .item-text {
    padding: 0;
}

.evidence-sources-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.evidence-source-item {
    margin-bottom: 8px;
    background: #ffffff;
    padding: 8px 10px;
    border-radius: 3px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.evidence-source-item:last-child {
    margin-bottom: 0;
}

.evidence-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none !important;
    color: #1d4ed8 !important;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.evidence-link:hover {
    color: #1e40af !important;
    text-decoration: none !important;
}

.evidence-link strong {
    flex: 1;
    color: inherit;
}

.external-icon {
    font-size: 10px;
    opacity: 0.7;
    margin-left: 6px;
    color: inherit;
}

.source-description {
    font-size: 10px;
    color: #6b7280;
    line-height: 1.3;
    font-style: italic;
    margin-top: 2px;
}

/* ==========================================
   COMPACT MEDICAL-GRADE LITERATURE LINKS
   ========================================== */

.clinical-section.compact {
    margin-bottom: 16px;
    padding: 12px 0;
}

.clinical-item.research-links-compact {
    background: transparent;
    padding: 0;
    margin: 0;
    border: none;
}

.compact-evidence-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.compact-evidence-link {
    background: #f8f9fa;
    color: #1d4ed8 !important;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 3px;
    border: 1px solid #e5e7eb;
    text-decoration: none !important;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.compact-evidence-link:hover {
    background: #e5f3ff;
    color: #1e40af !important;
    border-color: #bfdbfe;
    text-decoration: none !important;
}

/* ==========================================
   DIAGNOSTIC ASSESSMENT STYLES - SOAP MATCHING
   ========================================== */

.section-header.diagnostic {
    color: #0ea5e9 !important;
}

.section-count.confidence-high {
    background: #f0f9ff;
    color: #0369a1;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 3px;
    border: 1px solid #bae6fd;
}

.section-count.confidence-medium {
    background: #fefce8;
    color: #ca8a04;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 3px;
    border: 1px solid #fde047;
}

.section-count.confidence-low {
    background: #fef2f2;
    color: #dc2626;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 3px;
    border: 1px solid #fecaca;
}

.section-count.critical-badge {
    background: #fef2f2;
    color: #dc2626;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 3px;
    border: 1px solid #fecaca;
    animation: pulse 2s infinite;
}

.clinical-item.diagnostic .item-text {
    color: #4b5563 !important;
    line-height: 1.4;
}

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

/* ==========================================
   MEDICAL-GRADE SUBTLE LINK & BUTTON EFFECTS
   ========================================== */

/* Enhanced glowy shimmer effect for all links */
.evidence-link,
.compact-evidence-link,
.reference-link,
.search-term-link {
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    border-radius: 4px;
}

.evidence-link::before,
.compact-evidence-link::before,
.reference-link::before,
.search-term-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(59, 130, 246, 0.3),
        rgba(255, 255, 255, 0.6),
        rgba(59, 130, 246, 0.3),
        transparent
    );
    transition: left 0.8s ease;
    pointer-events: none;
}

.evidence-link:hover::before,
.compact-evidence-link:hover::before,
.reference-link:hover::before,
.search-term-link:hover::before {
    left: 100%;
}

/* Enhanced hover effects with glow */
.evidence-link:hover,
.compact-evidence-link:hover,
.reference-link:hover,
.search-term-link:hover {
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, 0.5) !important;
}

/* Evidence buttons with enhanced glowy effects */
.evidence-button {
    background: #f8f9fa !important;
    color: #6c757d !important;
    border: 1px solid #e5e7eb !important;
    padding: 6px 12px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    cursor: pointer !important;
    transition: all 0.4s ease !important;
    position: relative !important;
    overflow: hidden !important;
}

.evidence-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(59, 130, 246, 0.2),
        rgba(255, 255, 255, 0.4),
        rgba(59, 130, 246, 0.2),
        transparent
    );
    transition: left 0.6s ease;
    pointer-events: none;
}

.evidence-button:hover {
    background: #e3f2fd !important;
    color: #1976d2 !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.3) !important;
    transform: translateY(-2px) !important;
}

.evidence-button:hover::before {
    left: 100%;
}

.evidence-button::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 8px;
    width: 4px;
    height: 4px;
    background: currentColor;
    border-radius: 50%;
    opacity: 0;
    transform: translateY(-50%) scale(0);
    transition: all 0.3s ease;
}

.evidence-button:hover::after {
    opacity: 0.6;
    transform: translateY(-50%) scale(1);
    animation: subtle-pulse 2s infinite ease-in-out;
}

@keyframes subtle-pulse {
    0%, 100% { opacity: 0.6; transform: translateY(-50%) scale(1); }
    50% { opacity: 0.3; transform: translateY(-50%) scale(1.2); }
}

/* External link indicators with gentle animation */
.external-icon {
    transition: all 0.3s ease;
}

.evidence-link:hover .external-icon,
.compact-evidence-link:hover .external-icon {
    transform: translateX(2px) translateY(-2px);
    opacity: 1;
}

.diagnostic-confidence-widget {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.confidence-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.confidence-header h3 {
    margin: 0;
    color: #1a1a1a;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.confidence-header h3::before {
    content: "🎯";
    font-size: 18px;
}

.confidence-score {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    background: linear-gradient(135deg, #00D4FF, #0099CC);
    color: white;
    font-size: 14px;
    font-weight: 600;
}

.confidence-score.high {
    background: linear-gradient(135deg, #00D4FF, #0099CC);
}

.confidence-score.medium {
    background: linear-gradient(135deg, #00A8D4, #007799);
}

.confidence-score.low {
    background: linear-gradient(135deg, #6B7280, #4B5563);
}

.score-value {
    font-size: 16px;
    font-weight: bold;
}

.score-label {
    font-size: 11px;
    opacity: 0.95;
    text-transform: uppercase;
}

.primary-diagnosis {
    background: #FAFBFC;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    border: 1px solid #F0F3F5;
}

.primary-diagnosis h4 {
    margin: 0 0 6px 0;
    color: #6B7280;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.diagnosis-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.icd-codes {
    font-size: 12px;
    color: #6B7280;
    font-family: 'SF Mono', Monaco, monospace;
}

.evidence-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.supporting-evidence,
.contradicting-evidence {
    background: #FAFBFC;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #F0F3F5;
}

.supporting-evidence h5 {
    color: #00A8D4;
    margin: 0 0 8px 0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.contradicting-evidence h5 {
    color: #6B7280;
    margin: 0 0 8px 0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.evidence-section ul {
    margin: 0;
    padding-left: 16px;
}

.evidence-section li {
    margin-bottom: 6px;
    line-height: 1.4;
    font-size: 13px;
    color: #4A5568;
}

.critical-actions {
    margin-bottom: 12px;
}

.critical-actions h4 {
    margin: 0 0 12px 0;
    color: #1a1a1a;
    font-size: 14px;
    font-weight: 600;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    margin-bottom: 6px;
    transition: all 0.2s;
}

.action-item:hover {
    border-color: #00D4FF;
    box-shadow: 0 1px 3px rgba(0, 212, 255, 0.1);
}

.priority-badge {
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.action-item.immediate .priority-badge {
    background: #F3F4F6;
    color: #374151;
}

.action-item.urgent .priority-badge {
    background: #EFF6FF;
    color: #1D4ED8;
}

.action-item.routine .priority-badge {
    background: #F0F9FF;
    color: #0284C7;
}

.action-text {
    flex: 1;
    font-size: 13px;
    color: #4A5568;
}

.accept-btn,
.reject-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #E5E7EB;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.accept-btn:hover {
    border-color: #00D4FF;
    background: #EFF6FF;
    color: #00A8D4;
}

.accept-btn.selected {
    background: #00D4FF;
    color: white;
    border-color: #00D4FF;
}

.reject-btn:hover {
    border-color: #9CA3AF;
    background: #F9FAFB;
    color: #6B7280;
}

.reject-btn.selected {
    background: #6B7280;
    color: white;
    border-color: #6B7280;
}

.safety-assessment {
    background: #F0F9FF;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    border: 1px solid #DBEAFE;
}

.safety-assessment h4 {
    margin: 0 0 8px 0;
    color: #0284C7;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.safety-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.safety-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.safety-item .label {
    color: #666;
}

.safety-item .value {
    font-weight: 600;
}

.safety-item .value.high {
    color: #c62828;
}

.safety-item .value.moderate {
    color: #ef6c00;
}

.safety-item .value.low {
    color: #2e7d32;
}

.feedback-section {
    display: flex;
    gap: 8px;
    justify-content: center;
    padding-top: 12px;
    border-top: 1px solid #F0F3F5;
}

.feedback-btn {
    padding: 6px 12px;
    border-radius: 16px;
    border: 1px solid #E5E7EB;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    font-weight: 500;
}

.feedback-btn.helpful:hover {
    background: #EFF6FF;
    border-color: #00D4FF;
    color: #00A8D4;
}

.feedback-btn.not-helpful:hover {
    background: #F9FAFB;
    border-color: #9CA3AF;
    color: #6B7280;
}

/* Toast notification for feedback */
.feedback-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1a1a1a;
    color: white;
    padding: 10px 16px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
    z-index: 10000;
    font-size: 13px;
}

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

/* Modal diagnostic confidence styles */
.diagnostic-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.primary-diagnosis-card {
    grid-column: 1 / -1; /* Full width */
}

.primary-diagnosis-card .modal-card-header {
    background: linear-gradient(135deg, #00D4FF, #0099CC);
    color: white;
    border-radius: 6px 6px 0 0;
    padding: 12px 16px;
}

.primary-diagnosis-card .confidence-score {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Collapsed card confidence summary */
.confidence-summary {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}

.confidence-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.confidence-badge.high {
    background: linear-gradient(135deg, #00D4FF, #0099CC);
    color: white;
}

.confidence-badge.medium {
    background: linear-gradient(135deg, #00A8D4, #007799);
    color: white;
}

.confidence-badge.low {
    background: linear-gradient(135deg, #6B7280, #4B5563);
    color: white;
}

.diagnosis-preview {
    font-size: 13px;
    color: #4A5568;
    font-weight: 500;
    line-height: 1.3;
}

.critical-allergens {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #DBEAFE;
}

.critical-allergens h5 {
    color: #0284C7;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin: 0 0 8px 0;
}

.critical-allergens ul {
    margin: 0;
    padding-left: 16px;
}

.critical-allergens li {
    font-size: 13px;
    color: #4A5568;
    margin-bottom: 4px;
}

/* Safety assessment specific styling */
.safety-card .modal-card-content {
    background: #F0F9FF;
    border-radius: 6px;
    padding: 12px;
}

/* Responsive design */
@media (max-width: 768px) {
    .diagnostic-modal-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .evidence-section {
        grid-template-columns: 1fr;
    }
    
    .safety-grid {
        grid-template-columns: 1fr;
    }
    
    .feedback-section {
        flex-direction: column;
    }
    
    .diagnostic-confidence-widget {
        padding: 12px;
        margin: 8px 0;
    }
    
    .action-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .confidence-summary {
        align-items: center;
    }
}

/* Validation failure and warning styles */
.validation-failure-message {
    padding: 20px;
    text-align: center;
}

.warning-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.warning-icon {
    font-size: 48px;
}

.warning-header h3 {
    color: #6B7280;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.warning-content {
    text-align: left;
    max-width: 500px;
    margin: 0 auto;
}

.warning-content p {
    color: #4A5568;
    line-height: 1.5;
    margin-bottom: 16px;
}

.validation-issues {
    background: #FAFBFC;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    border: 1px solid #F0F3F5;
}

.validation-issues h4 {
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.validation-issues ul {
    margin: 0;
    padding-left: 20px;
    color: #6B7280;
    font-size: 13px;
}

.validation-issues li {
    margin-bottom: 4px;
}

.recommendation {
    background: #EFF6FF;
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid #00D4FF;
    color: #374151;
    font-size: 13px;
}

.low-confidence-warning {
    background: #FEF3C7;
    border: 1px solid #F59E0B;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.low-confidence-warning .warning-icon {
    font-size: 16px;
}

.low-confidence-warning .warning-text {
    color: #92400E;
    font-size: 13px;
    font-weight: 500;
}

.validation-warning {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.warning-badge {
    background: #FEE2E2;
    color: #DC2626;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    align-self: flex-start;
}

.warning-message {
    color: #6B7280;
    font-size: 12px;
    font-weight: 500;
}

/* New diagnostic confidence elements */
.clinical-reasoning {
    color: #6B7280;
    font-size: 12px;
    line-height: 1.4;
    margin-top: 8px;
    font-style: italic;
}

.confidence-indicators {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #F0F3F5;
}

.confidence-indicators h5 {
    color: #00A8D4;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin: 0 0 8px 0;
}

.action-rationale {
    font-size: 12px;
    color: #6B7280;
    margin-top: 4px;
    font-style: italic;
}

.safety-notes {
    background: #FFF7ED;
    padding: 8px;
    border-radius: 4px;
    margin: 8px 0;
    font-size: 13px;
    border-left: 3px solid #F59E0B;
}

.differential-item {
    border: 1px solid #F0F3F5;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
    background: #FAFBFC;
}

.diff-condition {
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.diff-likelihood {
    font-size: 12px;
    color: #6B7280;
    text-transform: uppercase;
    font-weight: 500;
    margin-bottom: 4px;
}

.diff-factors {
    font-size: 13px;
    color: #4A5568;
    line-height: 1.4;
}

/* Confidence Gap Analysis Styling */
.confidence-gap-card {
    border-left: 4px solid #F59E0B !important;
    background: #FFFBEB !important;
}

.confidence-gap-card .modal-card-header {
    background: linear-gradient(135deg, #F59E0B, #D97706) !important;
    color: white;
}

.uncertainty-explanation {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    border-left: 3px solid #6c757d;
    font-size: 14px;
    color: #495057;
}

.gap-section {
    margin-bottom: 16px;
}

.gap-section h5 {
    color: #495057;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    margin: 0 0 8px 0;
    letter-spacing: 0.5px;
}

.confidence-gaps-list,
.action-steps-list {
    margin: 0;
    padding-left: 20px;
    color: #495057;
}

.confidence-gaps-list li,
.action-steps-list li {
    margin-bottom: 6px;
    font-size: 14px;
    line-height: 1.4;
}

.action-steps-list li {
    font-weight: 500;
    color: #2c3e50;
}

.confidence-gaps-list li::marker {
    color: #6c757d;
}

.action-steps-list li::marker {
    color: #6c757d;
}

/* ==========================================
   REFERENCES TABLE MEDICAL-GRADE STYLING
   ========================================== */

.references-integration {
    padding: 16px;
    background: #ffffff;
}

.references-loader {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-size: 14px;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f8f9fa;
    border-top: 2px solid #6c757d;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.references-container {
    margin-top: 16px;
}

.references-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: white;
    border: 1px solid #dee2e6;
}

.references-table thead {
    background: #f8f9fa;
}

.references-table th {
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
}

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

.references-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f3f4;
    border-right: 1px solid #f1f3f4;
    color: #495057;
    line-height: 1.4;
}

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

.references-table tbody tr:hover {
    background: #f8f9fa;
}

.references-table a {
    color: #495057;
    text-decoration: none;
    font-weight: 500;
}

.references-table a:hover {
    text-decoration: underline;
    color: #2c3e50;
}

.relevance-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.relevance-badge.highly,
.relevance-badge.high {
    background: #f8f9fa;
    color: #495057;
    border-color: #6c757d;
}

.relevance-badge.medium {
    background: #f8f9fa;
    color: #6c757d;
}

.relevance-badge.low {
    background: #f8f9fa;
    color: #adb5bd;
}

/* ==========================================
   MEDICAL-GRADE CLINICAL INSIGHTS TABLE
   ========================================== */

.medical-grade-dashboard {
    padding: 0;
}

.medical-insights-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: white;
    border: 1px solid #dee2e6;
    margin: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.medical-insights-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.medical-insights-table th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-right: 1px solid #dee2e6;
    vertical-align: top;
    font-size: 13px;
}

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

.medical-insights-table td {
    padding: 10px;
    border-bottom: 1px solid #e9ecef;
    border-right: 1px solid #e9ecef;
    color: #495057;
    line-height: 1.4;
    vertical-align: top;
    font-size: 13px;
}

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

.medical-insights-table tbody tr:hover {
    background: #f8f9fa;
}

/* Reference link styling */
.reference-cell a {
    color: #1f77b4 !important;
    text-decoration: none !important;
    font-weight: 500;
    border-bottom: 1px dotted #1f77b4;
}

.reference-cell a:hover {
    color: #0d5aa7 !important;
    border-bottom: 1px solid #0d5aa7;
    text-decoration: none !important;
}

/* Medical-Grade Clinical Intelligence - SOAP Style */
.clinical-section {
    margin-bottom: 24px;
    background: linear-gradient(145deg, #ffffff, #f9fafb);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: none;
    position: relative;
    transition: all 0.3s ease;
}

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

.clinical-section::before {
    content: '🏥';
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 14px;
    opacity: 0.2;
}

.clinical-section:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    width: 60%;
    height: 1px;
    background: linear-gradient(to right, transparent, #e5e7eb, transparent);
    transform: translateX(-50%);
}

.section-header {
    font-family: 'Inter', sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #1f2937 !important;
    margin: 0 0 16px 0 !important;
    padding: 20px 20px 0 35px !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header.critical {
    color: #991b1b !important;
}

.section-header.documentation {
    color: #92400e !important;
}

.section-header.action {
    color: #166534 !important;
}

.section-header.success {
    color: #166534 !important;
}

.section-icon {
    font-size: 16px;
    opacity: 0.8;
}

.section-count {
    background: rgba(0,0,0,0.08);
    color: inherit;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    margin-left: auto;
    opacity: 0.7;
}

.section-items {
    padding: 0 20px 20px 35px;
}

.clinical-item {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    color: #4b5563 !important;
    line-height: 1.4 !important;
    letter-spacing: 0 !important;
    font-synthesis: none !important;
    
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    background: transparent;
    margin-bottom: 4px;
}

.clinical-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.item-icon {
    font-size: 14px;
    margin-top: 2px;
    flex-shrink: 0;
    opacity: 0.8;
}

.item-text {
    color: #4b5563 !important;
    flex: 1;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
}

/* Medical-grade emphasis for critical items */
.clinical-item.critical .item-text {
    color: #991b1b !important;
    font-weight: 500 !important;
}

.clinical-item.documentation .item-text {
    color: #92400e !important;
}

.clinical-item.action .item-text {
    color: #166534 !important;
}

.clinical-item.success .item-text {
    color: #166534 !important;
    font-weight: 500 !important;
}

/* Medical-Grade Clinical Recommendations Table */
.clinical-recommendations-table {
    margin-top: 0;
}

.medical-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-size: 12px !important;
    background: #ffffff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.medical-table thead {
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border-bottom: 2px solid #dee2e6;
}

.medical-table th {
    font-family: 'Inter', sans-serif !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #495057 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.medical-table .priority-col {
    width: 80px;
}

.medical-table .action-col {
    width: 45%;
}

.medical-table .rationale-col {
    width: 45%;
}

.medical-table tbody tr {
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.15s ease;
}

.medical-table tbody tr:hover {
    background-color: #f8f9fa;
}

.medical-table tbody tr:last-child {
    border-bottom: none;
}

.medical-table td {
    padding: 12px 16px;
    vertical-align: top;
    line-height: 1.4;
}

.priority-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.priority-badge.high {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.priority-badge.medium {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fde68a;
}

.priority-badge.routine {
    background: #f0f9ff;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.priority-badge.low {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.action-text {
    color: #1f2937;
    font-weight: 500;
    line-height: 1.4;
}

.rationale-text {
    color: #4b5563;
    font-weight: 400;
    line-height: 1.4;
    font-style: italic;
}

/* No recommendations message */
.no-recommendations {
    text-align: center;
    padding: 24px;
}

.info-message {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    font-size: 13px;
    font-style: italic;
}

.info-icon {
    font-size: 16px;
    opacity: 0.7;
}

/* Transcript Evidence Display */
.transcript-evidence {
    margin-top: 8px;
    padding: 8px 10px;
    background: #f8f9fa;
    border-left: 3px solid #28a745;
    border-radius: 4px;
    font-size: 11px;
}

.evidence-label {
    color: #28a745;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.evidence-quote {
    color: #495057;
    font-style: italic;
    line-height: 1.3;
    background: #ffffff;
    padding: 4px 6px;
    border-radius: 3px;
    border: 1px solid #e9ecef;
}

.no-alerts, .no-gaps, .no-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    background: #e8f5e8;
    border-radius: 6px;
    color: #155724;
}

.alert-icon, .gap-icon, .action-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.alert-text, .gap-text, .action-text {
    font-size: 14px;
    line-height: 1.4;
    color: #495057;
}

/* Column widths */
.priority-col { width: 10%; }
.insight-col { width: 25%; }
.description-col { width: 40%; }
.severity-col { width: 10%; }
.reference-col { width: 15%; }

/* Priority badges */
.priority-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    white-space: nowrap;
}

.priority-badge.critical {
    background: #495057;
    color: white;
}

.priority-badge.high {
    background: #6c757d;
    color: white;
}

.priority-badge.routine {
    background: #adb5bd;
    color: #495057;
}

.priority-badge.low {
    background: #e9ecef;
    color: #6c757d;
}

.priority-badge.info {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

/* Severity indicators */
.severity-indicator {
    padding: 1px 4px;
    border-radius: 2px;
    font-size: 10px;
    font-weight: 500;
    text-transform: capitalize;
}

.severity-indicator.critical {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
}

.severity-indicator.high {
    background: #f8f9fa;
    color: #6c757d;
    font-weight: 600;
}

.severity-indicator.routine {
    background: #f8f9fa;
    color: #6c757d;
}

.severity-indicator.low {
    background: #f8f9fa;
    color: #adb5bd;
}

.severity-indicator.informational {
    background: #f8f9fa;
    color: #adb5bd;
}

/* Category tags */
.category-tag {
    font-size: 9px;
    color: #6c757d;
    background: #f8f9fa;
    padding: 1px 4px;
    border-radius: 2px;
    margin-top: 2px;
    display: inline-block;
    border: 1px solid #e9ecef;
}

/* Insight cells */
.insight-cell strong {
    color: #2c3e50;
    font-size: 11px;
}

.description-cell {
    font-size: 11px;
    line-height: 1.4;
}

.reference-cell {
    font-size: 9px;
    color: #6c757d;
    line-height: 1.2;
}

.no-insights {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
    margin: 0;
}

/* Row styling based on priority */
.insight-row.critical {
    border-left: 3px solid #495057;
}

.insight-row.high {
    border-left: 3px solid #6c757d;
}

.insight-row.routine {
    border-left: 3px solid #adb5bd;
}

.insight-row.low {
    border-left: 3px solid #e9ecef;
}

.insight-row.info {
    border-left: 3px solid #f8f9fa;
}

/* ========================================
   ADVANCED NLP TRANSCRIPT EVIDENCE STYLING
   ======================================== */

/* Transcript Evidence Container */
.transcript-evidence-container {
    margin-top: 15px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #fafbfc;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Evidence Summary Header */
.evidence-summary {
    background: #f8f9fa;
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

.evidence-summary h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

.evidence-summary p {
    margin: 0;
    font-size: 12px;
    color: #6c757d;
}

/* Individual Evidence Display */
.transcript-evidence {
    margin: 8px 0;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    border-left: 3px solid #28a745;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.evidence-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 500;
}

.evidence-speaker {
    background: #007bff;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.evidence-speaker:contains("PATIENT") {
    background: #28a745;
}

.evidence-speaker:contains("CLINICIAN") {
    background: #6f42c1;
}

.evidence-timestamp {
    color: #6c757d;
    font-family: 'Courier New', monospace;
    font-size: 10px;
}

.evidence-relevance {
    background: #ffc107;
    color: #212529;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
}

.evidence-text {
    color: #2c3e50;
    font-size: 13px;
    line-height: 1.4;
    font-style: italic;
    padding: 5px 0;
}

.evidence-text::before {
    content: '"';
    color: #6c757d;
    font-size: 16px;
}

.evidence-text::after {
    content: '"';
    color: #6c757d;
    font-size: 16px;
}

/* Evidence List Container */
.evidence-list {
    padding: 10px 15px;
    max-height: 200px;
    overflow-y: auto;
}

/* Evidence Actions */
.evidence-actions {
    padding: 10px 15px;
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    text-align: center;
}

.evidence-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.evidence-btn:hover {
    background: #0056b3;
}

.evidence-btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Highlighted Transcript Segment (for jumping) */
.highlighted-segment {
    background: #fff3cd !important;
    border: 2px solid #ffc107 !important;
    animation: highlightPulse 1s ease-in-out;
}

@keyframes highlightPulse {
    0% { box-shadow: 0 0 5px #ffc107; }
    50% { box-shadow: 0 0 15px #ffc107; }
    100% { box-shadow: 0 0 5px #ffc107; }
}

/* Responsive Evidence Display */
@media (max-width: 768px) {
    .evidence-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .evidence-speaker,
    .evidence-timestamp,
    .evidence-relevance {
        font-size: 9px;
    }
    
    .evidence-text {
        font-size: 12px;
    }
    
    .transcript-evidence {
        margin: 6px 0;
        padding: 8px 10px;
    }
}

/* Match Type Specific Styling */
.transcript-evidence.direct-match {
    border-left-color: #28a745;
}

.transcript-evidence.entity-match {
    border-left-color: #17a2b8;
}

.transcript-evidence.contextual-match {
    border-left-color: #ffc107;
}

.transcript-evidence.mixed-match {
    border-left-color: #6f42c1;
}

/* Evidence Confidence Indicators */
.evidence-relevance.high-confidence {
    background: #28a745;
    color: white;
}

.evidence-relevance.medium-confidence {
    background: #ffc107;
    color: #212529;
}

.evidence-relevance.low-confidence {
    background: #6c757d;
    color: white;
}

/* ==========================================
   TRANSCRIPT EVIDENCE BUTTON STYLES
   ========================================== */

.evidence-button {
    background: #f8f9fa;
    color: #6c757d !important;
    border: 1px solid #e5e7eb;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer !important;
    transition: all 0.2s ease;
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    box-shadow: none;
    position: relative;
    z-index: 100;
    pointer-events: auto !important;
    user-select: none;
    text-decoration: none;
}

.evidence-button:hover {
    background: #ffffff;
    color: #374151 !important;
    border-color: #d1d5db;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.evidence-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(52, 152, 219, 0.3);
}

.transcript-evidence {
    margin-top: 8px;
}