/* New Compliance Reporting Dashboard Styles */
.insights-dashboard {
    width: 100%;
    max-width: 450px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(43, 107, 154, 0.15);
    border: 2px solid #2B6B9A;
    padding: 16px;
    font-family: 'Inter', sans-serif;
    margin: 0 auto;
    height: 310px;
    display: flex;
    flex-direction: column;
}

.insights-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(43, 107, 154, 0.2);
}

.insights-title h4 {
    font-size: 16px;
    font-weight: 600;
    color: #2B6B9A;
    margin: 0;
}

.report-period {
    font-size: 12px;
    color: rgba(43, 107, 154, 0.7);
    font-weight: 500;
}

.export-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #2B6B9A;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.export-btn:hover {
    background: #1e4d6b;
    transform: translateY(-1px);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 12px;
    flex: 1;
}

/* Key Metrics Overview */
.metrics-overview {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
}

.metric-card {
    flex: 1;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 6px;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(43, 107, 154, 0.1);
    position: relative;
    overflow: hidden;
}

.metric-card.primary {
    border-left: 3px solid #2B6B9A;
}

.metric-card.warning {
    border-left: 3px solid #F8B73B;
}

.metric-card.success {
    border-left: 3px solid #52A061;
}

.metric-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
}

.metric-card.primary .metric-icon {
    background: rgba(43, 107, 154, 0.1);
    color: #F05844;
}

.metric-card.warning .metric-icon {
    background: rgba(248, 183, 59, 0.1);
    color: #F8B73B;
}

.metric-card.success .metric-icon {
    background: rgba(82, 160, 97, 0.1);
    color: #52A061;
}

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

.metric-value {
    font-size: 16px;
    font-weight: 700;
    color: #2B6B9A;
    line-height: 1;
    animation: metricPulse 3s ease-in-out infinite;
}

.metric-label {
    font-size: 9px;
    color: rgba(43, 107, 154, 0.7);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.metric-trend {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 8px;
    font-weight: 600;
}

.metric-trend.up {
    color: #52A061;
}

.metric-trend.down {
    color: #F05844;
}

.metric-trend i {
    font-size: 8px;
}

@keyframes metricPulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

/* Chart Sections */
.chart-section {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px;
    border: 1px solid rgba(43, 107, 154, 0.1);
}

.chart-section.full-width {
    grid-column: 1 / -1;
}

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

.chart-header h5 {
    font-size: 11px;
    font-weight: 600;
    color: #2B6B9A;
    margin: 0;
}

.chart-controls {
    display: flex;
    gap: 4px;
}

.chart-btn {
    padding: 2px 6px;
    border: 1px solid rgba(43, 107, 154, 0.3);
    background: white;
    color: #2B6B9A;
    border-radius: 3px;
    font-size: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chart-btn.active {
    background: #2B6B9A;
    color: white;
}

.trend-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 9px;
    font-weight: 500;
}

.trend-indicator.positive {
    color: #52A061;
}

.trend-indicator i {
    font-size: 8px;
}

/* Donut Chart */
.donut-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.donut-svg {
    width: 80px;
    height: 80px;
}

.donut-center-value {
    font-size: 12px;
    font-weight: 700;
    fill: #2B6B9A;
}

.donut-center-label {
    font-size: 8px;
    fill: rgba(43, 107, 154, 0.7);
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 8px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.legend-dot.critical {
    background: #F05844;
}

.legend-dot.medium {
    background: #F8B73B;
}

.legend-dot.low {
    background: #52A061;
}

.legend-text {
    flex: 1;
    color: rgba(43, 107, 154, 0.8);
    font-weight: 500;
}

.legend-value {
    font-weight: 600;
    color: #2B6B9A;
}

/* Area Chart */
.area-chart {
    height: 80px;
}

.area-svg {
    width: 100%;
    height: 100%;
}

.axis-label {
    font-size: 7px;
    fill: rgba(43, 107, 154, 0.6);
    font-weight: 500;
}

/* Heatmap */
.heatmap-scale {
    display: flex;
    align-items: center;
    gap: 6px;
}

.scale-label {
    font-size: 7px;
    color: rgba(43, 107, 154, 0.6);
    font-weight: 500;
}

.scale-gradient {
    width: 30px;
    height: 4px;
    background: linear-gradient(90deg, #52A061 0%, #F8B73B 50%, #F05844 100%);
    border-radius: 2px;
}

.heatmap-grid {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.heatmap-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.market-label {
    font-size: 8px;
    font-weight: 500;
    color: #2B6B9A;
    min-width: 40px;
}

.heatmap-cell {
    width: 16px;
    height: 12px;
    border-radius: 2px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.heatmap-cell:hover {
    transform: scale(1.1);
}

.heatmap-cell.high {
    background: #52A061;
}

.heatmap-cell.medium {
    background: #F8B73B;
}

.heatmap-cell.low {
    background: #F05844;
}

.heatmap-legend {
    margin-top: 6px;
}

.legend-categories {
    display: flex;
    justify-content: space-between;
    font-size: 7px;
    color: rgba(43, 107, 154, 0.6);
    font-weight: 500;
}

/* Timeline Chart */
.timeline-stats {
    display: flex;
    gap: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 12px;
    font-weight: 700;
    color: #2B6B9A;
}

.stat-label {
    font-size: 7px;
    color: rgba(43, 107, 154, 0.7);
    font-weight: 500;
    text-transform: uppercase;
}

.timeline-chart {
    margin-top: 8px;
}

.timeline-bars {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.timeline-bar {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bar-label {
    font-size: 9px;
    font-weight: 500;
    color: #2B6B9A;
}

.bar-time {
    font-size: 8px;
    color: rgba(43, 107, 154, 0.7);
    font-weight: 500;
}

.bar-track {
    height: 8px;
    background: rgba(43, 107, 154, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.bar-progress {
    height: 100%;
    border-radius: 4px;
    transition: width 2s ease-out;
    animation: progressGrow 2s ease-out;
}

.critical-progress {
    background: linear-gradient(90deg, #F05844 0%, #ff6b6b 100%);
}

.medium-progress {
    background: linear-gradient(90deg, #F8B73B 0%, #ffcd3c 100%);
}

.low-progress {
    background: linear-gradient(90deg, #52A061 0%, #6bc46d 100%);
}

@keyframes progressGrow {
    0% {
        width: 0%;
    }
    100% {
        width: var(--final-width, 100%);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .insights-dashboard {
        max-width: 100%;
        height: auto;
        min-height: 300px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .metrics-overview {
        flex-direction: column;
        gap: 6px;
    }
    
    .donut-svg {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    .insights-dashboard {
        padding: 12px;
    }
    
    .insights-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .export-btn {
        align-self: flex-end;
    }
}
