:root {
  --series-1: #2a78d6; /* 수입 */
  --series-2: #eb6834; /* 지출 */
}
[data-bs-theme="dark"] {
  --series-1: #3987e5;
  --series-2: #d95926;
}

body {
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bs-tertiary-bg);
}
.card { border-color: var(--bs-border-color-translucent); }
.tabular { font-variant-numeric: tabular-nums; }

.stat-card { transition: border-color .15s; }
a.stat-card:hover { border-color: var(--bs-primary); }
.stat-value { font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

.swatch {
  display: inline-block; width: .7rem; height: .7rem; border-radius: 3px;
  margin-right: .4rem; vertical-align: baseline; box-shadow: 0 0 0 1px var(--bs-border-color-translucent);
}
.cat-bars li a:hover { background: var(--bs-secondary-bg); }
.cat-bars li + li { margin-top: .35rem; }
.cat-bars .pct { display: inline-block; min-width: 3.2rem; text-align: right; }
.progress { background: var(--bs-secondary-bg); }
.progress-bar { border-radius: 0 4px 4px 0; }

.cat-badge {
  display: inline-block; font-size: .8rem; padding: .15rem .55rem; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--cat) 45%, transparent);
  background: color-mix(in srgb, var(--cat) 14%, transparent);
  color: var(--bs-body-color);
  white-space: nowrap;
}

.chart-legend { display: flex; gap: 1rem; color: var(--bs-secondary-color); }
.legend-dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 2px; margin-right: .35rem; }
.legend-dot.series-1 { background: var(--series-1); }
.legend-dot.series-2 { background: var(--series-2); }

/* 거래 목록 */
.txn-table .desc-cell { max-width: 28rem; }
.sort-link { color: inherit; text-decoration: none; white-space: nowrap; }
.sort-link:hover { text-decoration: underline; }
.sort-link .bi { margin-left: .25rem; font-size: .75em; color: var(--bs-secondary-color); }
.sort-link.active .bi { color: var(--bs-primary); }
.txn-table .cat-select { border-left: 4px solid var(--cat, transparent); }
/* 미분류: 왼쪽 색 막대를 옅은 회색으로 (선택을 바꾸면 바로 반영) */
.txn-table .cat-select:has(option[value=""]:checked) { border-left-color: var(--bs-secondary-bg); }
.txn-table tr.row-transfer td { color: var(--bs-secondary-color); }
.txn-table select.saving { opacity: .6; }
.txn-table .memo-view {
  display: flex; align-items: baseline; max-width: 100%; padding: 0; border: 0;
  background: none; text-align: left; cursor: text;
  --memo-color: #65a30d; /* 연두색 (라이트) */
  color: var(--memo-color); font-weight: 700;
}
[data-bs-theme="dark"] .txn-table .memo-view { --memo-color: #a3e635; } /* 밝은 연두 (다크) */
.txn-table .memo-view .bi { color: var(--memo-color); }
.txn-table .memo-view.memo-empty,
.txn-table .memo-view.memo-empty .bi { color: var(--bs-secondary-color); font-weight: 400; }
.txn-table .memo-view .memo-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.txn-table .memo-view:hover .memo-text { text-decoration: underline dotted; }
.txn-table .memo-view.memo-empty { opacity: .55; }
@media (hover: hover) {
  .txn-table .memo-view.memo-empty { visibility: hidden; }
  .txn-table tr:hover .memo-view.memo-empty,
  .txn-table .memo-view.memo-empty:focus-visible { visibility: visible; }
}
.txn-table .memo-input { resize: vertical; min-height: calc(1.5em + .5rem + 2px); }
.txn-table .memo-input.saving { opacity: .6; }
.bulk-bar {
  position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%);
  z-index: 1030; max-width: calc(100% - 2rem);
}

/* 가져오기 */
.step {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: var(--bs-primary); color: #fff; font-size: .85rem; margin-right: .25rem;
}
.sample-wrap { max-height: 70vh; }
.sample-table td, .sample-table th { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; }
.preview-wrap { max-height: 65vh; }

/* 리포트 */
.report-table .sticky-col { position: sticky; left: 0; background: var(--bs-body-bg); z-index: 1; }
.report-table thead .sticky-col { background: var(--bs-tertiary-bg); }

/* 테마 토글 아이콘 */
[data-bs-theme="dark"] .theme-icon-dark { display: none; }
[data-bs-theme="light"] .theme-icon-light { display: none; }
