/* ==========================================================================
   Census V2 Visual Polish
   Enhanced UI for modern clinical interface
   Uses existing SOL design tokens
   ========================================================================== */

/* --------------------------------------------------------------------------
   STATS GRID - 3-column compact layout
   -------------------------------------------------------------------------- */
.sol-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sol-space-sm);
    padding: var(--sol-space-md);
    background: var(--sol-bg-panel);
    border-radius: var(--sol-radius-md);
    margin-top: var(--sol-space-md);
}

.sol-stat-cell {
    text-align: center;
    padding: var(--sol-space-xs) 0;
}

.sol-stat-cell .sol-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--sol-text-primary);
    line-height: 1.2;
}

.sol-stat-cell .sol-stat-label {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sol-text-tertiary);
    margin-top: var(--sol-space-xs);
}

.sol-stat-cell.sol-stat-critical .sol-stat-value {
    color: var(--sol-critical);
}

.sol-stat-cell.sol-stat-warning .sol-stat-value {
    color: var(--sol-warning);
}

/* --------------------------------------------------------------------------
   FILTER PILLS - Segmented control pattern
   -------------------------------------------------------------------------- */
.sol-filters.sol-filters--pills {
    background: var(--sol-bg-tertiary);
    border-radius: var(--sol-radius-md);
    padding: var(--sol-space-xs);
    display: inline-flex;
    gap: var(--sol-space-xs);
    margin: var(--sol-space-md) 0;
}

.sol-filters--pills .sol-filter-btn {
    border: none;
    background: transparent;
    border-radius: var(--sol-radius-sm);
    padding: var(--sol-space-xs) var(--sol-space-md);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--sol-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.sol-filters--pills .sol-filter-btn:hover {
    color: var(--sol-text-primary);
    background: var(--sol-bg-hover);
}

.sol-filters--pills .sol-filter-btn.active {
    background: var(--sol-bg-elevated);
    color: var(--sol-text-primary);
    box-shadow: var(--sol-shadow-sm);
}

.sol-filters--pills .sol-filter-btn:focus-visible {
    outline: 2px solid var(--sol-accent);
    outline-offset: 2px;
}

/* ==========================================================================
   1. PATIENT HEADER ENHANCEMENT
   ========================================================================== */

/* Larger, gradient avatar with subtle animation */
.sol-patient-header .sol-patient-avatar {
    width: 72px;
    height: 72px;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--sol-accent) 0%, #8b5cf6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sol-patient-header .sol-patient-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 28px rgba(59, 130, 246, 0.4);
}

/* Better patient name typography */
.sol-patient-header .sol-patient-name {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--sol-text-primary);
    margin-bottom: 0.375rem;
}

/* Pill badges for meta items */
.sol-patient-header .sol-patient-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.sol-patient-header .sol-meta-item {
    background: var(--sol-bg-tertiary);
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--sol-text-secondary);
    border: 1px solid var(--sol-border-subtle);
    transition: all 0.2s ease;
}

.sol-patient-header .sol-meta-item:hover {
    background: var(--sol-bg-hover);
    border-color: var(--sol-border);
    color: var(--sol-text-primary);
}

.sol-patient-header .sol-meta-divider {
    display: none; /* Hide dividers, using pills now */
}

/* Subtle glow on patient header */
.sol-patient-header {
    background: linear-gradient(180deg, var(--sol-bg-elevated) 0%, var(--sol-bg-tertiary) 100%);
    border: 1px solid var(--sol-border-subtle);
    border-radius: var(--sol-radius-lg);
    padding: var(--sol-space-xl);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: box-shadow 0.3s ease;
}

.sol-patient-header:hover {
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(59, 130, 246, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   2. CLINICAL PANEL HOVER EFFECTS
   ========================================================================== */

.sol-clinical-panel {
    background: var(--sol-bg-elevated);
    border: 1px solid var(--sol-border-subtle);
    border-radius: var(--sol-radius-lg);
    transition:
        transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.25s ease;
    will-change: transform;
}

.sol-clinical-panel:hover {
    transform: translateY(-2px);
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.2);
}

/* Panel header enhancement */
.sol-clinical-panel .sol-panel-header {
    border-bottom: 1px solid var(--sol-border-subtle);
    padding: var(--sol-space-md) var(--sol-space-lg);
}

.sol-clinical-panel .sol-panel-title {
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--sol-text-primary);
}

.sol-clinical-panel .sol-panel-title svg {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.sol-clinical-panel:hover .sol-panel-title svg {
    opacity: 1;
}

/* Panel count badges */
.sol-clinical-panel .sol-panel-count {
    background: var(--sol-bg-tertiary);
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--sol-text-secondary);
}

/* ==========================================================================
   3. TIMELINE ENHANCEMENTS
   ========================================================================== */

/* Timeline panel special styling */
.sol-timeline-panel {
    background: linear-gradient(180deg, var(--sol-bg-elevated) 0%, rgba(15, 17, 23, 0.95) 100%);
}

/* Better legend styling */
.sol-timeline-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--sol-border-subtle);
    background: rgba(0, 0, 0, 0.2);
}

.sol-legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    color: var(--sol-text-secondary);
    transition: color 0.2s ease;
}

.sol-legend-item:hover {
    color: var(--sol-text-primary);
}

.sol-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sol-legend-item:hover .sol-legend-dot {
    transform: scale(1.25);
    box-shadow: 0 0 8px currentColor;
}

.sol-legend-dot.diagnosis { background: #3b82f6; }
.sol-legend-dot.procedure { background: #10b981; }
.sol-legend-dot.consult { background: #f59e0b; }
.sol-legend-dot.medication { background: #8b5cf6; }
.sol-legend-dot.lab-critical { background: #ef4444; }
.sol-legend-dot.clinical-change { background: #06b6d4; }

/* Timeline track gradient */
.sol-timeline-track {
    background: linear-gradient(90deg,
        rgba(59, 130, 246, 0.1) 0%,
        rgba(139, 92, 246, 0.05) 50%,
        rgba(59, 130, 246, 0.1) 100%);
}

/* Event marker pulse animation */
@keyframes marker-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
}

.sol-timeline-events-layer [class*="event-marker"]:hover {
    animation: marker-pulse 1.5s ease-in-out infinite;
    transform: scale(1.3);
    z-index: 10;
}

/* Detail panel entrance */
.sol-timeline-detail-panel {
    background: var(--sol-bg-elevated);
    border: 1px solid var(--sol-border);
    border-radius: var(--sol-radius-md);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    animation: detail-slide-in 0.2s ease-out;
}

@keyframes detail-slide-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   4. PATIENT CARD ENHANCEMENTS (Sidebar)
   Main styles in sol-layout.css - this file only adds the ::before left bar
   ========================================================================== */

/* Left severity indicator bar - subtle glow, not bright solid */
.sol-patient-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: rgba(34, 197, 94, 0.6);
    border-radius: 12px 0 0 12px;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
}

/* Severity colors - muted with glow */
.sol-patient-card--critical::before,
.sol-patient-card.critical::before,
.sol-patient-card.high::before,
.sol-patient-card--high::before {
    background: rgba(239, 68, 68, 0.7);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.sol-patient-card--worsening::before,
.sol-patient-card.worsening::before {
    background: rgba(245, 158, 11, 0.7);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
}

.sol-patient-card--stable::before,
.sol-patient-card.stable::before {
    background: rgba(34, 197, 94, 0.6);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
}

/* Hover: slightly widen and brighten */
.sol-patient-card:hover::before {
    width: 4px;
}

.sol-patient-card.selected::before {
    width: 4px;
    background: rgba(59, 130, 246, 0.8);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
}

/* ==========================================================================
   5. BUTTON & ACTION POLISH
   ========================================================================== */

/* Primary button gradient */
.sol-action-btn.primary,
.sol-quick-action-btn--primary {
    background: linear-gradient(135deg, var(--sol-accent) 0%, #6366f1 100%);
    border: none;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.sol-action-btn.primary:hover,
.sol-quick-action-btn--primary:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
}

.sol-action-btn.primary:active,
.sol-quick-action-btn--primary:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* All action buttons base */
.sol-action-btn,
.sol-quick-action-btn {
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease,
        border-color 0.15s ease;
}

.sol-action-btn:hover,
.sol-quick-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sol-action-btn:active,
.sol-quick-action-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Focus rings for accessibility */
.sol-action-btn:focus-visible,
.sol-quick-action-btn:focus-visible,
button:focus-visible {
    outline: 2px solid var(--sol-accent);
    outline-offset: 2px;
}

/* Icon hover animation */
.sol-action-btn svg,
.sol-quick-action-btn svg {
    transition: transform 0.2s ease;
}

.sol-action-btn:hover svg,
.sol-quick-action-btn:hover svg {
    transform: scale(1.1);
}

/* ==========================================================================
   6. SKELETON LOADER ENHANCEMENT
   ========================================================================== */

@keyframes enhanced-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.sol-skeleton-card,
.sol-panel-skeleton .sol-skeleton-line,
.sol-skeleton-dot {
    background: linear-gradient(
        90deg,
        var(--sol-bg-tertiary) 0%,
        var(--sol-bg-hover) 25%,
        var(--sol-bg-elevated) 50%,
        var(--sol-bg-hover) 75%,
        var(--sol-bg-tertiary) 100%
    );
    background-size: 200% 100%;
    animation: enhanced-shimmer 2s ease-in-out infinite;
    border-radius: var(--sol-radius-sm);
}

/* Staggered animation delays */
.sol-skeleton-card:nth-child(1) { animation-delay: 0s; }
.sol-skeleton-card:nth-child(2) { animation-delay: 0.1s; }
.sol-skeleton-card:nth-child(3) { animation-delay: 0.2s; }
.sol-skeleton-card:nth-child(4) { animation-delay: 0.3s; }

.sol-panel-skeleton .sol-skeleton-line:nth-child(1) { animation-delay: 0s; }
.sol-panel-skeleton .sol-skeleton-line:nth-child(2) { animation-delay: 0.08s; }
.sol-panel-skeleton .sol-skeleton-line:nth-child(3) { animation-delay: 0.16s; }
.sol-panel-skeleton .sol-skeleton-line:nth-child(4) { animation-delay: 0.24s; }

/* Loading skeleton cards */
.sol-loading-skeleton .sol-skeleton-card {
    height: 80px;
    margin-bottom: var(--sol-space-sm);
    border-radius: var(--sol-radius-md);
}

/* ==========================================================================
   7. MICRO-INTERACTIONS
   ========================================================================== */

/* Toast slide-in animation */
.sol-toast-container .sol-toast {
    animation: toast-slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes toast-slide-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Modal backdrop blur */
.sol-modal-overlay {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    background: rgba(0, 0, 0, 0.6);
    transition: backdrop-filter 0.2s ease;
}

/* Modal content entrance */
.sol-modal-content {
    animation: modal-entrance 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modal-entrance {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Smooth scroll for panel content */
.sol-panel-content,
.sol-patient-list {
    scroll-behavior: smooth;
}

/* Scrollbar styling */
.sol-panel-content::-webkit-scrollbar,
.sol-patient-list::-webkit-scrollbar {
    width: 6px;
}

.sol-panel-content::-webkit-scrollbar-track,
.sol-patient-list::-webkit-scrollbar-track {
    background: transparent;
}

.sol-panel-content::-webkit-scrollbar-thumb,
.sol-patient-list::-webkit-scrollbar-thumb {
    background: var(--sol-border);
    border-radius: 3px;
}

.sol-panel-content::-webkit-scrollbar-thumb:hover,
.sol-patient-list::-webkit-scrollbar-thumb:hover {
    background: var(--sol-text-tertiary);
}

/* New data pulse indicator */
@keyframes data-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.sol-data-updated {
    animation: data-pulse 1s ease-in-out 3;
}

/* Status dot animations */
.sol-status-dot.online {
    animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(34, 197, 94, 0);
    }
}

/* ==========================================================================
   PATIENT HEADER V2 - Mission Control Redesign (2025-12-10)
   Timeline-centric clinical reasoning interface
   ========================================================================== */

/* Base header V2 container */
.sol-patient-header.sol-header-v2 {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    background: linear-gradient(180deg,
        var(--sol-bg-elevated) 0%,
        rgba(15, 17, 23, 0.98) 100%);
    border: 1px solid var(--sol-border-subtle);
    border-radius: var(--sol-radius-lg);
    overflow: hidden;
}

/* Row 1: Identity + Severity */
.sol-header-identity-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: var(--sol-space-lg) var(--sol-space-xl);
    background: linear-gradient(135deg,
        rgba(59, 130, 246, 0.05) 0%,
        transparent 50%);
}

.sol-header-v2 .sol-patient-identity {
    display: flex;
    align-items: center;
    gap: var(--sol-space-lg);
}

.sol-header-v2 .sol-patient-avatar {
    width: 64px;
    height: 64px;
    font-size: 1.375rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--sol-accent) 0%, #8b5cf6 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow:
        0 4px 16px rgba(59, 130, 246, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.sol-header-v2 .sol-patient-info {
    display: flex;
    flex-direction: column;
    gap: var(--sol-space-xs);
}

.sol-name-row {
    display: flex;
    align-items: center;
    gap: var(--sol-space-md);
}

.sol-header-v2 .sol-patient-name {
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--sol-text-primary);
    margin: 0;
}

/* Severity badge - inline with name */
.sol-severity-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
}

.sol-severity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: severity-pulse 2s ease-in-out infinite;
}

@keyframes severity-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

/* Severity states */
.sol-severity-badge[data-severity="stable"] {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.sol-severity-badge[data-severity="stable"] .sol-severity-dot {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.sol-severity-badge[data-severity="worsening"] {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.sol-severity-badge[data-severity="worsening"] .sol-severity-dot {
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.sol-severity-badge[data-severity="critical"],
.sol-severity-badge[data-severity="high"] {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.sol-severity-badge[data-severity="critical"] .sol-severity-dot,
.sol-severity-badge[data-severity="high"] .sol-severity-dot {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.sol-severity-badge[data-severity="improving"] {
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
    border: 1px solid rgba(6, 182, 212, 0.3);
}
.sol-severity-badge[data-severity="improving"] .sol-severity-dot {
    background: #06b6d4;
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.5);
}

/* Meta items - compact pills */
.sol-header-v2 .sol-patient-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sol-header-v2 .sol-meta-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--sol-text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Mini action buttons (top right) */
.sol-header-actions-mini {
    display: flex;
    gap: 8px;
}

.sol-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--sol-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sol-icon-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--sol-accent);
    transform: translateY(-1px);
}

.sol-icon-btn svg {
    width: 18px;
    height: 18px;
}

/* Row 2: Trajectory Bar */
.sol-trajectory-bar {
    display: flex;
    align-items: center;
    padding: var(--sol-space-md) var(--sol-space-xl);
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    gap: 0;
}

.sol-trajectory-segment {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 var(--sol-space-lg);
}

.sol-trajectory-segment:first-child {
    padding-left: 0;
}

.sol-traj-label {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sol-text-tertiary);
}

.sol-traj-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--sol-text-primary);
}

.sol-trajectory-divider {
    width: 1px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 var(--sol-space-sm);
}

.sol-trajectory-spacer {
    flex: 1;
}

/* Progress indicator with directional arrow */
.sol-progress-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sol-progress-arrow {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

/* Progress states */
.sol-progress-indicator[data-trend="improving"] {
    color: #22c55e;
}
.sol-progress-indicator[data-trend="improving"] .sol-progress-arrow {
    transform: rotate(0deg);
}

.sol-progress-indicator[data-trend="stable"] {
    color: var(--sol-text-secondary);
}
.sol-progress-indicator[data-trend="stable"] .sol-progress-arrow {
    transform: rotate(90deg);
}

.sol-progress-indicator[data-trend="worsening"] {
    color: #ef4444;
}
.sol-progress-indicator[data-trend="worsening"] .sol-progress-arrow {
    transform: rotate(180deg);
}

/* Trajectory actions */
.sol-trajectory-actions {
    display: flex;
    gap: 8px;
}

.sol-action-btn.compact {
    padding: 6px 12px;
    font-size: 0.8125rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

/* Row 3: Clinical Signals - Compact chips */
.sol-signals-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: var(--sol-space-sm) var(--sol-space-xl);
    background: rgba(0, 0, 0, 0.2);
    min-height: 0;
}

.sol-signals-row:empty {
    display: none;
}

.sol-signal-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sol-signal-chip.critical {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.sol-signal-chip.warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.sol-signal-chip.info {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.sol-signal-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.sol-signal-icon {
    font-size: 0.875rem;
}

.sol-signal-dismiss {
    opacity: 0.5;
    font-size: 1rem;
    line-height: 1;
    margin-left: 2px;
    transition: opacity 0.15s ease;
}

.sol-signal-chip:hover .sol-signal-dismiss {
    opacity: 1;
}

/* Hide V2 header when not visible */
.sol-header-v2:not(.visible) {
    display: none;
}

/* ==========================================================================
   8. SPARKLINE STYLES - Inline Trend Visualization (2025-12-10)
   ========================================================================== */

/* Base sparkline SVG */
.sparkline {
    display: inline-block;
    vertical-align: middle;
    margin-left: 6px;
}

.sparkline-no-data {
    opacity: 0.5;
}

/* Lab item with sparkline - enhanced layout */
.sol-lab-item.with-sparkline {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 8px;
}

.sol-lab-item.with-sparkline .sol-lab-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sol-lab-item.with-sparkline .sol-lab-value {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sol-lab-item.with-sparkline .sol-lab-sparkline {
    flex-shrink: 0;
}

/* Vital item with sparkline */
.sol-vital-item.with-sparkline {
    position: relative;
}

.sol-vital-item.with-sparkline .sol-vital-sparkline {
    position: absolute;
    bottom: 4px;
    right: 4px;
    opacity: 0.8;
}

.sol-vital-item.with-sparkline:hover .sol-vital-sparkline {
    opacity: 1;
}

/* Inline lab+sparkline combo (for dense displays) */
.lab-sparkline-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    font-size: 0.8125rem;
    transition: background 0.15s ease;
}

.lab-sparkline-inline:hover {
    background: rgba(255, 255, 255, 0.06);
}

.lab-sparkline-inline .lab-name {
    font-weight: 600;
    color: var(--sol-text-secondary);
    min-width: 36px;
}

.lab-sparkline-inline .lab-value {
    font-weight: 600;
    color: var(--sol-text-primary);
}

.lab-sparkline-inline .lab-unit {
    font-size: 0.6875rem;
    color: var(--sol-text-tertiary);
    margin-left: 2px;
}

/* Trend colors for inline labs */
.lab-sparkline-inline.trend-up .lab-value {
    color: #ef4444;
}

.lab-sparkline-inline.trend-down .lab-value {
    color: #22c55e;
}

.lab-sparkline-inline.trend-flat .lab-value {
    color: var(--sol-text-primary);
}

/* Header sparklines row - compact vital trends */
.sol-header-sparklines {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: var(--sol-space-sm) var(--sol-space-xl);
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.sol-header-sparkline-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sol-header-sparkline-item .vital-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--sol-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 28px;
}

.sol-header-sparkline-item .vital-current {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--sol-text-primary);
}

.sol-header-sparkline-item .vital-current.critical {
    color: #ef4444;
}

.sol-header-sparkline-item .vital-current.warning {
    color: #f59e0b;
}

/* Reference range indicator in sparkline tooltip */
.sparkline-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: var(--sol-bg-elevated);
    border: 1px solid var(--sol-border);
    border-radius: 4px;
    font-size: 0.6875rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 100;
}

.lab-sparkline-inline:hover .sparkline-tooltip {
    opacity: 1;
}

/* ==========================================================================
   ACCESSIBILITY: Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
