/* ==========================================================================
   Admin › Fund (2026-12-02): Update Customer Balance, Easy Payment, Vendor balance.
   Builds on manage-access.css (.ma-*, .mu-form) and employee-list.css (.ev-*).
   Tokens only (design-system.css).
   ========================================================================== */

/* ---------- Shared form grid ---------- */
html body .fd .fd-form { margin-top: 20px; min-width: 0; }
.fd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; padding: 24px 28px 20px; align-items: start; }
.fd-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fd-grid--flush { padding: 0; }
.fd-c { min-width: 0; }
.fd-c--full { grid-column: 1 / -1; }
.fd-c--wide { grid-column: span 2; }
.fd-sub[hidden] { display: none; }
.fd .ma-textarea { min-height: 96px; resize: vertical; }
.fd-strong { color: var(--tb-text-strong); font-weight: 500; }

/* ---------- Update Customer Balance: form + Balance details ---------- */
.fd-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.fd-layout .fd-form { max-width: none; }

/* Credit / Debit choice */
.fd-entry { margin: 0; padding: 0; border: 0; min-width: 0; }
.fd-entry__opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fd-entry__opt { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--tb-border); border-radius: var(--tb-radius-control); background: var(--tb-surface); cursor: pointer; transition: border-color .15s, background-color .15s; }
.fd-entry__opt:hover { border-color: var(--tb-border-hover); }
.fd-entry__opt input { margin-top: 3px; accent-color: var(--tb-primary); flex-shrink: 0; }
.fd-entry__opt span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fd-entry__opt strong { font-size: 14px; font-weight: 600; color: var(--tb-text-strong); }
.fd-entry__opt small { font-size: 12.5px; color: var(--tb-text-muted); }
.fd-entry__opt:has(input:checked) { border-color: var(--tb-primary); background: var(--tb-ice); }
.fd-entry__opt--d:has(input:checked) { border-color: var(--tb-danger); background: var(--tb-danger-soft); }
.fd-entry__opt--d input { accent-color: var(--tb-danger); }
.fd-entry.is-invalid .fd-entry__opt { border-color: var(--tb-danger); }

/* Balance details panel */
.fd-bal { position: sticky; top: calc(var(--tb-header-h, 64px) + 20px); margin-top: 20px; padding: 22px 22px 20px; border-radius: var(--tb-radius-card); }
.fd-bal__title { margin: 0 0 16px; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--tb-text-muted); }
.fd-bal__empty { padding: 20px 4px 12px; text-align: center; }
.fd-bal__empty .ev-state__icon { margin: 0 auto 10px; }
.fd-bal__who { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 15px; font-weight: 600; color: var(--tb-text-strong); overflow-wrap: anywhere; }
.fd-bal__unit { padding: 1px 8px; border-radius: var(--tb-radius-pill); background: var(--tb-ice); font-size: 12px; font-weight: 600; color: var(--tb-primary); }
.fd-bal__unit:empty { display: none; }
.fd-bal__label { margin: 0; font-size: 12.5px; color: var(--tb-text-muted); }
.fd-bal__amount { margin: 2px 0 16px; font-size: 28px; font-weight: 700; line-height: 1.2; color: var(--tb-primary); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fd-bal__amount.is-neg { color: var(--tb-danger); }
.fd-bal__list { margin: 0 0 18px; padding: 14px 0 0; border-top: 1px solid var(--tb-border); }
.fd-bal__list > div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13px; }
.fd-bal__list dt { font-weight: 400; color: var(--tb-text-neutral); }
.fd-bal__list dd { margin: 0; font-weight: 600; color: var(--tb-text-strong); text-align: right; }
.fd-bal__list .fd-bal__boa { font-weight: 400; font-style: italic; color: var(--tb-text-muted); }
.fd-bal__sub { margin: 0 0 8px; padding-top: 14px; border-top: 1px solid var(--tb-border); font-size: 13px; font-weight: 600; color: var(--tb-text-strong); }
.fd-bal__none { margin: 0; font-size: 13px; color: var(--tb-text-muted); }
.fd-recent { margin: 0; padding: 0; list-style: none; }
.fd-recent__item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 10px; padding: 8px 0; border-bottom: 1px solid var(--tb-bg); }
.fd-recent__item:last-child { border-bottom: 0; }
.fd-recent__amt { grid-row: span 2; font-size: 13px; font-weight: 600; }
.fd-recent__amt--c { color: var(--tb-success); }
.fd-recent__amt--d { color: var(--tb-danger); }
.fd-recent__what { font-size: 13px; color: var(--tb-text-strong); text-align: right; overflow-wrap: anywhere; }
.fd-recent__when { font-size: 12px; color: var(--tb-text-muted); text-align: right; }

/* ---------- Easy Payment (laid out as the live screen, 2026-12-03) ---------- */
/* Payment details: Customer · User name · Amount / Email ID · Mobile no. · Submit, Clear */
.fd-grid--ep { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fd-c--cust { grid-column: span 2; }
.fd-fetch { display: flex; align-items: flex-start; gap: 8px; padding-top: 26px; }
html body .fd .tb-input[readonly] { background: var(--tb-surface-muted); color: var(--tb-text-neutral); cursor: default; }

.fd-sec { margin: 0 28px; padding: 22px 0; border-top: 1px solid var(--tb-border); }
.fd-sec + .fd-sec { padding-top: 4px; border-top: 0; }
.fd-sec__title { margin: 0 0 4px; font-size: 15px; font-weight: 600; color: var(--tb-text-strong); }
.fd-sec__text { margin: 0 0 14px; font-size: 13px; color: var(--tb-text-neutral); }
.fd-grid--link { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Choose payment options: Bank name + one column per channel (live FetchAgentPGdetails table) */
.fd-pgt-wrap { overflow-x: auto; border: 1px solid var(--tb-border); border-radius: var(--tb-radius-control); }
.fd-pgt-wrap.is-invalid { border-color: var(--tb-danger); }
.fd-pgt { width: 100%; min-width: 880px; border-collapse: collapse; table-layout: fixed; }
.fd-pgt thead th { padding: 10px 12px; background: var(--tb-surface-muted); border-bottom: 1px solid var(--tb-border); font-size: 12.5px; font-weight: 600; color: var(--tb-text-muted); text-align: left; white-space: nowrap; }
.fd-pgt td, .fd-pgt tbody th { padding: 12px; border-bottom: 1px solid var(--tb-bg); vertical-align: middle; text-align: left; }
.fd-pgt tbody tr:last-child td, .fd-pgt tbody tr:last-child th { border-bottom: 0; }
.fd-pgt tbody tr.is-on td, .fd-pgt tbody tr.is-on th { background: var(--tb-ice-2); }
.fd-pgt__bank { width: 19%; }
.fd-pgt th:first-child { width: 19%; }
.fd-pgt__none { display: block; text-align: center; color: var(--tb-text-muted); }
.fd-pg__name { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; font-weight: 600; color: var(--tb-text-strong); cursor: pointer; }
.fd-pg__name input { width: 18px; height: 18px; margin: 0; accent-color: var(--tb-primary); flex-shrink: 0; }
/* Charge, then Flat / Percentage under it (live: the two halves of the cell) */
.fd-pg__fee { display: grid; gap: 6px; min-width: 0; }
.fd-pg__fee .tb-input { min-width: 0; text-align: right; }
html body .fd .fd-pg__fee .tb-select { min-width: 0; padding-left: 10px; padding-right: 26px; font-size: 13px; background-position: right 8px center; text-overflow: ellipsis; }
.fd-pgt tr:not(.is-on) .fd-pg__fee { opacity: .55; }

/* Payment links list */
.ma-filters__grid.fd-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fd-filters .fd-filters__wide { grid-column: span 2; }
.fd-filters .ma-filters__actions { grid-column: span 3; justify-content: flex-end; }
/* Payment links: the live list's 19 columns, so the table scrolls sideways with Track ID kept in view */
html body .fd .ev-table td { white-space: nowrap; }
html body .fd .ev-table td.ev-emp { white-space: normal; min-width: 170px; }
html body .fd .ev-table th:last-child, html body .fd .ev-table td:last-child { position: static; box-shadow: none; }
.fd-clip--mail { display: inline-block; max-width: 200px; vertical-align: bottom; }
.fd-link { padding: 4px 0; border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--tb-royal); cursor: pointer; }
.fd-link:hover { color: var(--tb-primary); text-decoration: underline; }
.fd-link:focus-visible { outline: 2px solid var(--tb-royal); outline-offset: 2px; border-radius: 4px; }
.fd-mail-ok { font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: var(--tb-success); }
.fd-track { font-weight: 600; color: var(--tb-primary); white-space: nowrap; }
html body .fd .ev-table .ev-emp { min-width: 140px; }
html body .fd .ev-table th:not(:first-child), html body .fd .ev-table td:not(:first-child) { padding-left: 10px; padding-right: 10px; }
.fd-clip { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-tag.fd-tag--pending { background: var(--tb-warning-soft); color: var(--tb-warn-ink); }
.ev-tag.fd-tag--expired { background: var(--tb-surface-muted); color: var(--tb-expired-ink); }

/* Windows (Update expiry date, Send mail) */
.fd-dialog { max-width: 480px; }
.fd-dialog .tb-field { margin-top: 16px; }
.fd-exp__opts { margin-top: 16px; }

/* ---------- Vendor balance ---------- */
.fd-nobal { font-size: 13px; font-style: italic; color: var(--tb-text-muted); white-space: nowrap; }

/* ---------- Widths ---------- */
@media (max-width: 1199.98px) {
    .fd-layout { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (max-width: 1099.98px) {
    .fd-grid--ep, .fd-grid--link { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fd-fetch { grid-column: 1 / -1; padding-top: 0; }
}
@media (max-width: 991.98px) {
    .fd-layout { grid-template-columns: minmax(0, 1fr); }
    .fd-bal { position: static; margin-top: 0; }
    .fd-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ma-filters__grid.fd-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fd-filters .ma-filters__actions { grid-column: auto; }
}
@media (max-width: 640px) {
    .fd-grid, .fd-grid--3 { grid-template-columns: minmax(0, 1fr); padding: 20px 20px 12px; }
    .fd-grid--flush { padding: 0; }
    .fd-c--wide { grid-column: auto; }
    .fd-entry__opts { grid-template-columns: minmax(0, 1fr); }
    .fd-grid--ep, .fd-grid--link { grid-template-columns: minmax(0, 1fr); }
    .fd-c--cust { grid-column: auto; }
    .fd-sec { margin: 0 20px; }
    /* Payment options: one card per bank, each channel labelled */
    .fd-pgt-wrap { overflow: visible; border: 0; }
    .fd-pgt { min-width: 0; }
    .fd-pgt thead { display: none; }
    .fd-pgt, .fd-pgt tbody, .fd-pgt tr, .fd-pgt td, .fd-pgt tbody th { display: block; width: auto; }
    .fd-pgt tr { margin-bottom: 10px; padding: 4px 14px 12px; border: 1px solid var(--tb-border); border-radius: var(--tb-radius-control); }
    .fd-pgt-wrap.is-invalid .fd-pgt tr { border-color: var(--tb-danger); }
    .fd-pgt td, .fd-pgt tbody th { padding: 6px 0; border: 0; background: none; }
    .fd-pgt tbody tr.is-on { background: var(--tb-ice-2); }
    .fd-pgt tbody tr.is-on td, .fd-pgt tbody tr.is-on th { background: none; }
    .fd-pgt td::before { content: attr(data-label); display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--tb-text-muted); }
    .fd-pgt__none { text-align: left; }
    .fd-pg__fee { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ma-filters__grid.fd-filters { grid-template-columns: minmax(0, 1fr); }
    .fd-filters .fd-filters__wide { grid-column: auto; }
    .fd .mu-form__head { flex-direction: column; align-items: flex-start; gap: 12px; }
    html body .fd .ev-table td { white-space: normal; }
    .fd-clip--mail { max-width: none; white-space: normal; overflow-wrap: anywhere; }
}

/* Vendor balance · suppliers that gave no balance (live "No Record Found", 2026-12-02) */
.fd-noans { list-style: none; margin: 14px auto 0; padding: 0; max-width: 460px; display: grid; gap: 8px; text-align: left; }
.fd-noans li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 10px 14px; border: 1px solid var(--tb-border); border-radius: var(--tb-radius-control); background: var(--tb-surface-muted); font-size: 13px; }
.fd-noans strong { color: var(--tb-text-strong); font-weight: 600; }
.fd-noans .num { color: var(--tb-text-muted); }
.fd-noans__msg { flex-basis: 100%; color: var(--tb-text-muted); }

/* ---- List-first (2026-12-03): Easy Payment's form in the side panel ---- */
.lf-drawer .fd-grid--ep, .lf-drawer .fd-grid--link { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lf-drawer .fd-fetch { grid-column: 1 / -1; padding-top: 0; }
.lf-drawer .fd-c--cust { grid-column: 1 / -1; }
html body .fd .lf-drawer .mu-form__head { flex-direction: row; align-items: flex-start; }
/* Payment options: one card per bank, its channels three to a row */
.lf-drawer .fd-pgt-wrap { overflow: visible; border: 0; }
.lf-drawer .fd-pgt { min-width: 0; }
.lf-drawer .fd-pgt thead { display: none; }
.lf-drawer .fd-pgt, .lf-drawer .fd-pgt tbody { display: block; width: auto; }
.lf-drawer .fd-pgt tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 14px; margin-bottom: 10px; padding: 6px 16px 14px; border: 1px solid var(--tb-border); border-radius: var(--tb-radius-control); }
.lf-drawer .fd-pgt-wrap.is-invalid .fd-pgt tr { border-color: var(--tb-danger); }
.lf-drawer .fd-pgt tbody th { grid-column: 1 / -1; width: auto; }
.lf-drawer .fd-pgt td, .lf-drawer .fd-pgt tbody th { display: block; padding: 6px 0; border: 0; background: none; }
.lf-drawer .fd-pgt tbody tr.is-on { background: var(--tb-ice-2); }
.lf-drawer .fd-pgt tbody tr.is-on td, .lf-drawer .fd-pgt tbody tr.is-on th { background: none; }
.lf-drawer .fd-pgt td::before { content: attr(data-label); display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--tb-text-muted); }
.lf-drawer .fd-pgt__none { text-align: left; }
@media (max-width: 640px) {
    .lf-drawer .fd-grid--ep, .lf-drawer .fd-grid--link { grid-template-columns: minmax(0, 1fr); }
    .lf-drawer .fd-pgt tr { grid-template-columns: minmax(0, 1fr); }
}
