/* ops-a2.css — 營運後台 A2（記號 cyc-ride-ui165-a2-20260915）
 * 分頁群組與子列、儲值四子分頁、報表⑤班次色塊圖、行內樣式外移。
 * 🔴 外部 css（CSP style-src 'self'、style-src-attr 'none'）；取代 ops-admin-new.js 22 處與 r38x-hotfix17-finance.js 1 處 style 屬性，數值逐字沿用原行內樣式。
 * 🔴 本檔在 admin.html 最後載入；需壓過既有元素選擇器時以「元素＋class」寫。 */

/* ── 分頁群組（7 組）與子列 ── */
.ops-subtabs { margin-top: -6px; }
.ops-subtabs:not(.is-open), .ops-subtabs.ops-single { display: none; }

/* ── 儲值四子分頁 ── */
.ops-rtabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.btn.ops-rtab.active { background: #2258f2; border-color: #2258f2; color: #fff; }
.ops-rpanel { display: none; }
.ops-rpanel.active { display: block; }

/* ── 報表⑤班次色塊圖：0 灰、1～5 淡、6～15 中、16 以上深 ── */
.orp-grid-legend { color: #607d8b; font-size: 13px; margin: 4px 0 8px; }
.orp-grid-title { font-weight: 700; margin: 12px 0 4px; }
.orp-grid th, .orp-grid td { text-align: center; white-space: nowrap; }
.orp-grid td.orp-grid-cell { min-width: 44px; }
.orp-grid td.orp-lv0 { background: #eceff1; color: #78909c; }
.orp-grid td.orp-lv1 { background: #e3f2fd; color: #0d47a1; }
.orp-grid td.orp-lv2 { background: #90caf9; color: #0d47a1; }
.orp-grid td.orp-lv3 { background: #1565c0; color: #fff; }

/* ── 行內樣式外移（ops-admin-new.js：隨身碼綁定、補發核對、遺失物通報；r38x-hotfix17-finance.js：待認領比對失敗重試）── */
.a2-warn-sm { color: #b00020; font-size: .78rem; margin-top: 2px; }
.a2-serial-echo { font-size: 2.2rem; font-weight: 800; letter-spacing: 3px; font-family: Arial, monospace; min-height: 2.6rem; }
.a2-serial-big { font-size: 2.2rem; font-weight: 800; letter-spacing: 3px; font-family: Arial, monospace; }
.a2-warn-bold { color: #b00020; font-weight: 700; }
.drv-small-note.a2-hint { color: #555; }
.a2-mt12 { margin-top: 12px; }
label.a2-label-block { font-weight: 700; display: block; margin-bottom: 4px; }
input.a2-retype { font-size: 1.3rem; letter-spacing: 2px; font-family: Arial, monospace; width: 100%; max-width: 280px; padding: 6px 10px; border: 2px solid #b00020; border-radius: 8px; }
.a2-muted-sm { color: #5b6b7a; font-size: .9em; }
.a2-muted { color: #5b6b7a; }
.a2-lost-card { border: 1px solid #d6dee6; border-radius: 10px; padding: 10px 12px; margin: 0 0 10px; }
.a2-lost-title { font-weight: 800; margin-bottom: 4px; }
.a2-lost-status { font-weight: 700; }
.a2-lost-status.is-done { color: #127a3d; }
.a2-lost-status.is-processing { color: #9a6b00; }
.a2-lost-status.is-open { color: #c40018; }
form.a2-lost-form { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
select.a2-lost-input, input.a2-lost-input { min-height: 38px; padding: 4px 8px; }
input.a2-lost-grow { flex: 1 1 260px; }
.btn.mini.a2-lost-btn { min-height: 38px; }
.a2-lost-msg { margin-top: 4px; font-size: .92em; }
.a2-lost-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }

/* ── A2-b（§四十二、補充二～四、§四十五）｜cyc-ride-ui166-a2b-20260916 ── */
/* 「新增帳號未掛接」子分頁移除（補充二）：hotfix16 仍會在執行期插入按鈕，這裡只隱藏按鈕，功能併入「母子帳號查詢」；hotfix16 檔不改。 */
.ops-groups [data-tab="family-unlinked"],
.ops-subtabs [data-tab="family-unlinked"] { display: none !important; }
/* 負值帳號每頁 10 筆（補充三）：只在螢幕隱藏非本頁列，列印仍印全部 */
@media screen { .orp-page-hide { display: none; } }
/* 色塊圖可列印（§四十五）：列印保留色階底色、表格不被橫向捲動框裁切、單張表盡量不跨頁 */
@media print {
  #opsReportRoot .table-wrap { overflow: visible !important; }
  #opsReportRoot .orp-grid td.orp-grid-cell { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #opsReportRoot .orp-grid { break-inside: avoid; page-break-inside: avoid; }
  #opsReportRoot .orp-page-hide { display: table-row; }
}

/* ── batch15 A2-c cyc-ride-ui168-a2c-20260917 ──
 * ① 營運報表④催款紀錄欄與小視窗（§五十四-5）② 財務贈送點數／退款：送出鈕、訊息區、提示列在兩欄表單中全寬（§五十七 Q9-3）。 */
.a2c-note-cell { appearance: none; background: none; border: 0; padding: 0; margin: 0; font: inherit; color: #1d4ed8; text-align: left; cursor: pointer; text-decoration: underline; }
.a2c-note-cell.is-empty { color: #64748b; }
.a2c-note-overlay { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 16px; background: rgba(15, 23, 42, 0.46); }
.a2c-note-box { box-sizing: border-box; width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; display: grid; gap: 10px; background: #fff; border: 1px solid #e2e8f0; border-radius: 18px; padding: 18px; }
.a2c-note-box h3, .a2c-note-box h4 { margin: 0; }
.a2c-note-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.a2c-note-input { box-sizing: border-box; width: 100%; min-height: 88px; resize: vertical; }
.a2c-note-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.a2c-note-msg { margin-right: auto; font-weight: 800; }
.a2c-note-msg.is-ok { color: #087b45; }
.a2c-note-msg.is-err { color: #c42121; }
.r38x-point-adjustment-form .a2c-span-all { grid-column: 1 / -1; }
/* 贈送／退款 panel 是 grid：欄寬下限預設取內容最小寬度，窄螢幕會被儲值紀錄下拉的長文字撐出卡片（2026-09-17 冒煙 390px 截圖發現）⇒ 下限設 0 */
.r38x-finance-suite .r38x-finance-panel[data-finance-panel="gift"].active,
.r38x-finance-suite .r38x-finance-panel[data-finance-panel="refund"].active { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 760px) {
  .r38x-point-adjustment-form .a2c-span-all { grid-column: auto; }
  .r38x-finance-suite [data-finance-panel="gift"] .r38x-point-adjustment-form,
  .r38x-finance-suite [data-finance-panel="refund"] .r38x-point-adjustment-form { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  .a2c-note-overlay { display: none; }
  .a2c-note-cell { color: inherit; text-decoration: none; }
}

/* ── batch15 A2-d cyc-ride-ui169-a2d-20260917 ──
 * 財務 → 退款功能：「退款結清」區塊（§七十 第 6 項）。表格沿用 r38x-finance-table／r38x-finance-scroll，鈕與訊息全寬沿用 a2c-span-all。 */
.a2d-settle { box-sizing: border-box; min-width: 0; margin: 0 0 16px; padding: 14px; border: 1px solid #fecdd3; border-radius: 16px; background: #fffafa; display: grid; gap: 10px; }
.a2d-settle h3 { margin: 0; }
.a2d-settle-table { min-width: 0; }
.a2d-settle-grid th, .a2d-settle-grid td { white-space: nowrap; }
.a2d-settle-totals { font-weight: 900; overflow-wrap: anywhere; }
.a2d-settle-totals:empty, .a2d-settle-blockers:empty { display: none; }
.a2d-settle-blockers { display: grid; gap: 6px; }
.a2d-settle-form { margin: 0; }
.a2d-pair-btn { margin-left: 6px; }
.a2d-pair-overlay { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 16px; background: rgba(15, 23, 42, 0.46); }
.a2d-pair-box { box-sizing: border-box; width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; display: grid; gap: 10px; background: #fff; border: 1px solid #e2e8f0; border-radius: 18px; padding: 18px; }
.a2d-pair-box h3 { margin: 0; }
.a2d-pair-list { min-width: 0; }
/* 小視窗掛在 body 下、不在財務區塊內：表格不吃 r38x-finance-suite 範圍規則 ⇒ 格線欄寬下限 0、清單自己橫向捲動（2026-09-17 冒煙截圖發現最後一欄被裁） */
.a2d-pair-box { grid-template-columns: minmax(0, 1fr); }
.a2d-pair-list .r38x-finance-scroll { max-width: 100%; overflow: auto; max-height: 50vh; }
.a2d-pair-list .r38x-finance-table { width: 100%; min-width: 0; border-collapse: collapse; }
.a2d-pair-list .r38x-finance-table th, .a2d-pair-list .r38x-finance-table td { padding: 8px; white-space: nowrap; }
.a2d-pair-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.a2d-pair-msg { margin-right: auto; font-weight: 800; }
.a2d-pair-msg.is-err { color: #c42121; }
@media print { .a2d-pair-overlay { display: none; } }

/* ── batch15 A2-d v2 cyc-ride-ui170-a2dv2-20260918 ──
 * 修正 2：乘客列表停用列淡灰（§七十八補充一）、結清紀錄小視窗格內可換行（窄螢幕不被裁）；修正 3：逐筆退款預覽列可換行顯示提示（§七十九）。 */
.a2d-row-disabled td { background: #f1f5f9; color: #64748b; }
#a2dSettleLogOverlay .r38x-finance-table th, #a2dSettleLogOverlay .r38x-finance-table td { white-space: normal; padding: 6px; }
#a2dSettleLogOverlay .r38x-finance-table td:nth-child(4), #a2dSettleLogOverlay .r38x-finance-table td:nth-child(5) { overflow-wrap: anywhere; }
#a2dSettleLogOverlay .r38x-finance-table th:nth-child(-n+3), #a2dSettleLogOverlay .r38x-finance-table td:nth-child(-n+3) { width: 1%; }
@media (max-width: 480px) { #a2dSettleLogOverlay .r38x-finance-table th, #a2dSettleLogOverlay .r38x-finance-table td { padding: 4px; font-size: 0.8em; } }
#refundPreview { white-space: pre-line; }
