/* 결제 이력 검색 · 확장 그리드 · 영수증 미리보기 모달 (Pure CSS Tokens) */
.payment-search-count {
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.payment-search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 12px;
}

.payment-search-form__keyword {
  flex: 1 1 220px;
  min-width: 180px;
  padding: 8px 12px;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--bg-base);
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
}

.payment-search-form__select,
.payment-search-form__date {
  padding: 8px 10px;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--bg-base);
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
}

.payment-search-form__sep {
  font-size: 12px;
  color: var(--text-secondary);
}

.payment-search-form__btn {
  padding: 8px 14px;
  font-size: 12px;
  white-space: nowrap;
}

.payment-table-wrap {
  overflow-x: auto;
}

.payment-history-table {
  min-width: 820px;
}

.payment-cell-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.payment-cell-num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.payment-cell-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.payment-receipt-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.payment-action-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-primary);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.payment-action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.payment-action-btn--dl {
  background: var(--bg-subtle);
}

.payment-receipt-muted {
  font-size: 11px;
  color: var(--text-secondary);
}

.payment-receipt-modal[hidden] {
  display: none;
}

.payment-receipt-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.payment-receipt-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.56);
}

.payment-receipt-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  padding: 18px 22px 24px;
}

.payment-receipt-modal__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.payment-receipt-modal__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.payment-receipt-btn {
  padding: 7px 12px;
  font-size: 12px;
}

.payment-receipt-sheet {
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 22px;
  color: var(--text-primary);
}

.receipt-sheet__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--border-strong, var(--text-primary));
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.receipt-sheet__title { margin: 0; font-size: 20px; font-weight: 800; }
.receipt-sheet__sub { margin: 4px 0 0; font-size: 12px; color: var(--text-secondary); }
.receipt-sheet__meta { font-size: 12px; color: var(--text-secondary); line-height: 1.6; text-align: right; }
.receipt-sheet__parties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.receipt-sheet__box { display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--border-default); border-radius: 8px; padding: 10px 12px; font-size: 12px; }
.receipt-sheet__box-label { font-size: 11px; color: var(--text-secondary); font-weight: 600; }
.receipt-sheet__amount-box { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 16px; border-radius: 8px; background: var(--bg-subtle); margin-bottom: 10px; }
.receipt-sheet__amount-box strong { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.receipt-sheet__proviso, .receipt-sheet__note { font-size: 11px; color: var(--text-secondary); margin: 0 0 12px; }
.receipt-sheet__details { margin: 0 0 12px; border-top: 1px solid var(--border-subtle); }
.receipt-sheet__details > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); font-size: 12px; }
.receipt-sheet__details dt { color: var(--text-secondary); }
.receipt-sheet__details dd { margin: 0; word-break: break-all; }

@media (max-width: 600px) {
  .receipt-sheet__parties { grid-template-columns: minmax(0, 1fr); }
  .receipt-sheet__details > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

@media print {
  body.receipt-printing > *:not(main),
  body.receipt-printing main > *:not(.dash-section[data-section="settings"]),
  body.receipt-printing .dash-section[data-section="settings"] > *:not(#paymentReceiptModal),
  body.receipt-printing .payment-receipt-modal__backdrop,
  body.receipt-printing .payment-receipt-modal__toolbar {
    display: none !important;
  }
  body.receipt-printing .payment-receipt-modal { position: static; padding: 0; }
  body.receipt-printing .payment-receipt-modal__dialog { box-shadow: none; border: 0; max-height: none; width: 100%; }
}
