/* Top Up Kuota. Scope under :is(#topup,#topupBuyDialog,#topupHistoryDialog) only. Preserve current dashboard theme. */
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-topup-header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:0 0 18px}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-topup-header h2{margin:0}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-package-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;margin:16px 0 22px}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-package{position:relative;cursor:pointer;display:flex;flex-direction:column;gap:5px;padding:17px 15px;border:1px solid #454348;border-radius:15px;background:#222326;min-height:125px}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-package input{position:absolute;right:12px;top:12px;width:18px;height:18px;accent-color:var(--brand-orange,#F78C1B)}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-package:has(input:checked){border-color:var(--brand-orange,#F78C1B);background:#35281c;box-shadow:0 0 0 1px var(--brand-orange,#F78C1B)}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-package-name{font-size:12px;color:#bdbbbf;padding-right:20px}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-package strong{font-size:23px;color:#fff;line-height:1.2}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-price{font-size:15px;color:var(--brand-orange,#F78C1B);font-weight:700;margin-top:auto}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-methods{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;margin:12px 0 18px}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-pay-method{border:1px solid #454348;border-radius:12px;background:#232429;padding:13px;display:flex;gap:10px;align-items:center;cursor:pointer;font-weight:600;font-size:14px}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-pay-method input{accent-color:var(--brand-orange,#F78C1B);width:18px;height:18px}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-pay-method:has(input:checked){border-color:var(--brand-orange,#F78C1B);background:#39291b}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-pay-method.disabled{opacity:.45;cursor:not-allowed}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-topup-buy{width:100%;max-width:370px;background:var(--brand-orange,#F78C1B)!important;color:#161616!important;font-weight:750}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) table small{display:block;margin-top:5px;color:#aea9ac}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-topup-admin-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-topup-admin-grid .card{margin:0}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-admin-form{display:grid;gap:12px}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-admin-form label{display:grid;gap:5px;font-size:13px}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-admin-form input{max-width:100%;box-sizing:border-box}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-admin-form input[type=checkbox]{width:auto;accent-color:var(--brand-orange,#F78C1B)}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-topup-settings{grid-column:1 / -1}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-setting-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-setting-grid input{width:100%}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-setting-grid small{font-size:11px;color:#a8a7a9}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-setting-checks{display:flex;gap:18px;flex-wrap:wrap}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-setting-checks label{display:flex;flex-direction:row;align-items:center}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-order-status{font-size:12px;padding:5px 8px;border-radius:8px;background:#49402b;color:#ffe5a6}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-status-paid{background:#20442d;color:#a9f2b8}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-status-expired{background:#492b2b;color:#ffb6ac}
#topupPayDialog{background:#1d1e22;color:#f5f4f6;border:1px solid #414247;border-radius:22px;max-width:min(500px,95vw);width:100%;padding:24px;box-sizing:border-box}
#topupPayDialog::backdrop{background:rgba(0,0,0,.8)}
#topupPayDialog h2{margin-top:0}
#topupPayDialog .td-pay-line{display:flex;justify-content:space-between;gap:12px;border-bottom:1px solid #36373c;padding:10px 0;font-size:13px}
#topupPayDialog .td-pay-line>span:first-child{color:#bcbcc4}
#topupPayDialog .td-qr{display:block;width:230px;height:230px;max-width:100%;margin:16px auto;border:11px solid white;border-radius:12px;object-fit:contain;background:white}
#topupPayDialog .td-qr[hidden]{display:none}
#topupPayDialog .td-invoice-total{color:var(--brand-orange,#F78C1B);font-size:22px;font-weight:800}
#topupPayDialog .td-pay-actions{display:flex;flex-wrap:wrap;gap:9px;margin-top:18px}
#topupPayDialog .td-pay-actions>*{flex:1;text-align:center;min-width:130px}
#topupPayDialog #topupPaymentState{color:#d2c8b9;line-height:1.5;font-size:13px}
#topupPayDialog #topupPayDetail{overflow-wrap:anywhere;font-size:12px}
#topupPayDialog .td-paid{color:#92eca0}
@media(max-width:800px){:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-topup-admin-grid{grid-template-columns:1fr}:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-setting-grid{grid-template-columns:1fr 1fr}}
@media(max-width:510px){:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-setting-grid{grid-template-columns:1fr}:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-package-list{grid-template-columns:1fr 1fr}:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-methods{grid-template-columns:1fr}#topupPayDialog{padding:16px}}

:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-setting-grid select{width:100%;box-sizing:border-box;min-height:40px;background:#232429;border:1px solid #454348;color:#f6f4f1;border-radius:9px;padding:8px;font:inherit}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-setting-grid input:disabled{opacity:.48;cursor:not-allowed}
:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-rate-status{grid-column:span 2;align-self:center;color:#e6b277;font-size:12px;line-height:1.5;border:1px solid #52422f;border-radius:9px;padding:11px;background:#2a241f}
@media(max-width:510px){:is(#topup,#topupBuyDialog,#topupHistoryDialog) .td-rate-status{grid-column:1/-1}}

/* v1.9.3: quota actions and separate member dialogs. */
.td-quota-actions{margin-left:auto;display:flex;flex-direction:column;gap:6px;flex:none;align-items:center}
.design-metrics article.highlight:has(#topupQuotaActions:not([hidden])){gap:12px;padding-left:20px;padding-right:20px}
.design-metrics article.highlight:has(#topupQuotaActions:not([hidden]))>.metric-icon{width:58px;height:58px}
.design-metrics article.highlight:has(#topupQuotaActions:not([hidden]))>div:not(.td-quota-actions){min-width:0;flex:1}
.td-quota-actions[hidden]{display:none!important}
button.td-quota-icon{display:grid;place-items:center;width:36px;height:36px;min-height:36px;padding:8px;border:1px solid #17171740;border-radius:10px;background:#ffffff24;color:#171717;cursor:pointer;box-shadow:none}
button.td-quota-icon:hover{background:#ffffff48;border-color:#17171780}
.td-quota-icon svg,.td-action-icon svg{display:block;width:20px;height:20px;flex:none}
.td-menu-dialog{box-sizing:border-box;background:#1d1e22;color:#f5f4f6;border:1px solid #414247;border-radius:20px;width:calc(100% - 32px);max-width:740px;max-height:88dvh;overflow:auto;padding:24px;box-shadow:0 24px 80px #0008}
.td-menu-dialog::backdrop{background:#000b}
.td-menu-dialog:not([open]){display:none}
.td-dialog-header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px}
.td-dialog-header h2{margin:0;font-size:23px}
.td-menu-dialog .card{padding:0;margin:0;background:transparent;border:0;box-shadow:none}
#topupHistoryDialog{max-width:1080px}
#topupHistoryDialog .td-history-page-title{display:none}
#topupHistoryDialog .tablewrap{overflow-x:auto}
#topupHistoryDialog table{width:100%;min-width:660px}
#topupHistoryDialog th,#topupHistoryDialog td{padding:12px 10px;text-align:left}
.td-order-actions{display:flex;align-items:center;gap:7px;white-space:nowrap}
button.td-action-icon{width:36px;height:36px;min-height:36px;display:inline-flex;align-items:center;justify-content:center;padding:8px;background:#2a2b30;border:1px solid #45464e;border-radius:9px;color:#e4e2e7;box-shadow:none;cursor:pointer}
button.td-action-icon:hover{border-color:#F78C1B;color:#F78C1B;background:#35281c}
button.td-cancel-icon{color:#edaaa1}
button.td-cancel-icon:hover{border-color:#ef8c7f;color:#ffb6ac;background:#492b2b}
.td-action-icon:focus-visible,.td-quota-icon:focus-visible{outline:2px solid currentColor;outline-offset:3px}
:is(#topup,#topupHistoryDialog) .td-status-cancelled{background:#36373d;color:#c5c5cf}
.td-confirm-dialog{max-width:470px;line-height:1.6}
.td-confirm-dialog h2{margin-top:0}
#topupCancelOrder{overflow-wrap:anywhere;font-size:13px}
.td-confirm-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:22px;flex-wrap:wrap}
@media(min-width:561px) and (max-width:1100px){.td-quota-actions{flex-direction:column;gap:5px}.design-metrics article.highlight{gap:10px}}
@media(max-width:560px){.td-menu-dialog{padding:18px;width:calc(100% - 20px);max-height:92dvh}.td-dialog-header h2{font-size:21px}.td-quota-actions{gap:6px}button.td-quota-icon{width:34px;height:34px;min-height:34px;padding:7px}}

:is(#topup,#topupHistoryDialog) .td-status-credited{background:#20442d;color:#a9f2b8}
.td-credit-dialog{max-width:520px}
.td-credit-details{margin:0}
.td-credit-details>div{display:flex;justify-content:space-between;gap:18px;padding:13px 0;border-bottom:1px solid #36373c;font-size:14px}
.td-credit-details dt{color:#bcbcc4}
.td-credit-details dd{margin:0;text-align:right;overflow-wrap:anywhere;min-width:0}
.td-credit-success{color:#a9f2b8}
