/* ============================================
   PROGRESS NOTE REDESIGN - "VITAL SIGNS" AESTHETIC
   ============================================
   ARCHITECTURE: Modern clinical monitoring UI with real-time feedback
   WHY: Transform generic dark dashboard into memorable medical experience
   TRADEOFF: More CSS complexity for significantly better UX/visual impact

   DESIGN PRINCIPLES:
   1. Every element should feel "alive" - subtle animations everywhere
   2. Severity is immediately visible through color + scale + position
   3. The workflow feels like monitoring vital signs - urgent but calm
   4. Typography establishes clinical credibility
   ============================================ */

/* ============================================
   CUSTOM PROPERTIES - VITAL SIGNS PALETTE
   ============================================ */
:root {
    /* Base Colors - Deep Medical Navy */
    --vital-bg-deep: #050810;
    --vital-bg-base: #0a0f1a;
    --vital-bg-elevated: #111827;
    --vital-bg-card: #1a2332;
    --vital-bg-hover: #243044;

    /* Clinical Accent Colors */
    --vital-critical: #FF6B6B;
    --vital-critical-glow: rgba(255, 107, 107, 0.25);
    --vital-critical-soft: rgba(255, 107, 107, 0.12);

    --vital-warning: #FFB84D;
    --vital-warning-glow: rgba(255, 184, 77, 0.25);
    --vital-warning-soft: rgba(255, 184, 77, 0.12);

    --vital-improving: #4ADE80;
    --vital-improving-glow: rgba(74, 222, 128, 0.25);
    --vital-improving-soft: rgba(74, 222, 128, 0.12);

    --vital-stable: #60A5FA;
    --vital-stable-glow: rgba(96, 165, 250, 0.25);
    --vital-stable-soft: rgba(96, 165, 250, 0.12);

    --vital-ai: #A78BFA;
    --vital-ai-glow: rgba(167, 139, 250, 0.3);
    --vital-ai-soft: rgba(167, 139, 250, 0.15);

    /* Text Hierarchy */
    --vital-text-bright: #F8FAFC;
    --vital-text-primary: #E2E8F0;
    --vital-text-secondary: #94A3B8;
    --vital-text-muted: #64748B;
    --vital-text-faint: #475569;

    /* Borders & Lines */
    --vital-border: rgba(148, 163, 184, 0.15);
    --vital-border-active: rgba(167, 139, 250, 0.4);
    --vital-border-glow: rgba(167, 139, 250, 0.6);

    /* Timing Functions */
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-snap: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ============================================
   TYPOGRAPHY - Uses locally hosted fonts from fonts.css
   JetBrains Mono for clinical data, Inter for body text
   ============================================ */

/* ============================================
   CONTAINER OVERRIDE - VITAL SIGNS THEME
   ============================================ */
.problem-approval-container {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: var(--vital-bg-deep);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--vital-border);
    z-index: 10;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Glass morphism effect */
    backdrop-filter: blur(20px);

    /* Entry animation */
    animation: containerSlideIn 0.5s var(--ease-spring) both;
}

@keyframes containerSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   HEADER - PHASE INDICATOR + VITAL METRICS
   ============================================ */
.problem-approval-header {
    flex-shrink: 0;
    padding: 0;
    background: transparent;
    border-bottom: none;
    position: relative;
}

/* Phase Progress Bar - Top Edge */
.vital-phase-progress {
    height: 3px;
    background: var(--vital-bg-elevated);
    position: relative;
    overflow: hidden;
}

.vital-phase-progress::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: var(--phase-progress, 0%);
    background: linear-gradient(90deg, var(--vital-ai), var(--vital-improving));
    transition: width 0.6s var(--ease-smooth);
    box-shadow: 0 0 20px var(--vital-ai-glow);
}

/* Header Content */
.vital-header-content {
    padding: 20px 24px 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    align-items: start;
}

.vital-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vital-phase-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--vital-ai-soft);
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 20px;
    width: fit-content;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: var(--vital-ai);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    animation: phaseBadgePulse 2s ease-in-out infinite;
}

@keyframes phaseBadgePulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--vital-ai-glow); }
    50% { box-shadow: 0 0 12px 4px var(--vital-ai-glow); }
}

.vital-phase-badge .phase-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--vital-ai);
    animation: phaseDotPulse 1s ease-in-out infinite;
}

@keyframes phaseDotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.vital-phase-badge.complete {
    background: var(--vital-improving-soft);
    border-color: rgba(74, 222, 128, 0.3);
    color: var(--vital-improving);
    animation: none;
}

.vital-phase-badge.complete .phase-dot {
    background: var(--vital-improving);
    animation: none;
}

.vital-header-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--vital-text-bright);
    margin: 8px 0 4px;
    letter-spacing: -0.02em;
}

.vital-header-subtitle {
    font-size: 14px;
    color: var(--vital-text-secondary);
    max-width: 400px;
}

/* Vital Metrics Grid - Right Side */
.vital-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.vital-metric {
    background: var(--vital-bg-elevated);
    border: 1px solid var(--vital-border);
    border-radius: 12px;
    padding: 12px 16px;
    min-width: 100px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s var(--ease-smooth);
}

.vital-metric::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--metric-color, var(--vital-text-muted));
    opacity: 0.6;
    transition: opacity 0.3s;
}

.vital-metric:hover::before {
    opacity: 1;
}

.vital-metric:hover {
    transform: translateY(-2px);
    border-color: var(--metric-color, var(--vital-border-active));
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.vital-metric-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    color: var(--vital-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.vital-metric-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 28px;
    font-weight: 700;
    color: var(--vital-text-bright);
    line-height: 1;
}

.vital-metric-status {
    font-size: 11px;
    color: var(--vital-text-secondary);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.vital-metric.processing .vital-metric-value {
    color: var(--vital-ai);
}

.vital-metric.problems { --metric-color: var(--vital-stable); }
.vital-metric.suggestions { --metric-color: var(--vital-warning); }
.vital-metric.selected { --metric-color: var(--vital-improving); }

/* Processing Animation in Metric */
.metric-processing-wave {
    display: flex;
    gap: 3px;
    align-items: flex-end;
    height: 12px;
}

.metric-processing-wave span {
    width: 3px;
    background: var(--vital-ai);
    border-radius: 2px;
    animation: waveBar 1s ease-in-out infinite;
}

.metric-processing-wave span:nth-child(1) { animation-delay: 0s; }
.metric-processing-wave span:nth-child(2) { animation-delay: 0.1s; }
.metric-processing-wave span:nth-child(3) { animation-delay: 0.2s; }
.metric-processing-wave span:nth-child(4) { animation-delay: 0.3s; }

@keyframes waveBar {
    0%, 100% { height: 4px; }
    50% { height: 12px; }
}

/* FIX (2026-01-13): Explicitly stop animations when hidden */
/* WHY: hidden attribute sets display:none but animations may not stop in all browsers */
.metric-processing-wave[hidden],
.metric-processing-wave[hidden] span {
    animation: none !important;
    display: none !important;
}

/* FIX (2026-01-13): Stop wave animation when suggestions are complete */
.vital-metric.suggestions.complete .metric-processing-wave,
.vital-metric.suggestions.complete .metric-processing-wave span {
    animation: none;
    display: none;
}

/* ============================================
   BODY - SCROLLABLE CONTENT AREA
   ============================================ */
.problem-approval-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 0;
    background: var(--vital-bg-base);
    position: relative;
}

/* Gradient fade at top and bottom */
.problem-approval-body::before,
.problem-approval-body::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 40px;
    pointer-events: none;
    z-index: 5;
}

.problem-approval-body::before {
    top: 0;
    background: linear-gradient(to bottom, var(--vital-bg-base), transparent);
}

.problem-approval-body::after {
    bottom: 0;
    background: linear-gradient(to top, var(--vital-bg-base), transparent);
}

/* Grid Layout - Main Content + Sidebar */
.problem-modal-content {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 0;
    min-height: 0;
    height: 100%;
}

.approval-main-content {
    overflow-y: auto;
    min-height: 0;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
.approval-main-content::-webkit-scrollbar {
    width: 6px;
}

.approval-main-content::-webkit-scrollbar-track {
    background: transparent;
}

.approval-main-content::-webkit-scrollbar-thumb {
    background: var(--vital-text-faint);
    border-radius: 3px;
}

.approval-main-content::-webkit-scrollbar-thumb:hover {
    background: var(--vital-text-muted);
}

/* ============================================
   SEVERITY GROUPS - VITAL SIGNS SECTIONS
   ============================================ */
.severity-group {
    margin-bottom: 0;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--group-border, var(--vital-border));
    background: var(--group-bg, var(--vital-bg-elevated));
    transition: all 0.3s var(--ease-smooth);
    animation: groupSlideIn 0.4s var(--ease-spring) both;
    animation-delay: var(--stagger-delay, 0ms);
}

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

.severity-group:hover {
    border-color: var(--group-accent, var(--vital-border-active));
}

.severity-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    cursor: pointer;
    transition: background 0.2s var(--ease-smooth);
    position: relative;
}

.severity-group-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--group-accent, var(--vital-text-muted));
    border-radius: 0 4px 4px 0;
}

.severity-group-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.severity-group-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 14px;
    color: var(--group-text, var(--vital-text-primary));
}

.severity-group-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: var(--group-icon-bg, var(--vital-bg-card));
    color: var(--group-accent, var(--vital-text-secondary));
    transition: all 0.3s var(--ease-spring);
}

.severity-group:hover .severity-group-icon {
    transform: scale(1.1);
    box-shadow: 0 0 16px var(--group-glow, transparent);
}

.severity-group-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--group-count-bg, rgba(255, 255, 255, 0.08));
    color: var(--group-accent, var(--vital-text-secondary));
}

/* Severity Group Variants */
.severity-group.critical {
    --group-border: rgba(255, 107, 107, 0.25);
    --group-bg: linear-gradient(135deg, rgba(255, 107, 107, 0.08), transparent);
    --group-accent: var(--vital-critical);
    --group-text: var(--vital-critical);
    --group-icon-bg: var(--vital-critical-soft);
    --group-glow: var(--vital-critical-glow);
    --group-count-bg: var(--vital-critical-soft);
}

.severity-group.improving {
    --group-border: rgba(74, 222, 128, 0.25);
    --group-bg: linear-gradient(135deg, rgba(74, 222, 128, 0.06), transparent);
    --group-accent: var(--vital-improving);
    --group-text: var(--vital-improving);
    --group-icon-bg: var(--vital-improving-soft);
    --group-glow: var(--vital-improving-glow);
    --group-count-bg: var(--vital-improving-soft);
}

.severity-group.active {
    --group-border: rgba(96, 165, 250, 0.25);
    --group-bg: linear-gradient(135deg, rgba(96, 165, 250, 0.06), transparent);
    --group-accent: var(--vital-stable);
    --group-text: var(--vital-stable);
    --group-icon-bg: var(--vital-stable-soft);
    --group-glow: var(--vital-stable-glow);
    --group-count-bg: var(--vital-stable-soft);
}

.severity-group.chronic {
    --group-border: rgba(255, 184, 77, 0.2);
    --group-bg: linear-gradient(135deg, rgba(255, 184, 77, 0.05), transparent);
    --group-accent: var(--vital-warning);
    --group-text: var(--vital-warning);
    --group-icon-bg: var(--vital-warning-soft);
    --group-glow: var(--vital-warning-glow);
    --group-count-bg: var(--vital-warning-soft);
}

.severity-group.labs {
    --group-border: rgba(167, 139, 250, 0.2);
    --group-bg: linear-gradient(135deg, rgba(167, 139, 250, 0.05), transparent);
    --group-accent: var(--vital-ai);
    --group-text: var(--vital-ai);
    --group-icon-bg: var(--vital-ai-soft);
    --group-glow: var(--vital-ai-glow);
    --group-count-bg: var(--vital-ai-soft);
}

.severity-group-body {
    padding: 12px 16px 16px;
}

.severity-group-body.collapsed {
    display: none;
}

/* Collapse/Expand Animation */
.severity-group-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--vital-text-muted);
}

.severity-group-toggle i {
    transition: transform 0.3s var(--ease-smooth);
}

.severity-group.collapsed .severity-group-toggle i {
    transform: rotate(-90deg);
}

/* ============================================
   PROBLEM CARDS - VITAL SIGN DISPLAYS
   ============================================ */
.problem-item-compact {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--vital-bg-card);
    border-radius: 12px;
    margin-bottom: 8px;
    border: 1px solid transparent;
    transition: all 0.25s var(--ease-smooth);
    position: relative;
    cursor: pointer;
    animation: problemFadeIn 0.35s var(--ease-spring) both;
    animation-delay: var(--problem-delay, 0ms);
}

@keyframes problemFadeIn {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.problem-item-compact:last-child {
    margin-bottom: 0;
}

.problem-item-compact:hover {
    background: var(--vital-bg-hover);
    border-color: var(--vital-border-active);
    transform: translateX(4px);
}

.problem-item-compact.is-selected {
    border-color: var(--vital-ai);
    box-shadow: 0 0 0 1px var(--vital-ai), 0 4px 16px var(--vital-ai-glow);
}

/* Checkbox Styling */
.problem-item-compact input[type="checkbox"] {
    appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid var(--vital-text-muted);
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s var(--ease-spring);
    flex-shrink: 0;
}

.problem-item-compact input[type="checkbox"]:checked {
    background: var(--vital-ai);
    border-color: var(--vital-ai);
}

.problem-item-compact input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 3px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.problem-item-compact input[type="checkbox"]:hover {
    border-color: var(--vital-ai);
    box-shadow: 0 0 0 3px var(--vital-ai-soft);
}

.problem-item-compact input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--vital-stable);
    outline-offset: 2px;
}

/* Problem Name */
.problem-item-compact .problem-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--vital-text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.problem-item-compact .problem-name .text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Status Badge */
.problem-item-compact .problem-status-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.problem-status-badge.ai {
    background: var(--vital-ai-soft);
    color: var(--vital-ai);
    border: 1px solid rgba(167, 139, 250, 0.3);
}

.problem-status-badge.manual {
    background: var(--vital-stable-soft);
    color: var(--vital-stable);
    border: 1px solid rgba(96, 165, 250, 0.3);
}

/* Trend Arrow */
.problem-trend-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--vital-bg-elevated);
    flex-shrink: 0;
}

.problem-trend-compact svg {
    width: 16px;
    height: 16px;
}

.problem-trend-compact.worsening {
    color: var(--vital-critical);
    background: var(--vital-critical-soft);
}
.problem-trend-compact.improving {
    color: var(--vital-improving);
    background: var(--vital-improving-soft);
}
.problem-trend-compact.stable {
    color: var(--vital-warning);
    background: var(--vital-warning-soft);
}

/* Confidence Score */
.problem-confidence {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--vital-text-muted);
    min-width: 40px;
    text-align: right;
}

.problem-confidence.high { color: var(--vital-improving); }
.problem-confidence.medium { color: var(--vital-warning); }
.problem-confidence.low { color: var(--vital-critical); }

/* ============================================
   CONSOLIDATION SUGGESTIONS - AI INSIGHTS
   ============================================ */
.smart-suggestions-section {
    background: linear-gradient(135deg, var(--vital-ai-soft), transparent);
    border: 1px solid rgba(167, 139, 250, 0.2);
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
    animation: suggestionsSlideIn 0.5s var(--ease-spring) both;
    animation-delay: 200ms;
}

@keyframes suggestionsSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.suggestion-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(167, 139, 250, 0.08);
    border-bottom: 1px solid rgba(167, 139, 250, 0.15);
}

.suggestion-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--vital-ai);
}

.suggestion-section-title i {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--vital-ai-soft);
    border-radius: 10px;
    font-size: 16px;
}

.suggestion-count-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    background: var(--vital-ai);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
}

.suggestion-list {
    padding: 12px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Suggestion Card */
.suggestion-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--vital-bg-card);
    border-radius: 12px;
    border: 1px solid var(--vital-border);
    transition: all 0.25s var(--ease-smooth);
    animation: suggestionFadeIn 0.4s var(--ease-spring) both;
    animation-delay: var(--suggestion-delay, 0ms);
}

@keyframes suggestionFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.suggestion-card:hover {
    border-color: var(--vital-ai);
    background: var(--vital-bg-hover);
}

.suggestion-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.suggestion-icon.merge {
    background: var(--vital-ai-soft);
    color: var(--vital-ai);
}

.suggestion-icon.duplicate {
    background: var(--vital-warning-soft);
    color: var(--vital-warning);
}

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

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

.suggestion-title .child-name {
    color: var(--vital-warning);
}

.suggestion-title .parent-name {
    color: var(--vital-ai);
}

.suggestion-rationale {
    font-size: 12px;
    color: var(--vital-text-secondary);
    line-height: 1.4;
}

.suggestion-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.suggestion-btn {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s var(--ease-smooth);
}

.suggestion-btn.accept {
    background: var(--vital-improving-soft);
    color: var(--vital-improving);
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.suggestion-btn.accept:hover {
    background: var(--vital-improving);
    color: white;
    transform: scale(1.05);
}

.suggestion-btn.dismiss {
    background: transparent;
    color: var(--vital-text-muted);
    border: 1px solid var(--vital-border);
}

.suggestion-btn.dismiss:hover {
    background: var(--vital-critical-soft);
    color: var(--vital-critical);
    border-color: rgba(255, 107, 107, 0.3);
}

/* ============================================
   SIDEBAR - PROBLEM TREE OVERVIEW
   ============================================ */
.problem-tree-sidebar {
    background: var(--vital-bg-elevated);
    border-left: 1px solid var(--vital-border);
    padding: 20px 16px;
    overflow-y: auto;
    min-height: 0;
}

.problem-tree-sidebar h5 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--vital-text-muted);
    margin: 0 0 16px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--vital-border);
}

.tree-severity-group {
    margin-bottom: 16px;
}

.tree-severity-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--vital-text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    padding-left: 8px;
}

.tree-severity-label .tree-icon {
    font-size: 12px;
}

.tree-problem-item {
    font-size: 12px;
    padding: 8px 10px;
    color: var(--vital-text-primary);
    border-left: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth);
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 6px;
    margin-left: 8px;
}

.tree-problem-item:hover {
    background: var(--vital-bg-hover);
    border-left-color: var(--vital-ai);
}

.tree-problem-item.is-unchecked {
    opacity: 0.4;
}

.tree-problem-item.is-unchecked .tree-problem-title {
    text-decoration: line-through;
}

.tree-problem-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-trend-icon {
    font-size: 11px;
    flex-shrink: 0;
}

.tree-trend-icon.worsening { color: var(--vital-critical); }
.tree-trend-icon.improving { color: var(--vital-improving); }
.tree-trend-icon.stable { color: var(--vital-warning); }

/* ============================================
   FOOTER - GENERATE ACTION
   ============================================ */
.problem-approval-footer {
    flex-shrink: 0;
    padding: 20px 24px;
    background: var(--vital-bg-elevated);
    border-top: 1px solid var(--vital-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.problem-footer-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--vital-text-secondary);
}

.problem-footer-info .selection-count {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--vital-ai);
}

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

.problem-footer-secondary {
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    background: transparent;
    color: var(--vital-text-secondary);
    border: 1px solid var(--vital-border);
    transition: all 0.2s var(--ease-smooth);
}

.problem-footer-secondary:hover {
    border-color: var(--vital-critical);
    color: var(--vital-critical);
    background: var(--vital-critical-soft);
}

.problem-footer-primary {
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--vital-ai), #8B5CF6);
    color: white;
    border: none;
    transition: all 0.3s var(--ease-spring);
    position: relative;
    overflow: hidden;
}

.problem-footer-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.problem-footer-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--vital-ai-glow);
}

.problem-footer-primary:hover::before {
    opacity: 1;
}

.problem-footer-primary:active {
    transform: translateY(0);
}

.problem-footer-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ============================================
   LOADING STATE - EKG WAVEFORM
   ============================================ */
.problem-modal-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
}

.vital-loading-container {
    margin-bottom: 32px;
}

/* EKG Waveform Animation */
.ekg-waveform {
    width: 200px;
    height: 60px;
    position: relative;
}

.ekg-waveform svg {
    width: 100%;
    height: 100%;
}

.ekg-line {
    fill: none;
    stroke: var(--vital-ai);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    animation: ekgDraw 2s ease-in-out infinite;
}

@keyframes ekgDraw {
    0% {
        stroke-dashoffset: 400;
        opacity: 0.3;
    }
    50% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
    100% {
        stroke-dashoffset: -400;
        opacity: 0.3;
    }
}

.vital-loading-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--vital-text-primary);
    margin-bottom: 8px;
}

.vital-loading-hint {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--vital-text-muted);
}

/* ============================================
   ERROR STATE
   ============================================ */
.problem-modal-state--error {
    background: var(--vital-critical-soft);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 16px;
    margin: 20px;
}

.vital-error-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--vital-critical-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 28px;
    color: var(--vital-critical);
}

.vital-error-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--vital-critical);
    margin-bottom: 8px;
}

.vital-error-message {
    font-size: 14px;
    color: var(--vital-text-secondary);
    max-width: 400px;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */
@media (max-width: 1200px) {
    .vital-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .problem-modal-content {
        grid-template-columns: 1fr 180px;
    }
}

@media (max-width: 900px) {
    .vital-header-content {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .vital-metrics-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .problem-modal-content {
        grid-template-columns: 1fr;
    }

    .problem-tree-sidebar {
        display: none;
    }
}

@media (max-width: 600px) {
    .vital-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .vital-metric-value {
        font-size: 22px;
    }

    .problem-footer-actions {
        flex-direction: column;
        width: 100%;
    }

    .problem-footer-secondary,
    .problem-footer-primary {
        width: 100%;
        text-align: center;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .problem-approval-container {
        background: white;
        color: black;
    }

    .severity-group,
    .problem-item-compact,
    .suggestion-card {
        border: 1px solid #ccc;
        background: white;
    }
}
