/**
 * 領収書ページ用CSS
 * 画面表示 + 印刷対応
 */

/* ── リセット・ベース ── */
.tr-body {
  margin: 0;
  padding: 0;
  font-family: 'Noto Serif JP', 'Yu Mincho', 'YuMincho', serif;
  background: #f5f5f5;
  color: #333;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* ── ラッパー ── */
.tr-wrapper {
  max-width: 700px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* ── エラー表示 ── */
.tr-error {
  background: #fff;
  border-radius: 8px;
  padding: 40px 20px;
  text-align: center;
  font-size: 15px;
  color: #c62828;
  box-shadow: 0 1px 8px rgba(0,0,0,0.08);
}

/* ── 印刷ボタン（画面のみ） ── */
.tr-actions {
  text-align: right;
  margin-bottom: 16px;
}
.tr-print-btn {
  display: inline-block;
  padding: 10px 28px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Noto Sans JP', sans-serif;
  color: #fff;
  background: #43a047;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
.tr-print-btn:hover {
  background: #388e3c;
}

/* ── 領収書本体 ── */
.tr-receipt {
  background: #fff;
  border: 2px solid #333;
  border-radius: 2px;
  padding: 48px 40px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

/* ── ヘッダー ── */
.tr-header {
  text-align: center;
  margin-bottom: 36px;
}
.tr-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.3em;
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 3px double #333;
  display: inline-block;
}
.tr-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 24px;
  margin-top: 8px;
}
.tr-meta-item {
  font-size: 13px;
}
.tr-meta-label {
  color: #777;
  margin-right: 6px;
}
.tr-meta-value {
  font-weight: 600;
  word-break: break-all;
}

/* ── 宛名 ── */
.tr-addressee {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 32px;
  padding-bottom: 8px;
  border-bottom: 1px solid #333;
}
.tr-addressee-suffix {
  font-size: 16px;
  font-weight: 400;
  margin-left: 8px;
}

/* ── 金額 ── */
.tr-amount-box {
  background: #f8f8f5;
  border: 2px solid #333;
  border-radius: 4px;
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}
.tr-amount-label {
  font-size: 16px;
  font-weight: 600;
  color: #555;
}
.tr-amount-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* ── 但書き・明細 ── */
.tr-description {
  margin-bottom: 40px;
}
.tr-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.tr-detail-table th {
  text-align: left;
  font-weight: 600;
  color: #555;
  padding: 10px 16px 10px 0;
  width: 110px;
  vertical-align: top;
  border-bottom: 1px solid #eee;
}
.tr-detail-table td {
  padding: 10px 0;
  border-bottom: 1px solid #eee;
  line-height: 1.6;
}

/* ── 発行者 ── */
.tr-issuer {
  text-align: right;
  margin-bottom: 32px;
}
.tr-issuer-name {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 4px;
}
.tr-issuer-address {
  font-size: 13px;
  color: #777;
  margin: 0;
}

/* ── 注意書き ── */
.tr-notes {
  border-top: 1px solid #ddd;
  padding-top: 16px;
}
.tr-notes p {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 11px;
  color: #999;
  margin: 0 0 4px;
  line-height: 1.7;
}

/* ── モバイル対応 ── */
@media (max-width: 600px) {
  .tr-receipt {
    padding: 32px 20px;
  }
  .tr-title {
    font-size: 24px;
  }
  .tr-addressee {
    font-size: 18px;
  }
  .tr-amount-value {
    font-size: 22px;
  }
  .tr-amount-box {
    padding: 16px 20px;
  }
  .tr-meta {
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
  }
}

/* ══════════════════════════════════
   印刷用スタイル
   ══════════════════════════════════ */
@media print {
  /* 不要な要素を非表示 */
  .tr-actions {
    display: none !important;
  }

  /* 背景 */
  .tr-body {
    background: #fff !important;
    padding: 0;
  }
  .tr-wrapper {
    max-width: none;
    padding: 0;
  }
  .tr-receipt {
    border: 2px solid #333;
    box-shadow: none;
    padding: 40px 36px;
  }

  /* ページ設定 */
  @page {
    margin: 15mm;
    size: A4;
  }
}
