/* Dashboard analytics — light cards, chart layout */

.dashboard-page {
    --dash-bg: #f4f6fb;
    --dash-card: #ffffff;
    --dash-border: #e8ecf3;
    --dash-text: #1e293b;
    --dash-muted: #64748b;
    --dash-blue: #3b82f6;
    --dash-orange: #f97316;
    --dash-purple: #8b5cf6;
    --dash-green: #22c55e;
    --dash-pink: #ec4899;
    background: var(--dash-bg);
    margin: -1rem -0.75rem 0;
    padding: 1.5rem 0.75rem 2rem;
    border-radius: 0;
}

.dashboard-page .dashboard-title {
    color: var(--dash-text);
    font-weight: 700;
}

.dashboard-page .dashboard-subtitle {
    color: var(--dash-muted);
    font-size: 1rem;
}

/* KPI tiles */
.kpi-card {
    background: var(--dash-card);
    border: 1px solid var(--dash-border);
    border-radius: 16px;
    padding: 1.25rem 1.35rem;
    height: 100%;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    position: relative;
}

.kpi-card:hover {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}

.kpi-card .kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.kpi-card .kpi-icon--blue { background: rgba(59, 130, 246, 0.12); color: var(--dash-blue); }
.kpi-card .kpi-icon--green { background: rgba(34, 197, 94, 0.12); color: var(--dash-green); }
.kpi-card .kpi-icon--orange { background: rgba(249, 115, 22, 0.12); color: var(--dash-orange); }
.kpi-card .kpi-icon--purple { background: rgba(139, 92, 246, 0.12); color: var(--dash-purple); }

.kpi-card .kpi-label {
    font-size: 0.8rem;
    color: var(--dash-muted);
    margin-bottom: 0.25rem;
}

.kpi-card .kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dash-text);
    line-height: 1.2;
}

.kpi-trend {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
}

.kpi-trend--up {
    color: #15803d;
    background: rgba(34, 197, 94, 0.12);
}

.kpi-trend--neutral {
    color: var(--dash-muted);
    background: #f1f5f9;
}

/* Chart panels */
.chart-card {
    background: var(--dash-card);
    border: 1px solid var(--dash-border);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    height: 100%;
    overflow: hidden;
}

.chart-card:hover {
    transform: none;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

.chart-card .chart-card-header {
    padding: 1.1rem 1.35rem 0.5rem;
    border-bottom: none;
    background: transparent;
    color: var(--dash-text);
    font-weight: 600;
    font-size: 1rem;
}

.chart-card .chart-card-body {
    padding: 0.75rem 1.25rem 1.25rem;
}

.chart-wrap {
    position: relative;
    min-height: 220px;
}

.chart-wrap--tall {
    min-height: 280px;
}

.chart-wrap--donut {
    min-height: 200px;
    max-width: 220px;
    margin: 0 auto;
}

/* Donut legend list */
.donut-legend {
    list-style: none;
    padding: 0;
    margin: 0;
}

.donut-legend li {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0;
    font-size: 0.875rem;
    color: var(--dash-text);
}

.donut-legend .legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.donut-legend .legend-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.donut-legend .legend-pct {
    font-weight: 600;
    color: var(--dash-muted);
}

/* Provider rank list */
.rank-list-item {
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--dash-border);
}

.rank-list-item:last-child {
    border-bottom: none;
}

.rank-list-item .rank-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--dash-text);
}

.rank-list-item .rank-meta {
    font-size: 0.75rem;
    color: var(--dash-muted);
}

.rank-bar {
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    margin-top: 0.4rem;
    overflow: hidden;
}

.rank-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--dash-blue), #60a5fa);
    transition: width 0.6s ease;
}

/* Resource mini stats inside chart card */
.resource-compare {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.resource-compare .rc-item {
    flex: 1;
    min-width: 120px;
    padding: 0.65rem 0.85rem;
    background: #f8fafc;
    border-radius: 10px;
    font-size: 0.8rem;
}

.resource-compare .rc-item strong {
    display: block;
    font-size: 1.1rem;
    color: var(--dash-text);
}

/* Recent table card on dashboard */
.dashboard-page .card.table-card .card-header {
    background: var(--dash-card);
    color: var(--dash-text);
    border-bottom: 1px solid var(--dash-border);
}

.dashboard-page .table thead {
    background: #f1f5f9;
    color: var(--dash-text);
}

@media (max-width: 991px) {
    .chart-wrap--donut {
        max-width: 100%;
    }
}
