/* 공통 헤더/레이아웃 스타일을 침범하지 않도록 body 전역 스타일을 제거했습니다 */

/* 1. 가계부 메인 컨테이너 */
.account-container {
  max-width: 600px;
  margin: 20px auto 40px auto;
  padding: 0 16px;
  box-sizing: border-box;
}

/* 2. 월 이동 및 달력 토글 */
.month-picker {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.current-month {
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 0.5px;
  color: #f8fafc;
}

.btn-month {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-month:hover { background: #334155; }

.btn-toggle-cal {
  background: #334155;
  color: #f8fafc;
  border: 1px solid #475569;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-toggle-cal:hover { background: #475569; }

/* 3. 슬라이딩 달력 */
.calendar-slide-container {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out, margin-bottom 0.3s ease, padding 0.3s ease;
  background: #1e293b;
  border-radius: 12px;
  border: 1px solid #334155;
  margin-bottom: 0;
  padding: 0 16px;
  box-sizing: border-box;
}

.calendar-slide-container.open {
  max-height: 500px;
  margin-bottom: 20px;
  padding: 16px;
}

.hidden { display: none !important; }

.cal-header, .cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.cal-header {
  font-weight: bold;
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 8px;
}

.cal-header .sun { color: #f87171; }
.cal-header .sat { color: #38bdf8; }

.cal-day {
  min-height: 50px;
  border: 1px solid #334155;
  padding: 4px;
  font-size: 11px;
  cursor: pointer;
  background: #0f172a;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transition: background-color 0.2s;
  box-sizing: border-box;
}

.cal-day:hover { background: #334155; }
.cal-day.empty { background: transparent; border: none; cursor: default; }

.day-num { font-weight: bold; color: #f8fafc; text-align: left; margin-bottom: 2px; }
.cal-inc { color: #34d399; font-size: 10px; font-weight: bold; }
.cal-exp { color: #f87171; font-size: 10px; font-weight: bold; }
.cal-memo { color: #94a3b8; font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }

/* 4. 당월 요약 카드 */
.summary-card {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  text-align: center;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.summary-item .label {
  display: block;
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 4px;
}

.summary-item .value {
  font-size: 15px;
  font-weight: bold;
}

.value.income { color: #34d399; }
.value.expense { color: #f87171; }

/* 5. 수입/지출 입력 폼 */
.entry-form-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.form-row:last-child { margin-bottom: 0; }

.input-select, .input-text {
  flex: 1;
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s;
}

.input-select:focus, .input-text:focus { border-color: #38bdf8; }
.input-text.full { flex: 1; }

.date-picker-input {
  cursor: pointer;
  color-scheme: dark;
}

.date-picker-input::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

.btn-submit {
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-submit:hover { background: #1d4ed8; }

/* 6. 내역 리스트 영역 */
.list-header { margin-bottom: 12px; }
.list-header h3 { font-size: 16px; margin: 0; color: #f8fafc; }

.entry-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.no-data {
  text-align: center;
  padding: 30px 0;
  color: #64748b;
  font-size: 14px;
}

.entry-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 12px 16px;
}

.entry-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.entry-date {
  font-size: 13px;
  color: #94a3b8;
  font-weight: bold;
  min-width: 36px;
}

.entry-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.entry-category {
  font-size: 14px;
  font-weight: bold;
  color: #f8fafc;
}

.entry-memo {
  font-size: 12px;
  color: #94a3b8;
}

.entry-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.entry-amount {
  font-size: 15px;
  font-weight: bold;
}

.entry-amount.income { color: #34d399; }
.entry-amount.expense { color: #f87171; }

.btn-del {
  background: transparent;
  color: #64748b;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}

.btn-del:hover { color: #ef4444; }

/* 7. 모달 팝업 스타일 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
  padding: 16px;
  box-sizing: border-box;
}

.modal-content {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #334155;
}

.modal-header h4 {
  margin: 0;
  font-size: 16px;
  color: #f8fafc;
}

.btn-close-modal {
  background: transparent;
  color: #94a3b8;
  border: none;
  font-size: 24px;
  cursor: pointer;
}

.btn-close-modal:hover { color: #f8fafc; }

.modal-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 12px 16px;
  border-top: 1px solid #334155;
  display: flex;
  justify-content: flex-end;
}

.btn-select-date {
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
}

.btn-select-date:hover { background: #1d4ed8; }