/* ── Stats dashboard ─────────────────────────────────────────── */

/* ── KPI cards row ───────────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 1.1rem;
    margin-bottom: 1.75rem;
}

.kpi-card {
    background: #fff;
    border: 1px solid #e3e8f0;
    border-radius: var(--innova-radius-input);
    padding: 1.1rem 1.25rem;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 30, 90, 0.06);
    position: relative;
    overflow: hidden;
    min-height: 7.5rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    width: 0.3rem;
    height: 100%;
    background: var(--innova-blue);
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.9rem rgba(0, 30, 90, 0.1);
}

.kpi-card.kpi-total::before    { background: var(--innova-blue); }
.kpi-card.kpi-hours::before    { background: #B8860B; }
.kpi-card.kpi-progress::before { background: #1E7E34; }
.kpi-card.kpi-tested::before   { background: #6F42C1; }

.kpi-label {
    font-family: var(--innova-font);
    font-size: 0.95rem;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.kpi-value {
    font-family: var(--innova-font);
    font-size: 2.4rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.1;
}

.kpi-sub {
    font-family: var(--innova-font);
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.45rem;
}

/* ── Section blocks ──────────────────────────────────────────── */
.stats-section {
    background: #fff;
    border: 1px solid #e3e8f0;
    border-radius: var(--innova-radius-input);
    padding: 1.1rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 0.125rem 0.45rem rgba(0, 30, 90, 0.04);
}

.stats-section-title {
    font-family: var(--innova-font);
    font-size: 1.15rem;
    font-weight: 600;
    color: #284986;
    margin: 0 0 0.9rem 0;
    padding-bottom: 0.55rem;
    border-bottom: 2px solid #e3e8f0;
}

.stats-empty {
    color: #6c757d;
    font-size: 0.95rem;
    margin: 0.5rem 0 0 0;
    text-align: center;
}

/* ── Breakdown grid: two columns on wide screens ─────────────── */
.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.breakdown-grid .stats-section {
    margin-bottom: 0;
}

/* ── Stats tables ────────────────────────────────────────────── */
.stats-table {
    width: 100%;
    margin: 0;
}

.stats-table thead th {
    font-size: 0.95rem;
    color: #6c757d;
    font-weight: 500;
    background: #f7f9fc;
}

.stats-table tbody td {
    font-size: 0.95rem;
    vertical-align: middle;
}

.stats-table .num-col {
    width: 5rem;
    text-align: center;
    white-space: nowrap;
}

.stats-table .bar-col {
    width: 40%;
}

.stats-table td.num-col {
    font-weight: 600;
    color: #1a1a1a;
}

.stats-table td.pct-col {
    color: #6c757d;
    font-weight: 500;
}

/* ── Inline bar in stats tables ──────────────────────────────── */
.stat-bar {
    background: #eef2f9;
    border-radius: 50px;
    height: 0.6rem;
    width: 100%;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    background: var(--innova-blue);
    border-radius: 50px;
    transition: width 0.4s ease;
}

.stat-bar-fill.fill-Converted    { background: #1E7E34; }
.stat-bar-fill.fill-InProgress   { background: #B8860B; }
.stat-bar-fill.fill-NotConverted { background: #C0392B; }
.stat-bar-fill.fill-Screen       { background: var(--innova-blue); }
.stat-bar-fill.fill-Output       { background: #128DFF; }
.stat-bar-fill.fill-Net48        { background: #6c757d; }
.stat-bar-fill.fill-NetCore10    { background: var(--innova-blue); }
.stat-bar-fill.fill-Passed       { background: #1E7E34; }
.stat-bar-fill.fill-Failed       { background: #C0392B; }
.stat-bar-fill.fill-Testing      { background: #B8860B; }
.stat-bar-fill.fill-NotTested    { background: #6c757d; }

/* ── Stacked progress bar ────────────────────────────────────── */
.progress-stacked {
    display: flex;
    width: 100%;
    height: 1.4rem;
    background: #eef2f9;
    border-radius: 50px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-segment {
    height: 100%;
    transition: width 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
}

.progress-segment.seg-Converted    { background: #1E7E34; }
.progress-segment.seg-InProgress   { background: #B8860B; }
.progress-segment.seg-NotConverted { background: #C0392B; }

.progress-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    font-size: 0.9rem;
    color: #495057;
}

.legend-dot {
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    margin-inline-end: 0.35rem;
    vertical-align: middle;
}

.legend-dot.status-Converted    { background: #1E7E34; }
.legend-dot.status-InProgress   { background: #B8860B; }
.legend-dot.status-NotConverted { background: #C0392B; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 767px) {
    .kpi-value { font-size: 1.9rem; }
    .kpi-grid { gap: 0.75rem; }
    .breakdown-grid { gap: 0.75rem; }
    .stats-table .num-col { width: 4rem; }
}
