/* MediMorph AI Clinical Viewer - Dark Theme */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
    background: #0a0a0a;
    color: #e5e5e5;
    overflow: hidden;
}

/* Main Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Viewport Section (Left) */
.viewport-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0a0a0a;
    position: relative;
}

.viewport-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #121212;
    border-bottom: 1px solid #262626;
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
    background: #1a1a1a;
    border-radius: 8px;
    padding: 4px;
}

.toggle-btn {
    padding: 0.5rem 1.25rem;
    background: transparent;
    color: #9ca3af;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.toggle-btn:hover {
    background: #262626;
    color: #e5e5e5;
}

.toggle-btn.active {
    background: #3b82f6;
    color: white;
}

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

.icon-btn {
    padding: 0.5rem;
    background: #1a1a1a;
    border: 1px solid #262626;
    border-radius: 6px;
    cursor: pointer;
    color: #9ca3af;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: #262626;
    color: #e5e5e5;
    border-color: #3b82f6;
}

#viewer-container {
    flex: 1;
    position: relative;
    background: #0a0a0a;
}

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #9ca3af;
    font-size: 1rem;
    z-index: 10;
}

/* Depth Legend */
.depth-legend {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(18, 18, 18, 0.95);
    border: 1px solid #262626;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    backdrop-filter: blur(10px);
    z-index: 100;
}

.legend-title {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #9ca3af;
}

.legend-gradient {
    width: 24px;
    height: 180px;
    background: linear-gradient(to bottom,
        #ef4444 0%,     /* red */
        #f59e0b 25%,    /* yellow */
        #10b981 50%,    /* green */
        #06b6d4 75%,    /* cyan */
        #3b82f6 100%    /* blue */
    );
    border-radius: 4px;
}

.legend-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 180px;
    font-size: 0.75rem;
    color: #d1d5db;
}

.legend-label {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.legend-unit {
    font-size: 0.65rem;
    color: #6b7280;
    font-weight: 600;
}

/* Bottom Controls */
.viewport-bottom-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #121212;
    border-top: 1px solid #262626;
}

.bottom-left-btns {
    display: flex;
    gap: 0.75rem;
}

.bottom-btn {
    padding: 0.5rem 1rem;
    background: #1a1a1a;
    border: 1px solid #262626;
    border-radius: 6px;
    color: #9ca3af;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.bottom-btn:hover {
    background: #262626;
    color: #e5e5e5;
    border-color: #3b82f6;
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #1a1a1a;
    border: 1px solid #262626;
    border-radius: 20px;
    font-size: 0.875rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6b7280;
}

.status-pill.status-success .status-dot {
    background: #10b981;
}

.status-pill.status-error .status-dot {
    background: #ef4444;
}

/* Analytics Panel (Right) */
.analytics-panel {
    width: 420px;
    background: #121212;
    border-left: 1px solid #262626;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.panel-header {
    padding: 1.5rem;
    border-bottom: 1px solid #262626;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    height: 32px;
    width: auto;
}

.panel-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #e5e5e5;
}

/* Priority Banner */
.priority-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: #1a1a1a;
    border-bottom: 1px solid #262626;
}

.priority-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #10b981;
}

.priority-banner.elevated .priority-indicator {
    background: #f59e0b;
}

.priority-banner span {
    font-size: 0.875rem;
    font-weight: 500;
    color: #10b981;
}

.priority-banner.elevated span {
    color: #f59e0b;
}

/* Capture Another Button */
.capture-another-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0.75rem 1.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
}

.capture-another-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.capture-another-btn svg {
    flex-shrink: 0;
}

/* Info Cards */
.info-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1.5rem;
    border-bottom: 1px solid #262626;
}

.info-card {
    background: #1a1a1a;
    border: 1px solid #262626;
    border-radius: 8px;
    padding: 1rem;
}

.info-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-value {
    font-size: 0.95rem;
    color: #e5e5e5;
    font-weight: 500;
}

/* Measurements Section */
.measurements-section {
    padding: 1.5rem;
    border-bottom: 1px solid #262626;
}

.measurements-section h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #e5e5e5;
    margin-bottom: 1rem;
}

.measurement-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #262626;
}

.measurement-tab {
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: -2px;
}

.measurement-tab:hover {
    color: #9ca3af;
}

.measurement-tab.active {
    border-bottom-color: #3b82f6;
    color: #3b82f6;
}

.tab-content {
    position: relative;
}

.tab-pane {
    display: none;
}

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

.metric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.metric-item {
    background: #1a1a1a;
    border: 1px solid #262626;
    border-radius: 8px;
    padding: 1rem;
}

.metric-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 600;
    color: #e5e5e5;
    font-variant-numeric: tabular-nums;
}

.metric-unit {
    font-size: 0.875rem;
    color: #6b7280;
    margin-left: 0.25rem;
    font-weight: 400;
}

/* Tissue Tab */
.tissue-segmented-bar {
    display: flex;
    height: 24px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.bar-segment {
    height: 100%;
    transition: opacity 0.2s;
}

.bar-segment:hover {
    opacity: 0.8;
}

.tissue-tiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.tissue-tile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #1a1a1a;
    border: 1px solid #262626;
    border-radius: 8px;
    padding: 0.875rem;
}

.tissue-tile-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.tissue-tile-label {
    flex: 1;
    font-size: 0.8125rem;
    color: #9ca3af;
    text-transform: capitalize;
}

.tissue-tile-value {
    font-size: 1rem;
    font-weight: 600;
    color: #e5e5e5;
    font-variant-numeric: tabular-nums;
}

.placeholder-message {
    padding: 2rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Artifacts Section */
.artifacts-section {
    border-bottom: 1px solid #262626;
}

.section-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #1a1a1a;
    border: none;
    color: #e5e5e5;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.section-toggle:hover {
    background: #202020;
}

.toggle-icon {
    transition: transform 0.2s;
}

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

.artifacts-content {
    max-height: 400px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.artifacts-content.collapsed {
    max-height: 0;
}

.artifact-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.5rem 0.5rem;
    border-bottom: 1px solid #262626;
}

.artifact-tab {
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 1px solid #262626;
    border-radius: 6px;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.artifact-tab:hover {
    background: #1a1a1a;
    color: #9ca3af;
}

.artifact-tab.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.artifact-viewer {
    padding: 1rem 1.5rem;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.artifact-viewer img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 6px;
    border: 1px solid #262626;
}

.loading-placeholder {
    color: #6b7280;
    font-size: 0.875rem;
    font-style: italic;
}

/* Panel Footer */
.panel-footer {
    margin-top: auto;
    padding: 1.5rem;
    border-top: 1px solid #262626;
}

.btn-report {
    width: 100%;
    padding: 0.875rem;
    background: #3b82f6;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 1rem;
}

.btn-report:hover {
    background: #2563eb;
}

.version-info {
    text-align: center;
    font-size: 0.75rem;
    color: #6b7280;
}

/* Scrollbar Styling */
.analytics-panel::-webkit-scrollbar {
    width: 8px;
}

.analytics-panel::-webkit-scrollbar-track {
    background: #0a0a0a;
}

.analytics-panel::-webkit-scrollbar-thumb {
    background: #262626;
    border-radius: 4px;
}

.analytics-panel::-webkit-scrollbar-thumb:hover {
    background: #3b82f6;
}

/* Run Selector (Multi-run mode) */
.run-selector {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #262626;
    background: #1a1a1a;
}

.run-selector-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.run-selector-row label {
    font-size: 0.875rem;
    color: #9ca3af;
    min-width: 40px;
}

.run-dropdown {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: #121212;
    border: 1px solid #262626;
    border-radius: 6px;
    color: #e5e5e5;
    font-size: 0.875rem;
    cursor: pointer;
}

.run-dropdown:hover {
    border-color: #3b82f6;
}

.run-dropdown:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.compare-toggle {
    display: flex;
    align-items: center;
}

.compare-toggle label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #9ca3af;
    cursor: pointer;
}

.compare-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3b82f6;
}

/* Compare Panel */
.compare-panel {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #262626;
    background: #151515;
}

.compare-selectors {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.compare-select-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.compare-select-row label {
    font-size: 0.875rem;
    color: #9ca3af;
    min-width: 50px;
}

.view-btn {
    padding: 0.375rem 0.75rem;
    background: #262626;
    border: 1px solid #3b3b3b;
    border-radius: 4px;
    color: #9ca3af;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.view-btn:hover {
    background: #333;
    color: #e5e5e5;
}

.view-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

/* Compare Diff Panel */
.compare-diff {
    background: #121212;
    border: 1px solid #262626;
    border-radius: 8px;
    padding: 1rem;
}

.compare-diff-title {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.diff-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #1a1a1a;
}

.diff-row:last-child {
    border-bottom: none;
}

.diff-label {
    font-size: 0.8125rem;
    color: #9ca3af;
}

.diff-values {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
}

.diff-val-a {
    color: #6b7280;
}

.diff-arrow {
    color: #4b5563;
}

.diff-val-b {
    color: #e5e5e5;
    font-weight: 500;
}

.diff-delta {
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-weight: 500;
}

.diff-delta.positive {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.diff-delta.negative {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.diff-delta.neutral {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

/* Compare Mode Tabs */
.compare-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #262626;
}

.compare-tab {
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: -2px;
}

.compare-tab:hover {
    color: #9ca3af;
}

.compare-tab.active {
    border-bottom-color: #3b82f6;
    color: #3b82f6;
}

/* Depth Diff View */
.depth-diff-container {
    text-align: center;
}

.depth-diff-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: 6px;
    border: 1px solid #262626;
    margin-bottom: 0.75rem;
}

.depth-diff-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.depth-diff-legend-bar {
    width: 150px;
    height: 16px;
    background: linear-gradient(to right, #3b82f6 0%, #ffffff 50%, #ef4444 100%);
    border-radius: 3px;
}

.depth-diff-legend-labels {
    display: flex;
    justify-content: space-between;
    width: 150px;
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

.depth-diff-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.75rem;
    font-size: 0.75rem;
}

.depth-diff-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.depth-diff-stat-label {
    color: #6b7280;
}

.depth-diff-stat-value {
    color: #e5e5e5;
    font-weight: 500;
}

/* Tissue Delta Bar */
.tissue-delta-summary {
    margin-bottom: 1rem;
}

.tissue-delta-bar {
    display: flex;
    height: 32px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    background: #1a1a1a;
}

.tissue-delta-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 500;
    color: white;
    transition: all 0.3s;
}

.tissue-delta-segment.positive {
    opacity: 1;
}

.tissue-delta-segment.negative {
    opacity: 0.6;
}

.dominant-change-callout {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #1a1a1a;
    border-left: 3px solid #3b82f6;
    border-radius: 4px;
    margin-top: 0.75rem;
}

.dominant-change-icon {
    font-size: 1rem;
}

.dominant-change-text {
    flex: 1;
}

.dominant-change-title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #e5e5e5;
}

.dominant-change-hint {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

/* Validation Warnings */
.validation-warnings {
    padding: 0.75rem 1.5rem;
    background: rgba(245, 158, 11, 0.1);
    border-bottom: 1px solid rgba(245, 158, 11, 0.3);
}

.validation-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #f59e0b;
    margin-bottom: 0.5rem;
}

.validation-icon {
    font-size: 1rem;
}

.validation-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.validation-item {
    font-size: 0.75rem;
    color: #fbbf24;
    padding: 0.25rem 0;
}

.validation-item.error {
    color: #ef4444;
}

.validation-item.warning {
    color: #f59e0b;
}

/* Evaluation Section */
.eval-section {
    margin-top: 1rem;
    border-top: 1px solid #262626;
    padding-top: 0.5rem;
}

.eval-section .section-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    color: #3b82f6;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.eval-section .section-toggle:hover {
    background: rgba(59, 130, 246, 0.15);
}

.eval-content {
    padding: 1rem;
    background: #0f0f0f;
    border-radius: 0 0 6px 6px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.eval-content.collapsed {
    max-height: 0;
    padding: 0 1rem;
}

.eval-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.eval-tab {
    padding: 0.375rem 0.75rem;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    color: #9ca3af;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.eval-tab:hover {
    background: #262626;
    color: #e5e5e5;
}

.eval-tab.active {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    color: #3b82f6;
}

.eval-metrics {
    padding: 0.5rem;
}

.eval-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.eval-metric {
    background: #1a1a1a;
    padding: 0.75rem;
    border-radius: 6px;
    text-align: center;
}

.eval-metric.highlight {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.eval-label {
    font-size: 0.625rem;
    color: #6b7280;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.eval-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #e5e5e5;
}

.eval-summary {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.eval-summary .eval-metric {
    flex: 1;
}

.eval-per-class {
    margin-top: 0.75rem;
}

.eval-per-class table {
    width: 100%;
    font-size: 0.75rem;
    border-collapse: collapse;
}

.eval-per-class th {
    text-align: left;
    padding: 0.375rem 0.5rem;
    color: #9ca3af;
    font-weight: 500;
    border-bottom: 1px solid #333;
}

.eval-per-class td {
    padding: 0.375rem 0.5rem;
    border-bottom: 1px solid #262626;
}

.eval-error {
    color: #ef4444;
    font-size: 0.75rem;
    padding: 0.5rem;
}

.eval-placeholder {
    color: #6b7280;
    font-size: 0.75rem;
    text-align: center;
    padding: 1rem;
}

/* Ground Truth Section (Synthetic Samples) */
.ground-truth-section {
    margin-top: 1rem;
    border-top: 1px solid #262626;
    padding-top: 0.5rem;
}

.ground-truth-section .section-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 6px;
    color: #22c55e;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.ground-truth-section .section-toggle:hover {
    background: rgba(34, 197, 94, 0.15);
}

.ground-truth-content {
    padding: 1rem;
    background: #0f0f0f;
    border-radius: 0 0 6px 6px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.ground-truth-content.collapsed {
    max-height: 0;
    padding: 0 1rem;
}

.ground-truth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ground-truth-tab {
    padding: 0.375rem 0.75rem;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    color: #9ca3af;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.ground-truth-tab:hover {
    background: #262626;
    color: #e5e5e5;
}

.ground-truth-tab.active {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
    color: #22c55e;
}

.ground-truth-viewer {
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    border-radius: 6px;
    padding: 0.5rem;
}

.ground-truth-viewer img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 4px;
}

.ground-truth-info {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #6b7280;
}

/* Control Divider */
.control-divider {
    width: 1px;
    height: 24px;
    background: #333;
    margin: 0 0.25rem;
}

/* Active icon button state */
.icon-btn.active {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    color: #3b82f6;
}

/* Point markers for measurement */
.point-marker {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #10b981;
    border: 2px solid #fff;
    border-radius: 50%;
    z-index: 150;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.point-marker:nth-of-type(2) {
    background: #ef4444;
}

/* Measurement overlay */
#measure-overlay {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

#measure-overlay strong {
    color: #fff;
}

/* Keyboard shortcut hints */
.icon-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #e5e5e5;
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 200;
}

/* Tooltip container for icon buttons */
.icon-btn {
    position: relative;
}

/* Responsive */
@media (max-width: 1200px) {
    .analytics-panel {
        width: 360px;
    }

    .metric-grid,
    .tissue-tiles {
        grid-template-columns: 1fr;
    }

    .viewport-controls {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .viewport-actions {
        flex-wrap: wrap;
    }
}

/* ============================================
   Clinical Warnings Section
   ============================================ */
.clinical-warnings-section {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(239, 68, 68, 0.1));
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    animation: warningPulse 2s ease-in-out infinite;
}

@keyframes warningPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.2); }
    50% { box-shadow: 0 0 15px 5px rgba(245, 158, 11, 0.15); }
}

.warnings-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #f59e0b;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.warnings-header svg {
    stroke: #f59e0b;
}

.warnings-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.warnings-list li {
    color: #fbbf24;
    font-size: 0.8rem;
    padding: 0.4rem 0;
    padding-left: 1.5rem;
    position: relative;
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}

.warnings-list li:last-child {
    border-bottom: none;
}

.warnings-list li::before {
    content: "⚠";
    position: absolute;
    left: 0;
    color: #f59e0b;
}

.warnings-list li.eschar-warning {
    color: #ef4444;
}

.warnings-list li.eschar-warning::before {
    content: "⛔";
    color: #ef4444;
}

/* ============================================
   Health Score Section
   ============================================ */
.health-score-section {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.health-score-header {
    color: #9ca3af;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.health-score-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.health-score-ring {
    position: relative;
    width: 80px;
    height: 80px;
}

.health-score-ring svg {
    transform: rotate(-90deg);
}

.health-score-ring circle:first-child {
    stroke: #333;
}

.health-score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.25rem;
    font-weight: 700;
    color: #10b981;
}

.health-score-label {
    font-size: 0.875rem;
    color: #6b7280;
}

.health-score-label.good { color: #10b981; }
.health-score-label.moderate { color: #f59e0b; }
.health-score-label.concerning { color: #ef4444; }

/* ============================================
   Enhanced Report Button
   ============================================ */
.btn-report {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
}

.btn-report:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-report::before {
    content: "📄";
}

/* ============================================
   Export Actions Bar
   ============================================ */
.export-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.btn-export {
    flex: 1;
    background: #262626;
    color: #9ca3af;
    border: 1px solid #333;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-export:hover {
    background: #333;
    color: #e5e5e5;
    border-color: #444;
}

/* ============================================
   Score Breakdown
   ============================================ */
.score-breakdown {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #333;
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.25rem;
}

.breakdown-row.positive {
    background: rgba(16, 185, 129, 0.1);
}

.breakdown-row.positive .breakdown-value {
    color: #10b981;
}

.breakdown-row.neutral {
    background: rgba(245, 158, 11, 0.1);
}

.breakdown-row.neutral .breakdown-value {
    color: #f59e0b;
}

.breakdown-row.negative {
    background: rgba(239, 68, 68, 0.1);
}

.breakdown-row.negative .breakdown-value {
    color: #ef4444;
}

.breakdown-label {
    color: #9ca3af;
}

.breakdown-value {
    font-weight: 600;
    font-family: monospace;
}

/* ============================================
   AI Insights Section
   ============================================ */
.ai-insights-section {
    margin-bottom: 1.5rem;
}

.ai-insights-section .section-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(59, 130, 246, 0.1));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 10px;
    cursor: pointer;
    color: #a78bfa;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.ai-insights-section .section-toggle:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(59, 130, 246, 0.15));
    border-color: rgba(139, 92, 246, 0.5);
}

.ai-toggle-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-toggle-header svg {
    stroke: #a78bfa;
}

.ai-insights-content {
    background: #1a1a1a;
    border: 1px solid #333;
    border-top: none;
    border-radius: 0 0 10px 10px;
    padding: 1rem;
    margin-top: -2px;
}

/* AI Narrative */
.ai-narrative {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #333;
}

.ai-narrative-title,
.ai-treatment-title,
.ai-trajectory-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #a78bfa;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.ai-narrative-title svg,
.ai-treatment-title svg,
.ai-trajectory-title svg {
    stroke: #a78bfa;
}

.ai-narrative-text {
    color: #d1d5db;
    font-size: 0.85rem;
    line-height: 1.6;
}

/* AI Treatment Recommendations */
.ai-treatment {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #333;
}

.ai-treatment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ai-treatment-list li {
    color: #9ca3af;
    font-size: 0.8rem;
    padding: 0.4rem 0;
    padding-left: 1.25rem;
    position: relative;
}

.ai-treatment-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #8b5cf6;
}

.ai-treatment-list li.priority-high {
    color: #fbbf24;
}

.ai-treatment-list li.priority-high::before {
    content: "⚡";
    color: #f59e0b;
}

/* AI Trajectory */
.ai-trajectory {
    margin-bottom: 1rem;
}

.trajectory-indicator {
    margin: 0.75rem 0;
}

.trajectory-bar {
    position: relative;
    height: 8px;
    background: linear-gradient(to right, #ef4444, #f59e0b, #10b981, #22d3ee);
    border-radius: 4px;
    overflow: visible;
}

.trajectory-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px 0 0 4px;
}

.trajectory-marker {
    position: absolute;
    top: -4px;
    width: 16px;
    height: 16px;
    background: white;
    border: 3px solid #1a1a1a;
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: left 0.5s ease;
}

.trajectory-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.65rem;
    color: #6b7280;
}

.trajectory-text {
    color: #9ca3af;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

/* AI Confidence */
.ai-confidence {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid #333;
}

.confidence-label {
    color: #6b7280;
    font-size: 0.7rem;
}

.confidence-bar {
    flex: 1;
    height: 4px;
    background: #333;
    border-radius: 2px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #3b82f6);
    transition: width 0.5s ease;
}

.confidence-value {
    color: #a78bfa;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 35px;
    text-align: right;
}

/* AI Insights Collapsed State */
.ai-insights-content {
    max-height: none;
    overflow-y: auto;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.ai-insights-content.collapsed {
    max-height: 0;
    padding: 0;
    border: none;
    opacity: 0;
}

.ai-insights-section .toggle-icon {
    transition: transform 0.3s ease;
}

.ai-insights-section .toggle-icon.rotated {
    transform: rotate(180deg);
}

/* Version update */
.version-info {
    font-size: 0.65rem;
    color: #4b5563;
    text-align: center;
    margin-top: 0.5rem;
}

/* ============================================
   Risk Assessment Matrix
   ============================================ */
.risk-assessment {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #333;
}

.risk-matrix {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.risk-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.risk-icon {
    font-size: 1rem;
    width: 24px;
    text-align: center;
}

.risk-details {
    flex: 1;
}

.risk-name {
    display: block;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 0.25rem;
}

.risk-bar-container {
    height: 6px;
    background: #262626;
    border-radius: 3px;
    overflow: hidden;
}

.risk-bar-fill {
    height: 100%;
    background: #10b981;
    border-radius: 3px;
    transition: width 0.5s ease, background 0.3s ease;
}

.risk-level {
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 60px;
    text-align: right;
}

/* ============================================
   ICD-10 Code Suggestions
   ============================================ */
.icd-suggestions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #333;
}

.icd-codes-list {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.icd-code-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
}

.icd-code {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.2);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    white-space: nowrap;
}

.icd-desc {
    font-size: 0.75rem;
    color: #9ca3af;
    line-height: 1.4;
}

/* ============================================
   Wound Classification Badge
   ============================================ */
.wound-classification {
    padding: 0 1.5rem;
    margin-bottom: 1rem;
}

.classification-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
}

.classification-icon {
    font-size: 1.25rem;
}

.classification-details {
    flex: 1;
}

.classification-label {
    display: block;
    font-size: 0.65rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.classification-value {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: #e5e5e5;
    margin-top: 0.125rem;
}

.classification-severity {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    border: 2px solid #f59e0b;
}

.severity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f59e0b;
}

.severity-text {
    font-size: 0.7rem;
    font-weight: 600;
    color: #e5e5e5;
}

/* ============================================
   Tissue Donut Chart
   ============================================ */
.tissue-donut-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.tissue-donut {
    position: relative;
    width: 120px;
    height: 120px;
}

.tissue-donut svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.tissue-donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-label {
    font-size: 0.65rem;
    color: #6b7280;
    text-transform: uppercase;
}

.donut-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #e5e5e5;
}

.tissue-donut-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-text {
    font-size: 0.75rem;
    color: #9ca3af;
}

.legend-pct {
    font-size: 0.75rem;
    font-weight: 600;
    color: #e5e5e5;
    margin-left: auto;
}

/* ============================================
   Healing Milestones Timeline
   ============================================ */
.healing-milestones {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #333;
}

.milestones-timeline {
    position: relative;
    padding: 0.75rem 0;
    margin-top: 0.75rem;
}

.milestone-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: #262626;
    border-radius: 2px;
    transform: translateY(-50%);
}

.milestone-progress {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #22c55e);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.milestones-markers {
    position: relative;
    display: flex;
    justify-content: space-between;
    z-index: 1;
}

.milestone-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.milestone-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #262626;
    border: 2px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
}

.milestone-dot.completed {
    background: #10b981;
    border-color: #10b981;
}

.milestone-dot.current {
    background: #3b82f6;
    border-color: #3b82f6;
    animation: milestonePulse 2s ease infinite;
}

@keyframes milestonePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
}

.milestone-label {
    font-size: 0.6rem;
    color: #6b7280;
    text-align: center;
    max-width: 60px;
}

.milestone-marker.completed .milestone-label {
    color: #10b981;
}

.milestone-marker.current .milestone-label {
    color: #3b82f6;
    font-weight: 600;
}

/* ============================================
   Enhanced Priority Banner Animation
   ============================================ */
.priority-banner.critical {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
    animation: criticalPulse 1.5s ease-in-out infinite;
}

.priority-banner.critical .priority-indicator {
    background: #ef4444;
}

.priority-banner.critical span {
    color: #ef4444;
}

@keyframes criticalPulse {
    0%, 100% { box-shadow: inset 0 0 0 0 rgba(239, 68, 68, 0.1); }
    50% { box-shadow: inset 0 0 30px 0 rgba(239, 68, 68, 0.15); }
}

/* ============================================
   Enhanced Metrics Display
   ============================================ */
.metric-item.highlight {
    border-color: #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), #1a1a1a);
}

.metric-trend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.25rem;
    font-size: 0.7rem;
}

.metric-trend.up {
    color: #10b981;
}

.metric-trend.down {
    color: #ef4444;
}

.metric-trend.stable {
    color: #6b7280;
}

/* ============================================
   Quick Actions Bar
   ============================================ */
.quick-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0 1.5rem;
    margin-bottom: 1rem;
}

.quick-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem;
    background: #1a1a1a;
    border: 1px solid #262626;
    border-radius: 6px;
    color: #9ca3af;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-action-btn:hover {
    background: #262626;
    color: #e5e5e5;
    border-color: #3b82f6;
}

.quick-action-btn svg {
    width: 14px;
    height: 14px;
}

/* ============================================
   Clinical Scales Section (WBP, TIME, TEXAS)
   ============================================ */
.clinical-scales-section {
    margin: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(139, 92, 246, 0.05));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.clinical-scales-section .section-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: #e5e5e5;
    cursor: pointer;
    transition: background 0.2s ease;
}

.clinical-scales-section .section-toggle:hover {
    background: rgba(59, 130, 246, 0.1);
}

.scales-toggle-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.scales-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 0.5rem;
    background: #3b82f6;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
}

.clinical-scales-content {
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.clinical-scales-content.collapsed {
    display: none;
}

/* Scale Cards */
.scale-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
}

.scale-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.scale-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.scale-ref {
    text-decoration: none;
    font-size: 0.8rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.scale-ref:hover {
    opacity: 1;
}

.scale-completeness {
    font-size: 0.65rem;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.scale-completeness.complete {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.scale-completeness.partial {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.scale-completeness.updated {
    animation: pulseUpdate 0.5s ease;
}

@keyframes pulseUpdate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); background: rgba(16, 185, 129, 0.4); }
}

/* WBP Card */
.wbp-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.wbp-class {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    background: #3b82f6;
    border-radius: 8px;
}

.wbp-label {
    font-size: 1rem;
    font-weight: 600;
    color: #e5e5e5;
}

.wbp-rationale {
    font-size: 0.75rem;
    color: #9ca3af;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.wbp-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #333;
}

.wbp-legend-item {
    font-size: 0.65rem;
    color: #6b7280;
    padding: 0.125rem 0.375rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.wbp-legend-item b {
    color: #9ca3af;
    margin-right: 0.25rem;
}

.wbp-legend-item.active {
    background: rgba(59, 130, 246, 0.2);
    color: #e5e5e5;
}

.wbp-legend-item.active b {
    color: #3b82f6;
}

/* TIME Grid */
.time-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.time-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    border: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.time-item.needs-input {
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.05);
}

.time-letter {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 4px;
}

.time-content {
    flex: 1;
    min-width: 0;
}

.time-label {
    font-size: 0.65rem;
    color: #6b7280;
    text-transform: uppercase;
}

.time-value {
    font-size: 0.75rem;
    color: #e5e5e5;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.time-source {
    font-size: 0.6rem;
    padding: 0.0625rem 0.25rem;
    border-radius: 3px;
    margin-top: 0.25rem;
    display: inline-block;
}

.time-source.computed {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.time-source.proxy {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.time-source.clinician_entered {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.time-source.unknown {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

/* TEXAS Grid */
.texas-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.texas-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    border: 1px solid transparent;
}

.texas-item.needs-input {
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.05);
}

.texas-label {
    font-size: 0.7rem;
    color: #9ca3af;
}

.texas-value {
    font-size: 0.75rem;
    color: #e5e5e5;
    font-weight: 500;
}

.texas-source {
    font-size: 0.6rem;
    padding: 0.0625rem 0.25rem;
    border-radius: 3px;
}

/* Clinician Input Button */
.btn-clinician-input {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(59, 130, 246, 0.2));
    border: 1px dashed rgba(139, 92, 246, 0.5);
    border-radius: 6px;
    color: #a78bfa;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-clinician-input:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(59, 130, 246, 0.3));
    border-color: #a78bfa;
    color: #c4b5fd;
}

/* Scales Disclaimer */
.scales-disclaimer {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.65rem;
    color: #6b7280;
    padding: 0.375rem 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

/* ============================================
   Nurse Charting Interface (Flowsheet Tab)
   ============================================ */
.charting-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.5rem 0;
}

.charting-section-header {
    font-size: 0.7rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

/* Body Figure Section */
.body-figure-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
}

.body-figure-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.body-view-toggle {
    display: flex;
    background: #1a1a1a;
    border-radius: 6px;
    padding: 0.125rem;
}

.body-view-btn {
    padding: 0.375rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 5px;
    color: #9ca3af;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.body-view-btn.active {
    background: #3b82f6;
    color: #fff;
}

.body-figure {
    width: 100%;
    max-width: 160px;
    margin: 0.5rem auto;
}

.body-svg {
    width: 100%;
    height: auto;
}

.selected-location {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    padding: 0.375rem 0.625rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 4px;
}

.location-label {
    color: #9ca3af;
}

.location-value {
    color: #3b82f6;
    font-weight: 500;
}

/* Quick Assessment Form */
.quick-assessment-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
}

.assessment-field {
    margin-bottom: 0.75rem;
}

.assessment-field label {
    display: block;
    font-size: 0.7rem;
    color: #9ca3af;
    margin-bottom: 0.25rem;
}

.chart-select {
    width: 100%;
    padding: 0.5rem;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    color: #e5e5e5;
    font-size: 0.8rem;
    cursor: pointer;
}

.chart-select:focus {
    outline: none;
    border-color: #3b82f6;
}

.chart-slider {
    width: 100%;
    -webkit-appearance: none;
    height: 6px;
    background: #262626;
    border-radius: 3px;
    outline: none;
}

.chart-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
}

.pain-value {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.125rem 0.375rem;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #3b82f6;
}

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

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #e5e5e5;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #3b82f6;
}

.chart-textarea {
    width: 100%;
    min-height: 60px;
    padding: 0.5rem;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    color: #e5e5e5;
    font-size: 0.8rem;
    font-family: inherit;
    resize: vertical;
}

.chart-textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

/* Charting Actions */
.charting-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-save-chart,
.btn-update-scales {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-save-chart {
    background: #10b981;
    color: #fff;
}

.btn-save-chart:hover {
    background: #059669;
}

.btn-update-scales {
    background: #3b82f6;
    color: #fff;
}

.btn-update-scales:hover {
    background: #2563eb;
}

/* ============================================
   Clinician Input Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #1a1a2e;
    border-radius: 12px;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.clinician-modal-content {
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.15));
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #e5e5e5;
}

.modal-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #ef4444;
}

.modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    max-height: 60vh;
}

.modal-description {
    font-size: 0.85rem;
    color: #9ca3af;
    margin: 0 0 1rem 0;
    line-height: 1.5;
}

.input-section {
    margin-bottom: 1.25rem;
}

.input-section h3 {
    font-size: 0.8rem;
    font-weight: 600;
    color: #60a5fa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #e5e5e5;
    margin-bottom: 0.375rem;
}

.clinical-select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #e5e5e5;
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.clinical-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.clinical-select option {
    background: #1a1a2e;
    color: #e5e5e5;
}

.clinical-textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #e5e5e5;
    font-size: 0.85rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.clinical-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.input-hint {
    display: block;
    font-size: 0.7rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-secondary {
    padding: 0.625rem 1rem;
    background: rgba(107, 114, 128, 0.3);
    border: 1px solid rgba(107, 114, 128, 0.3);
    border-radius: 6px;
    color: #9ca3af;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(107, 114, 128, 0.5);
    color: #e5e5e5;
}

.btn-primary {
    padding: 0.625rem 1rem;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* ============================================
   Epic-Style Body Figure with IV Sites
   ============================================ */
.body-figure-section.epic-style {
    padding: 1rem;
}

.body-figure-section .charting-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.marking-mode-toggle {
    display: flex;
    gap: 0.25rem;
}

.marking-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    color: #9ca3af;
    font-size: 0.65rem;
    cursor: pointer;
    transition: all 0.2s;
}

.marking-btn:hover {
    background: #262626;
    color: #e5e5e5;
}

.marking-btn.active {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    color: #3b82f6;
}

.marking-btn[data-mode="iv"].active {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #10b981;
}

.marking-btn[data-mode="drain"].active {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
    color: #f59e0b;
}

.body-figure.epic-body {
    max-width: 180px;
    margin: 0.75rem auto;
}

.body-svg {
    width: 100%;
    height: auto;
}

.body-region {
    fill: rgba(156, 163, 175, 0.15);
    stroke: #4b5563;
    stroke-width: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.body-region:hover {
    fill: rgba(59, 130, 246, 0.3);
    stroke: #3b82f6;
    stroke-width: 2;
}

.body-region.iv-site {
    fill: rgba(16, 185, 129, 0.1);
    stroke: #059669;
}

.body-region.iv-site:hover {
    fill: rgba(16, 185, 129, 0.3);
    stroke: #10b981;
}

.body-region.iv-site.primary {
    fill: rgba(16, 185, 129, 0.2);
    stroke: #10b981;
    stroke-dasharray: 3 2;
}

.body-region.selected {
    fill: rgba(239, 68, 68, 0.4);
    stroke: #ef4444;
    stroke-width: 2;
}

.body-region.marked-wound {
    fill: rgba(239, 68, 68, 0.5);
    stroke: #ef4444;
    stroke-width: 2;
}

.body-region.marked-iv {
    fill: rgba(16, 185, 129, 0.5);
    stroke: #10b981;
    stroke-width: 2;
}

.body-region.marked-drain {
    fill: rgba(245, 158, 11, 0.5);
    stroke: #f59e0b;
    stroke-width: 2;
}

.location-display-panel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.markers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    min-height: 24px;
}

.marker-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.375rem;
    font-size: 0.65rem;
    border-radius: 4px;
    cursor: pointer;
}

.marker-tag.wound {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.marker-tag.iv {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.marker-tag.drain {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.marker-tag .remove-marker {
    font-size: 0.75rem;
    opacity: 0.7;
    cursor: pointer;
}

.marker-tag .remove-marker:hover {
    opacity: 1;
}

/* SVG Markers */
.body-marker {
    cursor: pointer;
    transition: transform 0.2s;
}

.body-marker:hover {
    transform: scale(1.2);
}

/* ============================================
   Wound Drainage Color Chart
   ============================================ */
.drainage-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 0.75rem;
}

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

.drainage-color-picker label,
.drainage-amount-picker label {
    display: block;
    font-size: 0.7rem;
    color: #9ca3af;
    margin-bottom: 0.5rem;
}

.color-swatches {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid #333;
    cursor: pointer;
    transition: all 0.2s;
}

.color-swatch:hover {
    border-color: #9ca3af;
    transform: scale(1.1);
}

.color-swatch.selected {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4);
}

.selected-drainage-color {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #e5e5e5;
}

.drainage-color-name {
    font-weight: 500;
}

.amount-scale {
    display: flex;
    gap: 0.25rem;
}

.amount-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.25rem;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.amount-btn:hover {
    border-color: #9ca3af;
}

.amount-btn.selected {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.amount-indicator {
    width: 100%;
    max-width: 20px;
    background: linear-gradient(to top, #f59e0b, #fef9c3);
    border-radius: 2px;
    min-height: 4px;
}

.amount-btn span {
    font-size: 0.6rem;
    color: #9ca3af;
}

.amount-btn.selected span {
    color: #3b82f6;
}

.drainage-color-reference {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 0.5rem;
}

.reference-title {
    font-size: 0.65rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.375rem;
}

.reference-items {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ref-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: #9ca3af;
}

.ref-item.warning {
    color: #f59e0b;
}

.ref-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
}

.ref-text b {
    color: #e5e5e5;
}

/* ============================================
   Infection & Isolation Section
   ============================================ */
.infection-isolation-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 0.75rem;
}

.infection-isolation-section .charting-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.isolation-badge {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    animation: isolationPulse 2s infinite;
}

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

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

.isolation-precautions-panel {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(245, 158, 11, 0.1));
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    padding: 0.75rem;
    margin-top: 0.5rem;
}

.isolation-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ef4444;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.isolation-header svg {
    stroke: #ef4444;
}

.precautions-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 0.5rem;
}

.precaution-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #e5e5e5;
    padding: 0.25rem 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.precaution-icon {
    font-size: 1rem;
}

.isolation-type-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
}

.isolation-type-badge.contact {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.isolation-type-badge.droplet {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.isolation-type-badge.airborne {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.4);
}

.isolation-type-badge.contact-enteric {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

/* ============================================
   Bedside Dressing Recommendations
   ============================================ */
.dressing-recommendations-section {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(59, 130, 246, 0.08));
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 0.75rem;
}

.dressing-recommendations-section .charting-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #10b981;
}

.dressing-recommendations-section .charting-section-header svg {
    stroke: #10b981;
}

.dressing-ai-note {
    font-size: 0.65rem;
    color: #6b7280;
    font-style: italic;
    margin-bottom: 0.75rem;
}

.dressing-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.dressing-card {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    padding: 0.75rem;
    border-left: 3px solid #10b981;
}

.dressing-card.secondary {
    border-left-color: #3b82f6;
}

.dressing-type-badge {
    font-size: 0.6rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.dressing-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e5e5e5;
    margin-bottom: 0.25rem;
}

.dressing-rationale {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-bottom: 0.5rem;
}

.dressing-supplies {
    font-size: 0.7rem;
}

.supply-label {
    color: #6b7280;
    display: block;
    margin-bottom: 0.25rem;
}

.dressing-supplies ul {
    margin: 0;
    padding-left: 1rem;
    color: #e5e5e5;
}

.dressing-supplies li {
    margin-bottom: 0.125rem;
}

.dressing-frequency {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.dressing-frequency label {
    font-size: 0.7rem;
    color: #9ca3af;
}

.frequency-value {
    font-size: 0.75rem;
    font-weight: 500;
    color: #10b981;
}

.dressing-alerts {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 0.5rem;
}

.dressing-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
}

.dressing-alert.warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.dressing-alert.critical {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.dressing-alert.info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

.dressing-disclaimer {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6rem;
    color: #6b7280;
    padding: 0.375rem 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.dressing-disclaimer svg {
    stroke: #6b7280;
    flex-shrink: 0;
}

/* ============================================
   Pain Scale Visual
   ============================================ */
.pain-scale-visual {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pain-faces {
    display: flex;
    justify-content: space-between;
    font-size: 1.25rem;
}

.pain-face {
    opacity: 0.3;
    transition: all 0.2s;
}

.pain-face.active {
    opacity: 1;
    transform: scale(1.3);
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(16, 185, 129, 0.95);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    animation: toastSlideUp 0.3s ease;
}

.toast.error {
    background: rgba(239, 68, 68, 0.95);
}

.toast.warning {
    background: rgba(245, 158, 11, 0.95);
}

@keyframes toastSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ============================================
   QA Summary Panel
   ============================================ */
.qa-summary-panel {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #262626;
    border-radius: 12px;
    margin: 0.75rem 1rem;
    overflow: hidden;
}

.qa-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid #262626;
}

.qa-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #a1a1aa;
}

.qa-title svg {
    color: #10b981;
}

.qa-grade-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.875rem;
    background: rgba(161, 161, 170, 0.2);
    color: #a1a1aa;
}

.qa-grade-badge.grade-a {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.qa-grade-badge.grade-b {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.qa-grade-badge.grade-c {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.qa-grade-badge.grade-d,
.qa-grade-badge.grade-f {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.qa-summary-content {
    padding: 0.75rem 1rem;
}

.qa-status-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.qa-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.qa-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.qa-stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #71717a;
}

.qa-stat.passed .qa-stat-value { color: #10b981; }
.qa-stat.warned .qa-stat-value { color: #f59e0b; }
.qa-stat.failed .qa-stat-value { color: #ef4444; }

.qa-flags {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.qa-flag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 6px;
    font-size: 0.8rem;
    color: #10b981;
}

.qa-flag.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.qa-flag.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.qa-issues-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.qa-issue-item {
    padding: 0.4rem 0.6rem;
    background: rgba(239, 68, 68, 0.1);
    border-left: 2px solid #ef4444;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #fca5a5;
}

.qa-issue-item.success {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: #10b981;
    color: #6ee7b7;
}

/* ============================================
   Calibration Status Badge
   ============================================ */
.calibration-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    margin: 0.5rem 1rem;
}

.calibration-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: rgba(161, 161, 170, 0.15);
    border: 1px solid #3f3f46;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #a1a1aa;
}

.calibration-badge.calibrated {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
    color: #10b981;
}

.calibration-icon {
    font-size: 0.9rem;
}

.calibration-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #71717a;
}

.calibration-detail .detail-value {
    font-family: 'SF Mono', monospace;
    color: #a1a1aa;
}

/* ============================================
   Quality Center Card
   ============================================ */
.quality-center {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.05));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 10px;
    padding: 1rem;
    margin: 0.75rem 1rem;
}

.qc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.qc-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #e5e5e5;
}

.qc-title svg {
    color: #3b82f6;
}

.qc-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qc-grade-badge {
    padding: 0.25rem 0.5rem;
    background: #262626;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 700;
}

.qc-grade-badge.grade-a { background: #10b981; color: #fff; }
.qc-grade-badge.grade-b { background: #3b82f6; color: #fff; }
.qc-grade-badge.grade-c { background: #f59e0b; color: #000; }
.qc-grade-badge.grade-d, .qc-grade-badge.grade-f { background: #ef4444; color: #fff; }

.qc-calibration-badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    background: rgba(161, 161, 170, 0.15);
    border: 1px solid #3f3f46;
    border-radius: 4px;
    font-size: 0.7rem;
    color: #a1a1aa;
}

.qc-calibration-badge.calibrated {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
    color: #10b981;
}

.cal-icon { font-size: 0.75rem; }

.qc-summary {
    margin-bottom: 0.75rem;
}

.qc-status-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.qc-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.4rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.qc-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
}

.qc-stat-label {
    font-size: 0.6rem;
    color: #71717a;
    text-transform: uppercase;
}

.qc-stat.passed .qc-stat-value { color: #10b981; }
.qc-stat.warned .qc-stat-value { color: #f59e0b; }
.qc-stat.failed .qc-stat-value { color: #ef4444; }

.qc-validity-badges {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.validity-badge {
    padding: 0.15rem 0.4rem;
    background: rgba(107, 114, 128, 0.2);
    border-radius: 3px;
    font-size: 0.65rem;
    color: #9ca3af;
}

.validity-badge.valid { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.validity-badge.invalid { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.validity-badge.rel { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }

.qc-issues {
    max-height: 120px;
    overflow-y: auto;
    margin-bottom: 0.75rem;
}

.qc-issue-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
}

.qc-issue-icon { font-size: 0.85rem; }
.qc-issue-text { flex: 1; color: #d4d4d8; }
.qc-issue-impact {
    padding: 0.1rem 0.3rem;
    background: rgba(239, 68, 68, 0.15);
    border-radius: 2px;
    font-size: 0.6rem;
    color: #fca5a5;
}

.qc-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.qc-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.4rem 0.5rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 4px;
    font-size: 0.7rem;
    color: #60a5fa;
    cursor: pointer;
    transition: all 0.2s;
}

.qc-action-btn:hover {
    background: rgba(59, 130, 246, 0.2);
}

.qc-calibration-detail {
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    font-size: 0.7rem;
}

.cal-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.2rem 0;
}

.cal-label { color: #71717a; }
.cal-value { color: #a1a1aa; font-family: 'SF Mono', monospace; }

.qc-do-not-chart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid #ef4444;
    border-radius: 4px;
    color: #ef4444;
    font-weight: 600;
    font-size: 0.8rem;
    margin-top: 0.75rem;
}

/* ============================================
   Overlays Dropdown
   ============================================ */
.control-divider {
    width: 1px;
    height: 24px;
    background: #333;
    margin: 0 0.5rem;
}

.overlays-dropdown {
    position: relative;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dropdown-arrow {
    transition: transform 0.2s;
}

.overlays-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.overlays-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    padding: 0.5rem;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: none;
}

.overlays-dropdown.open .overlays-menu {
    display: block;
}

.overlay-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #d4d4d8;
    transition: background 0.15s;
}

.overlay-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.overlay-option input {
    width: 14px;
    height: 14px;
    accent-color: #3b82f6;
}

.overlay-swatch {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.overlay-divider {
    height: 1px;
    background: #333;
    margin: 0.5rem 0;
}

.overlay-clear-btn {
    width: 100%;
    padding: 0.4rem;
    background: rgba(239, 68, 68, 0.1);
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #ef4444;
    cursor: pointer;
}

/* ============================================
   IV/Lines Section
   ============================================ */
.iv-lines-section {
    background: rgba(96, 165, 250, 0.05);
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.add-line-btn {
    padding: 0.25rem 0.5rem;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 4px;
    font-size: 0.7rem;
    color: #60a5fa;
    cursor: pointer;
}

.iv-lines-table-container {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 0.5rem;
}

.iv-lines-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.iv-lines-table th {
    text-align: left;
    padding: 0.4rem 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    color: #9ca3af;
    font-weight: 500;
}

.iv-lines-table td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.no-lines-msg {
    text-align: center;
    color: #71717a;
    font-style: italic;
}

.iv-copy-forward {
    text-align: right;
}

.copy-forward-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.5rem;
    background: transparent;
    border: 1px solid #3f3f46;
    border-radius: 4px;
    font-size: 0.7rem;
    color: #9ca3af;
    cursor: pointer;
}

/* IV Modal */
.iv-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.iv-modal {
    width: 90%;
    max-width: 500px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    overflow: hidden;
}

.iv-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.1);
    border-bottom: 1px solid #333;
    font-weight: 600;
    color: #e5e5e5;
}

.iv-modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #9ca3af;
    cursor: pointer;
}

.iv-modal-body {
    padding: 1rem;
    max-height: 60vh;
    overflow-y: auto;
}

.iv-form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.iv-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.iv-form-field.full-width {
    grid-column: 1 / -1;
}

.iv-form-field label {
    font-size: 0.7rem;
    color: #9ca3af;
}

.chart-input {
    padding: 0.4rem 0.5rem;
    background: #262626;
    border: 1px solid #3f3f46;
    border-radius: 4px;
    color: #e5e5e5;
    font-size: 0.8rem;
}

.chart-textarea {
    padding: 0.4rem 0.5rem;
    background: #262626;
    border: 1px solid #3f3f46;
    border-radius: 4px;
    color: #e5e5e5;
    font-size: 0.8rem;
    resize: vertical;
}

.iv-assessment-section {
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.assessment-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    margin-bottom: 0.5rem;
}

.iv-assessment-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.iv-assessment-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: #d4d4d8;
    cursor: pointer;
}

.iv-assessment-item.warning-item {
    color: #fca5a5;
}

.iv-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid #333;
}

.iv-modal-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
}

.iv-modal-btn.secondary {
    background: transparent;
    border: 1px solid #3f3f46;
    color: #9ca3af;
}

.iv-modal-btn.primary {
    background: #3b82f6;
    border: none;
    color: #fff;
}

/* ============================================
   Extended Drainage Fields
   ============================================ */
.drainage-extended-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #333;
}

.drainage-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.drainage-field label {
    font-size: 0.7rem;
    color: #9ca3af;
}

.drainage-chart-string {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 6px;
}

.chart-string-label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    color: #9ca3af;
    white-space: nowrap;
}

.chart-string-content {
    flex: 1;
    font-family: 'SF Mono', monospace;
    font-size: 0.8rem;
    color: #e5e5e5;
}

.chart-string-content .placeholder {
    color: #71717a;
    font-style: italic;
}

.copy-chart-string-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.5rem;
    background: rgba(59, 130, 246, 0.2);
    border: none;
    border-radius: 4px;
    font-size: 0.7rem;
    color: #60a5fa;
    cursor: pointer;
}

/* ============================================
   Bed-Side Plan Section
   ============================================ */
.bedside-plan-section {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(59, 130, 246, 0.05));
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.draft-badge {
    padding: 0.15rem 0.4rem;
    background: rgba(245, 158, 11, 0.2);
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 700;
    color: #f59e0b;
    margin-left: auto;
}

.plan-header-note {
    font-size: 0.7rem;
    color: #71717a;
    margin-bottom: 0.75rem;
}

.formulary-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
}

.formulary-selector label {
    color: #9ca3af;
}

.plan-cards {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.plan-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 0.6rem;
    overflow: hidden;
}

.plan-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
}

.plan-type-badge {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.plan-type-badge.primary {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.plan-type-badge.secondary {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.plan-select {
    flex: 1;
    min-width: 0;
    padding: 0.25rem;
    background: #262626;
    border: 1px solid #3f3f46;
    border-radius: 4px;
    font-size: 0.7rem;
    color: #e5e5e5;
}

.plan-card-content {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.plan-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #e5e5e5;
    margin-bottom: 0.15rem;
}

.plan-size {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
}

.plan-size label {
    color: #9ca3af;
    white-space: nowrap;
}

.plan-size-select {
    padding: 0.15rem 0.3rem;
    background: #262626;
    border: 1px solid #3f3f46;
    border-radius: 4px;
    font-size: 0.65rem;
    color: #e5e5e5;
    min-width: 80px;
}

.plan-rationale {
    font-size: 0.65rem;
    color: #71717a;
    flex-basis: 100%;
    margin-top: 0.25rem;
}

.plan-frequency {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
    font-size: 0.7rem;
}

.plan-frequency label {
    color: #9ca3af;
    white-space: nowrap;
}

.plan-frequency .chart-select {
    flex: 1;
    min-width: 100px;
    max-width: 150px;
}

.frequency-note {
    font-size: 0.6rem;
    color: #71717a;
    flex-basis: 100%;
}

.plan-why-section {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    padding: 0.5rem 0.6rem;
    margin-bottom: 0.5rem;
}

.why-header {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #9ca3af;
    margin-bottom: 0.4rem;
}

.plan-why-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.plan-why-list li {
    position: relative;
    padding-left: 0.8rem;
    margin-bottom: 0.2rem;
    font-size: 0.7rem;
    color: #d4d4d8;
    line-height: 1.3;
}

.plan-why-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #10b981;
}

.plan-alerts {
    margin-bottom: 0.75rem;
}

.plan-alert-item {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 0.35rem 0.4rem;
    background: rgba(245, 158, 11, 0.1);
    border-left: 3px solid #f59e0b;
    border-radius: 4px;
    margin-bottom: 0.2rem;
    font-size: 0.7rem;
    color: #fbbf24;
    line-height: 1.3;
}

.plan-alert-item.critical {
    background: rgba(239, 68, 68, 0.15);
    border-left-color: #ef4444;
    color: #fca5a5;
}

.plan-alert-item.warning {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: #f59e0b;
    color: #fbbf24;
}

.plan-alert-item.info {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: #3b82f6;
    color: #93c5fd;
}

.plan-actions {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.copy-plan-btn, .print-plan-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.4rem 0.6rem;
    border-radius: 5px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-plan-btn {
    flex: 1;
    background: #10b981;
    border: none;
    color: #fff;
}

.copy-plan-btn:hover {
    background: #059669;
}

.print-plan-btn {
    background: transparent;
    border: 1px solid #3f3f46;
    color: #9ca3af;
}

.plan-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 0.5rem;
    background: rgba(245, 158, 11, 0.08);
    border-radius: 4px;
    font-size: 0.7rem;
    color: #fbbf24;
}

/* ============================================
   AI Output Tabs
   ============================================ */
.ai-output-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem 0.5rem 0;
    border-bottom: 1px solid #333;
    margin-bottom: 0.75rem;
}

.ai-tab {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 0.75rem;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s;
}

.ai-tab:hover {
    color: #e5e5e5;
}

.ai-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.ai-tab-content {
    display: none;
    animation: fadeIn 0.2s ease;
}

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

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

.chart-note-container, .patient-note-container {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.chart-note-header, .patient-note-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #333;
    font-size: 0.8rem;
    font-weight: 500;
    color: #9ca3af;
}

.copy-note-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: rgba(59, 130, 246, 0.15);
    border: none;
    border-radius: 4px;
    font-size: 0.7rem;
    color: #60a5fa;
    cursor: pointer;
}

.chart-note-content, .patient-note-content {
    padding: 0.75rem;
    font-size: 0.8rem;
    color: #d4d4d8;
    line-height: 1.6;
}

.note-loading {
    color: #71717a;
    font-style: italic;
}

/* Sources Tab */
.sources-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sources-section, .signals-section {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    padding: 0.75rem;
}

.sources-header, .signals-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #9ca3af;
    margin-bottom: 0.5rem;
}

.rag-citations {
    max-height: 150px;
    overflow-y: auto;
}

.citation-item {
    padding: 0.5rem;
    background: rgba(59, 130, 246, 0.08);
    border-left: 2px solid #3b82f6;
    border-radius: 4px;
    margin-bottom: 0.4rem;
    font-size: 0.75rem;
}

.citation-title {
    font-weight: 500;
    color: #e5e5e5;
    margin-bottom: 0.15rem;
}

.citation-source {
    font-weight: 500;
    color: #60a5fa;
    font-size: 0.7rem;
    margin-bottom: 0.15rem;
}

.citation-relevance {
    color: #9ca3af;
    font-size: 0.65rem;
    font-style: italic;
}

.citation-text {
    color: #d4d4d8;
}

.citation-loading {
    color: #71717a;
    font-style: italic;
}

.qa-signals {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.signal-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #d4d4d8;
}

.signal-icon {
    font-size: 0.85rem;
}

.measurement-validity {
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.validity-header {
    font-size: 0.7rem;
    font-weight: 500;
    color: #9ca3af;
    margin-bottom: 0.4rem;
}

.validity-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.validity-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.validity-label {
    font-size: 0.65rem;
    color: #71717a;
}

.validity-status {
    padding: 0.15rem 0.4rem;
    background: rgba(107, 114, 128, 0.2);
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
}

.validity-status.valid { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.validity-status.rel { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.validity-status.invalid { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

/* Healing Outlook enhancements */
.readonly-badge {
    padding: 0.1rem 0.3rem;
    background: rgba(107, 114, 128, 0.2);
    border-radius: 3px;
    font-size: 0.55rem;
    font-weight: 500;
    color: #9ca3af;
    margin-left: 0.5rem;
}

.trajectory-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding: 0.4rem 0.5rem;
    background: rgba(245, 158, 11, 0.08);
    border-radius: 4px;
    font-size: 0.65rem;
    color: #fbbf24;
}

/* Risk note */
.risk-note {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 4px;
    font-size: 0.7rem;
    color: #9ca3af;
}
