/* =========================================================
   SHARED CHART STYLES
========================================================= */

.financial-chart-wrapper,
.revenue-chart-wrapper,
.expenses-chart-wrapper {
    position: relative;
    width: 100%;
    background: #e8f5f1;
    font-family: "Proxima Nova Medium", sans-serif;
}


/* =========================================================
   FINANCIAL BAR CHART
========================================================= */

.financial-chart-wrapper {
    padding: 30px 40px 25px;
}

.financial-chart-container {
    position: relative;
    width: 100%;
    height: 500px;
}


/* =========================================================
   REVENUE + EXPENSES PIE CHARTS
========================================================= */

.revenue-chart-wrapper,
.expenses-chart-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 45px;
    padding: 35px 40px;
}


/* Chart portion */
.revenue-chart-container,
.expenses-chart-container {
    position: relative;
    flex: 0 0 52%;
    width: 52%;
    height: 450px;
    min-width: 0;
}


/* =========================================================
   PIE HTML LEGEND
========================================================= */

.pie-html-legend {
    flex: 0 1 520px;
    width: 100%;
    max-width: 520px;
    min-width: 0;
    font-family: "Proxima Nova Medium", sans-serif;
    text-align: left;
}


.pie-html-legend ul {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}


.pie-html-legend li {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr);
    align-items: start;
    column-gap: 13px;
    width: 100%;
    cursor: pointer;
    text-align: left;
}


/* Legend color dot */
.pie-html-legend-dot {
    width: 14px;
    height: 14px;
    margin-top: 4px;
    border-radius: 50%;
    flex: none;
}


/* Label + percentage */
.pie-html-legend-text {
    display: grid;

    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    column-gap: 20px;
    width: 100%;
    min-width: 0;
    font-size: 15px;
    line-height: 1.3;
    color: #222;
    text-align: left !important;
}


/* Category label */
.pie-html-legend-text > span:first-child {
    min-width: 0;

    padding: 0;

    text-align: left !important;

    white-space: normal;

    overflow-wrap: break-word;
}


/* Percentage */
.pie-html-legend-percent {
    min-width: 48px;
    margin: 0;
    white-space: nowrap;
    text-align: right !important;
    font-variant-numeric: tabular-nums;
    color: #222;
}

/* Disabled legend item */
.pie-html-legend li.is-hidden {
    opacity: 0.4;
}


/* =========================================================
   EXTERNAL HTML TOOLTIPS
========================================================= */

.chart-html-tooltip {
    position: absolute;
    z-index: 50;
    min-width: 210px;
    max-width: 280px;
    padding: 16px 18px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    color: #222;
    font-family: "Proxima Nova Medium", sans-serif;
    pointer-events: none;
    opacity: 0;
    transform: translate( -50%, calc(-100% - 14px) );
    transition: opacity 0.15s ease, left 0.08s ease, top 0.08s ease;
}

.chart-html-tooltip-title {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1;
    color: #777;
}

.chart-html-tooltip-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 8px;
}

.chart-html-tooltip-dot {
    width: 10px;
    height: 10px;
    margin-top: 4px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.chart-html-tooltip-label {
    font-size: 15px;
    line-height: 1.3;
}

.chart-html-tooltip-value {
    font-size: 22px;
    line-height: 1.1;
    color: #222;
}

.chart-html-tooltip-percent {
    margin-top: 5px;
    font-size: 14px;
    line-height: 1.2;
    color: #777;
}

/* =========================================================
   FINANCIAL TABLE
========================================================= */

.financial-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: #e8f5f1;
    padding: 30px;
    font-family: "Proxima Nova Medium", sans-serif;
}

.financial-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    border-spacing: 0;
    color: #222;

    font-family: "Proxima Nova Medium", sans-serif;
}


/* =========================================================
   TABLE HEADER
========================================================= */

.financial-table thead th {
    padding: 14px 18px;

    font-size: 15px;
    line-height: 1.15;
    font-weight: 600;
    text-align: right;
    color: #222;
    border-bottom: 1px solid rgba(0, 0, 0, 0.16);
}

.financial-table thead th:first-child {
    text-align: left;
}

.financial-table thead th span {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: #777;
}

/* Variance + percentage headers */
.financial-table thead th:nth-child(4),
.financial-table thead th:nth-child(5) {
    background:
        rgba(242, 189, 122, 0.20);
}


/* =========================================================
   TABLE BODY CELLS
========================================================= */

.financial-table tbody td {
    padding: 13px 18px;
    font-size: 16px;
    line-height: 1.35;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    vertical-align: middle;
}

/* Description */
.financial-table tbody td:first-child {
    width: 40%;
    text-align: left;
}

/* Numbers */
.financial-number,
.financial-percent {
    white-space: nowrap;
    text-align: right;
}


/* Variance + percentage columns */
.financial-table tbody td:nth-child(4),
.financial-table tbody td:nth-child(5) {
    background:
        rgba(242, 189, 122, 0.10);
}


/* =========================================================
   TABLE SECTION TITLES
========================================================= */

.financial-table .financial-section-title td {
    padding: 22px 18px 10px;
    background: transparent;
    border-bottom: 0;
    font-size: 18px;
    line-height: 1.2;
    color: #117553;
}

/* Don't add orange background to colspan titles */
.financial-table .financial-section-title td:nth-child(4),
.financial-table .financial-section-title td:nth-child(5) {
    background: transparent;
}

/* =========================================================
   TABLE TOTALS
========================================================= */

.financial-table .financial-total td {
    padding-top: 15px;
    padding-bottom: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.30);
    border-bottom: 1px solid rgba(0, 0, 0, 0.30);
    font-weight: normal;
}

.financial-table .financial-total td:first-child {
    color: #117553;
}

.financial-table .financial-subtotal td {
    border-top: 1px solid rgba(0, 0, 0, 0.16);
}

.financial-table .financial-emphasis td:first-child {
    font-style: italic;
}

/* =========================================================
   POSITIVE / NEGATIVE VALUES
========================================================= */

.financial-table .positive {
    color: #117553;
}

.financial-table .negative {
    color: #a64b3c;
}

/* =========================================================
   TABLE SECTION SPACER
========================================================= */

.financial-table .financial-section-spacer td {
    height: 25px;
    padding: 0;
    background: transparent !important;
    border: 0;
}

/* =========================================================
   TABLE ROW HOVER
========================================================= */

.financial-table tbody tr:not(
    .financial-section-title,
    .financial-section-spacer
):hover td {
    background-color: rgba(255, 255, 255, 0.45);
}

/* Keep variance columns slightly tinted on hover */
.financial-table tbody tr:not(
    .financial-section-title,
    .financial-section-spacer
):hover td:nth-child(4),
.financial-table tbody tr:not(
    .financial-section-title,
    .financial-section-spacer
):hover td:nth-child(5) {
    background-color:
        rgba(242, 189, 122, 0.18);
}

/* =========================================================
   TABLET
========================================================= */

@media (max-width: 991px) {
    .revenue-chart-wrapper,
    .expenses-chart-wrapper {
        gap: 25px;
        padding-left: 25px;
        padding-right: 25px;
    }

    .revenue-chart-container,
    .expenses-chart-container {
        flex-basis: 48%;
        width: 48%;
        height: 380px;
    }

    .pie-html-legend-text {
        font-size: 14px;
    }
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 767px) {

    /* -----------------------------------------
       Bar Chart
    ----------------------------------------- */
    .financial-chart-wrapper {
        padding: 25px 15px;
    }

    .financial-chart-container {
        height: 400px;
    }

    /* -----------------------------------------
       Pie Charts
    ----------------------------------------- */

    .revenue-chart-wrapper,
    .expenses-chart-wrapper {
        display: block;
        padding: 30px 22px;
    }

    .revenue-chart-container,
    .expenses-chart-container {
        width: 100%;
        height: 280px;
        margin: 0 auto 30px;
    }

    /* -----------------------------------------
       Pie Legend
    ----------------------------------------- */

    .pie-html-legend {
        width: 100%;
        max-width: none;
        margin: 0 auto;
    }

    .pie-html-legend ul {
        gap: 14px;
    }

    .pie-html-legend li {
        grid-template-columns: 12px minmax(0, 1fr);
        column-gap: 11px;
    }

    .pie-html-legend-dot {
        width: 12px;
        height: 12px;
        margin-top: 3px;
    }

    .pie-html-legend-text {
        grid-template-columns: minmax(0, 1fr) 48px;
        column-gap: 12px;
        font-size: 15px;
        line-height: 1.3;
        text-align: left !important;
    }

    .pie-html-legend-text > span:first-child {
        text-align: left !important;
    }

    .pie-html-legend-percent {
        min-width: 48px;
        text-align: right !important;
    }

    /* -----------------------------------------
       Tooltips
    ----------------------------------------- */

    .chart-html-tooltip {
        min-width: 180px;
        max-width: 230px;
        padding: 13px 15px;
    }

    .chart-html-tooltip-label {
        font-size: 14px;
    }

    .chart-html-tooltip-value {
        font-size: 19px;
    }

    /* -----------------------------------------
       Financial Table
    ----------------------------------------- */

    .financial-table-wrapper {
        padding: 20px 0 20px 15px;
    }

    .financial-table {
        min-width: 820px;
    }

    .financial-table thead th,
    .financial-table tbody td {
        padding-left: 12px;
        padding-right: 12px;
    }

    .financial-table tbody td {
        font-size: 14px;
    }

    .financial-table .financial-section-title td {
        font-size: 17px;
    }
}


/* =========================================================
   SMALL PHONES
========================================================= */

@media (max-width: 480px) {

    .revenue-chart-wrapper,
    .expenses-chart-wrapper {
        padding:
            25px 18px
            28px;
    }

    .revenue-chart-container,
    .expenses-chart-container {
        height: 250px;
        margin-bottom: 25px;
    }

    .pie-html-legend-text {
        font-size: 14px;
    }

    .pie-html-legend ul {
        gap: 12px;
    }
}