/* ── Activity-type colour palette ── */
:root {
    --ar-calls: #6366f1;
    --ar-emails: #a855f7;
    --ar-meetings: #06b6d4;
    --ar-other: #f59e0b;
}

/* ── View-toggle pill (stacked / trend) ── */
.ar-chart-toggle {
    display: inline-flex;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 3px;
    gap: 3px;
}

.ar-toggle-btn {
    border: none;
    background: transparent;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ar-toggle-btn.active {
    background: #fff;
    color: #0b509d;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.ar-toggle-btn:hover:not(.active) {
    color: #374151;
}

/* ── Chart legend dots (built via JS) ── */
.ar-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
}

.ar-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Loading overlay ── */
.ar-chart-loading {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    border-radius: 15px;
}

.ar-chart-loading.d-none {
    display: none !important;
}

.ar-no-data {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 4;
    border-radius: 15px;
    color: #9ca3af;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.ar-no-data.d-none {
    display: none !important;
}

/* ── Donut centre label ── */
.ar-donut-center {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.ar-donut-total {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1a202c;
    line-height: 1;
}

.ar-donut-label {
    font-size: 0.7rem;
    color: #718096;
    font-weight: 500;
    margin-top: 2px;
}

/* ── Donut legend rows (built via JS) ── */
.ar-donut-legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.ar-donut-legend-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ar-donut-legend-bar-wrap {
    flex: 1;
    height: 5px;
    background: #f3f4f6;
    border-radius: 99px;
    overflow: hidden;
    margin: 0 10px;
}

.ar-donut-legend-bar {
    height: 100%;
    border-radius: 99px;
    transition: width 0.6s ease;
}

.ar-donut-legend-val {
    font-weight: 700;
    color: #1a202c;
    min-width: 24px;
    text-align: center;
}

/* ── Top-deals mini progress bar ── */
.ar-progress-mini {
    height: 5px;
    border-radius: 99px;
    background: #f1f5f9;
    overflow: hidden;
    min-width: 60px;
}

.ar-progress-mini .bar {
    height: 100%;
    border-radius: 99px;
    background: #0b509d;
    transition: width 0.5s ease;
}

/* ── Rank badge ── */
.ar-deal-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 700;
}

canvas#ar-status-chart,
canvas#ar-monthly-chart {
    height: 320px !important;
}

/* ── Trend Chart Scroll Support ── */
.ar-trend-scroll-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px; /* Space for scrollbar */
    cursor: default;
}

.ar-trend-inner-wrap {
    min-width: 100%;
    height: 320px;
    position: relative;
    transition: width 0.3s ease-out;
}

/* Custom Scrollbar for the chart */
.ar-trend-scroll-container::-webkit-scrollbar {
    height: 6px;
}

.ar-trend-scroll-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.ar-trend-scroll-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.ar-trend-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ── Responsive Overrides (Default / max-width: 991px & 767px) ── */
@media (max-width: 767px), (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .report-filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .report-filter-select,
    .report-filter-multiselect {
        width: 100%;
        min-width: 100%;
    }

    .report-header-section {
        flex-direction: column;
        gap: 15px;
    }

    .report-title-area h1 {
        font-size: 1.5rem;
    }

    .report-page-container {
        padding: 15px;
    }

    .report-stats-card {
        padding: 15px;
    }

    .stats-value {
        font-size: 1.25rem !important;
    }

    .stats-icon-box {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .ar-chart-wrap {
        height: 250px !important;
    }
}

/* ── Small Height Screens (max-height: 699px) ── */
@media (max-height: 699px), (min-width: 768px) and (max-width: 1199px) and (orientation: landscape) {
    .report-page-container {
        padding: 15px 20px;
    }

    .report-header-section {
        margin-bottom: 15px;
    }

    .report-title-area h1 {
        font-size: 1.4rem;
    }

    .report-title-area p {
        font-size: 0.8rem;
    }

    .report-filter-row {
        margin-bottom: 15px;
    }

    .report-filter-select {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .report-stats-card {
        padding: 12px;
    }

    .stats-label {
        font-size: 0.75rem;
    }

    .stats-value {
        font-size: 1.25rem !important;
        margin: 2px 0;
    }

    .stats-icon-box {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }

    .chart-title {
        font-size: 1rem !important;
    }

    .mb-4,
    .my-4 {
        margin-bottom: 1rem !important;
    }

    .ar-chart-wrap {
        height: 220px !important;
    }

    canvas#ar-status-chart,
    canvas#ar-monthly-chart {
        max-height: 260px !important;
    }

    .table-responsive {
        max-height: 350px;
        overflow-y: auto;
    }

    .ar-donut-total {
        font-size: 1.2rem;
    }
}