/* === Expense statement tree ========================================== */

.financial-table .hidden-by-parent { display: none; }

/* Indent ladder -- --depth is emitted on the <tr> */
.financial-table tr.hierarchy-row {
    --indent-step: 1.25rem;
    --indent-base: 0.75rem;
}

.financial-table tr.hierarchy-row > td.tree-cell {
    padding-left: calc(
        var(--indent-base) + (var(--depth, 0) * var(--indent-step))
    );
    white-space: nowrap;
    position: relative;
}

/* Optional: faint guide line per level */
.financial-table tr.hierarchy-row > td.tree-cell::before {
    content: "";
    position: absolute;
    top: 0; bottom: 0;
    left: calc(
        var(--indent-base) + (var(--depth, 0) * var(--indent-step)) - 0.55rem
    );
    width: 1px;
    background: rgba(0, 0, 0, 0.06);
    pointer-events: none;
}
.financial-table tr.hierarchy-row[data-depth="0"] > td.tree-cell::before {
    display: none;
}

/* Toggle / spacer */
.financial-table .tree-cell .tree-toggle,
.financial-table .tree-cell .tree-spacer {
    display: inline-block;
    width: 1.1rem;
    margin-right: 0.25rem;
    text-align: center;
    vertical-align: middle;
}
.financial-table .tree-toggle {
    transition: transform 120ms ease;
    border: 0;
    background: transparent;
    color: #495057;
    cursor: pointer;
}
.financial-table .tree-toggle[aria-expanded="false"] {
    transform: rotate(-90deg);
}

.financial-table .tree-cell .node-code {
    color: #6c757d;
    margin-right: 0.4rem;
    font-variant-numeric: tabular-nums;
}

/* Child accounts */
.financial-table td.tree-cell.child-account {
    border-left: 2px solid rgba(13, 110, 253, 0.25);
    background: rgba(13, 110, 253, 0.03);
}

/* Group rows */
.financial-table tr.group-row > td {
    background: rgba(13, 110, 253, 0.04);
}
.financial-table tr.group-row[data-depth="0"] > td {
    background: rgba(13, 110, 253, 0.08);
    font-weight: 600;
}

/* Hover */
.financial-table tr.hierarchy-row:hover > td {
    background: rgba(13, 110, 253, 0.06);
}

/* Amount columns */
.expense-statement .month-col,
.expense-statement .total-col { white-space: nowrap; min-width: 90px; }
.expense-statement .total-col {
    font-weight: 600;
    background: rgba(13, 110, 253, 0.04);
}
.expense-statement thead .month-col {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.expense-statement .amount.opening-value { color: #6c757d; }
.expense-statement .amount.closing-value { font-weight: 600; }
.expense-statement .grand-total .amount   { font-weight: 700; font-size: 1.02em; }

/* Responsive */
@media (max-width: 992px) {
    .financial-table tr.hierarchy-row { --indent-step: 0.9rem; --indent-base: 0.5rem; }
}

/* Print */
@media print {
    .financial-table tr.hierarchy-row > td.tree-cell::before { display: none; }
    .financial-table tr.hierarchy-row:hover > td { background: transparent; }
    .no-print { display: none !important; }
    .hidden-by-parent { display: table-row !important; }
}