/* Visualization Widget Styles */
.visualization-widget {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.widget-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.widget-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: #1f2937;
}

.widget-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
}

.widget-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.widget-empty {
    text-align: center;
    color: #9ca3af;
    padding: 2rem;
}

.widget-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    opacity: 0.3;
}

.widget-empty p {
    margin: 0;
    font-size: 0.875rem;
}

/* Summary Card Styles */
.summary-card .widget-body {
    padding: 1.5rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.summary-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.summary-icon {
    font-size: 2rem;
    color: #3b82f6;
    opacity: 0.8;
}

.summary-content {
    display: flex;
    flex-direction: column;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
}

.summary-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Analytics grid (audit step 3.8: replaces Syncfusion's draggable dashboard) */
.viz-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 10px;
}
.viz-grid__full { grid-column: span 12; }
.viz-grid__third { grid-column: span 4; }
.viz-grid__half { grid-column: span 6; }

.widget-body--chart {
    align-items: stretch;
    justify-content: flex-start;
    min-height: 0;
}

.viz-bars {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.viz-bars__row {
    display: grid;
    grid-template-columns: minmax(0, 140px) 1fr 48px;
    align-items: center;
    gap: 10px;
    font-size: var(--font-size-sm, 0.875rem);
}
.viz-bars__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viz-bars__bar { height: 12px; border-radius: 999px; background: #EEF0F3; overflow: hidden; }
.viz-bars__bar span { display: block; height: 100%; border-radius: 999px; background: var(--color-primary, #3b82f6); }
.viz-bars__n { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

.viz-timeline { margin: 0; width: 100%; }
.viz-timeline svg { display: block; width: 100%; height: 160px; }
.viz-timeline__bar { fill: var(--color-primary, #3b82f6); }
.viz-timeline__bar:hover { opacity: 0.75; }
.viz-timeline__axis {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: var(--font-size-xs, 0.75rem);
    color: var(--color-text-muted, #6b7280);
}

/* Dashboard Controls */
.dashboard-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dashboard-controls-left {
    display: flex;
    gap: 0.5rem;
}

.dashboard-controls-right {
    display: flex;
    gap: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .viz-grid__third,
    .viz-grid__half { grid-column: span 12; }

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

    .dashboard-controls {
        flex-direction: column;
        gap: 1rem;
    }

    .dashboard-controls-left,
    .dashboard-controls-right {
        width: 100%;
        justify-content: center;
    }
}

/* Donut and sparkline (the lender portfolio, 2026-11-19): SVG drawn by DonutChart.razor / Sparkline.razor. */
.donut { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.donut__svg { flex: none; max-width: 100%; height: auto; }
.donut__slice { cursor: pointer; }
.donut__total { font-size: 26px; font-weight: 700; fill: var(--color-text); }
.donut__caption { font-size: 12px; fill: var(--color-text-muted); }
.donut__legend { display: flex; flex-direction: column; gap: 4px; flex: 1 1 160px; min-width: 0; }
.donut__row {
    display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px;
    border: 1px solid transparent; border-radius: 8px; background: transparent;
    font: inherit; font-size: 13px; color: var(--color-text); cursor: pointer; text-align: left;
}
.donut__row:hover { background: var(--color-bg-subtle); }
.donut__row:focus-visible { outline: 2px solid var(--color-focus-ring, #1D4ED8); outline-offset: 1px; }
.donut__row--on { border: 1.5px solid var(--color-primary); background: var(--color-primary-lighter, #EEF3FF); }
.donut__row--dim { opacity: 0.6; }
.donut__swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.donut__label { flex: 1; min-width: 0; }
.donut__icon { color: #B4410B; margin-right: 4px; }
.donut__n { font-weight: 600; }
.donut__pct { width: 44px; text-align: right; color: var(--color-text-muted); }
.sparkline { display: block; }
