/* Cashflow page extras (js/cashflow-plus.js) */
#page-cashflow .cashflow-dashboard-layout {
    grid-template-columns: minmax(0, 1fr);
}
.cfx-wrap {
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 12px 0;
}
.cfx-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 10px;
}
.cfx-toolbar label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
}
.cfx-toolbar .cfx-check {
    font-weight: 400;
}
.cfx-spacer {
    flex: 1;
}
.cfx-cmp {
    font-size: 13px;
    color: var(--text-secondary, #555);
}
.cfx-num {
    width: 110px;
    padding: 4px 8px;
}
.cfx-peak {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}
.cfx-peak > i {
    font-size: 20px;
    color: #2563eb;
    margin-top: 2px;
}
.cfx-peak.hot {
    background: #fef2f2;
    border-color: #fecaca;
}
.cfx-peak.hot > i {
    color: #dc2626;
}
.cfx-peak-warn {
    color: #b91c1c;
    font-weight: 600;
    margin: 2px 0;
}
.cfx-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
    align-items: center;
}
.cfx-chips-label {
    font-size: 12px;
    color: var(--text-secondary, #666);
}
.cfx-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.06);
    font-size: 12px;
}
.cfx-years {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.cfx-year {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 120px;
    padding: 8px 12px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 10px;
    background: var(--bg-card, #fff);
    cursor: pointer;
    text-align: start;
}
.cfx-year.on {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb inset;
}
.cfx-year span {
    font-size: 12px;
    color: var(--text-secondary, #666);
}
.cfx-year b {
    font-size: 16px;
}
.cfx-year small {
    font-size: 11px;
    color: #b45309;
}
.cfx-panel {
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 10px;
    background: var(--bg-card, #fff);
}
.cfx-panel > summary {
    cursor: pointer;
    padding: 12px 14px;
    font-weight: 700;
}
.cfx-panel-body {
    padding: 0 14px 14px;
}
.cfx-sub {
    margin-top: 10px;
}
.cfx-sub > summary {
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 6px;
}
.cfx-scroll {
    overflow-x: auto;
    margin-bottom: 10px;
}
.cfx-table td,
.cfx-table th {
    white-space: nowrap;
}
.cfx-heat {
    border-collapse: collapse;
    font-size: 12px;
    min-width: 100%;
}
.cfx-heat th,
.cfx-heat td {
    border: 1px solid var(--border-color, #e5e7eb);
    padding: 4px 8px;
    text-align: end;
    white-space: nowrap;
}
.cfx-heat thead th {
    background: rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
}
.cfx-heat .cfx-rowh {
    text-align: start;
    position: sticky;
    inset-inline-start: 0;
    background: var(--bg-card, #fff);
}
.cfx-heat .cfx-foot th,
.cfx-heat .cfx-foot td,
.cfx-heat .cfx-tot {
    font-weight: 700;
    background: rgba(0, 0, 0, 0.04);
}
.cfx-ccy {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
    font-size: 13px;
}
.cfx-h4 {
    margin: 12px 0 6px;
    font-size: 14px;
}
.cfx-neg {
    color: #dc2626;
    font-weight: 700;
}
.cfx-pos {
    color: #059669;
    font-weight: 700;
}
.cfx-chartbox {
    position: relative;
    height: 260px;
    margin: 10px 0;
}
.cfx-note {
    font-size: 12px;
    color: var(--text-secondary, #666);
    margin: 6px 0;
}
.cfx-note i {
    color: #dc2626;
}
.cfx-drafts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}
.cfx-draft textarea {
    width: 100%;
    margin: 6px 0;
    font-size: 12px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    padding: 6px;
    background: transparent;
    color: inherit;
}
.cfx-compare {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.cfx-hcell {
    white-space: nowrap;
}
.cfx-mobnav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 12px;
}
.cfx-unitbox {
    position: relative;
    display: inline-block;
}
.cfx-unitbtn {
    min-width: 130px;
    text-align: start;
    cursor: pointer;
}
.cfx-unitmenu {
    display: none;
    position: absolute;
    z-index: 50;
    top: 100%;
    inset-inline-start: 0;
    max-height: 320px;
    overflow: auto;
    min-width: 220px;
    padding: 8px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
.cfx-unitbox.open .cfx-unitmenu {
    display: block;
}
.cfx-unitmenu label {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 3px 2px;
    font-size: 13px;
    cursor: pointer;
}
.cfx-unitmenu-actions {
    display: flex;
    gap: 12px;
    padding-bottom: 4px;
    font-size: 12px;
}
.cfx-dash-link {
    font-size: 12px;
    text-decoration: none;
}
@media (max-width: 768px) {
    .cfx-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .cfx-spacer {
        display: none;
    }
    .cfx-year {
        min-width: calc(50% - 4px);
    }
    .cfx-chartbox {
        height: 220px;
    }
}
.cashflow-chart-section .card-body {
    position: relative;
    height: 380px;
}
.cashflow-chart-section .card-body canvas {
    max-height: 320px;
}
@media (max-width: 768px) {
    .cashflow-chart-section .card-body {
        height: 340px;
    }
}
[data-theme='dark'] .cfx-peak {
    background: #1e293b;
    border-color: #334155;
}
[data-theme='dark'] .cfx-peak.hot {
    background: #3f1d1d;
    border-color: #7f1d1d;
}
