/* 収支計算表のスタイル */
.cashflow-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 20px;
    max-width: 100%;
    overflow-x: auto;
}

.cashflow-table {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.cashflow-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.cashflow-table th,
.cashflow-table td {
    padding: 8px;
    border: 1px solid #e5e7eb;
    text-align: right;
}

.cashflow-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.cashflow-table td:first-child {
    text-align: left;
    white-space: nowrap;
    background-color: #f8f9fa;
    font-weight: 500;
}

/* セクション別の背景色 */
.section-income {
    background-color: #f0f9ff;  /* 青みがかった背景 */
}

.section-expense {
    background-color: #fff7ed;  /* オレンジがかった背景 */
}

.section-tax {
    background-color: #f0fdf4;  /* 緑がかった背景 */
}

.section-total {
    background-color: #fdf2f8;  /* ピンクがかった背景 */
}

.section-expense-declared-income {
    background-color: #caffca;  /* 黄色がかった背景 */
}

.section-expense-cashflow {
    background-color: #bbddff;  /* 黄色がかった背景 */
}

.section-expense-cashflow-total {
    color: #336699;
    background-color: #aaccee;  /* 黄色がかった背景 */
}

.section-expense-interest {
    background-color: #cccccc;  /* 赤がかった背景 */
}

.section-expense-interest .small-number-text {
    font-size: 12px;
}

.number-positive {
    color: #000000;  /* 赤色 */
    font-weight: bold;
}

.number-negative {
    color: #dc2626;  /* 赤色 */
    font-weight: bold;
}

.small-font {
    margin-left: 4px;
    display: inline-block;
    font-size: 12px;
}

.section-expense-loan-balance {
    background-color: #ffffa0;  /* 黄色がかった背景 */
}

/* セクションヘッダー */
.section-header td {
    background-color: #f3f4f6;
    font-weight: 600;
    text-align: left;
}

/* 合計行 */
.row-total td {
    font-weight: 600;
    border-top: 2px solid #e5e7eb;
}

/* 数値の表示 */
.number {
    font-family: 'Roboto Mono', monospace;
    text-align: right;
}

.number.positive {
    color: #047857;  /* 緑色 */
}

.number.negative {
    color: #dc2626;  /* 赤色 */
}

/* ヘッダー固定 */
.cashflow-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: #f8f9fa;
}

.cashflow-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .cashflow-container {
        padding: 10px;
    }

    .cashflow-table {
        font-size: 12px;
    }

    .cashflow-table th,
    .cashflow-table td {
        padding: 6px;
    }
}
