/* ============================================================
   零用金（2026-11）
   - 同仁的「核銷作業 › 零用金」分頁（petty.js）：class 一律 pc- 開頭，卡片、表單、按鈕沿用 style.css
   - 財務作業裡的零用金（finance.js）：fo-petty、fo-ded 開頭，其他沿用 finance.css
   顏色照 2018 VI（變數接 style.css）；琥珀字 #8a5a00、紅字 #b03a32（對比夠），次要文字不淺於 #566377
   ============================================================ */
.pc [tabindex="-1"]:focus { outline: none; } /* 程式移過去的焦點（標題、訊息）不畫框 */
.pc .card :focus-visible:not([tabindex="-1"]) { outline: 3px solid var(--navy); outline-offset: 2px; }
.pc .card-title, .pc .card-title-sm { margin-top: 0; }
.pc-loading, .pc-loaderr { margin-bottom: 16px; }
.pc-loaderr { color: #b03a32; font-weight: 700; }

/* 怎麼用：四個步驟 */
.pc-steps {
  list-style: none; margin: 0 0 26px; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px;
}
.pc-steps li {
  display: flex; align-items: flex-start; gap: 10px; min-width: 0;
  background: var(--surface-soft); border: 1px solid var(--border-soft); border-radius: 12px;
  padding: 12px 14px; font-size: 14px; line-height: 1.6; color: #3D4A5E;
}
.pc-step-n {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--navy); color: #fff; font-size: 13px; font-weight: 900;
}
.pc-step-text { min-width: 0; overflow-wrap: anywhere; }
.pc-step-text b { display: block; color: var(--navy); font-size: 15px; }

/* 申請表 */
.pc-form-title { margin-bottom: 12px; }
.pc-form .field-label { margin-top: 16px; }
.pc-form .form-field:nth-child(-n+2) .field-label { margin-top: 0; } /* 第一列（金額、所屬中心）上面不留白，兩欄才對齊 */
.pc-form .primary-btn { margin-top: 18px; }
.pc-err { margin: 14px 0 0; }
.pc-flash { margin-bottom: 14px; }

/* 我的零用金 */
.pc-list { display: flex; flex-direction: column; gap: 12px; }
.pc-item {
  border: 1.5px solid var(--border-light); border-radius: var(--radius-md);
  padding: 16px 18px; min-width: 0;
}
.pc-item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px 12px; flex-wrap: wrap; }
.pc-item-main { flex: 1 1 220px; min-width: 0; }
.pc-item-title { margin: 0 0 4px; font-size: 15.5px; font-weight: 800; color: var(--navy); line-height: 1.45; overflow-wrap: anywhere; }
.pc-item-meta { margin: 0; font-size: 12.5px; color: var(--text-muted); line-height: 1.6; overflow-wrap: anywhere; }
.pc-item-meta span + span::before { content: "・"; margin: 0 2px; }
.pc-item-side { flex: 0 0 auto; text-align: right; }
.pc-item-amt { font-size: 16px; font-weight: 800; color: var(--navy); white-space: nowrap; margin-bottom: 4px; }
.status-badge.pc-closed { background: var(--teal-soft); color: var(--teal-ink); }
.status-badge.pc-canceled { background: #EEF1F6; color: #3D4A5E; }
.pc-item .record-note { overflow-wrap: anywhere; }

.pc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pc-actions .ghost-btn-sm { min-height: 44px; }
.pc-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 9px 20px;
  border: none; border-radius: var(--radius-sm);
  background: var(--lime); color: var(--navy-dark);
  font-family: inherit; font-size: 14px; font-weight: 800;
  cursor: pointer;
}
.pc-btn:hover:not(:disabled) { background: var(--lime-dark); }
.pc-btn:disabled { background: #D3DAE5; color: #566377; cursor: not-allowed; }
.pc-confirm { margin-top: 12px; background: var(--danger-bg); border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.6; color: var(--text-main); }
.pc-confirm b { color: #b03a32; margin-right: 4px; }
.pc-confirm .pc-actions { margin-top: 8px; }

/* 金額小結：申請金額／已核銷合計／剩下 */
.pc-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin: 12px 0 0; }
.pc-sum div { min-width: 0; background: #fff; border: 1px solid var(--border-soft); border-radius: 10px; padding: 8px 10px; }
.pc-sum dt { font-size: 12.5px; font-weight: 700; color: var(--text-muted); }
.pc-sum dd { margin: 2px 0 0; font-size: 16px; font-weight: 900; color: var(--navy); overflow-wrap: anywhere; }
.pc-item > .pc-sum div { background: var(--surface-soft); }

/* 結案：勾這次用掉的單據 */
.pc-close { margin-top: 14px; background: var(--surface-soft); border: 1px solid var(--border-soft); border-radius: 12px; padding: 14px 16px; }
.pc-close-title { margin: 0 0 4px; font-size: 15.5px; font-weight: 900; color: var(--navy); }
.pc-close-hint { margin: 0 0 8px; }
.pc-receipts { background: #fff; border: 1px solid var(--border-soft); border-radius: 10px; padding: 0 12px; }
.pc-receipt { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 10px 0; cursor: pointer; }
.pc-receipt + .pc-receipt { border-top: 1px solid #EEF1F6; }
.pc-check { width: 20px; height: 20px; margin: 2px 0 0; flex-shrink: 0; accent-color: var(--navy); cursor: pointer; }
.pc-check:disabled { cursor: not-allowed; }
.pc-receipt-main { flex: 1 1 auto; min-width: 0; }
.pc-receipt-title { display: block; font-size: 14.5px; font-weight: 700; color: var(--text-main); overflow-wrap: anywhere; }
.pc-receipt-meta { display: block; font-size: 12.5px; color: var(--text-muted); overflow-wrap: anywhere; }
.pc-nw { white-space: nowrap; }
.pc-receipt-amt { flex: none; font-weight: 800; color: var(--navy); white-space: nowrap; }
.pc-receipt.is-on .pc-receipt-title { color: var(--navy); }
.pc-close-sum .record-note { margin-top: 10px; }

@media (max-width: 560px) {
  .pc-steps { grid-template-columns: 1fr; margin-bottom: 20px; }
  .pc-form .form-field:nth-child(2) .field-label { margin-top: 16px; } /* 手機是一欄：所屬中心在金額下面 */
  .pc-item { padding: 14px; }
  .pc-close { padding: 12px; }
  .pc-actions > button { flex: 1 1 auto; }
  /* 金額小結：手機一列一項（名稱在左、金額在右），不會有一格掉到下一列 */
  .pc-sum { grid-template-columns: 1fr; gap: 6px; }
  .pc-sum div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
  .pc-sum dd { margin: 0; text-align: right; }
}

/* ---------- 財務作業 › 零用金（finance.js；放行人核准） ---------- */
.fo-petty { border: 1.5px solid var(--fo-line); border-radius: 14px; padding: 16px 18px; margin-top: 14px; }
.fo-petty-head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; }
.fo-petty-title { margin: 0; font-size: 17px; font-weight: 900; line-height: 1.45; color: var(--fo-navy); overflow-wrap: anywhere; min-width: 0; }
.fo-petty-amt { font-size: 19px; font-weight: 900; color: var(--fo-navy); white-space: nowrap; }
.fo-petty .fo-dl { margin: 10px 0 4px; }
.fo-petty .fo-issue { margin-top: 12px; }

/* ② 核對清單的「零用金沖抵（扣回）」、待放行的扣回清單 */
.fo-ded-state { margin: 6px 0 0 !important; font-size: 14.5px; font-weight: 700; color: var(--fo-sub); }
.fo-ded-list { margin: 6px 0 4px; padding-left: 20px; font-size: 13.5px; line-height: 1.7; color: var(--fo-muted); overflow-wrap: anywhere; }
.fo-ded-list-strong { font-size: 15px; font-weight: 700; color: var(--fo-text); }
@media (max-width: 600px) {
  .fo-petty { padding: 14px; }
}

/* 自己取消的期限（撥款日前 7 天）、修改後重新申請（帶入上一次不核准的那一筆） */
.pc-cancel-until { align-self: center; font-size: 13px; color: var(--text-muted); }
.pc-reapply { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 14px; }
.pc-reapply p { margin: 0; flex: 1 1 260px; min-width: 0; }
