@charset "utf-8";

/* 공통 */
.account-flex {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px; /* 간격 줄임 */
}

.account-title {
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--content-font-color);
    
    margin: 0; /* 마진 제거하여 정렬 개선 */
}

/* 버튼 스타일 */
.btn_add .btn_submit {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    height: 30px;
}

.btn_add .btn_submit:hover {
    background-color: var(--btn-accent-bg);
    color: var(--btn-accent-text);
}

.btn_small {
    background-color: var(--gray-100);
    color: var(--content-font-color);
    border: 0;
    border-radius: 4px;
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
}

.btn_small:hover {
    background-color: var(--error-color);
    color: var(--white);
}

/* 테이블 스타일 */
.tbl_list {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--container-border-color);
    table-layout: fixed; /* 테이블 열 너비를 고정하여 넘침 방지 */
}

/* 고정 지출 테이블 열 너비 */
.fixed_expense_list .tbl_list th:nth-child(1),
.fixed_expense_list .tbl_list td:nth-child(1) {
    width: 25%; /* 항목명 */
}

.fixed_expense_list .tbl_list th:nth-child(2),
.fixed_expense_list .tbl_list td:nth-child(2) {
    width: 15%; /* 금액 */
}

.fixed_expense_list .tbl_list th:nth-child(3),
.fixed_expense_list .tbl_list td:nth-child(3) {
    width: 15%; /* 결제수단 */
}

.fixed_expense_list .tbl_list th:nth-child(4),
.fixed_expense_list .tbl_list td:nth-child(4) {
    width: 15%; /* 결제일 */
}

.fixed_expense_list .tbl_list th:nth-child(5),
.fixed_expense_list .tbl_list td:nth-child(5) {
    width: 20%; /* 분류 */
}

.fixed_expense_list .tbl_list th:nth-child(6),
.fixed_expense_list .tbl_list td:nth-child(6) {
    width: 60px; /* 관리 - 고정 너비 */
}

/* 고정 수입 테이블 열 너비 */
.fixed_income_list .tbl_list th:nth-child(1),
.fixed_income_list .tbl_list td:nth-child(1) {
    width: 50%; /* 항목명 */
}
.fixed_income_list .tbl_list th:nth-child(2),
.fixed_income_list .tbl_list td:nth-child(2) {
    width: 25%; /* 금액 */
}
.fixed_income_list .tbl_list th:nth-child(3),
.fixed_income_list .tbl_list td:nth-child(3) {
    width: calc(25% - 60px); /* 입금일 */
}
.fixed_income_list .tbl_list th:nth-child(4),
.fixed_income_list .tbl_list td:nth-child(4) {
    width: 60px; /* 관리 - 고정 너비 */
}

.fixed_expense_list .tbl_summary,
.fixed_income_list .tbl_summary {
    font-weight: 400;
    background-color: var(--container-border-color);
}

.tbl_summary {
    width: 100%;
    border-collapse: collapse;
}

/* 고정 지출/수입 합계 테이블 (2컬럼) */
.fixed_expense_list .tbl_summary th,
.fixed_income_list .tbl_summary th {
    width: 30%; /* 합계 제목 너비 */
    text-align: left;
    font-weight: 400;
}

.fixed_expense_list .tbl_summary td,
.fixed_income_list .tbl_summary td {
    width: 70%; /* 합계 금액 너비 */
    text-align: right;
    font-weight: 400;
}

/* 재정 요약 정보 테이블 (5컬럼 - 균등 분배) */
.financial_summary .tbl_summary {
    table-layout: fixed; /* 균등한 너비 분배 */
    border: 1px solid var(--container-border-color);
}

.financial_summary .tbl_summary th {
    width: 20%; /* 5개 컬럼 = 각 20% */
    text-align: center;
    font-weight: 400;
    background: var(--card-bg-color);
    color: var(--content-font-color);
    font-size: 1.1rem;
    padding: 8px;
    white-space: normal; /* 텍스트 줄바꿈 허용 */
    word-break: keep-all; /* 단어 단위로 줄바꿈 */
}

.financial_summary .tbl_summary td {
    width: 20%;
    text-align: center;
    font-weight: 400;
    padding: 6px 8px;
    border: 1px solid var(--container-border-color);
    font-size: 1rem;
    background: var(--gray-50);
    color: var(--gray-700);
    word-break: keep-all;
}

.tbl_list th {
    background: var(--btn-primary-bg);
    padding: 8px;
    color: var(--btn-primary-text);
    text-align: center;
    font-weight: 400;
    font-size: 0.9rem;
    border: 0;
}

.tbl_summary .td_total {
    color: var(--accent-color);
    font-weight: bold;
    font-size: 1.2rem;
    background: var(--gray-100);
}

.tbl_summary .total_expense, .tbl_summary .total_income {
    background: var(--btn-accent-bg);
    color: var(--btn-accent-text);
}

.tbl_list td {
    padding: 6px 6px; /* 패딩 줄임 */
    text-align: center;
    border-bottom: 1px solid var(--container-border-color);
    color: var(--content-font-color);
}

.tbl_list .td_num, .td_total {
    text-align: right;
}

.tbl_list .income {
    color: #3a8afd;
    font-weight: 400;
}

.tbl_list .expense {
    color: var(--primary-color);
    font-weight: 400;
}

/* 빈 테이블 */
.empty_table {
    text-align: center;
    color: var(--gray-600);
}

/* 합계 행 */
.total_row {
    font-weight: 400;
    background-color: var(--container-border-color) !important;
}

.total_row th {
    background-color: var(--text-secondary);
    color: var(--gray-200);
    text-align: right;
}

.total_row .td_total {
    font-weight: 400;
    color: var(--gray-700);
    text-align: right;
}

/* 고정 지출 및 수입 관리 스타일 */
.fixed_expense_income_container {
    width: 100%;
    color: var(--content-font-color);
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.fixed_expense_income_wrapper {
    display: flex;
    gap: 30px;
    width: 100%;
    flex-direction: column;
}

.fixed_expense_list, .fixed_income_list {
    flex: 1;
    min-width: 0; /* flex 아이템이 부모를 벗어나지 않도록 */
    overflow: hidden; /* 내용이 넘치지 않도록 */
}

.fixed_expense_list h3, .fixed_income_list h3 {
    color: var(--gray-700);
    font-family: var(--f-pre);
    font-weight: 800;
    font-size: 1.3rem;
    margin: 0 0 8px 0; /* 마진 조정 */
}

.financial_summary {
}

.financial_summary h3 {
    color: var(--content-font-color);
    font-weight: 400;
    margin: 0 0 10px 0;
    font-size: 1.3rem;
}

.tbl_summary {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--container-border-color);
    font-size: 12px;
}

.tbl_summary th {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    padding: 6px; /* 패딩 줄임 */
    text-align: center;
    font-weight: 400;
}

.tbl_summary td {
    padding: 4px 6px;
    border: 1px solid var(--container-border-color);
    font-weight: 400;
    color: var(--content-font-color);
}

/* 탭 스타일 개선 */
.account_tabs {
}

.account_tabs ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0; /* 탭 간격 제거 */
}

.account_tabs li {
    margin: 0; /* 탭 간격 제거 */
}

.account-tab {
    padding: 6px 10px; /* 패딩 축소 */
    font-size: 13px; /* 폰트 크기 조정 */
}

/* 타이틀과 버튼 정렬 통일 */
.section_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

/* 반응형 스타일 */
@media (max-width: 768px) {
    .fixed_expense_income_wrapper {
        flex-direction: column;
    }
    
    .fixed_expense_list, .fixed_income_list {
        margin-bottom: 10px;
    }
    
    .tbl_list th, .tbl_list td,
    .tbl_summary th, .tbl_summary td {
        padding: 4px 3px; /* 패딩 더 줄임 */
        font-size: 11px; /* 폰트 크기 줄임 */
    }
}
