/*
|--------------------------------------------------------------------------
| AGING CARD
|--------------------------------------------------------------------------
*/

.aging-card {
    width: 100%;
    overflow: hidden;
}


/*
|--------------------------------------------------------------------------
| HEADER
|--------------------------------------------------------------------------
*/

.aging-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.aging-title {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
}

.aging-subtitle {
    margin-top: 5px;

    font-size: 14px;
    font-weight: 400;

    color: #94a3b8;
}


/*
|--------------------------------------------------------------------------
| MODE SWITCH
|--------------------------------------------------------------------------
*/

.aging-mode-switch {
    display: flex;
    align-items: center;

    padding: 4px;

    background: #16223a;

    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
}

.aging-mode-btn {
    min-width: 80px;

    padding: 8px 16px;

    border: 0;
    border-radius: 7px;

    background: transparent;

    color: #94a3b8;

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    transition: all 0.2s ease;
}

.aging-mode-btn:hover {
    color: #ffffff;
}

.aging-mode-btn.active {
    background: #0f172a;
    color: #ffffff;
}


/*
|--------------------------------------------------------------------------
| SUMMARY
|--------------------------------------------------------------------------
*/

.aging-summary {
    display: grid;

    grid-template-columns:
        repeat(5, minmax(0, 1fr));

    border-top:
        1px solid rgba(255, 255, 255, 0.06);

    border-bottom:
        1px solid rgba(255, 255, 255, 0.06);
}

.aging-summary-item {
    position: relative;

    min-height: 110px;

    padding: 22px 28px;

    display: flex;
    flex-wrap: wrap;
    align-content: center;
    align-items: baseline;

    column-gap: 10px;
    row-gap: 5px;

    border-right:
        1px solid rgba(255, 255, 255, 0.06);
}

.aging-summary-item:last-child {
    border-right: 0;
}

.aging-summary-label {
    width: 100%;

    margin-bottom: 3px;

    color: #94a3b8;

    font-size: 12px;
    font-weight: 700;

    text-transform: uppercase;
}

.aging-summary-value {
    color: #ffffff;

    font-size: 27px;
    line-height: 1;

    font-weight: 700;
}

.aging-summary-item small {
    color: #94a3b8;

    font-size: 12px;
    font-weight: 500;
}


/*
|--------------------------------------------------------------------------
| SUMMARY COLORS
|--------------------------------------------------------------------------
*/

.aging-green {
    color: #43c77a;
}

.aging-yellow {
    color: #ffb000;
}

.aging-red {
    color: #f65353;
}


/*
|--------------------------------------------------------------------------
| INFO ROW
|--------------------------------------------------------------------------
*/

.aging-info-row {
    display: flex;
    align-items: center;

    gap: 35px;

    padding: 16px 28px;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.06);

    color: #94a3b8;

    font-size: 13px;
}

.aging-info-row > div {
    display: flex;
    align-items: center;

    gap: 7px;
}

.aging-info-row strong {
    color: #ffffff;

    font-weight: 700;
}


/*
|--------------------------------------------------------------------------
| BREADCRUMB
|--------------------------------------------------------------------------
*/

.aging-breadcrumb {
    min-height: 46px;

    padding: 12px 28px;

    display: flex;
    align-items: center;

    gap: 8px;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.06);

    color: #64748b;

    font-size: 13px;
}

.aging-breadcrumb-btn {
    padding: 0;

    border: 0;

    background: transparent;

    color: #60a5fa;

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;
}

.aging-breadcrumb-btn:hover {
    color: #93c5fd;
}

.aging-breadcrumb-current {
    color: #ffffff;
    font-weight: 600;
}


/*
|--------------------------------------------------------------------------
| TABLE WRAPPER
|--------------------------------------------------------------------------
*/

.aging-table-wrapper {
    width: 100%;

    overflow-x: auto;
}


/*
|--------------------------------------------------------------------------
| TABLE
|--------------------------------------------------------------------------
*/

.aging-table {
    width: 100%;

    border-collapse: collapse;

    table-layout: auto;
}

.aging-table thead {
    background: rgba(15, 23, 42, 0.4);
}

.aging-table th {
    padding: 14px 18px;

    color: #8fa9d6;

    font-size: 12px;
    font-weight: 700;

    text-align: left;

    text-transform: uppercase;

    white-space: nowrap;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.06);
}

.aging-table td {
    padding: 15px 18px;

    color: #dbe7ff;

    font-size: 13px;

    vertical-align: middle;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.05);
}

.aging-table tbody tr {
    transition: background 0.15s ease;
}

.aging-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

.aging-table tbody tr:last-child td {
    border-bottom: 0;
}


/*
|--------------------------------------------------------------------------
| ENTITY
|--------------------------------------------------------------------------
*/

.aging-entity {
    display: flex;
    align-items: center;

    gap: 10px;
}

.aging-entity strong {
    color: #ffffff;

    font-weight: 600;
}


/*
|--------------------------------------------------------------------------
| JOB NUMBER
|--------------------------------------------------------------------------
*/

.aging-job-number {
    color: #60a5fa;

    font-size: 12px;
    font-weight: 600;

    white-space: nowrap;
}


/*
|--------------------------------------------------------------------------
| STATUS
|--------------------------------------------------------------------------
*/

.aging-status {
    display: inline-flex;
    align-items: center;

    padding: 5px 9px;

    border-radius: 6px;

    background: rgba(59, 130, 246, 0.12);

    color: #93c5fd;

    font-size: 11px;
    font-weight: 600;

    white-space: nowrap;
}


/*
|--------------------------------------------------------------------------
| AGING BADGE
|--------------------------------------------------------------------------
*/

.aging-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 65px;

    padding: 5px 9px;

    border-radius: 6px;

    font-size: 11px;
    font-weight: 700;

    white-space: nowrap;
}


/*
|--------------------------------------------------------------------------
| HEALTHY
|--------------------------------------------------------------------------
*/

.aging-badge.healthy {
    background: rgba(67, 199, 122, 0.13);

    color: #43c77a;
}


/*
|--------------------------------------------------------------------------
| ATTENTION
|--------------------------------------------------------------------------
*/

.aging-badge.attention {
    background: rgba(255, 176, 0, 0.13);

    color: #ffb000;
}


/*
|--------------------------------------------------------------------------
| CRITICAL
|--------------------------------------------------------------------------
*/

.aging-badge.critical {
    background: rgba(246, 83, 83, 0.13);

    color: #f65353;
}


/*
|--------------------------------------------------------------------------
| ACTION
|--------------------------------------------------------------------------
*/

.aging-action-cell {
    width: 80px;

    text-align: right;
}

.aging-detail-btn {
    padding: 6px 12px;

    border:
        1px solid rgba(96, 165, 250, 0.25);

    border-radius: 6px;

    background: rgba(59, 130, 246, 0.08);

    color: #60a5fa;

    font-size: 11px;
    font-weight: 600;

    cursor: pointer;

    transition: all 0.15s ease;
}

.aging-detail-btn:hover {
    background: rgba(59, 130, 246, 0.18);

    border-color:
        rgba(96, 165, 250, 0.5);

    color: #93c5fd;
}


/*
|--------------------------------------------------------------------------
| EMPTY
|--------------------------------------------------------------------------
*/

.aging-empty {
    height: 130px;

    text-align: center !important;

    color: #64748b !important;
}


/*
|--------------------------------------------------------------------------
| TABLE SCROLLBAR
|--------------------------------------------------------------------------
*/

.aging-table-wrapper::-webkit-scrollbar {
    height: 6px;
}

.aging-table-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.aging-table-wrapper::-webkit-scrollbar-thumb {
    background: #334155;

    border-radius: 10px;
}


/*
|--------------------------------------------------------------------------
| RESPONSIVE
|--------------------------------------------------------------------------
*/

@media (max-width: 1200px) {

     .aging-summary {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }


    .aging-summary-item:nth-child(2) {
        border-right: 0;
    }

    .aging-summary-item:nth-child(-n+2) {
        border-bottom:
            1px solid rgba(255, 255, 255, 0.06);
    }

}


@media (max-width: 768px) {

    .aging-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .aging-mode-switch {
        width: 100%;
    }

    .aging-mode-btn {
        flex: 1;
    }

    .aging-summary {
        grid-template-columns: 1fr;
    }

    .aging-summary-item {
        min-height: 90px;

        padding: 18px 20px;

        border-right: 0;

        border-bottom:
            1px solid rgba(255, 255, 255, 0.06);
    }

    .aging-summary-item:last-child {
        border-bottom: 0;
    }

    .aging-info-row {
        align-items: flex-start;
        flex-direction: column;

        gap: 8px;

        padding: 15px 20px;
    }

    .aging-breadcrumb {
        padding:
            12px 20px;

        overflow-x: auto;

        white-space: nowrap;
    }

    .aging-table {
        min-width: 750px;
    }

}

/*
|--------------------------------------------------------------------------
| HEALTH STATUS
|--------------------------------------------------------------------------
*/

.aging-health-status {
    display: inline-flex;

    align-items: center;

    gap: 6px;

    font-size: 11px;

    font-weight: 600;

    white-space: nowrap;
}


.aging-health-dot {
    width: 7px;

    height: 7px;

    border-radius: 50%;
}


/*
|--------------------------------------------------------------------------
| HEALTHY
|--------------------------------------------------------------------------
*/

.aging-health-status.healthy {
    color: #43c77a;
}

.aging-health-status.healthy
.aging-health-dot {
    background: #43c77a;
}


/*
|--------------------------------------------------------------------------
| ATTENTION
|--------------------------------------------------------------------------
*/

.aging-health-status.attention {
    color: #ffb000;
}

.aging-health-status.attention
.aging-health-dot {
    background: #ffb000;
}


/*
|--------------------------------------------------------------------------
| CRITICAL
|--------------------------------------------------------------------------
*/

.aging-health-status.critical {
    color: #f65353;
}

.aging-health-status.critical
.aging-health-dot {
    background: #f65353;
}

/*
|--------------------------------------------------------------------------
| DISTRIBUTION LEGEND
|--------------------------------------------------------------------------
*/

.aging-distribution-legend {
    display: flex;
    align-items: center;

    flex-wrap: wrap;

    gap: 22px;

    padding: 12px 28px;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.06);

    color: #cbd5e1;

    font-size: 11px;
}

.aging-distribution-legend > div {
    display: flex;
    align-items: center;

    gap: 6px;
}

.aging-distribution-legend small {
    color: #64748b;
}


/*
|--------------------------------------------------------------------------
| LEGEND DOT
|--------------------------------------------------------------------------
*/

.aging-legend-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    flex-shrink: 0;
}

.aging-legend-dot.healthy {
    background: #43c77a;
}

.aging-legend-dot.attention {
    background: #ffb000;
}

.aging-legend-dot.critical {
    background: #f97316;
}

.aging-legend-dot.severe {
    background: #ef4444;
}


/*
|--------------------------------------------------------------------------
| DISTRIBUTION CELL
|--------------------------------------------------------------------------
*/

.aging-distribution-cell {
    min-width: 250px;
}


/*
|--------------------------------------------------------------------------
| DISTRIBUTION
|--------------------------------------------------------------------------
*/

.aging-distribution {
    width: 100%;
    max-width: 320px;
}


/*
|--------------------------------------------------------------------------
| BAR
|--------------------------------------------------------------------------
*/

.aging-distribution-bar {
    width: 100%;
    height: 7px;

    display: flex;

    overflow: hidden;

    background: rgba(255, 255, 255, 0.05);

    border-radius: 20px;
}

.aging-distribution-segment {
    height: 100%;

    transition:
        width 0.25s ease;
}

.aging-distribution-segment.healthy {
    background: #43c77a;
}

.aging-distribution-segment.attention {
    background: #ffb000;
}

.aging-distribution-segment.critical {
    background: #f97316;
}

.aging-distribution-segment.severe {
    background: #ef4444;
}


/*
|--------------------------------------------------------------------------
| DISTRIBUTION INFO
|--------------------------------------------------------------------------
*/

.aging-distribution-info {
    display: flex;

    align-items: center;

    gap: 10px;

    margin-top: 5px;

    font-size: 9px;

    font-weight: 600;
}

.aging-distribution-info .healthy {
    color: #43c77a;
}

.aging-distribution-info .attention {
    color: #ffb000;
}

.aging-distribution-info .critical {
    color: #f97316;
}

.aging-distribution-info .severe {
    color: #ef4444;
}

.aging-summary-value-row {
    display: flex;
    align-items: baseline;

    gap: 8px;
}

.aging-summary-range {
    width: 100%;

    margin-top: 4px;

    color: #64748b;

    font-size: 10px;
}

.aging-orange {
    color: #f97316;
}


/*
|--------------------------------------------------------------------------
| ENTITY
|--------------------------------------------------------------------------
*/

.aging-entity-content {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 4px;
}

.aging-entity-content strong {
    color: #ffffff;

    font-size: 13px;
    font-weight: 600;
}

.aging-entity-content small {
    color: #64748b;

    font-size: 10px;
}


/*
|--------------------------------------------------------------------------
| MAIN VALUE
|--------------------------------------------------------------------------
*/

.aging-main-value {
    color: #e2e8f0;

    font-size: 12px;
    font-weight: 700;

    white-space: nowrap;
}


/*
|--------------------------------------------------------------------------
| AVERAGE
|--------------------------------------------------------------------------
*/

.aging-average {
    color: #cbd5e1;

    font-size: 12px;
    font-weight: 600;

    white-space: nowrap;
}

.aging-average small {
    color: #64748b;

    font-size: 10px;
}


/*
|--------------------------------------------------------------------------
| DETAIL ARROW
|--------------------------------------------------------------------------
*/

.aging-detail-arrow {
    margin-left: 4px;

    font-size: 15px;
    line-height: 10px;
}

@media (max-width: 1200px) {

    .aging-summary {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

}


@media (max-width: 768px) {

    .aging-summary {
        grid-template-columns:
            1fr 1fr;
    }

}


@media (max-width: 480px) {

    .aging-summary {
        grid-template-columns:
            1fr;
    }

}

/* =========================================================
   AGING & JOB PROGRESS
   ========================================================= */

.aging-card {
    margin-top: 24px;
    margin-bottom: 24px;
}