/* --- Modern Healthcare Dashboard Design System --- */

:root {
    --bg-main: #0b132b;
    --bg-card: rgba(28, 37, 65, 0.75);
    --bg-card-border: rgba(255, 255, 255, 0.08);
    --bg-input: #111d38;
    --border-input: #1c2d54;
    --border-focus: #06b6d4;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-teal: #06b6d4;
    --accent-blue: #3b82f6;
    --accent-indigo: #6366f1;
    --accent-purple: #a855f7;
    
    --color-normal: #10b981;
    --color-normal-bg: rgba(16, 185, 129, 0.15);
    --color-abnormal: #ef4444;
    --color-abnormal-bg: rgba(239, 68, 68, 0.15);
    
    --color-risk-low: #10b981;
    --color-risk-mod: #eab308;
    --color-risk-elev: #f97316;
    --color-risk-high: #ef4444;
    --color-risk-vhigh: #e11d48;
    --color-risk-crit: #9f1239;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(6, 182, 212, 0.25);
    --font-heading: 'Outfit', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    padding: 24px;
    background-image: 
        radial-gradient(at 0% 0%, rgba(6, 182, 212, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(99, 102, 241, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
}

.app-container {
    max-width: 1440px;
    margin: 0 auto;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    box-shadow: var(--shadow-soft);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-teal), var(--accent-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.app-header h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* Test Selector Card */
.test-selector-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.95));
    backdrop-filter: blur(16px);
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), var(--shadow-glow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

@media (max-width: 768px) {
    .test-selector-card {
        flex-direction: column;
        align-items: stretch;
    }
}

.test-selector-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.badge-icon {
    font-size: 2rem;
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: var(--radius-md);
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.test-selector-info h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.test-selector-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.test-select-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.select-label {
    font-weight: 600;
    color: var(--accent-teal);
    font-size: 0.9rem;
    white-space: nowrap;
}

.test-select {
    background: #0f172a;
    border: 2px solid var(--accent-teal);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    min-width: 320px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
    transition: all 0.2s ease;
}

.test-select:hover, .test-select:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
    outline: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-preset {
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-preset:hover {
    background: #334155;
    color: #fff;
    border-color: var(--accent-teal);
    transform: translateY(-1px);
}

.btn-preset.abnormal:hover {
    border-color: var(--color-abnormal);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-teal), var(--accent-blue));
    color: #fff;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.4);
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-input);
    padding: 14px 24px;
    font-size: 1rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Layout Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(380px, 1.2fr);
    gap: 24px;
    align-items: start;
}

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

.form-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.test-fields-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Card Sections */
.card-section {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-soft);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.section-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
}

.section-badge.teal { background: var(--accent-teal); }
.section-badge.cyan { background: #0284c7; }
.section-badge.indigo { background: var(--accent-indigo); }
.section-badge.purple { background: var(--accent-purple); }

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
    flex-grow: 1;
}

.badge-count {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Fields Grid */
.fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.unit {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 400;
}

input, select {
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.2s ease;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

select {
    cursor: pointer;
}

select option {
    background-color: #0f172a;
    color: #fff;
}

/* Actions */
.form-actions {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

/* Result Sidebar */
.result-sidebar {
    position: sticky;
    top: 24px;
}

.result-card {
    border-color: rgba(6, 182, 212, 0.2);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.status-indicator-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-indicator-dot.active-normal {
    background: var(--color-normal);
    box-shadow: 0 0 10px var(--color-normal);
}

.status-indicator-dot.active-abnormal {
    background: var(--color-abnormal);
    box-shadow: 0 0 10px var(--color-abnormal);
}

.result-placeholder {
    text-align: center;
    padding: 30px 10px;
    color: var(--text-muted);
}

.placeholder-icon {
    margin-bottom: 12px;
    color: var(--text-muted);
}

/* Result Content & Status / Risk Hierarchy */
.result-status-section, .result-risk-section {
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.result-section-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.prediction-badge-container {
    text-align: center;
}

.prediction-badge {
    display: inline-block;
    padding: 8px 24px;
    border-radius: 30px;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.prediction-badge.normal {
    background: var(--color-normal-bg);
    color: var(--color-normal);
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.prediction-badge.abnormal {
    background: var(--color-abnormal-bg);
    color: var(--color-abnormal);
    border: 1px solid rgba(239, 68, 68, 0.4);
}

/* Gauge Meter */
.gauge-container {
    text-align: center;
}

.gauge-meter {
    height: 14px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.gauge-fill {
    height: 100%;
    width: 0%;
    background: var(--color-risk-low);
    border-radius: 14px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1), background 0.6s ease;
}

.gauge-value {
    margin-bottom: 8px;
}

.stat-number {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.risk-level-indicator {
    margin-top: 10px;
}

.risk-level-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
}

.risk-low { color: var(--color-risk-low); border-color: var(--color-risk-low); background: rgba(16, 185, 129, 0.1); }
.risk-mod { color: var(--color-risk-mod); border-color: var(--color-risk-mod); background: rgba(234, 179, 8, 0.1); }
.risk-elev { color: var(--color-risk-elev); border-color: var(--color-risk-elev); background: rgba(249, 115, 22, 0.1); }
.risk-high { color: var(--color-risk-high); border-color: var(--color-risk-high); background: rgba(239, 68, 68, 0.1); }
.risk-vhigh { color: var(--color-risk-vhigh); border-color: var(--color-risk-vhigh); background: rgba(225, 29, 72, 0.15); }
.risk-crit { color: var(--color-risk-crit); border-color: var(--color-risk-crit); background: rgba(159, 18, 57, 0.2); text-shadow: 0 0 8px rgba(255,0,0,0.5); }

/* Risk Contributors */
.risk-contributors-section {
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.contributors-explanation {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-align: center;
}

.contributors-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}

.contributors-grid::-webkit-scrollbar {
    width: 6px;
}

.contributors-grid::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
}

.contributors-grid::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
}

.contributor-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.2fr;
    align-items: center;
    gap: 12px;
}

.contributor-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.contributor-value {
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
    text-align: right;
}

.contributor-status {
    font-size: 0.85rem;
    font-weight: 600;
    text-align: right;
}

.status-elevated { color: var(--color-risk-elev); }
.status-decreased { color: #3b82f6; }
.status-normal { color: var(--color-risk-low); }
.status-abnormal { color: var(--color-risk-high); }



.details-grid {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.detail-label { color: var(--text-secondary); }
.detail-value { font-weight: 600; color: #fff; }

.clinical-note {
    font-size: 0.85rem;
    padding: 12px;
    border-radius: var(--radius-sm);
    line-height: 1.5;
}

.clinical-note.normal {
    background: rgba(16, 185, 129, 0.1);
    color: #a7f3d0;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.clinical-note.abnormal {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

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

.hidden { display: none !important; }
. r i s k - e x p l a n a t i o n - t e x t   {   f o n t - s i z e :   0 . 7 5 r e m ;   c o l o r :   v a r ( - - t e x t - m u t e d ) ;   m a r g i n - t o p :   1 2 p x ;   l i n e - h e i g h t :   1 . 4 ;   f o n t - s t y l e :   i t a l i c ;   o p a c i t y :   0 . 8 ;   }  
 