/* ===== Global Page Styling ===== */
body {
    background-color: #f4f6f9 !important;
    font-family: "Segoe UI", Arial, sans-serif !important;
    color: #333;
}

/* ===== Card Common ===== */
.card {
    border: none !important;
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12) !important;
    }

/* ===== SCTP (Light Blue) ===== */
.card-blue {
    background-color: #e8f0fe !important;
    border-left: 5px solid #1877f2 !important;
}

    .card-blue .card-header {
        background: linear-gradient(135deg, #0046a8, #1877f2) !important;
        color: #fff !important;
    }

/* ===== TDP (Light Pink) ===== */
.card-pink {
    background-color: #fde6ef !important;
    border-left: 5px solid #e83e8c !important;
}

    .card-pink .card-header {
        background: linear-gradient(135deg, #b10f5f, #e83e8c) !important;
        color: #fff !important;
    }

/* ===== ACTI (Light Green) ===== */
.card-green {
    background-color: #e8f5e9 !important;
    border-left: 5px solid #28a745 !important;
}

    .card-green .card-header {
        background: linear-gradient(135deg, #1e7a34, #28a745) !important;
        color: #fff !important;
    }

/* ===== FDS (Light Orange) ===== */
.card-orange {
    background-color: #fff4e5 !important;
    border-left: 5px solid #fd7e14 !important;
}

    .card-orange .card-header {
        background: linear-gradient(135deg, #c45a00, #fd7e14) !important;
        color: #fff !important;
    }

/* ===== MT/RT (Light Purple) ===== */
.card-purple {
    background-color: #f3e8ff !important;
    border-left: 5px solid #6f42c1 !important;
}

    .card-purple .card-header {
        background: linear-gradient(135deg, #4a2289, #6f42c1) !important;
        color: #fff !important;
    }

/* ===== Card Header Common ===== */
.card-header {
    font-weight: 600 !important;
    font-size: 1.1rem !important;
    padding: 0.75rem 1rem !important;
    border-bottom: none !important;
}

/* ===== Card Body ===== */
.card-body {
    background-color: transparent !important;
    text-align: center !important;
}

    .card-body h6 {
        font-weight: 600;
        font-size: 1.05rem;
        margin-bottom: 1rem;
        color: #212529 !important;
    }

    .card-body p {
        margin: 0.3rem 0;
        font-size: 0.95rem;
        color: #444 !important;
    }

/* ===== Shadow Utility ===== */
.shadow {
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1) !important;
}

/* ===== Responsive Layout ===== */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1.5rem;
    }
}

.chart-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
    padding: 20px;
    transition: transform 0.3s ease;
}

    .chart-container:hover {
        transform: scale(1.02);
    }

    .nested-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
    font-size: 13px;
}

.nested-legend .lg-box {
    width: 14px;
    height: 14px;
    display: inline-block;
    margin-right: 6px;
    border-radius: 3px;
}
.chart-wrap {
    width: 100%;
    max-width: 350px; /* chart maximum size */
    margin: auto;
}

canvas {
    width: 100% !important;
    height: auto !important; /* auto-scale height for responsiveness */
    display: block;
}
