/* ==========================================================================
   Charts - Chart containers, funnel, vertical progress bars
   ========================================================================== */

/* --------------------------------------------------------------------------
   Chart Container
   -------------------------------------------------------------------------- */

.chart-container {
    position: relative;
    width: 100%;
}

.chart-container canvas {
    width: 100% !important;
}

/* --------------------------------------------------------------------------
   Donut Chart Grid (Dashboard - Quarterly Goal Progress)
   -------------------------------------------------------------------------- */

.donut-chart-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-lg);
    justify-content: center;
}

.donut-chart-item {
    text-align: center;
    flex: 0 0 auto;
    width: 140px;
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    transition: background-color var(--transition-fast);
}

.donut-chart-item:hover {
    background-color: var(--bg-tile-hover);
}

.donut-chart-item .chart-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent-tertiary);
    margin-bottom: var(--space-sm);
}

.donut-chart-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.donut-chart-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Horizontal Bar Chart (Dashboard - ProScan Status)
   -------------------------------------------------------------------------- */

.hbar-chart-container {
    width: 100%;
}

.hbar-row {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-sm);
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
}

.hbar-row:hover {
    background-color: var(--bg-tile-hover);
}

.hbar-label {
    width: 140px;
    flex-shrink: 0;
    font-size: 0.8125rem;
    color: var(--text-primary);
    font-weight: 500;
}

.hbar-bar-wrapper {
    flex: 1;
    height: 28px;
    background-color: var(--border-color-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: 0 var(--space-sm);
}

.hbar-bar {
    height: 100%;
    border-radius: var(--radius-sm);
    transition: width var(--transition-base);
    display: flex;
    align-items: center;
    padding-left: var(--space-sm);
    min-width: 0;
}

.hbar-count {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--accent-primary);
    width: 30px;
    text-align: right;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Sales Pipeline Funnel (Custom CSS — proportional height, tapered width)
   -------------------------------------------------------------------------- */

.funnel-chart-custom {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.funnel-section {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    overflow: hidden;
    transition: opacity var(--transition-fast);
}

.funnel-section:hover {
    opacity: 0.85;
}

.funnel-section-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    text-align: center;
    pointer-events: none;
}

.funnel-section-label {
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.funnel-section-amount {
    font-size: 0.6875rem;
    font-weight: 500;
    opacity: 0.9;
}

/* --------------------------------------------------------------------------
   Vertical Progress Bars (Dashboard - Priority Goal Tracking)
   -------------------------------------------------------------------------- */

.vertical-bars-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: var(--space-lg);
    padding: var(--space-md) 0;
    min-height: 280px;
}

.vertical-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    flex: 1;
    max-width: 200px;
}

.vertical-bar-target {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-align: center;
    white-space: nowrap;
}

.vertical-bar-track {
    width: 100%;
    height: 200px;
    background-color: var(--border-color-light);
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.vertical-bar-fill {
    width: 100%;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 30px;
    transition: height var(--transition-base);
}

.vertical-bar-value {
    font-size: 0.75rem;
    font-weight: 700;
    color: #FFFFFF;
    text-align: center;
    line-height: 1.2;
}

.vertical-bar-pct {
    font-size: 0.625rem;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

.vertical-bar-label {
    font-size: 1rem;
    color: var(--text-secondary);
    text-align: center;
    max-width: 200px;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* --------------------------------------------------------------------------
   Revenue by Month Line Chart
   -------------------------------------------------------------------------- */

.line-chart-container {
    position: relative;
    height: 300px;
}

.line-chart-container canvas {
    height: 100% !important;
}
