
/* =========================
   기본 설정
========================= */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 30px;
  background-color: #edf6fc;
  color: #263445;
  font-family: Arial, "Malgun Gothic", sans-serif;
}

.app {
  max-width: 1100px;
  margin: 0 auto;
}

/* =========================
   헤더
========================= */
.header {
  margin-bottom: 24px;
}

.header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: #2c4a66;
}

/* =========================
   흰색 카드 공통 스타일
========================= */
.input-section,
.list-section {
  background-color: #ffffff;
  padding: 26px;
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(75, 130, 170, 0.08);
  border: 1px solid #e4eef6;
}

.input-section {
  margin-bottom: 22px;
}

.input-section h2,
.list-section h2 {
  margin: 0 0 22px;
  font-size: 19px;
  font-weight: 700;
  color: #354d63;
}

/* =========================
   입력 폼
========================= */
.input-form {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 130px;
}

.input-group label {
  font-size: 13px;
  font-weight: 600;
  color: #71869a;
}

.input-group input,
.input-group select {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid #dce8f1;
  border-radius: 10px;
  background-color: #fafdff;
  color: #33485b;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus,
.input-group select:focus {
  border-color: #80bce5;
  box-shadow: 0 0 0 3px rgba(128, 188, 229, 0.15);
}

/* =========================
   추가 버튼
========================= */
#addButton {
  height: 46px;
  padding: 0 24px;
  border: none;
  border-radius: 10px;
  background-color: #35b779;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s, transform 0.15s;
}

#addButton:hover {
  background-color: #279c62;
}

#addButton:active {
  transform: scale(0.98);
}

/* =========================
   내역 목록 카드
========================= */
.list-section {
  min-height: 300px;
}

.transaction-list {
  width: 100%;
  overflow-x: auto;
}

/* =========================
   내역 테이블
========================= */
.transaction-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.transaction-table th,
.transaction-table td {
  padding: 15px 12px;
  border-bottom: 1px solid #edf2f6;
  text-align: left;
  font-size: 14px;
}

.transaction-table th {
  background-color: #f3f9fd;
  color: #71869a;
  font-size: 13px;
  font-weight: 600;
}

.transaction-table th:first-child {
  border-radius: 8px 0 0 8px;
}

.transaction-table th:last-child {
  border-radius: 0 8px 8px 0;
  text-align: right;
}

.transaction-table td:last-child {
  text-align: right;
}

/* =========================
   지출 / 수입 색상
========================= */
.expense {
  color: #e05252;
  font-weight: 600;
}

.income {
  color: #3987d6;
  font-weight: 600;
}

/* =========================
   내역이 없을 때
========================= */
.empty-message {
  padding: 65px 20px;
  text-align: center;
  color: #9aabba;
  font-size: 14px;
}

/* =========================
   모바일 화면
========================= */
@media (max-width: 700px) {
  body {
    padding: 16px;
  }

  .header {
    margin-bottom: 18px;
  }

  .header h1 {
    font-size: 24px;
  }

  .input-section,
  .list-section {
    padding: 20px;
    border-radius: 15px;
  }

  .input-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .input-group {
    min-width: 0;
  }

  #addButton {
    width: 100%;
    grid-column: 1 / -1;
  }

  .transaction-table {
    min-width: 550px;
  }

  .transaction-table th,
  .transaction-table td {
    padding: 12px 8px;
    font-size: 13px;
  }
}
