/* Reports page: KPI tiles, change badges, SVG charts, heatmap, print. */
:root {
    --rpt-series-1: #2a78d6; /* this period / returning */
    --rpt-series-2: #eb6834; /* new clients */
    --rpt-compare: #8a8984;
    --rpt-grid: #e6e6e3;
    --rpt-empty: #f1f1ef;
    --rpt-seq-1: #dbe8f8;
    --rpt-seq-2: #b0cdf0;
    --rpt-seq-3: #78a9e3;
    --rpt-seq-4: #3f80d1;
    --rpt-seq-5: #1f5aa6;
    --rpt-good: #146c43;
    --rpt-bad: #b02a37;
}

.rpt-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem 0.75rem;
}

.rpt-filters .form-select,
.rpt-filters .form-control {
    min-width: 9rem;
}

.rpt-print-title {
    display: none;
}

.rpt-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

/* KPI tiles */
.rpt-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 0.75rem;
}

.rpt-kpi {
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    background: #fff;
}

.rpt-kpi-label {
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
}

.rpt-kpi-value {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.25;
    margin-top: 0.15rem;
    font-variant-numeric: tabular-nums;
}

.rpt-kpi-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.78rem;
    margin-top: 0.2rem;
}

.rpt-kpi-note {
    font-size: 0.78rem;
    color: var(--bs-secondary-color);
    margin-top: 0.15rem;
}

.rpt-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    margin-left: 0.15rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 50%;
    font-size: 0.65rem;
    cursor: help;
}

/* ▲ / ▼ change */
.rpt-change {
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.rpt-up {
    color: var(--rpt-good);
}

.rpt-down {
    color: var(--rpt-bad);
}

.rpt-flat {
    color: var(--bs-secondary-color);
    font-weight: 400;
}

/* Tables */
.rpt-table th {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    white-space: nowrap;
}

.rpt-num {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.rpt-scroll {
    max-height: 26rem;
    overflow-y: auto;
}

.rpt-meter {
    height: 4px;
    margin: 0.2rem 0 0.1rem auto;
    width: 4rem;
    border-radius: 2px;
    background: var(--rpt-empty);
    overflow: hidden;
}

.rpt-meter span {
    display: block;
    height: 100%;
    background: var(--rpt-series-1);
}

.rpt-days-input {
    width: auto;
}

.rpt-days-input input {
    max-width: 5.5rem;
}

/* Charts: SVG plot stretched to the card, HTML axis labels. */
.rpt-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    font-size: 0.8rem;
    color: var(--bs-secondary-color);
    margin-bottom: 0.5rem;
}

.rpt-key {
    display: inline-block;
    width: 0.9rem;
    height: 0.6rem;
    margin-right: 0.3rem;
    vertical-align: middle;
    border-radius: 2px;
}

.rpt-key-line {
    height: 2px;
    background: var(--rpt-series-1);
}

.rpt-key-dash {
    height: 0;
    border-top: 2px dashed var(--rpt-compare);
}

.rpt-key-returning {
    background: var(--rpt-series-1);
}

.rpt-key-new {
    background: var(--rpt-series-2);
}

.rpt-chart {
    height: 13rem;
    padding: 0.4rem 0 1.4rem 3.2rem;
}

.rpt-plot {
    position: relative;
    height: 100%;
}

.rpt-plot svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.rpt-grid {
    stroke: var(--rpt-grid);
    stroke-width: 1;
}

.rpt-line {
    fill: none;
    stroke: var(--rpt-series-1);
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.rpt-line-compare {
    fill: none;
    stroke: var(--rpt-compare);
    stroke-width: 2;
    stroke-dasharray: 5 4;
}

.rpt-area {
    fill: var(--rpt-series-1);
    opacity: 0.08;
}

.rpt-bar-returning {
    fill: var(--rpt-series-1);
}

.rpt-bar-new {
    fill: var(--rpt-series-2);
}

.rpt-hit {
    fill: transparent;
}

.rpt-hit:hover {
    fill: rgba(0, 0, 0, 0.05);
}

.rpt-ylabel {
    position: absolute;
    right: calc(100% + 0.4rem);
    transform: translateY(-50%);
    font-size: 0.7rem;
    color: var(--bs-secondary-color);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.rpt-xlabel {
    position: absolute;
    top: calc(100% + 0.3rem);
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--bs-secondary-color);
    white-space: nowrap;
}

/* Heatmap */
.rpt-heat-wrap {
    overflow-x: auto;
}

.rpt-heat {
    display: grid;
    gap: 2px;
    min-width: max-content;
}

.rpt-heat-row {
    display: contents;
}

.rpt-heat-hour {
    font-size: 0.65rem;
    color: var(--bs-secondary-color);
    text-align: center;
}

.rpt-heat-day {
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
    align-self: center;
}

.rpt-heat-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 1.6rem;
    border-radius: 3px;
    font-size: 0.65rem;
    font-variant-numeric: tabular-nums;
}

.rpt-heat-scale {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.rpt-heat-swatch {
    display: inline-block;
    width: 1rem;
    height: 0.75rem;
    border-radius: 2px;
}

@media (max-width: 575.98px) {
    .rpt-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .rpt-kpi {
        padding: 0.6rem;
    }

    .rpt-kpi-value {
        font-size: 1.2rem;
    }

    .rpt-chart {
        height: 11rem;
        padding-left: 2.8rem;
    }
}

@media print {
    .sidebar,
    .top-row,
    .billing-banner,
    .rpt-no-print,
    #blazor-error-ui {
        display: none !important;
    }

    .page,
    main,
    .content {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .rpt-print-title {
        display: block;
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 0.25rem;
    }

    .rpt-card,
    .rpt-kpi {
        break-inside: avoid;
    }

    .rpt-scroll {
        max-height: none;
        overflow: visible;
    }

    .table-responsive {
        overflow: visible !important;
    }

    .rpt-hit:hover {
        fill: transparent;
    }
}
