/* Real agent-funds flows. Amounts and status copy are rendered only from server data. */
:root { --funds-ink: #292723; --funds-muted: #847b72; --funds-line: #eee7e0; --funds-soft: #fff8f1; --funds-orange: #d96b18; }
.app-page[data-page="recharge"], .app-page[data-page="margin"], .app-page[data-page="withdrawal"], .app-page[data-page="funds-order"] { max-width: 1080px; }
.agent-funds-boundary { margin: 0 0 16px; line-height: 1.7; }
.agent-funds-layout { display: grid; gap: 16px; }
.agent-funds-panel { min-width: 0; margin: 0; padding: 18px; border: 1px solid var(--funds-line); border-radius: 18px; box-shadow: none; }
.agent-funds-panel h2 { margin: 0; color: var(--funds-ink); font-size: 18px; }
.agent-funds-panel .section-heading { align-items: flex-start; }
.agent-funds-panel .section-heading p { max-width: 560px; margin: 6px 0 0; color: var(--funds-muted); font-size: 12px; line-height: 1.65; }
.agent-funds-form { display: grid; gap: 13px; margin-top: 16px; }
.agent-funds-form .field { display: grid; gap: 7px; margin: 0; }
.agent-funds-form .field > span, .agent-funds-form .field > label { color: #5c554f; font-size: 12px; font-weight: 600; }
.agent-funds-form input, .agent-funds-form select, .agent-funds-form textarea { width: 100%; min-height: 44px; box-sizing: border-box; padding: 11px 12px; color: var(--funds-ink); background: #fff; border: 1px solid #ded6ce; border-radius: 11px; font: inherit; }
.agent-funds-form textarea { resize: vertical; }
.agent-funds-form input:focus, .agent-funds-form select:focus, .agent-funds-form textarea:focus { border-color: var(--funds-orange); outline: 3px solid #e9832b1c; }
.agent-funds-form input:disabled, .agent-funds-form select:disabled { background: #f5f3f1; }
.agent-funds-form .button { min-height: 46px; }
.agent-funds-feedback { margin: 12px 0 0; font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.agent-funds-contract-note { margin: 12px 0 0; color: var(--funds-muted); font-size: 12px; line-height: 1.7; }
.agent-funds-order-list, .agent-margin-ledger { display: grid; gap: 10px; margin-top: 14px; }
.agent-funds-order-card { padding: 15px; background: #fff; border: 1px solid var(--funds-line); border-radius: 14px; }
.agent-funds-order-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.agent-funds-order-heading { display: grid; min-width: 0; gap: 5px; }
.agent-funds-order-type { color: var(--funds-ink); font-size: 14px; font-weight: 700; }
.agent-funds-order-id { color: var(--funds-muted); font-size: 10px; overflow-wrap: anywhere; }
.agent-funds-order-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 16px; margin: 0 0 14px; padding: 12px 0; border-top: 1px solid var(--funds-line); border-bottom: 1px solid var(--funds-line); }
.agent-funds-order-summary div { min-width: 0; }
.agent-funds-order-summary dt { color: var(--funds-muted); font-size: 10px; }
.agent-funds-order-summary dd { margin: 3px 0 0; color: var(--funds-ink); font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
#agent-recharge-list { scroll-margin-top: 20px; }
.agent-margin-process { margin: 0 0 16px; padding: 13px 15px; background: var(--funds-soft); border: 1px solid var(--funds-line); border-radius: 12px; }
.agent-margin-process summary { color: var(--funds-ink); font-size: 13px; font-weight: 700; cursor: pointer; }
.agent-margin-process ol { display: grid; gap: 8px; margin: 13px 0 0; padding-left: 22px; color: #62584f; font-size: 12px; line-height: 1.7; }
.agent-funds-order-head .badge { flex: none; }
.agent-funds-order-amounts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 14px 0; }
.agent-funds-order-amounts strong { color: #b65413; font-size: 19px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.agent-funds-order-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--funds-muted); font-size: 11px; }
.agent-funds-state { padding: 24px 14px; color: var(--funds-muted); background: #faf9f8; border: 1px dashed #e3ddd7; border-radius: 12px; text-align: center; font-size: 12px; line-height: 1.7; }
.agent-funds-state strong { color: var(--funds-ink); }
.agent-funds-state p { margin: 5px 0 12px; }
.agent-funds-state.is-error { color: #9b3f32; background: #fff7f5; border-color: #f1cbc4; }
.agent-funds-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; color: var(--funds-muted); font-size: 11px; }
.agent-funds-tier-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.agent-funds-tier { padding: 14px 12px; background: var(--funds-soft); border: 1px solid #f2dfc9; border-radius: 13px; }
.agent-funds-tier strong { display: block; color: #a74f16; font-size: 21px; }
.agent-funds-tier span { display: block; margin-top: 5px; color: #7f6854; font-size: 11px; line-height: 1.55; }
.agent-funds-tier-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.agent-funds-tier-options label { position: relative; display: grid; gap: 4px; padding: 11px; background: #fff; border: 1px solid #ded6ce; border-radius: 11px; cursor: pointer; }
.agent-funds-tier-options label:has(input:checked) { border-color: var(--funds-orange); box-shadow: 0 0 0 2px #e9832b17; }
.agent-funds-tier-options input { width: auto; min-height: auto; margin: 0; }
.agent-funds-tier-options strong { font-size: 15px; }
.agent-funds-tier-options small { color: var(--funds-muted); font-size: 10px; }
.agent-margin-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; background: var(--funds-line); border: 1px solid var(--funds-line); border-radius: 14px; }
.agent-margin-metric { display: grid; gap: 5px; padding: 15px; background: #fff; }
.agent-margin-metric span { color: var(--funds-muted); font-size: 11px; }
.agent-margin-metric strong { color: var(--funds-ink); font-size: 22px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.agent-margin-metric small { color: #a79b90; font-size: 10px; }
.agent-margin-ledger-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; padding: 12px 0; border-bottom: 1px solid var(--funds-line); }
.agent-margin-ledger-row:last-child { border-bottom: 0; }
.agent-margin-ledger-row strong { font-size: 13px; }
.agent-margin-ledger-amount { color: #b65413; font-weight: 700; }
.agent-margin-ledger-row code { overflow: hidden; color: var(--funds-muted); font-size: 10px; text-overflow: ellipsis; }
.agent-margin-ledger-row time { color: var(--funds-muted); font-size: 10px; text-align: right; }
.agent-funds-detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.agent-funds-detail-heading h2 { margin-top: 4px; }
.agent-funds-detail-amounts { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 20px 0; }
.agent-funds-detail-amounts strong { color: #b65413; font-size: 26px; overflow-wrap: anywhere; }
.agent-funds-detail-list { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 0; margin: 18px 0; border-top: 1px solid var(--funds-line); }
.agent-funds-detail-list dt, .agent-funds-detail-list dd { margin: 0; padding: 11px 0; border-bottom: 1px solid var(--funds-line); font-size: 12px; overflow-wrap: anywhere; }
.agent-funds-detail-list dt { color: var(--funds-muted); }
.agent-funds-detail-list dd { color: var(--funds-ink); }
.agent-funds-order-actions { margin: 14px 0; }
#agent-recharge-payment-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--funds-line); }
.home-funds-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 12px 0 148px; }
.home-funds-shortcuts a { display: grid; gap: 4px; padding: 13px 11px; color: var(--funds-ink); background: #fff; border: 1px solid var(--funds-line); border-radius: 13px; text-decoration: none; }
.home-funds-shortcuts strong { font-size: 13px; }
.home-funds-shortcuts small { color: var(--funds-muted); font-size: 10px; line-height: 1.45; }
#agent-funds-confirm-dialog { width: min(520px, calc(100% - 28px)); max-height: calc(100dvh - 40px); padding: 20px; overflow: auto; border: 0; border-radius: 18px; }
#agent-funds-confirm-dialog::backdrop { background: #1f1b17a6; }
#agent-funds-confirm-description { color: #6e6258; font-size: 13px; line-height: 1.75; }
#agent-funds-confirm-details { display: grid; gap: 8px; max-height: 220px; margin: 16px 0; padding: 12px; overflow: auto; background: #faf8f6; border-radius: 11px; }
.agent-funds-confirm-row { display: grid; grid-template-columns: minmax(90px, .7fr) minmax(0, 1.3fr); gap: 10px; font-size: 11px; }
.agent-funds-confirm-row span { color: var(--funds-muted); }
.agent-funds-confirm-row strong { overflow-wrap: anywhere; }
.agent-funds-confirm-check { display: flex; align-items: flex-start; gap: 9px; margin: 14px 0; color: #514a44; font-size: 12px; line-height: 1.6; }
.agent-funds-confirm-check input { flex: none; margin-top: 3px; }
.agent-funds-confirm-buttons { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
@media (min-width: 760px) {
  .agent-funds-layout { grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); align-items: start; }
  .agent-funds-panel--wide { grid-column: 1 / -1; }
  .agent-funds-panel--sticky { position: sticky; top: 20px; }
  .agent-margin-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .home-funds-shortcuts { grid-column: 2; grid-row: 6; margin: 0; }
}
@media (max-width: 420px) {
  .agent-funds-panel { padding: 15px; }
  .agent-funds-order-head { display: grid; }
  .agent-funds-order-head .badge { justify-self: start; }
  .agent-funds-tier-grid { gap: 7px; }
  .agent-funds-tier { padding: 11px 8px; }
  .agent-funds-tier strong { font-size: 18px; }
  .agent-funds-tier-options { grid-template-columns: 1fr; }
  .agent-funds-order-summary { grid-template-columns: 1fr; }
  .agent-funds-detail-list { grid-template-columns: 100px minmax(0, 1fr); }
}
/* List-led recharge screen and focused creation dialog. */
.app-page[data-page="recharge"] .recharge-page-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:20px}
.recharge-page-heading h1{margin:0;font-size:24px}
.recharge-page-heading p{margin:6px 0 0;color:var(--funds-muted);font-size:13px}
.recharge-page-heading .button{flex:none;white-space:nowrap}
.recharge-list-tools{display:flex;gap:6px;align-items:center}
.recharge-history-panel>.section-heading{align-items:center}
#agent-recharge-list .agent-funds-order-card{display:block;color:inherit;text-decoration:none;transition:border-color .15s,box-shadow .15s}
#agent-recharge-list .agent-funds-order-card:hover{border-color:#c4d8d2;box-shadow:0 3px 14px #163a3010}
#agent-recharge-list .agent-funds-order-card:focus-visible{outline:3px solid #18736050;outline-offset:2px}
#agent-recharge-list .agent-funds-order-heading{display:flex;align-items:baseline;flex-wrap:wrap;gap:8px}
#agent-recharge-list .agent-funds-order-amounts{margin:12px 0}
#agent-recharge-list .agent-funds-order-summary{display:block;padding:0 0 10px;margin:0 0 10px;border-top:0}
#agent-recharge-list .agent-funds-order-summary>div{display:inline-flex;gap:8px;align-items:baseline;margin-right:14px}
#agent-recharge-list .agent-funds-order-summary dd{margin:0;font-size:12px}
#agent-recharge-list .agent-funds-order-foot>.button{padding:0;min-height:24px;color:#187360;background:none}
#agent-recharge-pending-intent:not([hidden]){display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
.recharge-create-dialog{width:min(480px,calc(100% - 28px));max-height:calc(100dvh - 40px);margin:auto;padding:24px;border:0;border-radius:18px;overflow:auto;color:var(--funds-ink);background:#fff;box-shadow:0 24px 70px #102e3326}
.recharge-create-dialog::backdrop{background:#10282480}
.recharge-create-dialog .section-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}
.recharge-create-dialog h2{margin:0;font-size:20px}
.recharge-create-dialog .section-heading p{margin:7px 0 0;color:var(--funds-muted);font-size:13px;line-height:1.6}
.recharge-create-dialog .icon-button{flex:none;width:32px;height:32px;min-height:32px;font-size:22px;border-radius:8px;border:0;background:#f2f6f4;color:#567065}
.recharge-create-dialog .agent-funds-form{gap:16px;margin-top:22px}
.recharge-create-dialog .safe-action-note{margin:16px 0 0;color:var(--funds-muted);font-size:12px;line-height:1.7}
.recharge-create-dialog [hidden]{display:none!important}
.agent-funds-payment-channel{padding:16px;border:1px solid var(--funds-line);border-radius:12px;background:#fafcfb;margin:16px 0}
.agent-funds-payment-channel h3{margin:0 0 10px;font-size:15px}
.agent-funds-payment-channel p{margin:6px 0;overflow-wrap:anywhere;line-height:1.6;font-size:13px}
.agent-funds-form>.button{min-height:44px;border-radius:10px}
.agent-funds-form .field{gap:8px}
.agent-funds-feedback{padding:10px 12px;border-radius:10px;line-height:1.65}
#agent-funds-confirm-dialog .eyebrow{display:none}
@media(max-width:540px){
 .app-page[data-page="recharge"] .recharge-page-heading{align-items:flex-start;gap:10px}
 .recharge-page-heading h1{font-size:21px}.recharge-page-heading p{font-size:12px;max-width:180px}
 .recharge-page-heading .button{padding:10px 12px;font-size:12px;min-height:40px}
 .recharge-history-panel>.section-heading{gap:8px}.recharge-list-tools .button{padding:6px 8px;font-size:11px}
 #agent-recharge-list .agent-funds-order-head{display:flex;flex-wrap:wrap}
 #agent-recharge-list .agent-funds-order-heading{gap:5px}
 #agent-recharge-list .agent-funds-order-amounts{gap:6px 14px}
 #agent-recharge-list .agent-funds-order-amounts strong{font-size:17px}
 .recharge-create-dialog{padding:20px;max-height:calc(100dvh - 24px)}
 .agent-funds-confirm-buttons .button{min-height:44px}
}
.agent-recharge-process{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;list-style:none;margin:18px 0;padding:0}
.agent-recharge-process li{display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center;color:#86958f;min-width:0;position:relative}
.agent-recharge-process li:not(:last-child)::after{content:"";position:absolute;top:13px;left:calc(50% + 18px);width:calc(100% - 30px);height:1px;background:#dce5df}
.agent-recharge-process__marker{display:grid;place-items:center;width:27px;height:27px;flex:none;border-radius:50%;background:#edf2ef;color:#72847a;font-size:12px}
.agent-recharge-process li.is-done .agent-recharge-process__marker,.agent-recharge-process li.is-current .agent-recharge-process__marker{color:#fff;background:#187d6d}
.agent-recharge-process li.is-current{color:#187d6d}
.agent-recharge-process li strong{display:block;font-size:12px;font-weight:600;line-height:1.5}
.agent-recharge-process li small{display:block;margin-top:3px;font-size:10px;line-height:1.5;color:#7e8c85}
.agent-funds-order-metadata{padding:12px 0;border-block:1px solid var(--funds-line);margin:16px 0}
.agent-funds-order-metadata>summary{cursor:pointer;font-size:13px;font-weight:600;color:#50665c}
.agent-funds-order-metadata .agent-funds-detail-list{margin:12px 0 0}
@media(max-width:540px){.agent-recharge-process li small{display:none}.agent-recharge-process li strong{font-size:10px}.agent-funds-detail-amounts strong{font-size:21px}.agent-funds-detail-amounts{gap:6px 16px;margin:16px 0}.agent-funds-order-actions{margin:10px 0}.agent-funds-form{gap:15px}}
.payment-proof-field{align-items:start}
.agent-funds-form .payment-proof-choose{display:grid;justify-items:center;gap:5px;width:100%;padding:18px 12px;min-height:108px;border:1px dashed #b6cfc7;border-radius:12px;background:#f5faf8;color:#36665a;font:inherit;cursor:pointer}
.payment-proof-choose>span{font-size:27px;line-height:1}.payment-proof-choose>strong{font-size:13px}.payment-proof-choose>small{font-size:11px;color:#84968e}
.payment-proof-preview:not([hidden]){display:flex;position:relative;width:100%;align-items:center;gap:12px;padding:12px 38px 12px 12px;background:#f5faf8;border:1px solid #dce8e2;border-radius:12px;min-width:0}
.payment-proof-preview img{width:64px;height:64px;object-fit:cover;border-radius:8px;flex:none;border:1px solid #dbe5df}
.payment-proof-preview>div{min-width:0}.payment-proof-preview strong{display:block;font-size:12px;overflow-wrap:anywhere}.payment-proof-preview small{display:block;font-size:11px;color:#6e857a;margin-top:6px}
.agent-funds-form .payment-proof-remove{position:absolute;right:8px;top:8px;display:grid;place-items:center;width:24px;height:24px;min-height:24px;padding:0;border:0;border-radius:50%;background:#e2eae5;color:#567465;font-size:18px;cursor:pointer}
.payment-proof-status{margin:0;font-size:12px;color:#70877b;line-height:1.6}
#agent-payment-proof-check{justify-self:start;min-height:32px;padding:6px 10px;font-size:12px}
.payment-proof-field [hidden]{display:none!important}

.funds-action-disclosure>summary{display:flex;justify-content:space-between;align-items:center;min-height:44px;cursor:pointer;list-style:none;font-size:16px;font-weight:650;color:#18372e}.funds-action-disclosure>summary::-webkit-details-marker{display:none}.funds-action-disclosure>summary>span{font-size:22px;font-weight:400;color:#477c69}.funds-action-disclosure[open]>summary{margin-bottom:16px}.funds-action-disclosure[open]>summary>span{transform:rotate(45deg)}

.redemption-amount-entry{display:flex;gap:8px;align-items:center}.redemption-amount-entry input{min-width:0;flex:1}.redemption-amount-entry button{flex:none;white-space:nowrap}
