/* SRTTS payment and claiming screens. Uses the theme variables, so dark mode follows automatically. */

/* ---- New status badges ---- */
.badge-status-forpay      { background: #FFE9CC; color: #8F4300; }
.badge-status-paypending  { background: #E9E9E9; color: #525252; }
.badge-status-payverified { background: #D3F4EE; color: #0A6557; }
.badge-status-ready       { background: #BDF0D3; color: #0A5535; }
.badge-status-claimed     { background: #E1ECE4; color: #3B5A46; }
.badge-pay-test           { background: #FFF3CD; color: #7A5A00; font-weight: 700; margin-left: 6px; }
html[data-theme="dark"] .badge-status-forpay      { background: #4A3213; color: #FFC98A; }
html[data-theme="dark"] .badge-status-paypending  { background: #323232; color: #CBCBCB; }
html[data-theme="dark"] .badge-status-payverified { background: #0F3D37; color: #8FE6D8; }
html[data-theme="dark"] .badge-status-ready       { background: #124A2F; color: #9BEBBF; }
html[data-theme="dark"] .badge-status-claimed     { background: #26362D; color: #B5CDBD; }
html[data-theme="dark"] .badge-pay-test           { background: #4A3D12; color: #FFE08A; }

/* dashboard bar colors */
.st-pay   { background: #F59E0B; }
.st-ready { background: #14B8A6; }

/* ---- Progress tracker ---- */
.pay-tracker { display: flex; gap: 0; list-style: none; margin: 0 0 22px; padding: 0; }
.pay-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; position: relative; text-align: center; font-size: 13px; color: var(--color-text-muted); }
.pay-step::before { content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 3px; background: var(--color-border); z-index: 0; }
.pay-step:first-child::before { display: none; }
.pay-step.is-done::before, .pay-step.is-current::before { background: var(--color-primary); }
.pay-step-dot { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
    background: var(--color-surface, #fff); border: 2px solid var(--color-border); font-weight: 700; font-size: 14px; }
.pay-step.is-done .pay-step-dot { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.pay-step.is-current .pay-step-dot { border-color: var(--color-primary); color: var(--color-primary); box-shadow: 0 0 0 4px rgba(109, 109, 109, .15); }
.pay-step.is-current .pay-step-label, .pay-step.is-done .pay-step-label { color: var(--color-heading); font-weight: 700; }

/* ---- Cards and tables ---- */
.pay-card .card-body > * + * { margin-top: 16px; }
.pay-muted { color: var(--color-text-muted); font-size: 13px; }
.pay-table-wrap { overflow-x: auto; }
.pay-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pay-table th, .pay-table td { padding: 9px 10px; border-bottom: 1px solid var(--color-border); text-align: left; vertical-align: middle; }
.pay-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--color-text-muted); }
.pay-table .num { text-align: right; white-space: nowrap; }
.pay-table small { color: var(--color-text-muted); }
.pay-table tfoot th { font-size: 14px; text-transform: none; color: var(--color-heading); border-bottom: 0; }
.pay-hint, .pay-state, .pay-paid, .pay-cash { padding: 14px; border: 1px solid var(--color-border); border-radius: var(--radius, 10px); background: var(--color-surface-alt, #F7F7F7); }
.pay-paid { border-left: 4px solid #12a150; }
.pay-state { border-left: 4px solid #f59e0b; }
.pay-inline { display: inline-block; margin-left: 10px; }
.pay-add { display: grid; grid-template-columns: 1fr 120px auto; gap: 12px; align-items: end; }
.pay-add .form-group { margin: 0; }
.pay-send { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.pay-cash-title { font-weight: 700; color: var(--color-heading); margin-bottom: 10px; }
.pay-cash-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.pay-cash-row .form-group { margin: 0; }
.pay-methods fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.pay-method { display: inline-flex; align-items: center; gap: 8px; margin-right: 18px; padding: 10px 16px; border: 1px solid var(--color-border); border-radius: 10px; cursor: pointer; min-height: 44px; }
.pay-method:has(input:checked) { border-color: var(--color-primary); box-shadow: 0 0 0 2px rgba(109, 109, 109, .18); }
.pay-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pay-actions .btn { min-height: 44px; }

/* ---- Pickup box ---- */
.pay-pickup { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; padding: 18px;
    border: 2px solid #12a150; border-radius: 12px; background: var(--color-surface-alt, #f1fbf5); }
.pay-pickup-text { flex: 1 1 220px; line-height: 1.7; }
.pay-pickup-text strong { font-size: 18px; color: var(--color-heading); }
.pay-ticketno { margin-top: 8px; font-weight: 800; letter-spacing: .04em; font-size: 18px; color: var(--color-heading); }
.pay-qr { width: 132px; height: 132px; background: #fff; padding: 6px; border-radius: 8px; }
.pay-qr svg { width: 100%; height: 100%; display: block; }

/* ---- Payments list and fee admin ---- */
.pay-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 16px; }
.pay-toolbar .form-group { margin: 0; }
.pay-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.pay-stat { padding: 14px 16px; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface, #fff); }
.pay-stat b { display: block; font-size: 22px; color: var(--color-heading); }
.pay-stat span { font-size: 13px; color: var(--color-text-muted); }
.pay-row-off { opacity: .55; }

@media (max-width: 640px) {
  .pay-add, .pay-cash-row { grid-template-columns: 1fr; }
  .pay-step { font-size: 12px; }
  .pay-table thead { display: none; }
  .pay-table tr { display: block; border-bottom: 1px solid var(--color-border); padding: 8px 0; }
  .pay-table td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 10px; text-align: right; }
  .pay-table td::before { content: attr(data-label); color: var(--color-text-muted); text-align: left; }
  .pay-table tfoot tr { display: flex; justify-content: space-between; }
  .pay-table tfoot th[colspan] { flex: 1; }
}

/* ---- Printable payment order and receipt ---- */
.po-body { margin: 0; background: #F1F1F1; font-family: "Times New Roman", Georgia, serif; color: #111; }
.po-bar { max-width: 760px; margin: 14px auto; display: flex; gap: 10px; justify-content: flex-end; font-family: Inter, "Segoe UI", Arial, sans-serif; }
.po-bar a, .po-bar button { font: inherit; font-size: 14px; padding: 10px 16px; border-radius: 8px; border: 1px solid #CACACA; background: #fff; color: #111; cursor: pointer; text-decoration: none; }
.po-bar button { background: #404040; color: #fff; border-color: #404040; }
.po-page { position: relative; max-width: 760px; margin: 0 auto 30px; background: #fff; border: 2px solid #111; padding: 26px 30px; }
.po-head { display: flex; align-items: center; gap: 16px; border-bottom: 2px solid #111; padding-bottom: 12px; }
.po-head img { width: 70px; height: 70px; object-fit: contain; }
.po-head .po-org { flex: 1; text-align: center; line-height: 1.35; }
.po-head .po-org small { display: block; font-size: 12px; }
.po-head .po-org b { font-size: 20px; letter-spacing: .02em; }
.po-title { text-align: center; font-size: 24px; font-weight: 700; margin: 16px 0 4px; letter-spacing: .08em; text-transform: uppercase; }
.po-form-no { text-align: right; font-size: 12px; }
.po-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; margin: 14px 0; font-size: 15px; }
.po-meta div span { display: inline-block; min-width: 118px; font-weight: 700; }
.po-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.po-table th, .po-table td { border: 1px solid #111; padding: 7px 9px; }
.po-table th { background: #f0f0f0; text-align: left; }
.po-table .num { text-align: right; white-space: nowrap; }
.po-total td { font-weight: 700; font-size: 16px; }
.po-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-top: 26px; }
.po-sign { flex: 1; text-align: center; }
.po-sign div { border-top: 1px solid #111; margin-top: 44px; padding-top: 4px; font-size: 14px; }
.po-qr { width: 110px; height: 110px; }
.po-qr svg { width: 100%; height: 100%; display: block; }
.po-paid { position: absolute; right: 36px; top: 150px; transform: rotate(-12deg); border: 4px solid #0a7d3a; color: #0a7d3a; font-weight: 800; font-size: 34px; letter-spacing: .12em; padding: 4px 18px; opacity: .85; }
.po-note { font-size: 12px; margin-top: 12px; color: #333; }
@media print {
  .po-body { background: #fff; }
  .po-bar { display: none; }
  .po-page { border: 2px solid #000; margin: 0; max-width: none; box-shadow: none; }
  .po-paid { color: #000; border-color: #000; }
}
