.product-stats-search-card,
.product-stats-panel,
.product-stats-state,
.product-stats-kpi {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    box-shadow: 0 0.25rem 1rem rgba(15, 23, 42, 0.045);
}

.product-stats-search-card,
.product-stats-panel,
.product-stats-state {
    padding: 1.25rem;
}

.product-stats-search-card {
    border-top: 3px solid #2980b9;
}

.product-stats-mode-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.product-stats-mode-buttons .btn {
    min-width: 6.5rem;
    border-radius: 0.5rem;
}

.product-stats-search-icon,
.product-stats-product-icon,
.product-stats-state-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.8rem;
    color: #2980b9;
    background: #eaf4fb;
    font-size: 1.35rem;
}

.product-stats-state {
    min-height: 22rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.product-stats-state-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    font-size: 1.8rem;
}

.product-stats-state-icon-error {
    color: #c0392b;
    background: #fbeceb;
}

.product-stats-product-header {
    background: linear-gradient(135deg, #ffffff 0%, #f5faff 100%);
}

.product-stats-product-icon {
    color: #fff;
    background: #2980b9;
}

.product-stats-sku {
    max-width: 100%;
    font-size: 0.8rem;
    letter-spacing: 0.025em;
    overflow: hidden;
    text-overflow: ellipsis;
}

.min-width-0 {
    min-width: 0;
}

.product-stats-range-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.product-stats-range-buttons .btn {
    min-width: 3.25rem;
    border-radius: 0.5rem;
}

.product-stats-range-buttons .btn.active {
    color: #fff;
    background: #2980b9;
    border-color: #2980b9;
}

.product-stats-custom-range {
    max-width: 32rem;
}

.product-stats-kpi {
    position: relative;
    padding: 1rem;
    overflow: hidden;
}

.product-stats-kpi::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    content: "";
    background: var(--kpi-accent);
}

.product-stats-kpi-sales {
    --kpi-accent: #2980b9;
    --kpi-soft: #eaf4fb;
}

.product-stats-kpi-purchases {
    --kpi-accent: #16a085;
    --kpi-soft: #e7f6f3;
}

.product-stats-kpi-net {
    --kpi-accent: #8e44ad;
    --kpi-soft: #f4eafa;
}

.product-stats-kpi-average {
    --kpi-accent: #d68910;
    --kpi-soft: #fdf3df;
}

.product-stats-kpi-label {
    margin-bottom: 0.25rem;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.product-stats-kpi-value {
    margin-bottom: 0;
    color: #172033;
    font-size: clamp(1.7rem, 2.5vw, 2.25rem);
    font-weight: 700;
    line-height: 1.1;
}

.product-stats-kpi-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.65rem;
    color: var(--kpi-accent);
    background: var(--kpi-soft);
    font-size: 1.1rem;
}

.product-stats-trend {
    min-height: 1.25rem;
    margin-top: 0.75rem;
    font-size: 0.82rem;
}

.product-stats-trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    margin-right: 0.25rem;
    font-weight: 700;
}

.product-stats-chart-wrap {
    position: relative;
    min-height: 23rem;
}

.product-stats-chart-wrap canvas {
    width: 100% !important;
    height: 23rem !important;
}

.product-stats-chart-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #64748b;
    background: rgba(255, 255, 255, 0.9);
}

.product-stats-legend {
    display: inline-block;
    width: 0.65rem;
    height: 0.65rem;
    margin-right: 0.3rem;
    border-radius: 50%;
}

.product-stats-legend-sales {
    background: #2980b9;
}

.product-stats-legend-purchases {
    background: #16a085;
}

.product-stats-summary-table thead th {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.product-stats-summary-table tbody th {
    color: #475569;
    font-weight: 600;
}

.product-stats-summary-table td {
    font-variant-numeric: tabular-nums;
}

.product-stats-insight {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem;
    border-radius: 0.65rem;
    background: #f8fafc;
}

.product-stats-insight-icon {
    color: #d68910;
    font-size: 1.25rem;
}

@media (max-width: 575.98px) {
    .product-stats-search-card,
    .product-stats-panel,
    .product-stats-state {
        padding: 1rem;
        border-radius: 0.65rem;
    }

    .product-stats-search-card #productDropdown {
        flex-wrap: wrap;
    }

    .product-stats-search-card .twitter-typeahead {
        width: calc(100% - 3rem) !important;
    }

    .product-stats-search-card #productTypeaheadBTN {
        width: 100%;
        margin-top: 0.5rem;
        border-radius: 0.5rem !important;
    }

    .product-stats-mode-buttons .btn {
        flex: 1 1 30%;
        min-width: 0;
    }

    .product-stats-custom-range {
        flex-wrap: wrap;
    }

    .product-stats-custom-range #dateRangePicker {
        width: calc(100% - 3rem);
    }

    .product-stats-custom-range #applyCustomRange {
        width: 100%;
        margin-top: 0.5rem;
        border-radius: 0.5rem !important;
    }

    .product-stats-chart-wrap,
    .product-stats-chart-wrap canvas {
        min-height: 19rem;
        height: 19rem !important;
    }
}
