/* =========================================================
   PROFIT LOSS
========================================================= */

.profit-loss-card {
    width: 100%;
    background: #1d3557;
    border-radius: 18px;
    overflow: hidden;
}


/* HEADER */

.profit-loss-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.profit-loss-title {
    margin: 0;
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
}

.profit-loss-subtitle {
    margin-top: 5px;
    color: #9fb3d9;
    font-size: 12px;
}


/* SUMMARY */

.profit-loss-summary {
    display: flex;
    align-items: center;
    gap: 28px;
}

.profit-loss-summary-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: right;
}

.profit-loss-summary-item span {
    color: #9fb3d9;
    font-size: 11px;
}

.profit-loss-summary-item strong {
    color: #ffffff;
    font-size: 15px;
}


/* TABLE */

.profit-loss-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.profit-loss-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 850px;
}

.profit-loss-table th {
    background: #162744;
    color: #9fb3d9;
    padding: 13px 18px;
    text-align: right;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.profit-loss-table th:first-child {
    text-align: left;
}

.profit-loss-table td {
    padding: 13px 18px;
    color: #e8eef9;
    font-size: 13px;
    text-align: right;
    border-bottom: 1px solid rgba(255,255,255,.06);
    white-space: nowrap;
}

.profit-loss-table td:first-child {
    text-align: left;
}


/* DIVISION */

.profit-loss-division-row {
    background: #1d3557;
    cursor: pointer;
    transition: background .2s ease;
}

.profit-loss-division-row:hover {
    background: #233e66;
}

.profit-loss-division-row td {
    font-weight: 600;
}


/* TOGGLE */

.profit-loss-toggle {
    width: 22px;
    height: 22px;
    padding: 0;
    margin-right: 6px;
    border: 0;
    background: transparent;
    color: #8fb6ff;
    cursor: pointer;
    font-size: 11px;
}

.profit-loss-arrow {
    display: inline-block;
    transition: transform .2s ease;
}

.profit-loss-level-name {
    color: #ffffff;
}


/* CUSTOMER */

.profit-loss-child-row {
    display: none;
    background: #172c4b;
}

.profit-loss-child-row.is-open {
    display: table-row;
}

.profit-loss-child-wrapper {
    padding: 0;
}


.profit-loss-customer {
    width: 100%;
}


.profit-loss-customer-row {
    display: grid;

    grid-template-columns:
        minmax(280px, 1fr)
        90px
        140px
        140px
        140px
        90px;

    align-items: center;

    padding: 11px 18px 11px 38px;

    color: #dce6f7;

    font-size: 12px;

    border-bottom: 1px solid rgba(255,255,255,.04);

    cursor: pointer;
}

.profit-loss-customer-row:hover {
    background: rgba(255,255,255,.03);
}


.profit-loss-name {
    display: flex;
    align-items: center;
}


/* PROJECT */

.profit-loss-projects {
    display: none;
    background: #12233d;
}

.profit-loss-projects.is-open {
    display: block;
}


.profit-loss-project-row {
    display: grid;

    grid-template-columns:
        minmax(280px, 1fr)
        90px
        140px
        140px
        140px
        90px;

    align-items: center;

    padding: 10px 18px 10px 78px;

    color: #aebfda;

    font-size: 11px;

    border-bottom: 1px solid rgba(255,255,255,.035);
}


.profit-loss-project-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.project-dot {
    color: #6ea1ff;
    margin-right: 8px;
}


/* PROFIT */

.profit-positive {
    color: #4fd18b !important;
}

.profit-negative {
    color: #ff6872 !important;
}

.profit-warning {
    color: #ffc44d !important;
}


/* EMPTY */

.profit-loss-loading,
.profit-loss-empty,
.profit-loss-no-child {
    color: #8fa5c9 !important;
    text-align: center !important;
}

.profit-loss-loading {
    padding: 35px !important;
}


/* FOOTER */

.profit-loss-footer {
    display: flex;
    justify-content: space-between;
    padding: 10px 18px;
    color: #7189ae;
    font-size: 10px;
    border-top: 1px solid rgba(255,255,255,.05);
}


/* MOBILE */

@media (max-width: 768px) {

    .profit-loss-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .profit-loss-summary {
        width: 100%;
        justify-content: space-between;
        gap: 10px;
    }

    .profit-loss-summary-item {
        text-align: left;
    }

}

.profit-loss-card {
    margin-top: 20px;
}