/* =========================================================
   CASH FLOW FORECAST
   ========================================================= */


/* =========================================================
   MAIN WRAPPER
   ========================================================= */

.cashflow-forecast {
    width: 100% !important;
    max-width: 100% !important;

    overflow: hidden !important;

    font-family: Arial, Helvetica, sans-serif;

    color: #263746;
}



/* =========================================================
   BUSINESS PLAN HEADER
   ========================================================= */

.business-plan-header {
    margin-bottom: 14px;

    padding: 18px 22px;

    background: #ffffff;

    border: 1px solid #dfe6ee;
    border-radius: 10px;

    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}


.business-plan-header__eyebrow {
    margin-bottom: 6px;

    color: #4f6f95;

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 0.08em;
}


.business-plan-header__main {
    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;
}


.business-plan-header__content {
    min-width: 0;
}


.business-plan-header__title {
    margin: 0;

    color: #173d7a;

    font-size: 24px;
    font-weight: 700;

    line-height: 1.2;
}


.business-plan-header__fbo {
    margin-top: 3px;
    margin-bottom: 7px;

    color: #4f6b8a;

    font-size: 14px;
    font-weight: 700;
}


.business-plan-header__subtitle {
    max-width: 850px;

    margin: 0;

    color: #657789;

    font-size: 13px;
    line-height: 1.5;
}


.business-plan-header__badge {
    flex: 0 0 auto;

    padding: 7px 11px;

    background: #edf4ff;

    border: 1px solid #cad9eb;
    border-radius: 999px;

    color: #1755a0;

    font-size: 11px;
    font-weight: 700;

    white-space: nowrap;
}



/* =========================================================
   GLOBAL GRID
   ========================================================= */

.cashflow-forecast .k-grid {
    border: 0 !important;

    background: transparent !important;

    box-shadow: none !important;
}


.cashflow-forecast .k-grid-header {
    border: 0 !important;
}


.cashflow-forecast .k-grid-header-wrap {
    border: 0 !important;
}


.cashflow-forecast .k-grid-table,
.cashflow-forecast .k-grid-header-table {
    table-layout: fixed !important;
}


.cashflow-forecast .k-grid td,
.cashflow-forecast .k-grid th {
    box-sizing: border-box !important;
}



/* =========================================================
   FORCE HORIZONTAL SCROLL
   ========================================================= */

/*
 * Keep the top Kendo grid constrained to the viewport.
 */

.cashflow-forecast
> .k-grid {
    width: 100% !important;
    max-width: 100% !important;

    overflow: hidden !important;
}


/*
 * This becomes the primary horizontal scroll surface.
 */

.cashflow-forecast
> .k-grid
> .k-grid-container {
    width: 100% !important;
    max-width: 100% !important;

    overflow-x: auto !important;
    overflow-y: visible !important;

    -webkit-overflow-scrolling: touch;
}


/*
 * Do not let this wrapper become the scrolling surface.
 */

.cashflow-forecast
> .k-grid
> .k-grid-container
> .k-grid-content {
    width: auto !important;
    max-width: none !important;

    overflow: visible !important;
}


/*
 * Actual top table width.
 *
 * hierarchy = 40
 * name      = 390
 * months    = 12 x 105
 * total     = 120
 */

.cashflow-forecast
> .k-grid
> .k-grid-container
> .k-grid-content
> table {
    width: 1810px !important;
    min-width: 1810px !important;
    max-width: none !important;

    table-layout: fixed !important;
}


/*
 * Header remains clipped to the visible grid width.
 */

.cashflow-forecast
> .k-grid
> .k-grid-header {
    width: 100% !important;
    max-width: 100% !important;

    overflow: hidden !important;
}


.cashflow-forecast
> .k-grid
> .k-grid-header
> .k-grid-header-wrap {
    width: 100% !important;
    max-width: 100% !important;

    overflow: hidden !important;
}


.cashflow-forecast
> .k-grid
> .k-grid-header
> .k-grid-header-wrap
> table {
    width: 1810px !important;
    min-width: 1810px !important;
    max-width: none !important;

    table-layout: fixed !important;
}



/* =========================================================
   LEVEL 2 / LEVEL 3 WIDTHS
   ========================================================= */

/*
 * Level 2:
 *
 * hierarchy = 32
 * name      = 358
 * months    = 12 x 105
 * total     = 120
 */

.cashflow-forecast
.cashflow-line
> .k-grid-header
> .k-grid-header-wrap
> table,

.cashflow-forecast
.cashflow-line
> .k-grid-container
> .k-grid-content
> table {
    width: 1770px !important;
    min-width: 1770px !important;
    max-width: none !important;

    table-layout: fixed !important;
}


/*
 * Level 3:
 *
 * delete = 40
 * name   = 318
 * months = 12 x 105
 * total  = 120
 */

.cashflow-forecast
.cashflow-subline
> .k-grid-header
> .k-grid-header-wrap
> table,

.cashflow-forecast
.cashflow-subline
> .k-grid-container
> .k-grid-content
> table {
    width: 1738px !important;
    min-width: 1738px !important;
    max-width: none !important;

    table-layout: fixed !important;
}


/*
 * Important:
 * nested grids should NOT create competing scrollbars.
 */

.cashflow-forecast
.cashflow-line
> .k-grid-container,

.cashflow-forecast
.cashflow-subline
> .k-grid-container {
    overflow: visible !important;
}


.cashflow-forecast
.cashflow-line
> .k-grid-container
> .k-grid-content,

.cashflow-forecast
.cashflow-subline
> .k-grid-container
> .k-grid-content {
    overflow: visible !important;

    max-width: none !important;
}



/* =========================================================
   TOP LEVEL COLUMN GEOMETRY
   ========================================================= */


/* hierarchy */

.cashflow-forecast
> .k-grid
> .k-grid-header
> .k-grid-header-wrap
> table
> colgroup
> col:nth-child(1),

.cashflow-forecast
> .k-grid
> .k-grid-container
> .k-grid-content
> table
> colgroup
> col:nth-child(1) {
    width: 40px !important;
}


/* Name */

.cashflow-forecast
> .k-grid
> .k-grid-header
> .k-grid-header-wrap
> table
> colgroup
> col:nth-child(2),

.cashflow-forecast
> .k-grid
> .k-grid-container
> .k-grid-content
> table
> colgroup
> col:nth-child(2) {
    width: 390px !important;
}


/* Jan-Dec */

.cashflow-forecast
> .k-grid
> .k-grid-header
> .k-grid-header-wrap
> table
> colgroup
> col:nth-child(n+3):nth-child(-n+14),

.cashflow-forecast
> .k-grid
> .k-grid-container
> .k-grid-content
> table
> colgroup
> col:nth-child(n+3):nth-child(-n+14) {
    width: 105px !important;
}


/* Total */

.cashflow-forecast
> .k-grid
> .k-grid-header
> .k-grid-header-wrap
> table
> colgroup
> col:nth-child(15),

.cashflow-forecast
> .k-grid
> .k-grid-container
> .k-grid-content
> table
> colgroup
> col:nth-child(15) {
    width: 120px !important;
}



/* =========================================================
   TOP HEADER
   ========================================================= */

.cashflow-forecast
> .k-grid
> .k-grid-header
th {
    height: 40px !important;

    padding: 0 10px !important;

    background: #173d7a !important;

    border-color: rgba(255, 255, 255, 0.12) !important;

    color: #ffffff !important;

    font-size: 11px !important;
    font-weight: 700 !important;

    text-transform: uppercase !important;
}


.cashflow-forecast
> .k-grid
> .k-grid-header
th:nth-child(2) {
    text-align: left !important;
}


.cashflow-forecast
> .k-grid
> .k-grid-header
th:nth-child(n+3) {
    text-align: right !important;
}



/* =========================================================
   TOP LEVEL ROWS
   ========================================================= */

.cashflow-forecast
> .k-grid
> .k-grid-container
> .k-grid-content
> table
> tbody
> tr.k-master-row
> td {
    height: 48px !important;

    padding: 0 10px !important;

    border-color: #d9e3ed !important;

    font-size: 12px !important;
}


.cashflow-forecast
> .k-grid
> .k-grid-container
> .k-grid-content
> table
> tbody
> tr.k-master-row
> td:nth-child(2) {
    font-weight: 700 !important;
}


.cashflow-forecast
> .k-grid
> .k-grid-container
> .k-grid-content
> table
> tbody
> tr.k-master-row
> td:nth-child(n+3) {
    text-align: right !important;

    font-weight: 700 !important;
}



/* =========================================================
   TOP ROW COLOURS
   ========================================================= */


/* Income */

.cashflow-forecast
> .k-grid
> .k-grid-container
> .k-grid-content
> table
> tbody
> tr:nth-child(1 of .k-master-row)
> td {
    background: #eaf7f0 !important;

    color: #008142 !important;
}


/* Expenses */

.cashflow-forecast
> .k-grid
> .k-grid-container
> .k-grid-content
> table
> tbody
> tr:nth-child(2 of .k-master-row)
> td {
    background: #edf4ff !important;

    color: #1755a0 !important;
}


/* Investments */

.cashflow-forecast
> .k-grid
> .k-grid-container
> .k-grid-content
> table
> tbody
> tr:nth-child(3 of .k-master-row)
> td {
    background: #f3f0ff !important;

    color: #6741d9 !important;
}


/* Net Cash Flow */

.cashflow-forecast
> .k-grid
> .k-grid-container
> .k-grid-content
> table
> tbody
> tr:nth-child(4 of .k-master-row)
> td {
    background: #e2f5eb !important;

    border-top: 2px solid #99d9b7 !important;

    color: #007b3e !important;

    font-weight: 700 !important;
}



/* =========================================================
   NET CASH FLOW - NO EXPANDER
   ========================================================= */

.cashflow-forecast
> .k-grid
> .k-grid-container
> .k-grid-content
> table
> tbody
> tr:nth-child(4 of .k-master-row)
> td.k-hierarchy-cell
> a {
    display: none !important;
}



/* =========================================================
   HIERARCHY BUTTONS
   ========================================================= */

.cashflow-forecast
.k-hierarchy-cell {
    text-align: center !important;
}


.cashflow-forecast
.k-hierarchy-cell
> a {
    display: inline-flex !important;

    align-items: center;
    justify-content: center;

    width: 20px !important;
    height: 20px !important;

    border: 1px solid #c8d8e9;
    border-radius: 5px;

    background: #ffffff;

    color: #1755a0;
}



/* =========================================================
   DETAIL ROWS
   ========================================================= */

.cashflow-forecast
tr.k-detail-row
> td.k-detail-cell {
    padding: 0 !important;

    background: #ffffff !important;
}



/* =========================================================
   LEVEL 2 - CASHFLOW LINE
   ========================================================= */

.cashflow-forecast
.cashflow-line {
    border: 0 !important;

    background: #ffffff !important;
}



/* =========================================================
   LEVEL 2 COLUMN GEOMETRY
   ========================================================= */


/* hierarchy */

.cashflow-forecast
.cashflow-line
> .k-grid-header
> .k-grid-header-wrap
> table
> colgroup
> col:nth-child(1),

.cashflow-forecast
.cashflow-line
> .k-grid-container
> .k-grid-content
> table
> colgroup
> col:nth-child(1) {
    width: 32px !important;
}


/* Name */

.cashflow-forecast
.cashflow-line
> .k-grid-header
> .k-grid-header-wrap
> table
> colgroup
> col:nth-child(2),

.cashflow-forecast
.cashflow-line
> .k-grid-container
> .k-grid-content
> table
> colgroup
> col:nth-child(2) {
    width: 358px !important;
}


/* Jan-Dec */

.cashflow-forecast
.cashflow-line
> .k-grid-header
> .k-grid-header-wrap
> table
> colgroup
> col:nth-child(n+3):nth-child(-n+14),

.cashflow-forecast
.cashflow-line
> .k-grid-container
> .k-grid-content
> table
> colgroup
> col:nth-child(n+3):nth-child(-n+14) {
    width: 105px !important;
}


/* Total */

.cashflow-forecast
.cashflow-line
> .k-grid-header
> .k-grid-header-wrap
> table
> colgroup
> col:nth-child(15),

.cashflow-forecast
.cashflow-line
> .k-grid-container
> .k-grid-content
> table
> colgroup
> col:nth-child(15) {
    width: 120px !important;
}



/* =========================================================
   HIDE LEVEL 2 HEADER
   ========================================================= */

.cashflow-forecast
.cashflow-line
> .k-grid-header {
    display: none !important;
}



/* =========================================================
   LEVEL 2 ROWS
   ========================================================= */

.cashflow-forecast
.cashflow-line
> .k-grid-container
> .k-grid-content
> table
> tbody
> tr.k-master-row
> td {
    height: 42px !important;

    padding: 0 10px !important;

    background: #ffffff !important;

    border-color: #e1e8ef !important;

    color: #27466d !important;

    font-size: 12px !important;
}


.cashflow-forecast
.cashflow-line
> .k-grid-container
> .k-grid-content
> table
> tbody
> tr.k-master-row
> td:nth-child(2) {
    font-weight: 700 !important;
}


.cashflow-forecast
.cashflow-line
> .k-grid-container
> .k-grid-content
> table
> tbody
> tr.k-master-row
> td:nth-child(n+3) {
    text-align: right !important;
}



/* =========================================================
   LEVEL 2 TOTAL
   ========================================================= */

.cashflow-forecast
.cashflow-line
> .k-grid-container
> .k-grid-content
> table
> tbody
> tr.k-master-row
> td:nth-child(15) {
    background: #eef5fb !important;

    color: #174f83 !important;

    font-weight: 700 !important;
}



/* =========================================================
   DERIVED LEVEL 2 ROW
   ========================================================= */

.cashflow-forecast
.cashflow-line
tr.cashflow-derived
> td:not(.k-hierarchy-cell) {
    background: #f4f7fb !important;
}


.cashflow-forecast
.cashflow-line
tr.cashflow-derived
> td:nth-child(2) {
    color: #365c8c !important;

    font-weight: 700 !important;
}


.cashflow-forecast
.cashflow-line
tr.cashflow-derived
> td:nth-child(n+3) {
    color: #718196 !important;

    cursor: not-allowed !important;
}



/* =========================================================
   LEVEL 3 - SUBLINE
   ========================================================= */

.cashflow-forecast
.cashflow-subline {
    border: 0 !important;

    background: #f8fbf9 !important;
}



/* =========================================================
   LEVEL 3 COLUMN GEOMETRY
   ========================================================= */


/* Delete */

.cashflow-forecast
.cashflow-subline
> .k-grid-header
> .k-grid-header-wrap
> table
> colgroup
> col:nth-child(1),

.cashflow-forecast
.cashflow-subline
> .k-grid-container
> .k-grid-content
> table
> colgroup
> col:nth-child(1) {
    width: 40px !important;
}


/* Name */

.cashflow-forecast
.cashflow-subline
> .k-grid-header
> .k-grid-header-wrap
> table
> colgroup
> col:nth-child(2),

.cashflow-forecast
.cashflow-subline
> .k-grid-container
> .k-grid-content
> table
> colgroup
> col:nth-child(2) {
    width: 318px !important;
}


/* Jan-Dec */

.cashflow-forecast
.cashflow-subline
> .k-grid-header
> .k-grid-header-wrap
> table
> colgroup
> col:nth-child(n+3):nth-child(-n+14),

.cashflow-forecast
.cashflow-subline
> .k-grid-container
> .k-grid-content
> table
> colgroup
> col:nth-child(n+3):nth-child(-n+14) {
    width: 105px !important;
}


/* Total */

.cashflow-forecast
.cashflow-subline
> .k-grid-header
> .k-grid-header-wrap
> table
> colgroup
> col:nth-child(15),

.cashflow-forecast
.cashflow-subline
> .k-grid-container
> .k-grid-content
> table
> colgroup
> col:nth-child(15) {
    width: 120px !important;
}



/* =========================================================
   HIDE LEVEL 3 HEADER
   ========================================================= */

.cashflow-forecast
.cashflow-subline
> .k-grid-header {
    display: none !important;
}



/* =========================================================
   LEVEL 3 ROW
   ========================================================= */

.cashflow-forecast
.cashflow-subline
> .k-grid-container
> .k-grid-content
> table
> tbody
> tr
> td {
    height: 38px !important;

    padding: 0 10px !important;

    background: #f8fbf9 !important;

    border-color: #e3ebe7 !important;

    color: #37556f !important;

    font-size: 12px !important;
}



/* Delete */

.cashflow-forecast
.cashflow-subline
> .k-grid-container
> .k-grid-content
> table
> tbody
> tr
> td:nth-child(1) {
    padding: 0 !important;

    text-align: center !important;

    background: #f8fbf9 !important;
}



/* Name */

.cashflow-forecast
.cashflow-subline
> .k-grid-container
> .k-grid-content
> table
> tbody
> tr
> td:nth-child(2) {
    position: relative;

    padding-left: 30px !important;

    color: #08733d !important;

    font-weight: 600 !important;
}


.cashflow-forecast
.cashflow-subline
> .k-grid-container
> .k-grid-content
> table
> tbody
> tr
> td:nth-child(2)::before {
    content: "↳";

    position: absolute;

    left: 12px;
    top: 50%;

    transform: translateY(-50%);

    color: #62a880;

    font-weight: 700;
}



/* Jan-Dec */

.cashflow-forecast
.cashflow-subline
> .k-grid-container
> .k-grid-content
> table
> tbody
> tr
> td:nth-child(n+3):nth-child(-n+14) {
    text-align: right !important;
}



/* Total */

.cashflow-forecast
.cashflow-subline
> .k-grid-container
> .k-grid-content
> table
> tbody
> tr
> td:nth-child(15) {
    background: #edf6f1 !important;

    color: #08733d !important;

    font-weight: 700 !important;

    text-align: right !important;
}



/* =========================================================
   DELETE BUTTON
   ========================================================= */

.cashflow-forecast
.cashflow-subline
.aw-link[title="Delete item"] {
    display: inline-flex !important;

    align-items: center;
    justify-content: center;

    width: 24px !important;
    min-width: 24px !important;
    height: 24px !important;

    padding: 0 !important;

    background: #fff4f4 !important;

    border: 1px solid #efc6c6 !important;
    border-radius: 5px !important;

    color: #c64242 !important;

    box-shadow: none !important;
}


.cashflow-forecast
.cashflow-subline
.aw-link[title="Delete item"]:hover {
    background: #ffe5e5 !important;

    border-color: #e9a8a8 !important;

    color: #aa2727 !important;
}


.cashflow-forecast
.cashflow-subline
.aw-link[title="Delete item"]
.fa-trash-alt {
    margin: 0 !important;

    font-size: 11px !important;
}



/* =========================================================
   TOOLBARS
   ========================================================= */

.cashflow-forecast
[id$="_tb_wrapper"]
> .k-toolbar {
    min-height: 42px !important;

    padding: 7px 10px !important;

    background: #f8fafc !important;

    border: 0 !important;
    border-bottom: 1px solid #e3eaf1 !important;

    gap: 7px !important;
}



/* =========================================================
   TOOLBAR BUTTONS
   ========================================================= */

.cashflow-forecast
[id$="_tb_wrapper"]
> .k-toolbar
.k-button:has(.fa-plus),

.cashflow-forecast
[id$="_tb_wrapper"]
> .k-toolbar
.k-button:has(.fa-save) {
    display: inline-flex !important;

    align-items: center !important;
    justify-content: center !important;

    width: auto !important;
    min-width: 32px !important;
    height: 28px !important;

    padding: 0 10px !important;

    border-radius: 5px !important;

    box-shadow: none !important;

    font-size: 11px !important;
    font-weight: 600 !important;
}



/* Add */

.cashflow-forecast
[id$="_tb_wrapper"]
> .k-toolbar
.k-button:has(.fa-plus) {
    background: #edf4ff !important;

    border: 1px solid #bfd1e8 !important;

    color: #1755a0 !important;
}


.cashflow-forecast
[id$="_tb_wrapper"]
> .k-toolbar
.k-button:has(.fa-plus):hover {
    background: #dfeeff !important;
}



/* Save */

.cashflow-forecast
[id$="_tb_wrapper"]
> .k-toolbar
.k-button:has(.fa-save) {
    background: #eaf7ef !important;

    border: 1px solid #acd6bc !important;

    color: #08733d !important;
}


.cashflow-forecast
[id$="_tb_wrapper"]
> .k-toolbar
.k-button:has(.fa-save):hover {
    background: #d9f0e2 !important;
}



/* Save label */

.cashflow-forecast
[id$="_tb_wrapper"]
> .k-toolbar
.k-button:has(.fa-save)::after {
    content: "Save";

    margin-left: 6px;

    font-size: 11px;
    font-weight: 600;
}



/* =========================================================
   EDITING
   ========================================================= */

.cashflow-forecast
td.k-edit-cell {
    padding: 3px 5px !important;
}


.cashflow-forecast
td.k-edit-cell
input {
    width: 84px !important;
    height: 28px !important;

    box-sizing: border-box;

    padding: 3px 6px !important;

    border: 1px solid #8eb2d7 !important;
    border-radius: 4px !important;

    background: #ffffff !important;

    color: #233d5c !important;

    font-size: 12px !important;

    text-align: right !important;

    outline: none !important;

    box-shadow:
        0 0 0 2px
        rgba(
            23,
            85,
            160,
            0.08
        ) !important;
}



/* =========================================================
   NO RECORDS
   ========================================================= */

.cashflow-forecast
.cashflow-subline
.k-grid-norecords {
    background: #fafcfb !important;

    border: 0 !important;
}


.cashflow-forecast
.cashflow-subline
.k-grid-norecords-template {
    padding: 10px 14px !important;

    color: #91a09a !important;

    font-size: 11px !important;
}



/* =========================================================
   CARRY FORWARD POPUP
   ========================================================= */

.cashflow-carry-popup {
    position: absolute;

    z-index: 99999;

    width: 245px;

    box-sizing: border-box;

    padding: 12px 13px;

    background: #ffffff;

    border: 1px solid #ccd9e8;
    border-radius: 8px;

    box-shadow:
        0 8px 24px
        rgba(
            26,
            49,
            82,
            0.18
        );

    font-family:
        Arial,
        Helvetica,
        sans-serif;
}


.cashflow-carry-popup__title {
    margin-bottom: 4px;

    color: #173d7a;

    font-size: 12px;
    font-weight: 700;
}


.cashflow-carry-popup__text {
    margin-bottom: 11px;

    color: #64758a;

    font-size: 11.5px;
    line-height: 1.45;
}


.cashflow-carry-popup__text strong {
    color: #344e70;

    font-weight: 700;
}


.cashflow-carry-popup__actions {
    display: flex;

    align-items: center;

    gap: 7px;
}


.cashflow-carry-popup__yes {
    display: inline-flex;

    align-items: center;

    gap: 6px;

    height: 28px;

    padding: 0 10px;

    background: #1755a0;

    border: 1px solid #1755a0;
    border-radius: 5px;

    color: #ffffff;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 11px;
    font-weight: 700;

    cursor: pointer;
}


.cashflow-carry-popup__yes:hover {
    background: #123f7c;

    border-color: #123f7c;
}


.cashflow-carry-popup__no {
    height: 28px;

    padding: 0 8px;

    background: transparent;

    border: 0;

    color: #75869a;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 11px;
    font-weight: 600;

    cursor: pointer;
}


.cashflow-carry-popup__no:hover {
    color: #344e70;
}



/* =========================================================
   GENERAL CLEANUP
   ========================================================= */

.cashflow-forecast
.k-pager {
    display: none !important;
}


.cashflow-forecast
.k-selected,
.cashflow-forecast
.k-table-row.k-selected {
    box-shadow: none !important;
}
