/* ═══════════════════════════════════════════════════════════════════════════
   토스 스타일 디자인 시스템 — 라이트 모드 · 엔터프라이즈

   토스 디자인의 핵심을 옮겼다:
    · 파랑 하나만 강조색으로 쓰고 나머지는 회색조로 눌러 정보 위계를 만든다
    · 여백을 넉넉히 — 금융 화면은 빽빽할수록 실수가 는다
    · 숫자는 크고 굵게. 사용자가 확인해야 하는 건 결국 금액이다
    · 모서리는 둥글게(12~16px), 그림자는 거의 없이 경계선으로 구분

   외부 폰트·CDN 을 쓰지 않는다. Caddy 가 정적 파일로만 서비스하고
   네트워크 의존을 늘리지 않기 위해서다. Pretendard 가 설치돼 있으면 쓰고,
   없으면 시스템 한글 폰트로 떨어진다.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* ── 브랜드 ─────────────────────────────────────────────────────────── */
  --blue-50: #e8f3ff;
  --blue-100: #c9e2ff;
  --blue-200: #90c2ff;
  --blue-300: #64a8ff;
  --blue-400: #4593fc;
  --blue-500: #3182f6; /* 토스 블루 — 주 강조색 */
  --blue-600: #2272eb;
  --blue-700: #1b64da;
  --blue-800: #1957c2;
  --blue-900: #194aa6;

  /* ── 회색조 — 정보 위계의 뼈대 ──────────────────────────────────────── */
  --grey-0: #ffffff;
  --grey-50: #f9fafb;
  --grey-100: #f2f4f6;
  --grey-200: #e5e8eb;
  --grey-300: #d1d6db;
  --grey-400: #b0b8c1;
  --grey-500: #8b95a1;
  --grey-600: #6b7684;
  --grey-700: #4e5968;
  --grey-800: #333d4b;
  --grey-900: #191f28;

  /* ── 의미색 ─────────────────────────────────────────────────────────── */
  --red-50: #ffeeee;
  --red-500: #f04452; /* 오류·위험·감소 */
  --red-600: #e03131;
  --green-50: #e8f8f1;
  --green-500: #15c47e; /* 성공·증가 */
  --green-600: #00b26b;
  --yellow-50: #fff8e1;
  --yellow-500: #ffc700; /* 주의·대기 */
  --yellow-700: #b98900;
  --violet-50: #f3f0ff;
  --violet-500: #7c5cfc;

  /* ── 시맨틱 별칭 ─────────────────────────────────────────────────────── */
  --bg: var(--grey-50);
  --bg-elevated: var(--grey-0);
  --border: var(--grey-200);
  --border-strong: var(--grey-300);
  --text: var(--grey-900);
  --text-secondary: var(--grey-700);
  --text-tertiary: var(--grey-500);
  --text-disabled: var(--grey-400);
  --primary: var(--blue-500);

  /* ── 치수 ───────────────────────────────────────────────────────────── */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0, 27, 55, 0.04);
  --shadow: 0 2px 8px rgba(0, 27, 55, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 27, 55, 0.1);
  --shadow-modal: 0 16px 48px rgba(0, 27, 55, 0.16);

  --sidebar-width: 248px;
  --header-height: 60px;

  --font: 'Pretendard', 'Pretendard Variable', -apple-system, BlinkMacSystemFont,
    'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', system-ui, sans-serif;
  /* 숫자를 표에서 세로로 맞추려면 고정폭 숫자가 필요하다 */
  --font-num: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

/* ═══════════════════════════════════════════════════════════════════════════
   리셋
   ═══════════════════════════════════════════════════════════════════════════ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-break: keep-all;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

img,
svg {
  display: block;
  max-width: 100%;
}

/* ═══════════════════════════════════════════════════════════════════════════
   타이포그래피
   ═══════════════════════════════════════════════════════════════════════════ */

.t-display {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.3;
}
.t-h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.35;
}
.t-h2 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.2px;
  line-height: 1.4;
}
.t-h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
}
.t-body {
  font-size: 15px;
  font-weight: 400;
}
.t-body-strong {
  font-size: 15px;
  font-weight: 600;
}
.t-sm {
  font-size: 13px;
}
.t-xs {
  font-size: 12px;
}

.t-secondary {
  color: var(--text-secondary);
}
.t-tertiary {
  color: var(--text-tertiary);
}
.t-primary {
  color: var(--primary);
}
.t-danger {
  color: var(--red-500);
}
.t-success {
  color: var(--green-600);
}
.t-warn {
  color: var(--yellow-700);
}

/* 금액 — 토스에서 가장 중요한 요소. 크고 굵고 숫자 간격을 고르게. */
.amount {
  font-family: var(--font-num);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
}
.amount-xl {
  font-size: 32px;
}
.amount-lg {
  font-size: 24px;
}
.amount-md {
  font-size: 19px;
}
.amount-sm {
  font-size: 15px;
}
.amount-unit {
  font-size: 0.65em;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-left: 2px;
}
/* 표 안의 숫자는 자릿수를 맞춘다 */
.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   레이아웃
   ═══════════════════════════════════════════════════════════════════════════ */

.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px;
}
.container-wide {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}

.stack {
  display: flex;
  flex-direction: column;
}
.stack-2 {
  gap: 8px;
}
.stack-3 {
  gap: 12px;
}
.stack-4 {
  gap: 16px;
}
.stack-6 {
  gap: 24px;
}
.stack-8 {
  gap: 32px;
}

.row {
  display: flex;
  align-items: center;
}
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.row-gap-2 {
  gap: 8px;
}
.row-gap-3 {
  gap: 12px;
}
.row-gap-4 {
  gap: 16px;
}
.grow {
  flex: 1;
  min-width: 0;
}
.wrap {
  flex-wrap: wrap;
}

.grid {
  display: grid;
  gap: 16px;
}
.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

.hidden {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   카드
   ═══════════════════════════════════════════════════════════════════════════ */

.card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 20px;
}
.card-flat {
  background: var(--grey-100);
  border-radius: var(--radius-lg);
  border: none;
  padding: 20px;
}
.card-tight {
  padding: 16px;
}
.card-hover {
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  cursor: pointer;
}
.card-hover:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.card-hover:active {
  transform: scale(0.995);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   버튼
   ═══════════════════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 48px;
  padding: 0 20px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  transition: background-color 0.15s, opacity 0.15s, transform 0.08s;
  white-space: nowrap;
  user-select: none;
}
.btn:active:not(:disabled) {
  transform: scale(0.98);
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--blue-500);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--blue-600);
}

.btn-secondary {
  background: var(--grey-100);
  color: var(--grey-800);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--grey-200);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--grey-50);
  border-color: var(--border-strong);
}

.btn-danger {
  background: var(--red-500);
  color: #fff;
}
.btn-danger:hover:not(:disabled) {
  background: var(--red-600);
}

.btn-text {
  height: auto;
  padding: 4px 6px;
  background: none;
  color: var(--primary);
  font-weight: 600;
}
.btn-text:hover:not(:disabled) {
  text-decoration: underline;
}

.btn-sm {
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}
.btn-lg {
  height: 56px;
  font-size: 17px;
  border-radius: var(--radius-lg);
}
.btn-block {
  width: 100%;
}

/* 하단 고정 CTA — 모바일 유저 화면의 주 행동 */
.btn-fixed {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, transparent);
  z-index: 40;
}
.btn-fixed .btn {
  max-width: 440px;
  margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   입력
   ═══════════════════════════════════════════════════════════════════════════ */

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.field-hint {
  font-size: 12px;
  color: var(--text-tertiary);
}
.field-error {
  font-size: 12px;
  color: var(--red-500);
  font-weight: 500;
}

.input,
.select,
.textarea {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea {
  height: auto;
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.6;
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px var(--blue-50);
}
.input::placeholder,
.textarea::placeholder {
  color: var(--text-disabled);
}
.input:disabled,
.select:disabled {
  background: var(--grey-100);
  color: var(--text-disabled);
}
.input-error {
  border-color: var(--red-500);
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%238B95A1' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 38px;
}

/* 금액 입력 — 크고 굵게, 오른쪽에 단위 */
.input-amount {
  height: 64px;
  font-family: var(--font-num);
  font-size: 26px;
  font-weight: 700;
  text-align: right;
  padding-right: 48px;
  font-variant-numeric: tabular-nums;
}
.input-amount-wrap {
  position: relative;
}
.input-amount-unit {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-tertiary);
  pointer-events: none;
}

.search {
  position: relative;
}
.search .input {
  padding-left: 40px;
}
.search::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3E%3Ccircle cx='7' cy='7' r='5.25' stroke='%238B95A1' stroke-width='1.5'/%3E%3Cpath d='M11 11L14.5 14.5' stroke='%238B95A1' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat center;
  pointer-events: none;
}

/* 체크박스 */
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.check input {
  appearance: none;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin: 0;
  border: 1.5px solid var(--border-strong);
  border-radius: 6px;
  background: var(--bg-elevated);
  transition: background-color 0.12s, border-color 0.12s;
}
.check input:checked {
  background: var(--blue-500)
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none'%3E%3Cpath d='M3 7.5L6 10.5L11.5 4' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    no-repeat center;
  border-color: var(--blue-500);
}
.check-label {
  font-size: 14px;
  line-height: 22px;
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   뱃지 · 태그
   ═══════════════════════════════════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 9px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-blue {
  background: var(--blue-50);
  color: var(--blue-700);
}
.badge-grey {
  background: var(--grey-100);
  color: var(--grey-700);
}
.badge-green {
  background: var(--green-50);
  color: var(--green-600);
}
.badge-red {
  background: var(--red-50);
  color: var(--red-600);
}
.badge-yellow {
  background: var(--yellow-50);
  color: var(--yellow-700);
}
.badge-violet {
  background: var(--violet-50);
  color: var(--violet-500);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-green { background: var(--green-500); }
.dot-red { background: var(--red-500); }
.dot-yellow { background: var(--yellow-500); }
.dot-grey { background: var(--grey-400); }

/* ═══════════════════════════════════════════════════════════════════════════
   목록 · 테이블
   ═══════════════════════════════════════════════════════════════════════════ */

.list {
  display: flex;
  flex-direction: column;
}
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.list-item:last-child {
  border-bottom: none;
}
.list-item-clickable {
  cursor: pointer;
  transition: background-color 0.12s;
  margin: 0 -12px;
  padding: 16px 12px;
  border-radius: var(--radius);
}
.list-item-clickable:hover {
  background: var(--grey-50);
}

/* 키-값 행 — 영수증·상세 정보 */
.kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
}
.kv-key {
  font-size: 14px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}
.kv-val {
  font-size: 14px;
  font-weight: 500;
  text-align: right;
  word-break: break-all;
}
.kv-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}
.kv-total {
  padding-top: 14px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
}
.kv-total .kv-key {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

/* 엔터프라이즈 테이블 */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
}
.table {
  min-width: 100%;
  font-size: 13px;
}
.table th {
  position: sticky;
  top: 0;
  background: var(--grey-50);
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--grey-100);
  vertical-align: middle;
}
.table tbody tr:last-child td {
  border-bottom: none;
}
.table tbody tr:hover {
  background: var(--grey-50);
}
.table-clickable tbody tr {
  cursor: pointer;
}
.table .num {
  font-family: var(--font-num);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   내비게이션 — 엔터프라이즈 사이드바 (어드민 · 파트너)
   ═══════════════════════════════════════════════════════════════════════════ */

.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--header-height);
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--blue-500);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.sidebar-nav {
  padding: 12px;
  flex: 1;
}
.nav-section {
  margin-top: 16px;
}
.nav-section:first-child {
  margin-top: 0;
}
.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-disabled);
  letter-spacing: 0.4px;
  padding: 0 12px 6px;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background-color 0.12s, color 0.12s;
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.nav-item:hover {
  background: var(--grey-50);
  color: var(--text);
}
.nav-item.active {
  background: var(--blue-50);
  color: var(--blue-700);
  font-weight: 600;
}
.nav-count {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--red-500);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}
.content {
  padding: 24px;
  flex: 1;
}

/* 모바일 하단 탭 (유저 화면) */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(58px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 50;
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  transition: color 0.12s;
}
.tab.active {
  color: var(--blue-500);
  font-weight: 600;
}
.tab-icon {
  font-size: 19px;
  line-height: 1;
}

.appbar {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 4px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 30;
}
.appbar-back {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  font-size: 20px;
  color: var(--text-secondary);
}
.appbar-back:hover {
  background: var(--grey-100);
}
.appbar-title {
  font-size: 17px;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   모달 — 돈이 오가는 행동은 전부 2단계 확인 (SPEC_PAGES 공통 UX 1)
   ═══════════════════════════════════════════════════════════════════════════ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(25, 31, 40, 0.45);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 100;
  animation: fade 0.15s ease;
}
.modal {
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 400px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  animation: pop 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.modal-wide {
  max-width: 760px;
}
/* 확인 모달 머리 아이콘 — 파괴적 작업이면 붉게 */
.modal-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--blue-50);
  color: var(--blue-600);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}
.modal-icon-danger {
  background: var(--red-50);
  color: var(--red-500);
}
.modal-title {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}
.modal-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 24px;
}
.modal-actions .btn {
  flex: 1;
}

@keyframes fade {
  from { opacity: 0; }
}
@keyframes pop {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   토스트
   ═══════════════════════════════════════════════════════════════════════════ */

.toasts {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  pointer-events: none;
  width: calc(100% - 40px);
  max-width: 400px;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--grey-900);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.1);
  line-height: 1.5;
  /* 토스트를 눌러 즉시 닫을 수 있게 — 호스트는 pointer-events:none 이다 */
  pointer-events: auto;
  cursor: pointer;
}
.toast .icon {
  flex-shrink: 0;
  margin-top: 1px;
}
.toast-error {
  background: var(--red-500);
}
.toast-success {
  background: var(--green-600);
}
.toast-warning {
  background: var(--yellow-700);
}
.toast-out {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(16px); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   상태 표시
   ═══════════════════════════════════════════════════════════════════════════ */

/* 진행 스테퍼 — 거래룸 상단 */
.stepper {
  display: flex;
  align-items: center;
  gap: 4px;
}
.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.step-dot {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--grey-200);
  transition: background-color 0.3s;
}
.step.done .step-dot,
.step.current .step-dot {
  background: var(--blue-500);
}
.step-label {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
}
.step.current .step-label {
  color: var(--blue-600);
  font-weight: 600;
}

/* 카운트다운 — 타이머가 있는 상태는 항상 노출 (SPEC_PAGES 공통 UX 2) */
.countdown {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--blue-50);
  color: var(--blue-700);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.countdown-urgent {
  background: var(--red-50);
  color: var(--red-600);
}

/* 빈 상태 */
.empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-tertiary);
}
/* 아이콘을 옅은 원 안에 넣는다. 선 아이콘만 두면 허전하고 시선이 안 잡힌다. */
.empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: var(--radius-full);
  background: var(--grey-100);
  color: var(--grey-500);
  display: grid;
  place-items: center;
}
.empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.empty-desc {
  font-size: 13px;
  line-height: 1.6;
  max-width: 280px;
  margin: 0 auto;
}

/* 스켈레톤 */
.skeleton {
  background: linear-gradient(90deg, var(--grey-100) 25%, var(--grey-200) 37%, var(--grey-100) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
.skeleton-line {
  height: 13px;
}
.skeleton-list {
  display: flex;
  flex-direction: column;
}
.skeleton-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.skeleton-row:last-child {
  border-bottom: none;
}
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* 알림 배너 */
.banner {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.6;
  text-align: left;
}
.banner-body {
  min-width: 0;
}
.banner-title {
  font-weight: 700;
  margin-bottom: 2px;
}
.banner-info {
  background: var(--blue-50);
  color: var(--blue-800);
}
.banner-warn {
  background: var(--yellow-50);
  color: var(--yellow-700);
}
.banner-danger {
  background: var(--red-50);
  color: var(--red-600);
}
.banner-success {
  background: var(--green-50);
  color: var(--green-600);
}
/* 팁 — 정보성이지만 파랑(=진행 안내)과 구분해야 하는 부가 설명 */
.banner-tip {
  background: var(--grey-50);
  color: var(--text-secondary);
}
.banner-icon {
  flex-shrink: 0;
  /* 아이콘 중심을 첫 줄 텍스트 중심에 맞춘다 (line-height 1.6, 13px → 20.8px) */
  height: 20.8px;
  display: grid;
  place-items: center;
  opacity: 0.9;
}

/* 구분선 */
.divider {
  height: 1px;
  background: var(--border);
  border: none;
  margin: 20px 0;
}
.divider-thick {
  height: 8px;
  background: var(--grey-100);
  border: none;
  margin: 24px -20px;
}

/* 필터 바 */
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}
.chip {
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.12s;
}
.chip:hover {
  border-color: var(--border-strong);
}
.chip.active {
  background: var(--grey-900);
  border-color: var(--grey-900);
  color: #fff;
  font-weight: 600;
}

/* 로딩 스피너 */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-dark {
  border-color: var(--grey-300);
  border-top-color: var(--grey-700);
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.page-loading {
  display: grid;
  place-items: center;
  min-height: 240px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   반응형
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .content,
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (max-width: 480px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  .amount-xl {
    font-size: 28px;
  }
}

/* 유저 앱은 하단 탭바 높이만큼 여백을 준다 */
.has-tabbar {
  padding-bottom: calc(70px + env(safe-area-inset-bottom));
}
.has-fixed-cta {
  padding-bottom: 88px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   아이콘 (Lucide)

   stroke 가 currentColor 이므로 부모의 color 를 그대로 상속한다. 색을 따로
   지정하지 말고 부모 텍스트 색을 맞추는 쪽으로 쓴다.
   ═══════════════════════════════════════════════════════════════════════════ */

.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* 아이콘 + 텍스트를 나란히 놓는 버튼 (btn 은 이미 inline-flex 라 gap 만 준다) */
.btn .icon {
  margin-right: 6px;
  margin-left: -2px;
}
.btn-icon-only {
  padding: 0;
  width: 40px;
}
.btn-icon-only .icon {
  margin: 0;
}
.btn-sm.btn-icon-only {
  width: 34px;
}

/* 목록 행 오른쪽 꺾쇠 — 눌러서 들어가는 행임을 알린다 */
.chevron {
  color: var(--grey-400);
  flex-shrink: 0;
  transition: transform 0.12s, color 0.12s;
}
.list-item-clickable:hover .chevron {
  color: var(--text-tertiary);
  transform: translateX(2px);
}

/* 원형 아이콘 배지 — 목록 행 왼쪽, 통계 카드 머리 */
.icon-badge {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--grey-100);
  color: var(--grey-600);
}
.icon-badge-blue {
  background: var(--blue-50);
  color: var(--blue-600);
}
.icon-badge-green {
  background: var(--green-50);
  color: var(--green-600);
}
.icon-badge-red {
  background: var(--red-50);
  color: var(--red-500);
}
.icon-badge-yellow {
  background: var(--yellow-50);
  color: var(--yellow-700);
}
.icon-badge-lg {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
}

/* 하단 탭 — 활성 탭만 stroke 를 굵혀 채워진 느낌을 준다 */
.tab .icon {
  transition: transform 0.14s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.tab.active .icon {
  stroke-width: 2.4;
  transform: translateY(-1px);
}

/* 사이드바 내비 아이콘은 비활성일 때 한 톤 흐리게 */
.nav-item .icon {
  color: var(--grey-500);
  transition: color 0.12s;
}
.nav-item:hover .icon,
.nav-item.active .icon {
  color: inherit;
}

/* ═══════════════════════════════════════════════════════════════════════════
   상호작용 다듬기
   ═══════════════════════════════════════════════════════════════════════════ */

/* 키보드 사용자에게만 포커스 링을 보인다. 마우스 클릭에는 링이 남지 않는다. */
:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
.btn:focus-visible {
  outline-offset: 3px;
}

/* 누를 때 살짝 눌리는 느낌 — 토스 특유의 촉각 피드백 */
.btn:not(:disabled):active {
  transform: scale(0.985);
}
.tab:active .icon {
  transform: scale(0.9);
}

/* 로딩 중 버튼은 폭이 고정되므로 스피너만 가운데 정렬 */
.btn[aria-busy='true'] {
  cursor: progress;
}

/* 숫자는 전부 자리 폭을 맞춘다 — 금액이 흔들리면 신뢰가 떨어진다 */
.amount,
.amount-xl,
.kv-val,
.table td,
.stat-value,
.mono {
  font-variant-numeric: tabular-nums;
}
.mono {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  letter-spacing: -0.2px;
}

/* 페이지 전환 시 살짝 떠오르게 — 라우터가 매번 innerHTML 을 갈아끼운다 */
.view-enter {
  animation: view-in 0.18s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes view-in {
  from { opacity: 0; transform: translateY(6px); }
}

/* 움직임을 줄이도록 설정한 사용자에게는 애니메이션을 끈다 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   결제 완료 영수증 · 체크리스트
   ═══════════════════════════════════════════════════════════════════════════ */

.receipt-head {
  text-align: center;
  margin-bottom: 32px;
}
/* 성공 체크 — 원이 먼저 커지고 체크가 그려진다 */
.receipt-check {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  border-radius: var(--radius-full);
  background: var(--green-50);
  color: var(--green-600);
  display: grid;
  place-items: center;
  animation: pop-in 0.34s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.5); }
}

/* 완료된 준비 단계 */
.step-done {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-tertiary);
}
.step-check {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--green-500);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.step-done .t-h3 {
  color: var(--text-secondary);
}

/* 어드민 위험 구역 — 아이콘을 본문 옆에 정렬 */
.danger-zone {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.danger-zone .icon {
  margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   정보 밀도 다듬기 (엔터프라이즈 화면)
   ═══════════════════════════════════════════════════════════════════════════ */

/* 표 행에 마우스를 올리면 짚어준다 — 가로로 긴 표에서 줄을 놓치지 않게 */
.table tbody tr {
  transition: background-color 0.1s;
}
.table tbody tr:hover {
  background: var(--grey-50);
}
.table-row-clickable {
  cursor: pointer;
}

/* 표 헤더는 스크롤해도 붙어 있는다 */
.table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-elevated);
  z-index: 1;
}

/* 통계 카드 — 아이콘 + 라벨 + 값 + 증감 */
.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.stat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 10px;
}
.stat-value {
  font-family: var(--font-num);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.2;
}
.stat-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 6px;
}

/* 목록 행 왼쪽 아이콘 + 본문 + 오른쪽 값 */
.row-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
}
.row-item-body {
  flex: 1;
  min-width: 0;
}
.row-item-title {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-item-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* 여러 줄이 넘칠 때 말줄임 */
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 값 옆에 붙는 복사 버튼 — 계좌번호·코드처럼 그대로 옮겨 적어야 하는 값 */
.btn-copy {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-left: 6px;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  vertical-align: middle;
  transition: background-color 0.12s, color 0.12s;
}
.btn-copy:hover {
  background: var(--grey-100);
  color: var(--text);
}
.btn-copy:active {
  transform: scale(0.92);
}

/* 지표 카드 머리·목록 행에 쓰는 작은 아이콘 배지 */
.icon-badge-sm {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
}

/* ═══════════════════════════════════════════════════════════════════════════
   라우트 전환 피드백
   ═══════════════════════════════════════════════════════════════════════════ */

/* 상단 진행 바 — 폭을 90% 까지 밀어두고 완료 시 100% 로 채운 뒤 사라진다.
   실제 진행률을 알 수 없으니 "곧 끝난다"는 느낌만 준다. */
.route-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--blue-500);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  border-radius: 0 2px 2px 0;
}
.route-progress-active {
  opacity: 1;
  width: 90%;
  transition: width 8s cubic-bezier(0.1, 0.9, 0.2, 1), opacity 0.1s;
}
.route-progress-done {
  opacity: 0;
  width: 100%;
  transition: width 0.18s ease-out, opacity 0.3s 0.15s;
}

/* 라우트 로딩 실패 화면 */
.route-error {
  display: grid;
  place-items: center;
  min-height: 60vh;
  padding: 24px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   알림
   ═══════════════════════════════════════════════════════════════════════════ */

/* 홈 상단 — 인사말 + 알림 종 */
.home-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 14px;
}
.bell {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-right: -8px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  transition: background-color 0.12s;
}
.bell:hover {
  background: var(--grey-100);
}
/* 안 읽은 개수 — 종 오른쪽 위에 겹친다 */
.bell-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  background: var(--red-500);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  /* 배경과 분리해 보이게 흰 테두리를 두른다 */
  box-shadow: 0 0 0 2px var(--bg);
}

.notif {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px;
  margin: 0 -12px;
  border-radius: var(--radius);
  transition: background-color 0.12s;
}
.notif[role='link'] {
  cursor: pointer;
}
.notif[role='link']:hover {
  background: var(--grey-50);
}
/* 안 읽은 알림 — 왼쪽에 파란 막대로 표시한다. 배경만 바꾸면
   읽은 것과의 차이가 흐릿하다. */
.notif-unread {
  background: var(--blue-50);
  box-shadow: inset 3px 0 0 var(--blue-500);
}
.notif-unread:hover {
  background: var(--blue-100);
}
.notif-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}
.notif-unread .notif-title {
  color: var(--blue-800);
}
