@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap");

.reporting {

    --color-initial: rgb(165 49 228);
    --color-renewal: rgb(252 66 117);
    --color-product: #fb923c;
    --color-apple: rgb(201 131 239);
    --color-google: rgb(253 142 173);
    --color-revenue: #a855f7;

    --color-border: #dde3ec;
    --color-text: #1e2a3a;
    --color-muted: #6b7a8d;
    --color-bg: #f0f4f8;
    --color-active: #4f9cf9;

    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
    overflow: hidden;
    font-family: "DM Sans", sans-serif;
    background: var(--color-bg);
    box-sizing: border-box;
    color: var(--color-text);

    & * {
        box-sizing: border-box;
    }

    & .color-initial {
        background: var(--color-initial);
    }

    & .color-renewal {
        background: var(--color-renewal);
    }

    & .color-product {
        background: var(--color-product);
    }

    & .color-apple {
        background: var(--color-apple);
    }

    & .color-google {
        background: var(--color-google);
    }

    & .color-revenue {
        background: var(--color-revenue);
    }

    & .report-filter-card {
        background: #fff;
        border-radius: 14px;
        border: 1px solid var(--color-border);
        padding: 14px 18px;
        display: flex;
        flex-direction: column;
        gap: 10px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
        flex-shrink: 0;
    }

    & .report-filter-row {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
    }

    & .report-quick-pills {
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
    }

    & .report-pill {
        padding: 5px 13px;
        border-radius: 20px;
        font-size: 12px;
        font-weight: 500;
        border: 1.5px solid var(--color-border);
        background: transparent;
        color: var(--color-muted);
        cursor: pointer;
        transition: all 0.18s;

        &:hover {
            border-color: var(--bg-color);
            color: var(--bg-color);
        }

        &.active {
            background: var(--bg-color);
            border-color: var(--bg-color);
            color: #fff;
        }
    }

    & .report-sep {
        width: 1px;
        height: 28px;
        background: var(--color-border);
        flex-shrink: 0;
    }

    & .report-date-group {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    & .report-date-label {
        font-size: 11px;
        font-weight: 600;
        color: var(--color-muted);
        text-transform: uppercase;
        letter-spacing: 0.06em;
    }

    & .report-date-input {
        padding: 6px 10px;
        border-radius: 8px;
        border: 1.5px solid var(--color-border);
        font-family: "DM Mono", monospace;
        font-size: 12px;
        color: var(--color-text);
        background: var(--color-bg);
        outline: none;
        transition: border-color 0.18s;

        &:focus {
            border-color: var(--bg-color);
        }
    }

    & .report-plan-toggle,
    & .report-platform-toggle {
        display: flex;
        border-radius: 8px;
        border: 1.5px solid var(--color-border);
        overflow: hidden;
    }

    & .report-plan-btn,
    & .report-platform-btn {
        padding: 6px 13px;
        font-size: 12px;
        font-weight: 500;
        border: none;
        border-right: 1px solid var(--color-border);
        background: transparent;
        color: var(--color-muted);
        cursor: pointer;
        transition: all 0.18s;

        &:last-child {
            border-right: none;
        }

        &.active {
            background: var(--bg-color);
            color: #fff;
        }

        &:hover:not(.active) {
            background: var(--color-bg);
        }
    }

    & .report-kpi-row {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
        flex-shrink: 0;
    }

    & .report-kpi-card {
        background: #fff;
        border-radius: 14px;
        border: 1px solid var(--color-border);
        padding: 16px 18px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    & .report-kpi-label {
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.07em;
        color: var(--color-muted);
        display: flex;
        align-items: center;
        gap: 6px;
    }

    & .report-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        display: inline-block;
        flex-shrink: 0;
    }

    & .report-kpi-value {
        font-size: 26px;
        font-weight: 600;
        font-family: "DM Mono", monospace;
        line-height: 1;
    }

    & .report-kpi-delta {
        font-size: 12px;
        font-weight: 500;
        color: green;

        &.neg {
            color: red;
        }

        &.flat {
            color: blue;
        }
    }

    & .report-charts-row {
        display: grid;
        grid-template-columns: 1fr 320px;
        gap: 14px;
        flex-shrink: 0;
    }

    & .report-chart-card {
        background: #fff;
        border-radius: 14px;
        border: 1px solid var(--color-border);
        padding: 18px 20px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
        display: flex;
        flex-direction: column;
        height: 360px;
    }

    & .report-chart-card.report-pie-card {
        justify-content: space-between;
    }

    & .report-pie-card .report-pie-tabs {
        flex-shrink: 0;
    }

    & .report-pie-card .report-chart-canvas-wrap {
        flex: none;
        height: 160px;
    }

    & .report-pie-card .report-pie-legend {
        flex-shrink: 0;
        margin-top: 16px;
    }

    & .report-chart-title {
        font-size: 13px;
        font-weight: 600;
        margin-bottom: 2px;
    }

    & .report-chart-sub {
        font-size: 11px;
        color: var(--color-muted);
        margin-bottom: 8px;
        min-height: 14px;
    }

    & .report-chart-canvas-wrap {
        position: relative;
        flex: 1;
        min-height: 0;
    }

    & .report-pie-tabs {
        display: flex;
        border-bottom: 2px solid var(--color-border);
        margin-bottom: 10px;
    }

    & .report-pie-tab {
        padding: 6px 14px;
        font-size: 12px;
        font-weight: 600;
        border: none;
        background: transparent;
        color: var(--color-muted);
        cursor: pointer;
        border-bottom: 2px solid transparent;
        margin-bottom: -2px;
        transition: all 0.18s;

        &.active {
            color: var(--bg-color);
            border-bottom-color: var(--bg-color);
        }

        &:hover:not(.active) {
            color: var(--color-text);
        }
    }

    & .report-pie-legend {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 14px;
    }

    & .report-pie-legend-item {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 12px;
    }

    & .report-pie-legend-dot {
        width: 10px;
        height: 10px;
        border-radius: 3px;
        flex-shrink: 0;
    }

    & .report-pie-legend-label {
        color: var(--color-muted);
        flex: 1;
    }

    & .report-pie-legend-val {
        font-weight: 600;
        font-family: "DM Mono", monospace;
        font-size: 13px;
    }

    & .report-pie-legend-pct {
        color: var(--color-muted);
        font-size: 11px;
        min-width: 36px;
        text-align: right;
    }

    & .report-trend-header {
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        margin-bottom: 20px;
    }

    & .report-trend-header>div:first-child {
        position: absolute;
        left: 0;
    }

    & .report-trend-legend {
        display: flex;
        gap: 16px;
        align-items: center;
    }

    & .report-trend-legend-item {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 12px;
        color: var(--color-muted);
    }

    & .report-trend-legend-dot {
        width: 10px;
        height: 10px;
        border-radius: 3px;
        flex-shrink: 0;
    }

    & .report-table-card {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        background: #fff;
        border-radius: 14px;
        border: 1px solid var(--color-border);
        padding: 18px 20px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
        overflow: hidden;
    }

    & .report-table-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 14px;
        flex-shrink: 0;
    }

    & .report-table-wrap {
        overflow-x: auto;
        overflow-y: scroll;
        flex: 1;
        min-height: 0;
        display: block;
    }

    & .report-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 13px;

        & thead th {
            position: sticky;
            top: 0;
            background: #fff;
            z-index: 1;
            text-align: left;
            padding: 8px 12px;
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.07em;
            color: var(--color-muted);
            white-space: nowrap;
            border-bottom: 2px solid var(--color-border);
        }

        & td {
            padding: 10px 12px;
            border-bottom: 1px solid var(--color-border);
        }

        & tbody tr:last-child td {
            border-bottom: none;
        }

        & tbody tr:hover td {
            background: var(--color-bg);
        }
    }

    & .report-badge {
        display: inline-block;
        padding: 2px 8px;
        border-radius: 20px;
        font-size: 11px;
        font-weight: 600;

        &.initial {
            background: color-mix(in srgb, var(--color-initial) 12%, transparent);
            color: var(--color-initial);
        }

        &.renewal {
            background: color-mix(in srgb, var(--color-renewal) 12%, transparent);
            color: var(--color-renewal);
        }

        &.product {
            background: color-mix(in srgb, var(--color-product) 12%, transparent);
            color: var(--color-product);
        }
    }

    & .report-plan-light,
    & .report-plan-standard,
    & .report-plan-pro {
        color: var(--color-text);
    }

    & .report-amount {
        font-family: "DM Mono", monospace;
    }
}