/* ===== demo-container override ===== */
/* 帳票は固定幅レイアウトのため、横スクロールで小画面に対応 */
.demo-container {
  overflow-x: auto;
  padding: 24px;
  justify-content: flex-start;
}

/* ===== 請求書ラッパー ===== */
.invoice-wrap {
  width: 100%;
  min-width: 480px;
  max-width: 720px;
  margin: 0 auto;
}

/* ===== 帳票カード（紙の見た目） ===== */
.invoice-paper {
  background: #fff;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.12);
  max-width: 680px;
  margin: 0 auto;
  padding: 40px;
}

/* ===== ヘッダー（「請求書」 + 番号・日付） ===== */
.invoice-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
}

.invoice-heading {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: #1a2332;
}

/* dt/dd をグリッドで横並びに */
.invoice-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 16px;
  font-size: 13px;
}

.invoice-meta dt {
  font-weight: 600;
  color: #7a8a9a;
  white-space: nowrap;
  margin: 0;
}

.invoice-meta dd {
  margin: 0;
  color: #1a2332;
}

/* ===== 請求先・発行元（2カラム） ===== */
.invoice-parties {
  display: flex;
  gap: 32px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.invoice-to,
.invoice-from {
  flex: 1;
  min-width: 180px;
}

.invoice-label {
  font-size: 11px;
  font-weight: 700;
  color: #2B7FE8;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 6px;
}

.invoice-company {
  font-size: 16px;
  font-weight: 700;
  color: #1a2332;
  margin: 0 0 4px;
}

.invoice-addr {
  font-size: 13px;
  color: #5a6a7a;
  margin: 0 0 2px;
}

/* ===== 明細テーブル ===== */
.invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 14px;
}

.invoice-table th {
  background: #2B7FE8;
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
}

.invoice-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  color: #1a2332;
}

/* 数量・単価・金額列は右寄せ */
.invoice-table .col-qty,
.invoice-table .col-price,
.invoice-table .col-amount {
  text-align: right;
}

.invoice-table tbody tr:last-child td {
  border-bottom: none;
}

/* ===== 合計エリア（右寄せ） ===== */
.invoice-totals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  margin-bottom: 32px;
}

.invoice-total-row {
  display: flex;
  justify-content: space-between;
  gap: 48px;
  font-size: 14px;
  color: #5a6a7a;
  min-width: 240px;
}

/* 合計（税込）行を強調 */
.invoice-total-row.is-grand {
  font-size: 18px;
  font-weight: 700;
  color: #1a2332;
  border-top: 2px solid #1a2332;
  padding-top: 8px;
  margin-top: 4px;
}

/* ===== 振込先 ===== */
.invoice-bank {
  background: #f4f6f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px 20px;
  font-size: 14px;
  color: #1a2332;
}

.invoice-bank p {
  margin: 0 0 4px;
}

.invoice-bank p:last-child {
  margin: 0;
}

/* ===== 読み込み中メッセージ ===== */
.invoice-loading {
  color: #9aa5b4;
  font-size: 14px;
  padding: 48px 20px;
  text-align: center;
  margin: 0;
}

/* ===== PDF出力ボタン ===== */
.invoice-actions {
  display: flex;
  justify-content: center;
  padding: 20px 0 4px;
}

.invoice-print-btn {
  background: #2B7FE8;
  color: #fff;
  border: none;
  padding: 12px 32px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: sans-serif;
  transition: background 0.15s;
}

.invoice-print-btn:hover {
  background: #1A6ED4;
}

.invoice-print-btn:disabled {
  background: #9aa5b4;
  cursor: not-allowed;
}

/* ===== ステータスメッセージ ===== */
.invoice-status {
  text-align: center;
  font-size: 13px;
  min-height: 20px;
  margin: 4px 0 0;
  padding: 0 24px;
  color: transparent;
  transition: color 0.15s;
}

.invoice-status.is-success {
  color: #22c55e;
}

.invoice-status.is-error {
  color: #ef4444;
}

