/* amCharts 4 Container Improvements */
#ordersPie,
#ticketsPie,
#productsPie {
    width: 100% !important;
    min-height: 260px;
    margin: 0 auto;
    flex: 1;
}

/* Chart Loading State */
.gauge-card.is-loading #ordersPie,
.gauge-card.is-loading #ticketsPie,
.gauge-card.is-loading #productsPie {
    opacity: 0.3;
    pointer-events: none;
}

/* Chart Container Styling */
.gauge-card[style*="height:320px"] {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    overflow: hidden;
}

.gauge-card[style*="height:320px"] h4 {
    margin-bottom: 10px;
    text-align: center;
    flex-shrink: 0;
}

.gauge-card[style*="height:320px"] > div[id$="Pie"] {
    flex: 1;
    width: 100% !important;
    min-height: 0;
}

/* Pie wrap container */
.orders-pie-wrap {
    overflow: hidden;
}

/* Hide amCharts watermark logo */
#ordersPie > div > svg > g > g[opacity="0.4"],
#ticketsPie > div > svg > g > g[opacity="0.4"],
#productsPie > div > svg > g > g[opacity="0.4"],
g[aria-labelledby] > g:last-child,
a[title="JavaScript charts"],
a[href*="amcharts.com"] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
}

/* Clip chart SVG so nothing overflows the card */
#ordersPie > div,
#ticketsPie > div,
#productsPie > div {
    overflow: hidden !important;
}

/* Responsive Chart Adjustments */
@media (max-width: 768px) {
    .gauge-card[style*="height:320px"] {
        height: 300px !important;
    }

    #ordersPie,
    #ticketsPie,
    #productsPie {
        min-height: 200px;
    }
}

/* Chart Error State */
.chart-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #666;
    font-style: italic;
    text-align: center;
}

/* Chart No Data State */
.chart-no-data {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #999;
    font-size: 14px;
    text-align: center;
}
