/* ============================================================================
   Sales-by-Category report — professional light theme, matches dashboard cards.
   All rules scoped under .sbc so nothing leaks globally.
   ============================================================================ */

.sbc {
    font-family: "Nunito", sans-serif;
    display: flex;
    flex-direction: column;
    gap: 16px;
    color: #0f172a;
}

/* ── KPI strip ──────────────────────────────────────────────────────────── */
.sbc-kpis {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.sbc-kpi {
    position: relative;
    background: #ffffff;
    border: 1px solid var(--rz-base-300, #e4e6eb);
    border-radius: 12px;
    padding: 16px 18px 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.03);
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

    .sbc-kpi:hover {
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.10), 0 3px 8px rgba(15, 23, 42, 0.05);
        transform: translateY(-2px);
        border-color: var(--rz-base-400, #d4d6dd);
    }

    /* accent stripe */
    .sbc-kpi::before {
        content: "";
        position: absolute;
        inset: 0 auto 0 0;
        width: 4px;
        background: var(--accent, #2563eb);
    }

    .sbc-kpi.accent-blue { --accent: #2563eb; --accent-soft: rgba(37, 99, 235, 0.12); }
    .sbc-kpi.accent-indigo { --accent: #6366f1; --accent-soft: rgba(99, 102, 241, 0.12); }
    .sbc-kpi.accent-green { --accent: #16a34a; --accent-soft: rgba(22, 163, 74, 0.12); }

.sbc-kpi-head {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 10px;
}

.sbc-kpi-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft, rgba(37, 99, 235, 0.12));
    color: var(--accent, #2563eb);
    flex: 0 0 auto;
}

    .sbc-kpi-icon .rzi,
    .sbc-kpi-icon .notranslate {
        font-size: 20px;
    }

.sbc-kpi-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #6b7280;
}

.sbc-kpi-value {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.15;
    color: #0f172a;
    word-break: break-word;
}

.sbc-kpi-sub {
    margin-top: 4px;
    font-size: 0.78rem;
    color: #6b7280;
}

/* ── Section card ───────────────────────────────────────────────────────── */
.sbc-card {
    background: #ffffff;
    border: 1px solid var(--rz-base-300, #e4e6eb);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.sbc-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.sbc-card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sbc-pill {
    font-size: 0.78rem;
    color: #4a5260;
    background: var(--rz-base-100, #f5f6f8);
    border: 1px solid var(--rz-base-300, #e4e6eb);
    border-radius: 999px;
    padding: 3px 10px;
}

.sbc-hint {
    font-size: 0.78rem;
    color: #6b7280;
    margin-top: 8px;
}

/* ── Grid polish ────────────────────────────────────────────────────────── */
.sbc-grid .rz-grid-table thead th {
    background: var(--rz-base-50, #fafbfc);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-size: 0.74rem;
    font-weight: 700;
    color: #6b7280;
}

/* emphasise the Total footer row */
.sbc-grid .rz-datatable-tfoot td,
.sbc-grid tfoot td {
    background: var(--rz-base-100, #f5f6f8);
    font-weight: 700;
    color: #0f172a;
    border-top: 2px solid var(--rz-base-300, #e4e6eb);
}

/* clickable category link */
.sbc-grid a.sbc-cat-link {
    font-weight: 600;
    color: #2563eb;
    text-decoration: underline;
    cursor: pointer;
}

    .sbc-grid a.sbc-cat-link:hover {
        color: #1d4ed8;
        text-decoration: underline;
    }

/* numeric cells a touch tabular for clean alignment */
.sbc-grid .rz-text-align-right {
    font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
    .sbc-kpis {
        grid-template-columns: 1fr;
    }
}
