/* =========================================================
   SUMMARY WRAPPER
========================================================= */

.summary-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 18px;
}


/* =========================================================
   BASE SUMMARY GRID
========================================================= */

.summary-grid {
    display: grid;
    width: 100%;
    gap: 10px;
}


/* =========================================================
   OPERATIONAL ROW
   Total Job | Completed | In Progress

   Menggunakan 8 kolom:
   kosong | Total | Completed | Progress | kosong

   Tujuannya supaya 3 card berada di tengah
   dan ukuran card tetap proporsional.
========================================================= */

.summary-grid-operational {
    grid-template-columns: repeat(8, minmax(0, 1fr));
}


/* setiap operational card menggunakan 2 kolom */

.summary-grid-operational .summary-card {
    grid-column: span 2;
}


/* card pertama dimulai dari kolom ke-2 */

.summary-grid-operational .summary-card:first-child {
    grid-column: 2 / span 2;
}


/* =========================================================
   FINANCIAL ROW
   Revenue | Cost | Profit | Margin
========================================================= */

.summary-grid-financial {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}


/* =========================================================
   SUMMARY CARD
========================================================= */

.summary-card {
    position: relative;

    width: 100%;
    min-width: 0;

    height: 110px;

    border-radius: 12px;

    padding: 12px;

    overflow: hidden;

    color: white;

    box-sizing: border-box;
}


/* =========================================================
   CARD HEADER
========================================================= */

.summary-header {
    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 10px;
}


/* =========================================================
   TITLE
========================================================= */

.summary-title {
    font-size: 11px;

    font-weight: 600;

    line-height: 1.3;

    opacity: .95;
}


/* =========================================================
   VALUE
========================================================= */

.summary-value {
    font-size: 17px;

    font-weight: 700;

    line-height: 1.2;

    margin-top: 4px;
}


/* =========================================================
   SUBTITLE
========================================================= */

.summary-subtitle {
    margin-top: 4px;

    font-size: 10px;

    line-height: 1.3;

    opacity: .75;
}


/* =========================================================
   ICON
========================================================= */

.summary-icon {
    width: 34px;

    height: 34px;

    min-width: 34px;

    border-radius: 50%;

    background: rgba(
        255,
        255,
        255,
        .15
    );

    display: flex;

    align-items: center;

    justify-content: center;
}


.summary-icon i {
    font-size: 15px;
}


/* =========================================================
   SPARKLINE
========================================================= */

.summary-spark {
    position: absolute;

    left: 10px;

    right: 10px;

    bottom: 8px;
}


.summary-spark svg {
    display: block;

    width: 100%;

    height: 22px;
}


/* =========================================================
   COLORS
========================================================= */

.primary {
    background: #214D98;
}


.success {
    background: #1F7D47;
}


.warning {
    background: #A87400;
}


.danger {
    background: #923A41;
}


.purple {
    background: #4734A8;
}


.orange {
    background: #7F532C;
}


.info {
    background: #245B8E;
}


.teal {
    background: #146C6D;
}


/* =========================================================
   RESPONSIVE
   <= 1600px
========================================================= */

@media (max-width: 1600px) {

    /*
    |--------------------------------------------------------------------------
    | Operational
    |--------------------------------------------------------------------------
    |
    | Tetap 3 card dan tetap center
    |
    */

    .summary-grid-operational {
        grid-template-columns:
            repeat(8, minmax(0, 1fr));
    }


    .summary-grid-operational .summary-card {
        grid-column: span 2;
    }


    .summary-grid-operational
    .summary-card:first-child {
        grid-column: 2 / span 2;
    }


    /*
    |--------------------------------------------------------------------------
    | Financial
    |--------------------------------------------------------------------------
    */

    .summary-grid-financial {
        grid-template-columns:
            repeat(4, minmax(0, 1fr));
    }

}


/* =========================================================
   RESPONSIVE
   <= 1200px
========================================================= */

@media (max-width: 1200px) {

    /*
    |--------------------------------------------------------------------------
    | Operational
    |--------------------------------------------------------------------------
    |
    | Pada layar lebih kecil kita gunakan 3 kolom penuh.
    |
    */

    .summary-grid-operational {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }


    .summary-grid-operational .summary-card,
    .summary-grid-operational
    .summary-card:first-child {
        grid-column: auto;
    }


    /*
    |--------------------------------------------------------------------------
    | Financial
    |--------------------------------------------------------------------------
    */

    .summary-grid-financial {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


/* =========================================================
   RESPONSIVE
   <= 768px
========================================================= */

@media (max-width: 768px) {

    .summary-wrapper {
        gap: 10px;
    }


    .summary-grid {
        gap: 10px;
    }


    /*
    |--------------------------------------------------------------------------
    | Operational
    |--------------------------------------------------------------------------
    */

    .summary-grid-operational {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }


    /*
    |--------------------------------------------------------------------------
    | Financial
    |--------------------------------------------------------------------------
    */

    .summary-grid-financial {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


/* =========================================================
   RESPONSIVE
   <= 576px
========================================================= */

@media (max-width: 576px) {

    .summary-grid-operational,
    .summary-grid-financial {
        grid-template-columns: 1fr;
    }


    .summary-card {
        height: 105px;
    }

}

.aging-summary-value.warning {
    color: #F7B731;
    background: transparent;
}

.aging-summary-value.info {
    color: #4F8DF7;
    background: transparent;
}

.aging-summary-value.success {
    color: #42C77A;
    background: transparent;
}