/* Predigm SaMD Dashboard V6 - Advanced Features */

:root {
    --primary: #0066CC;
    --primary-light: #E6F0FA;
    --success: #10B981;
    --success-light: #D1FAE5;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --danger: #DC2626;
    --danger-light: #FEE2E2;
    --purple: #7C3AED;
    --purple-light: #EDE9FE;
    --bg: #F8FAFC;
    --panel: #FFFFFF;
    --text: #1E293B;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    --border: #E2E8F0;
    --font: 'Inter', -apple-system, sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 13px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
}

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

.logo-text {
    font-size: 18px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #00AAFF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-ver {
    font-size: 9px;
    padding: 2px 5px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 4px;
    margin-left: 4px;
    -webkit-text-fill-color: var(--primary);
}

.patient-badge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.patient-avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary), #00AAFF);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 11px;
}

.patient-name {
    font-weight: 600;
    font-size: 13px;
}

.predigm-id-badge {
    font-size: 10px;
    padding: 2px 8px;
    background: linear-gradient(135deg, #10B981, #34D399);
    color: white;
    border-radius: 10px;
    font-weight: 600;
    font-family: monospace;
}

.practice-mode-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ccc;
    transition: 0.3s;
    border-radius: 20px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider {
    background: #F59E0B;
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 11px;
    color: var(--text-secondary);
}

.practice-mode-banner {
    display: none;
    background: linear-gradient(90deg, #FEF3C7, #FDE68A);
    color: #92400E;
    text-align: center;
    padding: 8px;
    font-size: 12px;
    font-weight: 600;
}

.practice-mode-banner.active {
    display: block;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-smart,
.btn-lang {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border: none;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
}

.btn-smart {
    background: linear-gradient(135deg, var(--purple), #A855F7);
    color: white;
}

.btn-lang {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
}

.analysis-mode {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: var(--primary-light);
    border-radius: 12px;
    font-size: 11px;
    color: var(--primary);
}

.analysis-mode.advanced {
    background: var(--success-light);
    color: var(--success);
}

.mode-dot {
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
}

/* Navigation */
.main-nav {
    display: flex;
    gap: 4px;
    padding: 8px 16px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
}

.nav-btn {
    padding: 8px 16px;
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
}

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

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

/* Views & Dashboard Grid */
.view {
    display: none;
    flex: 1;
    overflow: auto;
}

.view.active {
    display: block;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 260px 1fr 280px;
    gap: 10px;
    padding: 10px;
    height: calc(100vh - 130px);
}

/* Panels */
.panel {
    background: var(--panel);
    border-radius: 10px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.panel-header h2 {
    font-size: 13px;
    font-weight: 600;
}

.btn-history {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    opacity: 0.6;
}

/* Tabs & Form (inherited from V5) */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.tab {
    flex: 1;
    padding: 6px;
    background: none;
    border: none;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
}

.tab.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    margin-bottom: -1px;
}

.tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.tab-pane {
    display: none;
}

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

.compact-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-row label {
    width: 55px;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.form-row input,
.form-row select {
    flex: 1;
    padding: 5px 6px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 11px;
}

.unit {
    font-size: 9px;
    color: var(--text-muted);
    width: 20px;
}

.bmi-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: var(--primary-light);
    border-radius: 5px;
    font-size: 11px;
}

.bmi-val {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin-left: auto;
}

.level-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.level-chips label {
    padding: 2px 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 9px;
    cursor: pointer;
}

.level-chips label:has(input:checked) {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.level-chips input {
    display: none;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
    font-size: 11px;
}

.toggle {
    position: relative;
    width: 32px;
    height: 18px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border);
    border-radius: 9px;
    transition: 0.2s;
}

.toggle .slider:before {
    content: "";
    position: absolute;
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: 0.2s;
}

.toggle input:checked+.slider {
    background: var(--primary);
}

.toggle input:checked+.slider:before {
    transform: translateX(14px);
}

.mri-badge {
    padding: 5px 8px;
    background: linear-gradient(135deg, var(--purple), #A855F7);
    color: white;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
}

.key-field {
    padding: 8px;
    background: var(--warning-light);
    border: 1px solid var(--warning);
    border-radius: 5px;
    margin-top: 6px;
}

.key-field label {
    display: block;
    font-weight: 600;
    color: #92400E;
    margin-bottom: 4px;
    font-size: 11px;
}

.key-field select {
    width: 100%;
    padding: 5px;
    border: 1px solid var(--warning);
    border-radius: 4px;
    font-size: 11px;
}

.btn-calculate {
    margin: 8px;
    padding: 10px;
    background: linear-gradient(135deg, var(--primary), #0088FF);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
}

.btn-calculate.loading .btn-text {
    opacity: 0;
}

.btn-calculate.loading .btn-spinner {
    display: block;
}

.btn-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Center Panel: Donuts & Sunburst */
.panel-center {
    padding: 12px;
    overflow-y: auto;
}

.risk-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
}

.risk-toggle-btn {
    flex: 1;
    padding: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

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

.dual-donut-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.donut-card {
    text-align: center;
    padding: 16px;
    background: var(--bg);
    border-radius: 12px;
    min-width: 180px;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.donut-card.projected {
    background: linear-gradient(135deg, var(--success-light), #A7F3D0);
}

.donut-card h4 {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.donut-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto;
}

.donut-chart {
    width: 100%;
    height: 100%;
}

.donut-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: 700;
    color: var(--danger);
}

.donut-center-text.projected {
    color: var(--success);
}

.risk-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 10px;
    background: var(--danger-light);
    color: var(--danger);
}

.risk-badge.success,
.risk-badge.low {
    background: var(--success-light);
    color: var(--success);
}

.risk-badge.moderate {
    background: var(--warning-light);
    color: #B45309;
}

.ci-display {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 6px;
}

.donut-arrow {
    font-size: 28px;
    color: var(--success);
    font-weight: bold;
}

.reduction-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 12px;
    background: var(--success);
    color: white;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
}

.sunburst-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.sunburst-section h4 {
    font-size: 13px;
    margin-bottom: 10px;
}

.sunburst-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    justify-content: center;
}

#sunburstChart {
    min-height: 300px;
    min-width: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sunburst-legend {
    width: 220px;
    flex-shrink: 0;
}

/* Factor Bar Chart */
.factor-bar-chart {
    padding: 10px;
    background: var(--bg);
    border-radius: 8px;
}

.factor-bar-chart h5 {
    font-size: 11px;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.factor-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.factor-name {
    width: 70px;
    font-size: 10px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.factor-bar-container {
    flex: 1;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.factor-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.factor-value {
    width: 40px;
    font-size: 10px;
    font-weight: 600;
    text-align: right;
    color: var(--text-secondary);
}

/* Explainability Sections (SaMD Compliance) */
.explainability-section {
    margin-top: 12px;
}

.cohort-card,
.time-curve-card {
    padding: 12px;
    background: var(--panel);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.cohort-card h5,
.time-curve-card h5 {
    font-size: 12px;
    margin-bottom: 10px;
    color: var(--text);
}

.cohort-percentile {
    margin-bottom: 10px;
}

.percentile-bar {
    position: relative;
    height: 12px;
    background: linear-gradient(90deg, #10B981 0%, #F59E0B 50%, #DC2626 100%);
    border-radius: 6px;
}

.percentile-fill {
    display: none;
}

.percentile-marker {
    position: absolute;
    top: -4px;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-value {
    font-size: 8px;
    font-weight: 700;
    color: var(--primary);
    position: absolute;
    top: -16px;
    white-space: nowrap;
}

.percentile-labels {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 4px;
}

.cohort-text {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
}

.cohort-evidence {
    display: flex;
    justify-content: flex-end;
}

.evidence-tag {
    font-size: 9px;
    padding: 2px 8px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 10px;
}

/* Time Risk Curve */
.time-curve-svg {
    display: block;
    margin: 0 auto;
}

.curve-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 8px;
    font-size: 10px;
}

.legend-current {
    color: var(--danger);
}

.legend-projected {
    color: var(--success);
}

.curve-note {
    font-size: 9px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 6px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 11px;
    border-bottom: 1px solid var(--border);
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 4px;
}

/* What-If Panel */
.panel-whatif {
    padding: 10px;
    overflow-y: auto;
}

.whatif-desc {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.whatif-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-item {
    padding: 8px;
    background: var(--bg);
    border-radius: 6px;
    border: 1px solid var(--border);
}

.control-item:has(input:checked) {
    border-color: var(--success);
    background: var(--success-light);
}

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

.control-slider {
    margin-top: 6px;
}

.control-slider input[type="range"] {
    width: 100%;
}

.control-slider select {
    width: 100%;
    padding: 4px;
    font-size: 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.control-detail {
    font-size: 9px;
    color: var(--success);
    margin-top: 4px;
    display: none;
}

.control-item:has(input:checked) .control-detail {
    display: block;
}

.whatif-summary {
    margin-top: 12px;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary-light), #DBEAFE);
    border-radius: 8px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 10px;
}

.summary-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--success);
}

.btn-action-plan,
.btn-export {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
}

.btn-action-plan {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-export {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
}

/* Enhanced Action Plan */
.action-plan-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.action-plan-header {
    margin-bottom: 24px;
}

.ap-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.ap-hero-icon {
    font-size: 48px;
}

.ap-hero-content h1 {
    font-size: 28px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ap-hero-content p {
    color: var(--text-secondary);
    font-size: 14px;
}

.ap-date-picker {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--panel);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.ap-date-picker label {
    font-weight: 600;
}

.ap-date-picker input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}

.btn-today {
    padding: 8px 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.ap-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 12px;
    color: white;
    margin-bottom: 16px;
}

.ap-stat {
    text-align: center;
}

.ap-stat-value {
    font-size: 28px;
    font-weight: 700;
}

.ap-stat-label {
    font-size: 11px;
    opacity: 0.9;
}

.ap-stat.primary {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
}

.ap-stat.highlight .ap-stat-value {
    color: #10B981;
}

.ap-stat-arrow {
    font-size: 24px;
    opacity: 0.7;
}

.progress-container {
    padding: 16px;
    background: var(--panel);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), #34D399);
    border-radius: 5px;
    transition: width 0.5s;
}

/* Dynamic Milestones */
.milestone-title {
    font-size: 16px;
    margin: 24px 0 16px;
}

.empty-state {
    color: var(--text-muted);
    text-align: center;
    padding: 40px;
    background: var(--bg);
    border-radius: 10px;
}

.milestone-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.milestone-card {
    padding: 16px;
    background: var(--panel);
    border-radius: 10px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
}

.milestone-card.smoking {
    border-left-color: var(--danger);
}

.milestone-card.muscle {
    border-left-color: var(--warning);
}

.milestone-card.weight {
    border-left-color: #3B82F6;
}

.milestone-card.exercise {
    border-left-color: var(--success);
}

.milestone-card.diabetes {
    border-left-color: var(--purple);
}

.milestone-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.milestone-week {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.milestone-date {
    font-size: 11px;
    color: var(--primary);
    font-weight: 600;
    margin-top: 2px;
}

.milestone-card h3 {
    font-size: 16px;
    margin: 4px 0 8px;
}

.milestone-card p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.milestone-card ul {
    list-style: none;
    font-size: 11px;
    color: var(--text-secondary);
}

.milestone-card li {
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.milestone-card li input[type="checkbox"] {
    width: 14px;
    height: 14px;
}

.milestone-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    margin-top: 10px;
}

.milestone-badge.easy {
    background: var(--success-light);
    color: var(--success);
}

.milestone-badge.moderate {
    background: var(--warning-light);
    color: #B45309;
}

.milestone-badge.hard {
    background: var(--danger-light);
    color: var(--danger);
}

.milestone-impact {
    display: inline-block;
    margin-left: 6px;
    padding: 3px 8px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
}

/* Weekly Tracker */
.weekly-tracker {
    margin-top: 32px;
}

.weekly-tracker h3 {
    font-size: 16px;
    margin-bottom: 16px;
}

.week-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 8px;
}

.week-cell {
    padding: 10px 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    text-align: center;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.week-cell:hover {
    border-color: var(--primary);
}

.week-cell.completed {
    background: var(--success-light);
    border-color: var(--success);
}

.week-cell .week-num {
    font-weight: 600;
}

.week-cell .week-date {
    font-size: 8px;
    color: var(--text-muted);
}

/* QR Section */
.qr-section {
    margin-top: 32px;
    padding: 24px;
    background: linear-gradient(135deg, var(--primary-light), #DBEAFE);
    border-radius: 12px;
}

.qr-section h3 {
    font-size: 16px;
    margin-bottom: 16px;
}

.qr-container {
    display: flex;
    gap: 24px;
    align-items: center;
}

#qrCode {
    background: white;
    padding: 12px;
    border-radius: 8px;
}

.qr-info {
    flex: 1;
}

.qr-info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.btn-share {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}

.ap-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
}

.btn-back,
.btn-print {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.btn-back {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-print {
    background: var(--primary);
    border: none;
    color: white;
}

/* Evidence View (same as V5) */
.evidence-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px;
}

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

.evidence-header h1 {
    font-size: 28px;
}

.evidence-update {
    text-align: right;
}

.update-badge {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, var(--success), #34D399);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.update-schedule {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.evidence-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.evidence-stat {
    text-align: center;
    padding: 20px;
    background: var(--panel);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.evidence-stat .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.evidence-stat .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.evidence-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.evidence-card {
    background: var(--panel);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.evidence-card.schedule {
    background: linear-gradient(135deg, var(--primary-light), #DBEAFE);
}

.evidence-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.evidence-card-header h3 {
    font-size: 14px;
}

.evidence-tag {
    padding: 4px 10px;
    background: var(--success-light);
    color: var(--success);
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
}

.evidence-items {
    padding: 12px 18px;
}

.evidence-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

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

.ref-icon {
    font-size: 20px;
    width: 32px;
    flex-shrink: 0;
}

.ref-content {
    flex: 1;
}

.ref-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.ref-source {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.ref-meta {
    font-size: 10px;
    color: var(--primary);
    font-weight: 500;
}

.schedule-timeline {
    display: flex;
    justify-content: space-around;
    padding: 20px;
}

.schedule-item {
    text-align: center;
    position: relative;
}

.schedule-item::after {
    content: '→';
    position: absolute;
    right: -30px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
}

.schedule-item:last-child::after {
    display: none;
}

.schedule-date {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
}

.schedule-desc {
    font-size: 11px;
    color: var(--text-secondary);
}

.schedule-item.past {
    opacity: 0.5;
}

.schedule-item.current .schedule-date {
    color: var(--success);
}

.schedule-item.current .schedule-desc {
    color: var(--success);
    font-weight: 600;
}

.evidence-footer {
    margin-top: 24px;
}

/* Smart Input Modal - ENHANCED */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--panel);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow: auto;
}

.modal-content.wide {
    max-width: 700px;
}

.modal-content.small {
    max-width: 400px;
}

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

.modal-header h2 {
    font-size: 18px;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: var(--bg);
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
}

.smart-input-body {
    padding: 20px;
}

/* Smart Tabs */
.smart-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.smart-tab {
    flex: 1;
    padding: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
}

.smart-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.smart-pane {
    display: none;
}

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

/* Smart Lens */
.lens-info {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--purple-light), #DDD6FE);
    border-radius: 12px;
    margin-bottom: 20px;
}

.lens-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.lens-info h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.lens-info p {
    font-size: 13px;
    color: var(--text-secondary);
}

.lens-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
}

.lens-status .status-icon {
    font-size: 18px;
}

.lens-status.capturing {
    background: var(--danger-light);
    color: var(--danger);
}

.lens-status.analyzing {
    background: var(--warning-light);
    color: #B45309;
}

.lens-status.success {
    background: var(--success-light);
    color: var(--success);
}

.btn-lens {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--danger), #EF4444);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-lens:hover {
    opacity: 0.9;
}

.btn-lens.stop {
    background: linear-gradient(135deg, #6B7280, #4B5563);
}

.lens-preview {
    display: none;
    margin-top: 16px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.lens-preview.active {
    display: block;
}

#screenVideo {
    width: 100%;
    border-radius: 8px;
}

.lens-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

.lens-overlay.active {
    display: flex;
}

.lens-overlay p {
    font-size: 16px;
    margin-bottom: 12px;
}

.lens-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.lens-extracted {
    display: none;
    margin-top: 16px;
    padding: 16px;
    background: var(--success-light);
    border-radius: 8px;
}

.lens-extracted.active {
    display: block;
}

.lens-extracted h4 {
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--success);
}

.extracted-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.extracted-field {
    padding: 8px;
    background: white;
    border-radius: 6px;
    font-size: 12px;
}

.extracted-field .field-label {
    font-size: 10px;
    color: var(--text-muted);
}

.extracted-field .field-value {
    font-weight: 600;
}

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

.btn-apply {
    flex: 1;
    padding: 12px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.btn-retry {
    padding: 12px 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
}

/* File Upload (same as V5) */
.upload-zone {
    padding: 40px;
    border: 2px dashed var(--border);
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
}

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

.upload-zone input {
    display: none;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

.btn-browse {
    margin-top: 12px;
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.smart-preview {
    display: none;
    margin-top: 16px;
}

.smart-preview.active {
    display: block;
}

.smart-preview img {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 12px;
}

.extracted-data {
    padding: 12px;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 12px;
}

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

.btn-cancel {
    padding: 10px 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
}

/* History Modal */
.history-list {
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    padding: 12px;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
}

.history-item:hover {
    background: var(--primary-light);
}

.history-item-name {
    font-weight: 600;
    font-size: 13px;
}

.history-item-meta {
    font-size: 11px;
    color: var(--text-muted);
}

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

/* Audit Footer with Model Info Badge */
.audit-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: linear-gradient(90deg, var(--bg), #EEF2FF, var(--bg));
    border-top: 1px solid var(--border);
    font-size: 10px;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 8px;
}

.footer-left,
.footer-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.audit-footer strong {
    color: var(--text-secondary);
}

/* Model Info Badge */
.model-info-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #F0F9FF, #EDE9FE);
    border: 1px solid #C7D2FE;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 500;
}

.model-info-badge .model-version {
    color: var(--primary);
}

.model-info-badge .model-auc {
    font-weight: 600;
    color: var(--success);
}

.model-info-badge .model-validated {
    color: var(--success);
}

.model-info-badge strong {
    font-weight: 700;
}

.evidence-badge {
    color: var(--success);
    font-weight: 600;
}

.disclaimer {
    color: var(--warning);
}

/* Disabled intervention items */
.control-item.disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: not-allowed;
}

.control-item.disabled .slider {
    background: #ccc !important;
}

.control-item.disabled::after {
    content: '✓ 해당 없음';
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    font-size: 10px;
    color: var(--success);
    font-weight: 500;
}

/* Responsive */
@media (max-width: 1100px) {
    .dashboard-grid {
        grid-template-columns: 240px 1fr;
    }

    .panel-whatif {
        grid-column: 1 / -1;
    }

    .week-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        height: auto;
    }

    .evidence-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .week-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* ============================================
   CDS FEATURES - Clinical Decision Support
   ============================================ */

/* Risk Alert Banner */
.risk-alert-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 12px 0;
    border-radius: 10px;
    animation: pulse-alert 2s ease-in-out infinite;
}

.risk-alert-banner.hidden {
    display: none;
}

.risk-alert-banner.low {
    background: linear-gradient(135deg, #D1FAE5, #A7F3D0);
    border: 2px solid #10B981;
}

.risk-alert-banner.moderate {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    border: 2px solid #F59E0B;
}

.risk-alert-banner.high {
    background: linear-gradient(135deg, #FEE2E2, #FECACA);
    border: 2px solid #DC2626;
    animation: pulse-alert 1.5s ease-in-out infinite;
}

@keyframes pulse-alert {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.01);
    }
}

.alert-icon {
    font-size: 24px;
}

.alert-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.alert-content strong {
    font-size: 14px;
    color: var(--text);
}

.alert-content span {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Clinical Recommendations Panel */
.clinical-recommendations {
    padding: 12px;
    background: var(--panel);
    border-radius: 10px;
    border: 1px solid var(--border);
    margin: 12px 0;
}

.clinical-recommendations h5 {
    font-size: 13px;
    margin-bottom: 10px;
    color: var(--text);
}

.recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recommendation-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg);
    border-radius: 8px;
    border-left: 4px solid;
}

.recommendation-item.critical {
    border-left-color: #DC2626;
    background: #FEF2F2;
}

.recommendation-item.important {
    border-left-color: #F59E0B;
    background: #FFFBEB;
}

.recommendation-item.suggested {
    border-left-color: #10B981;
    background: #F0FDF4;
}

.rec-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.rec-content {
    flex: 1;
}

.rec-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.rec-desc {
    font-size: 10px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.rec-evidence {
    font-size: 9px;
    color: var(--primary);
    display: inline-block;
}

.rec-evidence-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.btn-view-evidence {
    font-size: 9px;
    padding: 2px 8px;
    background: var(--primary-light);
    color: var(--primary);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Evidence Detail Panel */
.evidence-detail {
    margin-top: 10px;
    padding: 10px;
    background: linear-gradient(135deg, var(--bg), #EEF2FF);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 10px;
    animation: slideDown 0.2s ease-out;
}

.evidence-detail.hidden {
    display: none;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }

    to {
        opacity: 1;
        max-height: 200px;
    }
}

.evidence-source {
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.pubmed-link {
    margin-left: 8px;
    padding: 2px 6px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
}

.pubmed-link:hover {
    background: #0056b3;
}

.evidence-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 6px;
    color: var(--text);
}

.evidence-stats strong {
    color: var(--primary);
}

.evidence-desc {
    margin-bottom: 6px;
    color: var(--text-secondary);
    line-height: 1.4;
    font-style: italic;
}

.evidence-level {
    color: var(--text-muted);
}

.level-badge {
    padding: 2px 6px;
    background: var(--success-light);
    color: var(--success);
    border-radius: 4px;
    font-weight: 600;
}

/* CI Error Bar Enhancement */
.ci-error-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 8px;
    padding: 6px 10px;
    background: var(--bg);
    border-radius: 6px;
}

.ci-bar-visual {
    display: flex;
    align-items: center;
    gap: 2px;
}

.ci-bar-line {
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.ci-bar-point {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
}

.ci-bar-cap {
    width: 2px;
    height: 10px;
    background: var(--primary);
}

.ci-text {
    font-size: 10px;
    color: var(--text-muted);
}

/* ============================================
   CDS FEATURE 4: AUDIT TRAIL / DECISION LOG
   ============================================ */
.audit-trail-section {
    margin-top: 12px;
    padding: 10px;
    background: var(--panel);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.audit-trail-section.hidden {
    display: none;
}

.audit-trail-section h5 {
    font-size: 12px;
    margin-bottom: 8px;
    color: var(--text);
}

.audit-trail-list {
    max-height: 120px;
    overflow-y: auto;
}

.audit-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: var(--bg);
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 10px;
}

.audit-time {
    color: var(--text-muted);
    font-family: monospace;
    font-size: 9px;
}

.audit-action {
    flex: 1;
    color: var(--text);
}

.audit-risk {
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--primary-light);
    color: var(--primary);
}

/* ============================================
   CDS FEATURE 5: COMPARATIVE CASES
   ============================================ */
.comparative-cases-section {
    margin-top: 12px;
    padding: 10px;
    background: var(--panel);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.comparative-cases-section.hidden {
    display: none;
}

.comparative-cases-section h5 {
    font-size: 12px;
    margin-bottom: 8px;
    color: var(--text);
}

.comparative-cases-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.case-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg);
    border-radius: 6px;
    border-left: 3px solid var(--primary);
}

.case-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

.case-info {
    flex: 1;
}

.case-profile {
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
}

.case-factors {
    font-size: 9px;
    color: var(--text-muted);
}

.case-outcome {
    text-align: right;
}

.case-risk {
    font-size: 13px;
    font-weight: 700;
    color: var(--danger);
}

.case-status {
    font-size: 9px;
    color: var(--text-muted);
}

.case-status.recurred {
    color: var(--danger);
}

.case-status.success {
    color: var(--success);
}

/* ============================================
   MODEL REGISTRY & PERFORMANCE MONITORING
   ============================================ */

/* Model Registry Panel */
.model-registry {
    background: linear-gradient(135deg, #F0F9FF, #EEF2FF);
}

.registry-status {
    font-size: 11px;
    padding: 2px 8px;
    background: var(--success-light);
    color: var(--success);
    border-radius: 10px;
}

.model-versions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 0;
}

.model-version-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid var(--border);
}

.model-version-item.production {
    border-left-color: var(--success);
    background: linear-gradient(90deg, #D1FAE5, white);
}

.model-version-item.staging {
    border-left-color: var(--warning);
    background: linear-gradient(90deg, #FEF3C7, white);
}

.model-version-item.archived {
    opacity: 0.7;
}

.version-badge {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    padding: 4px 10px;
    background: var(--primary-light);
    border-radius: 6px;
}

.version-badge.beta {
    background: var(--warning-light);
    color: #B45309;
}

.version-info {
    display: flex;
    gap: 12px;
    font-size: 11px;
}

.version-status {
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.version-status.production {
    background: var(--success-light);
    color: var(--success);
}

.version-status.staging {
    background: var(--warning-light);
    color: #B45309;
}

.version-status.archived {
    background: var(--bg);
    color: var(--text-muted);
}

.version-auc {
    color: var(--text);
    font-weight: 600;
}

.version-date {
    color: var(--text-muted);
}

/* Performance Monitoring Panel */
.performance-monitor {
    background: linear-gradient(135deg, #ECFDF5, #D1FAE5);
}

.monitor-status {
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 10px;
}

.monitor-status.healthy {
    background: var(--success);
    color: white;
}

.monitor-status.warning {
    background: var(--warning);
    color: white;
}

.performance-metrics {
    display: flex;
    gap: 12px;
    margin: 12px 0;
}

.metric-card {
    flex: 1;
    padding: 12px;
    background: white;
    border-radius: 8px;
    text-align: center;
}

.metric-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.metric-value.psi-good {
    color: var(--success);
}

.metric-value.psi-warning {
    color: var(--warning);
}

.metric-label {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
}

.metric-threshold {
    font-size: 9px;
    color: var(--success);
    margin-top: 2px;
}

/* Drift Indicator */
.drift-indicator {
    margin-top: 12px;
}

.drift-bar {
    position: relative;
    height: 10px;
    background: linear-gradient(90deg, #10B981 0%, #F59E0B 50%, #DC2626 100%);
    border-radius: 5px;
}

.drift-fill {
    position: absolute;
    top: -2px;
    left: 0;
    height: 14px;
    width: 4px;
    background: var(--text);
    border-radius: 2px;
}

.drift-threshold {
    position: absolute;
    top: -2px;
    left: 50%;
    height: 14px;
    width: 2px;
    background: var(--danger);
}

.drift-labels {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 4px;
}

.drift-labels .current {
    font-weight: 600;
    color: var(--success);
}

/* Shadow A/B Testing Panel */
.shadow-testing {
    background: linear-gradient(135deg, #EDE9FE, #DDD6FE);
}

.shadow-status {
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 10px;
}

.shadow-status.active {
    background: var(--purple);
    color: white;
}

.shadow-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 16px 0;
}

.shadow-model {
    padding: 12px 20px;
    background: white;
    border-radius: 10px;
    text-align: center;
    border: 2px solid var(--success);
}

.shadow-model.challenger {
    border-color: var(--purple);
}

.shadow-label {
    font-size: 10px;
    color: var(--text-muted);
}

.shadow-version {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.shadow-vs {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
}

.shadow-results {
    display: flex;
    justify-content: space-around;
    padding: 12px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
}

.shadow-stat {
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.stat-num.agreement {
    color: var(--success);
}

.stat-desc {
    font-size: 10px;
    color: var(--text-muted);
}

/* Evidence Level Badge (Simplified) */
.evidence-level-badge {
    display: inline-block;
    padding: 3px 10px;
    background: var(--success-light);
    color: var(--success);
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
}

/* Key References Papers List */
.key-references {
    background: #FAFBFC;
}

.model-description {
    padding: 12px 16px;
    background: #EEF6FF;
    border-left: 3px solid var(--primary);
    border-radius: 6px;
    margin-bottom: 16px;
}

.model-description p {
    margin: 0;
    font-size: 12px;
    color: var(--text);
    line-height: 1.5;
}

.paper-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}

.paper-item {
    padding: 14px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.paper-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.paper-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.paper-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.evidence-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

.evidence-badge.high {
    background: #FEE2E2;
    color: #DC2626;
}

.evidence-badge.moderate {
    background: #FEF3C7;
    color: #B45309;
}

.stat-text {
    font-size: 11px;
    color: var(--text);
}

.paper-item .pubmed-link {
    display: inline-block;
    font-size: 11px;
    color: var(--text-muted);
    text-decoration: none;
}

.paper-item .pubmed-link:hover {
    text-decoration: underline;
    color: var(--text);
}

/* Meta-Analysis Citation */
.meta-analysis-citation {
    padding: 14px;
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.citation-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.citation-text {
    font-size: 11px;
    color: var(--text);
    line-height: 1.5;
    margin-bottom: 8px;
}

.citation-note {
    font-size: 10px;
    color: var(--text-muted);
    font-style: italic;
}