
/* =========================
   1. 전체 기본 설정
========================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Malgun Gothic", sans-serif;
    background-color: #f7f9fc;
    color: #333333;
    padding: 30px 15px;
}

/* 전체 화면 */

.container {
    max-width: 650px;
    margin: 0 auto;
}

/* =========================
   2. 제목 영역
========================= */

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 28px;
    color: #333333;
    margin-bottom: 8px;
}

.header p {
    font-size: 14px;
    color: #888888;
}

/* =========================
   3. 카드 공통 디자인
========================= */

.input-section,
.list-section {
    background-color: #ffffff;
    padding: 28px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 22px;
}

.input-section h2,
.list-section h2 {
    font-size: 20px;
    margin-bottom: 22px;
    color: #333333;
}

/* =========================
   4. 입력 영역
========================= */

#expense-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: bold;
    color: #555555;
}

.form-group input,
.form-group select {
    width: 100%;
    height: 46px;
    padding: 0 13px;
    border: 1px solid #e2e6ed;
    border-radius: 9px;
    background-color: #ffffff;
    color: #333333;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* 입력칸 선택 효과 */

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #8bbcf0;
    box-shadow: 0 0 0 3px rgba(139, 188, 240, 0.15);
}

/* =========================
   5. 추가 버튼
========================= */

.add-button {
    width: 100%;
    height: 49px;
    margin-top: 5px;
    border: none;
    border-radius: 9px;
    background-color: #dcecff;
    color: #326da9;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

/* 마우스를 올렸을 때 */

.add-button:hover {
    background-color: #bcd9fb;
}

.add-button:active {
    transform: scale(0.99);
}

/* =========================
   6. 목록 표 영역
========================= */

.table-container {
    width: 100%;
    overflow-x: auto;
}

#transaction-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

/* 표 제목 */

#transaction-table thead {
    background-color: #f7f9fc;
}

#transaction-table th {
    padding: 14px 8px;
    font-size: 13px;
    font-weight: bold;
    color: #666666;
    border-bottom: 1px solid #e9edf2;
}

/* 표 내용 */

#transaction-table td {
    padding: 15px 8px;
    font-size: 14px;
    border-bottom: 1px solid #f0f2f5;
}

/* 마지막 줄 */

#transaction-table tbody tr:last-child td {
    border-bottom: none;
}

/* =========================
   7. 수입 / 지출 색상
========================= */

/* 지출 - 빨간색 */

.expense {
    color: #e05252;
    font-weight: bold;
}

/* 수입 - 파란색 */

.income {
    color: #2878d0;
    font-weight: bold;
}

/* 내역이 없을 때 */

.empty-message {
    color: #999999;
    padding: 35px 10px !important;
    text-align: center;
}

/* =========================
   8. 모바일 화면
========================= */

@media (max-width: 480px) {

    body {
        padding: 20px 12px;
    }

    .header h1 {
        font-size: 24px;
    }

    .input-section,
    .list-section {
        padding: 22px 16px;
        border-radius: 14px;
    }

    #transaction-table th,
    #transaction-table td {
        padding: 12px 5px;
        font-size: 12px;
    }
}
