/* ========================================================= */
/* INVESTMENT RETURN CALCULATOR                              */
/* ========================================================= */


/* ========================================================= */
/* MAIN CALCULATOR CARD                                      */
/* ========================================================= */

.investment-calculator-card {

    padding: 28px 34px;

}


/* ========================================================= */
/* INVESTMENT INPUT GRID                                     */
/* ========================================================= */

.investment-input-grid {

    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    column-gap: 28px;

    /* row-gap: 20px; */

}


/* ========================================================= */
/* STEP-UP FIELDS                                            */
/* ========================================================= */

/*
   Step-Up (%) and Step-Up Frequency use the same
   two-column grid as the other investment fields.

   They remain hidden until Step-Up is enabled.
*/

.stepup-field {

    transition: opacity 0.2s ease;

}


/* ========================================================= */
/* WARNING                                                    */
/* ========================================================= */

.input-warning {

    min-height: 18px;

    margin-top: 5px;

    color: var(--color-msg-error, #c62828);

    font-size: 12px;

}


/* ========================================================= */
/* CASHFLOW SECTION HEADER                                   */
/* ========================================================= */

.investment-section-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 16px;

}


/* ========================================================= */
/* CASHFLOW TOGGLE BUTTON                                    */
/* ========================================================= */

.cashflow-toggle-btn {

    padding: 8px 16px;

    border: 1px solid rgba(255,255,255,0.75);

    border-radius: 5px;

    background: transparent;

    color: white;

    font-size: 14px;

    font-weight: 600;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        color 0.15s ease;

}


.cashflow-toggle-btn:hover {

    background: white;

    color: var(--color-primary);

}


/* ========================================================= */
/* CASHFLOW CARD                                             */
/* ========================================================= */

.cashflow-section {

    padding: 26px;

}


/* ========================================================= */
/* CASHFLOW GUIDANCE                                         */
/* ========================================================= */

.cashflow-guidance {

    margin-bottom: 22px;

    padding: 18px 20px;

    background: #f6f8f9;

    border-left: 4px solid var(--color-primary);

    border-radius: 6px;

}


.cashflow-guidance h3 {

    margin-top: 0;

    margin-bottom: 8px;

    color: var(--color-primary);

    font-size: 18px;

}


.cashflow-guidance p {

    margin: 6px 0;

    color: var(--color-text-secondary);

    font-size: 14px;

    line-height: 1.55;

}


/* ========================================================= */
/* CASHFLOW TABLE WRAPPER                                    */
/* ========================================================= */

.cashflow-table-wrapper {

    width: 100%;

    overflow-x: auto;

}


/* ========================================================= */
/* CASHFLOW TABLE                                            */
/* ========================================================= */

#cashflow-table {

    width: 100%;

    border-collapse: collapse;

    table-layout: fixed;

}


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

#cashflow-table th {

    padding: 11px 12px;

    background: #0d7ea5;

    color: white;

    font-weight: 600;

}


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

#cashflow-table td {

    padding: 8px 10px;

    vertical-align: middle;

}


/* ========================================================= */
/* ALTERNATING ROWS                                          */
/* ========================================================= */

#cashflow-table tbody tr:nth-child(odd) {

    background: #f5f7f8;

}


#cashflow-table tbody tr:nth-child(even) {

    background: white;

}


/* ========================================================= */
/* TABLE INPUTS                                              */
/* ========================================================= */

#cashflow-table input {

    width: 100%;

    box-sizing: border-box;

    height: 40px;

}


/* ========================================================= */
/* COLUMN WIDTHS                                             */
/* ========================================================= */

#cashflow-table th:nth-child(1),
#cashflow-table td:nth-child(1) {

    width: 23%;

}


#cashflow-table th:nth-child(2),
#cashflow-table td:nth-child(2) {

    width: 28%;

}


#cashflow-table th:nth-child(3),
#cashflow-table td:nth-child(3) {

    width: 28%;

}


#cashflow-table th:nth-child(4),
#cashflow-table td:nth-child(4) {

    width: 21%;

}


/* ========================================================= */
/* ACTION COLUMN                                             */
/* ========================================================= */

#cashflow-table .actions-column {

    text-align: center;

}


#cashflow-table td:last-child {

    text-align: center;

    white-space: nowrap;

}


/* ========================================================= */
/* ROW ACTION BUTTONS                                        */
/* ========================================================= */

.cashflow-row-action {

    width: 32px;

    height: 32px;

    padding: 0;

    margin: 0 2px;

    border: 1px solid #999;

    border-radius: 4px;

    background: white;

    color: #333;

    font-family: inherit;

    font-size: 14px;

    font-weight: 400;

    line-height: 30px;

    text-align: center;

    cursor: pointer;

    box-sizing: border-box;

    appearance: none;

    -webkit-appearance: none;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        transform 0.1s ease;

}


.cashflow-row-action:hover {

    background: #f0f4f6;

    border-color: #666;

}


.cashflow-row-action:active {

    transform: scale(0.95);

}


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

.cashflow-row-action.delete {

    color: #9b1c1c;

}


/* ========================================================= */
/* CASHFLOW ACTIONS                                          */
/* ========================================================= */

.cashflow-actions {

    margin-top: 20px;

    padding-top: 20px;

    border-top: 1px solid var(--color-border-light);

}


/* ========================================================= */
/* INVESTMENT INSIGHTS                                       */
/* ========================================================= */

#xirr-result .summary-card {

    padding: 4px 0;

    box-shadow: none;

    border: none;

    background: transparent;

}


#xirr-result .summary-card h3 {

    margin-top: 0;

    margin-bottom: 14px;

    color: var(--color-primary);

    font-size: 20px;

}


#xirr-result .summary-card p {

    margin: 0;

    color: var(--color-text-primary);

    font-size: 15px;

    line-height: 1.7;

}


/* ========================================================= */
/* XIRR ERROR MESSAGE                                        */
/* ========================================================= */

#xirr-result .summary-card h3 + p {

    max-width: 1100px;

}


/* ========================================================= */
/* RESPONSIVE LAYOUT                                         */
/* ========================================================= */

@media (max-width: 768px) {

    .investment-calculator-card {

        padding: 22px;

    }


    .investment-input-grid {

        grid-template-columns: 1fr;

    }


    .investment-section-header {

        align-items: flex-start;

    }


    .cashflow-toggle-btn {

        flex-shrink: 0;

    }


    #cashflow-table {

        min-width: 760px;

    }

}
