/* ============================================
   LedgerIQ Premium Dashboard - Visual Transformation
   "Software that LOOKS like it does what you want"
   ============================================ */

/* ============================================
   PHASE 1: PREMIUM COLOR SYSTEM
   Trust-inspiring, sophisticated palette
   ============================================ */

:root {
    /* Primary - Deep Navy (Trust & Sophistication) */
    --premium-navy-900: #0f172a;
    --premium-navy-800: #1e293b;
    --premium-navy-700: #334155;
    --premium-navy-600: #475569;
    --premium-navy-500: #64748b;

    /* Accent - Emerald (Growth & LedgerIQ Brand) */
    --premium-emerald-500: #10b981;
    --premium-emerald-400: #34d399;
    --premium-emerald-600: #059669;
    --premium-emerald-glow: rgba(16, 185, 129, 0.3);

    /* Positive - Teal */
    --premium-teal-500: #14b8a6;
    --premium-teal-400: #2dd4bf;

    /* Warning - Amber */
    --premium-amber-500: #f59e0b;
    --premium-amber-400: #fbbf24;

    /* Negative - Rose */
    --premium-rose-500: #f43f5e;
    --premium-rose-400: #fb7185;

    /* Surfaces - Warm grays with subtle blue undertone */
    --premium-surface-50: #f8fafc;
    --premium-surface-100: #f1f5f9;
    --premium-surface-200: #e2e8f0;
    --premium-surface-300: #cbd5e1;
    --premium-surface-800: #1e293b;
    --premium-surface-900: #0f172a;

    /* Glass Effects */
    --premium-glass-bg: rgba(255, 255, 255, 0.03);
    --premium-glass-border: rgba(255, 255, 255, 0.08);
    --premium-glass-highlight: rgba(255, 255, 255, 0.12);

    /* Premium Shadows */
    --premium-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --premium-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --premium-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --premium-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --premium-shadow-glow-emerald: 0 0 40px rgba(16, 185, 129, 0.15);
    --premium-shadow-glow-rose: 0 0 40px rgba(244, 63, 94, 0.15);

    /* Premium Typography */
    --premium-font-display: 'SF Pro Display', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --premium-font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --premium-font-mono: 'SF Mono', 'Fira Code', monospace;

    /* Transitions */
    --premium-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --premium-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --premium-duration-fast: 150ms;
    --premium-duration-base: 250ms;
    --premium-duration-slow: 400ms;
}

/* ============================================
   PHASE 2: HERO SECTION - COMMAND CENTER
   Glass-morphism with data visualization
   ============================================ */

.hero-section {
    background: linear-gradient(135deg,
        var(--premium-navy-900) 0%,
        #1a2744 50%,
        var(--premium-navy-800) 100%
    );
    padding: 2.5rem;
    border-radius: 24px;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    color: white;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--premium-shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Subtle grid pattern overlay */
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

/* Ambient glow effect */
.hero-section::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(
        ellipse at center,
        var(--premium-emerald-glow) 0%,
        transparent 60%
    );
    opacity: 0.4;
    pointer-events: none;
    animation: heroGlowPulse 8s ease-in-out infinite;
}

@keyframes heroGlowPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.1); }
}

.hero-content {
    flex: 1;
    z-index: 2;
    position: relative;
    max-width: 550px;
}

.company-branding {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.company-avatar {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--premium-emerald-500), var(--premium-teal-500));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    box-shadow:
        0 8px 24px rgba(16, 185, 129, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.company-name {
    font-family: var(--premium-font-display);
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.company-subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 0.75rem 0;
    font-weight: 400;
}

.period-display {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    background: var(--premium-glass-bg);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--premium-glass-border);
}

.period-display .period-icon {
    opacity: 0.8;
}

/* Health Pulse Indicator */
.hero-health-pulse {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--premium-glass-bg);
    border-radius: 16px;
    border: 1px solid var(--premium-glass-border);
    backdrop-filter: blur(10px);
}

.pulse-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--premium-emerald-400);
    box-shadow: 0 0 12px var(--premium-emerald-500);
    animation: pulseGlow 2s ease-in-out infinite;
}

.pulse-indicator.warning {
    background: var(--premium-amber-400);
    box-shadow: 0 0 12px var(--premium-amber-500);
}

.pulse-indicator.critical {
    background: var(--premium-rose-400);
    box-shadow: 0 0 12px var(--premium-rose-500);
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

.pulse-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.pulse-value {
    font-weight: 700;
    color: var(--premium-emerald-400);
}

.pulse-value.warning { color: var(--premium-amber-400); }
.pulse-value.critical { color: var(--premium-rose-400); }

/* Hero Actions */
.hero-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.hero-action-btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--premium-duration-base) var(--premium-ease);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.hero-action-btn.primary {
    background: linear-gradient(135deg, var(--premium-emerald-500), var(--premium-teal-500));
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.hero-action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
}

.hero-action-btn.primary:active {
    transform: translateY(0);
}

.hero-action-btn.secondary {
    background: var(--premium-glass-bg);
    color: white;
    border: 1px solid var(--premium-glass-border);
    backdrop-filter: blur(10px);
}

.hero-action-btn.secondary:hover {
    background: var(--premium-glass-highlight);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Hero Visual - Chart Area */
.hero-visual {
    flex: 0 0 420px;
    height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    position: relative;
}

.animated-chart-container {
    width: 100%;
    height: 100%;
    position: relative;
    background: var(--premium-glass-bg);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--premium-glass-border);
    padding: 1.25rem;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

/* ============================================
   PHASE 3: BENTO GRID EXECUTIVE SUMMARY
   Apple-style varied card sizes
   ============================================ */

.executive-summary {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

/* Primary Metric - Takes 5 columns */
.summary-card.primary-metric {
    grid-column: span 5;
    background: linear-gradient(135deg, var(--premium-navy-800) 0%, var(--premium-navy-900) 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
}

.summary-card.primary-metric::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: radial-gradient(
        ellipse at top right,
        var(--premium-emerald-glow),
        transparent 70%
    );
    opacity: 0.5;
    pointer-events: none;
}

/* Secondary Metric - Takes 4 columns */
.summary-card.secondary-metric {
    grid-column: span 4;
    background: linear-gradient(135deg, #1a1f36 0%, #252d4a 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Health Metric - Takes 3 columns */
.summary-card.health-metric {
    grid-column: span 3;
    background: white;
    color: var(--premium-navy-900);
    border: 1px solid var(--premium-surface-200);
}

/* Base Card Styles */
.summary-card {
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: var(--premium-shadow-lg);
    transition: all var(--premium-duration-base) var(--premium-ease);
    position: relative;
    overflow: hidden;
}

.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--premium-shadow-xl);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.summary-card.health-metric .metric-icon {
    background: var(--premium-surface-100);
}

.metric-icon svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

.metric-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.35rem 0.75rem;
    border-radius: 100px;
    background: rgba(16, 185, 129, 0.15);
    color: var(--premium-emerald-400);
}

.metric-status.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--premium-amber-400);
}

.metric-status.negative {
    background: rgba(244, 63, 94, 0.15);
    color: var(--premium-rose-400);
}

/* Better contrast for status badges on light backgrounds */
.summary-card.health-metric .metric-status {
    background: rgba(16, 185, 129, 0.12);
    color: var(--premium-emerald-600);
}

.summary-card.health-metric .metric-status.warning {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706; /* amber-600 */
}

.summary-card.health-metric .metric-status.negative {
    background: rgba(244, 63, 94, 0.12);
    color: #dc2626; /* red-600 */
}

.status-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.metric-content {
    position: relative;
    z-index: 1;
}

.metric-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Ensure readable text on light backgrounds */
.summary-card.health-metric .metric-title {
    color: var(--premium-navy-700);
    opacity: 1;
}

.metric-value {
    font-family: var(--premium-font-display);
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.summary-card.primary-metric .metric-value {
    font-size: 3rem;
}

.metric-context {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Ensure readable context text on light backgrounds */
.summary-card.health-metric .metric-context {
    color: var(--premium-navy-600);
    opacity: 1;
}

.change-indicator {
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.change-indicator.positive {
    color: var(--premium-emerald-400);
}

.change-indicator.negative {
    color: var(--premium-rose-400);
}

.summary-card.health-metric .change-indicator.positive {
    color: var(--premium-emerald-500);
}

.summary-card.health-metric .change-indicator.negative {
    color: var(--premium-rose-500);
}

/* Enhanced Sparklines */
.metric-sparkline {
    height: 60px;
    margin-top: 1.25rem;
    position: relative;
    opacity: 0.9;
}

.metric-sparkline canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Health Score Ring - Enhanced */
.health-score-ring {
    width: 56px;
    height: 56px;
}

.circular-chart {
    display: block;
    width: 100%;
    height: 100%;
}

.circle-bg {
    fill: none;
    stroke: var(--premium-surface-200);
    stroke-width: 3;
}

.summary-card.health-metric .circle-bg {
    fill: none;
    stroke: var(--premium-surface-200);
    stroke-width: 3;
}

.summary-card.health-metric .circle {
    fill: none;
    stroke: var(--premium-emerald-500);
    stroke-width: 3;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke-dasharray 1s var(--premium-ease);
}

/* Ensure change indicators have proper colors on all card types */
.summary-card.primary-metric .change-indicator.positive,
.summary-card.secondary-metric .change-indicator.positive {
    color: var(--premium-emerald-400);
}

.summary-card.primary-metric .change-indicator.negative,
.summary-card.secondary-metric .change-indicator.negative {
    color: var(--premium-rose-400);
}

/* ============================================
   PHASE 4: INSIGHTS SECTION - INTELLIGENCE FEED
   Premium insight cards with urgency hierarchy
   ============================================ */

.insights-section-enhanced {
    margin: 3rem 0;
    padding: 2rem;
    background: white;
    border-radius: 24px;
    box-shadow: var(--premium-shadow-md);
    border: 1px solid var(--premium-surface-200);
}

.insights-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--premium-surface-200);
}

.insights-title-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.insights-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--premium-emerald-500), var(--premium-teal-500));
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.insights-title {
    font-family: var(--premium-font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--premium-navy-900);
    margin: 0;
}

.insights-subtitle {
    font-size: 0.9rem;
    color: var(--premium-navy-600);
    margin: 0.25rem 0 0 0;
}

/* Health Score in Insights Header */
.insights-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.insights-score .score-ring {
    position: relative;
    width: 72px;
    height: 72px;
}

.insights-score .score-circle {
    width: 100%;
    height: 100%;
}

.score-bg {
    fill: none;
    stroke: var(--premium-surface-200);
    stroke-width: 6;
}

.score-fill {
    fill: none;
    stroke: var(--premium-emerald-500);
    stroke-width: 6;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke-dashoffset 1s var(--premium-ease);
}

.insights-score .score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--premium-font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--premium-navy-900);
}

.insights-score .score-label {
    font-size: 0.75rem;
    color: var(--premium-navy-600);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Filter Chips - Premium Style */
.filter-chips {
    display: flex;
    gap: 0.625rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.filter-chip {
    padding: 0.625rem 1.125rem;
    border: 1.5px solid var(--premium-surface-300);
    border-radius: 100px;
    background: white;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--premium-navy-600);
    cursor: pointer;
    transition: all var(--premium-duration-fast) var(--premium-ease);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-chip:hover {
    border-color: var(--premium-emerald-500);
    color: var(--premium-emerald-600);
    background: rgba(16, 185, 129, 0.05);
}

.filter-chip.active {
    background: var(--premium-emerald-500);
    border-color: var(--premium-emerald-500);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Insights Grid - Enhanced */
.insights-grid-enhanced {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 1.25rem;
}

/* Enhanced Insight Card */
.insight-card-enhanced {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--premium-shadow-sm);
    border: 1px solid var(--premium-surface-200);
    transition: all var(--premium-duration-base) var(--premium-ease);
    position: relative;
    overflow: hidden;
}

.insight-card-enhanced:hover {
    transform: translateY(-3px);
    box-shadow: var(--premium-shadow-lg);
    border-color: var(--premium-surface-300);
}

/* Category Indicators */
.insight-card-enhanced.category-opportunity {
    border-left: 4px solid var(--premium-emerald-500);
}

.insight-card-enhanced.category-risk {
    border-left: 4px solid var(--premium-rose-500);
}

.insight-card-enhanced.category-action {
    border-left: 4px solid var(--premium-navy-700);
}

/* Critical Insight - Larger, Pulsing */
.insight-card-enhanced.priority-critical {
    grid-column: span 2;
    background: linear-gradient(135deg, #fef2f2 0%, #fff1f2 100%);
    border-left: 4px solid var(--premium-rose-500);
    animation: criticalPulse 3s ease-in-out infinite;
}

@keyframes criticalPulse {
    0%, 100% { box-shadow: var(--premium-shadow-md); }
    50% { box-shadow: var(--premium-shadow-md), 0 0 20px rgba(244, 63, 94, 0.15); }
}

.insight-header-enhanced {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.insight-icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--premium-duration-fast) var(--premium-ease);
}

.insight-card-enhanced:hover .insight-icon-circle {
    transform: scale(1.05);
}

.insight-icon-circle.category-opportunity {
    background: rgba(16, 185, 129, 0.1);
    color: var(--premium-emerald-500);
}

.insight-icon-circle.category-risk {
    background: rgba(244, 63, 94, 0.1);
    color: var(--premium-rose-500);
}

.insight-icon-circle.category-action {
    background: var(--premium-surface-100);
    color: var(--premium-navy-700);
}

.insight-priority-badge {
    padding: 0.3rem 0.75rem;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.insight-priority-badge.priority-critical {
    background: var(--premium-rose-500);
    color: white;
}

.insight-priority-badge.priority-high {
    background: var(--premium-amber-500);
    color: white;
}

.insight-priority-badge.priority-medium {
    background: var(--premium-navy-700);
    color: white;
}

.insight-priority-badge.priority-low {
    background: var(--premium-surface-200);
    color: var(--premium-navy-700);
}

.insight-title-enhanced {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--premium-navy-900);
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

.insight-description-enhanced {
    font-size: 0.9rem;
    color: var(--premium-navy-700);
    line-height: 1.6;
    margin: 0;
}

/* Impact Statement */
.insight-impact {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1rem;
    background: rgba(16, 185, 129, 0.08);
    border-radius: 10px;
    margin: 1rem 0;
}

.impact-icon {
    color: var(--premium-emerald-500);
    flex-shrink: 0;
}

.impact-text {
    font-size: 0.875rem;
    color: var(--premium-emerald-600);
    font-weight: 500;
}

/* Insight Action Button */
.insight-action {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--premium-surface-200);
}

.insight-action-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 10px;
    background: var(--premium-surface-100);
    color: var(--premium-navy-800);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--premium-duration-fast) var(--premium-ease);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.insight-action-btn:hover {
    background: var(--premium-emerald-500);
    color: white;
    transform: translateY(-1px);
}

.insight-action-btn:active {
    transform: translateY(0);
}

/* ============================================
   PHASE 5: PERFORMANCE OVERVIEW CARDS
   ============================================ */

.performance-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.overview-chart-card {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--premium-shadow-md);
    border: 1px solid var(--premium-surface-200);
    transition: all var(--premium-duration-base) var(--premium-ease);
}

.overview-chart-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--premium-shadow-lg);
}

.overview-chart-card.featured {
    grid-column: span 2;
}

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

.chart-header h3 {
    font-family: var(--premium-font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--premium-navy-900);
    margin: 0;
}

.chart-container {
    height: 200px;
    position: relative;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ============================================
   PHASE 6: MICRO-INTERACTIONS & ANIMATIONS
   ============================================ */

/* Animated Number Counter */
.animate-number {
    transition: all var(--premium-duration-slow) var(--premium-ease);
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--premium-surface-200) 25%,
        var(--premium-surface-100) 50%,
        var(--premium-surface-200) 75%
    );
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: 8px;
}

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

/* Staggered Fade In */
.stagger-fade-in > * {
    opacity: 0;
    transform: translateY(10px);
    animation: staggerFadeIn var(--premium-duration-slow) var(--premium-ease) forwards;
}

.stagger-fade-in > *:nth-child(1) { animation-delay: 0ms; }
.stagger-fade-in > *:nth-child(2) { animation-delay: 50ms; }
.stagger-fade-in > *:nth-child(3) { animation-delay: 100ms; }
.stagger-fade-in > *:nth-child(4) { animation-delay: 150ms; }
.stagger-fade-in > *:nth-child(5) { animation-delay: 200ms; }
.stagger-fade-in > *:nth-child(6) { animation-delay: 250ms; }

@keyframes staggerFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Value Change Animation */
.value-changed {
    animation: valueFlash var(--premium-duration-base) var(--premium-ease);
}

@keyframes valueFlash {
    0% { color: inherit; }
    50% { color: var(--premium-emerald-500); }
    100% { color: inherit; }
}

.value-changed.negative {
    animation: valueFlashNegative var(--premium-duration-base) var(--premium-ease);
}

@keyframes valueFlashNegative {
    0% { color: inherit; }
    50% { color: var(--premium-rose-500); }
    100% { color: inherit; }
}

/* Button Ripple Effect */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.btn-ripple:active::after {
    width: 200px;
    height: 200px;
}

/* ============================================
   PHASE 7: RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1200px) {
    .executive-summary {
        grid-template-columns: repeat(6, 1fr);
    }

    .summary-card.primary-metric {
        grid-column: span 6;
    }

    .summary-card.secondary-metric {
        grid-column: span 3;
    }

    .summary-card.health-metric {
        grid-column: span 3;
    }

    .insight-card-enhanced.priority-critical {
        grid-column: span 1;
    }
}

@media (max-width: 900px) {
    .hero-section {
        flex-direction: column;
        text-align: center;
        padding: 2rem;
        min-height: auto;
    }

    .hero-content {
        max-width: 100%;
    }

    .company-branding {
        flex-direction: column;
        align-items: center;
    }

    .hero-visual {
        flex: none;
        width: 100%;
        height: 200px;
        margin-top: 1.5rem;
    }

    .hero-actions {
        justify-content: center;
    }

    .executive-summary {
        grid-template-columns: 1fr;
    }

    .summary-card.primary-metric,
    .summary-card.secondary-metric,
    .summary-card.health-metric {
        grid-column: span 1;
    }

    .insights-grid-enhanced {
        grid-template-columns: 1fr;
    }

    .overview-chart-card.featured {
        grid-column: span 1;
    }
}

@media (max-width: 600px) {
    .hero-section {
        padding: 1.5rem;
        border-radius: 20px;
    }

    .company-name {
        font-size: 1.5rem;
    }

    .metric-value {
        font-size: 2rem;
    }

    .summary-card.primary-metric .metric-value {
        font-size: 2.25rem;
    }

    .hero-action-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.85rem;
    }

    .filter-chips {
        justify-content: center;
    }
}

/* ============================================
   PHASE 8: DARK MODE SUPPORT (OPTIONAL)
   ============================================ */

@media (prefers-color-scheme: dark) {
    .insights-section-enhanced,
    .overview-chart-card,
    .insight-card-enhanced {
        background: var(--premium-navy-800);
        border-color: rgba(255, 255, 255, 0.08);
        color: white;
    }

    .insights-title,
    .chart-header h3,
    .insight-title-enhanced {
        color: #f8fafc; /* Near-white for best readability */
    }

    .insights-subtitle,
    .insight-description-enhanced {
        color: #cbd5e1; /* surface-300 - good contrast on dark */
    }

    .filter-chip {
        background: var(--premium-navy-700);
        border-color: rgba(255, 255, 255, 0.15);
        color: #e2e8f0; /* surface-200 - brighter for readability */
    }

    .filter-chip:hover {
        background: var(--premium-navy-600);
        color: white;
    }

    .filter-chip.active {
        background: var(--premium-emerald-500);
        border-color: var(--premium-emerald-500);
        color: white;
    }

    .insight-action-btn {
        background: var(--premium-navy-700);
        color: #f1f5f9; /* surface-100 */
    }

    .insight-action-btn:hover {
        background: var(--premium-emerald-500);
        color: white;
    }

    /* Dark mode insight cards - ensure readability */
    .insight-card-enhanced.priority-critical {
        background: linear-gradient(135deg, #3f1a22 0%, #4a1d2b 100%);
    }

    .insight-impact {
        background: rgba(16, 185, 129, 0.12);
    }

    .impact-text {
        color: var(--premium-emerald-400);
    }

    /* Dark mode health metric card */
    .summary-card.health-metric {
        background: var(--premium-navy-700);
        color: white;
        border-color: rgba(255, 255, 255, 0.1);
    }

    .summary-card.health-metric .metric-title,
    .summary-card.health-metric .metric-context {
        color: rgba(255, 255, 255, 0.85);
    }

    .summary-card.health-metric .metric-status {
        color: var(--premium-emerald-400);
    }

    /* Score value in dark mode */
    .insights-score .score-value {
        color: white;
    }
}
