.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: white;
    padding: 1.5rem !important;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.05) !important;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stat-header span {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-header i {
    font-size: 1.2rem;
}

.stat-card p {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.stat-footer {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 0.25rem;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.chart-container {
    background: white;
    padding: 1.5rem !important;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    height: 420px;
    /* Standardize height */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    transition: box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    /* Safety measure */
}

.chart-wrapper {
    flex: 1;
    position: relative;
    min-height: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.chart-container h4 {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-container:hover {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.05);
}



@media (max-width: 768px) {


    .card-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.75rem !important;
        margin-bottom: 1.5rem !important;
        width: 100% !important;
    }

    .stat-card {
        padding: 1rem !important;
        width: 100% !important;
    }

    .stat-header span {
        font-size: 0.65rem !important;
    }

    .stat-card p {
        font-size: 1.25rem !important;
        margin-top: 0.25rem !important;
    }

    .charts-grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }

    .chart-container {
        height: 350px !important;
        padding: 1rem !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .chart-container h4 {
        margin-bottom: 0.75rem !important;
        text-align: center;
        width: 100%;
    }

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