.wallet-overview{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:34px}
.wallet-overview>div{min-height:126px;padding:20px;background:var(--bg-surface);border:1px solid var(--border-color);border-radius:8px;display:flex;flex-direction:column;justify-content:center}
.wallet-overview span,.wallet-overview small{color:var(--text-muted)}
.wallet-overview strong{display:block;margin:5px 0;font-size:clamp(18px,2vw,27px);line-height:1.45}
.wallet-overview>div:first-child strong{color:var(--success);font-size:clamp(25px,3vw,36px)}
.wallet-overview .wallet-status-ok{color:var(--success);font-size:19px}

.wallet-collection{margin-bottom:28px}
.wallet-section-head,.wallet-panel-title{display:flex;align-items:center;justify-content:space-between;gap:18px}
.wallet-section-head{margin-bottom:16px}
.wallet-section-head h2,.wallet-panel-title h2{font-size:21px}
.wallet-section-head p,.wallet-panel-title p{font-size:12px}
.wallet-cards{display:flex;gap:14px;overflow-x:auto;overscroll-behavior-inline:contain;scroll-snap-type:inline mandatory;scrollbar-width:thin;scrollbar-color:var(--border-color) transparent;padding:2px 2px 12px}
.wallet-cards::-webkit-scrollbar{height:6px}
.wallet-cards::-webkit-scrollbar-thumb{background:var(--border-color);border-radius:8px}
.wallet-account-card,.wallet-add-card{flex:0 0 292px;height:174px;border-radius:8px;scroll-snap-align:start}
.wallet-account-card{position:relative;isolation:isolate;overflow:hidden;padding:18px;color:#fff;border:1px solid rgba(255,255,255,.14);box-shadow:0 10px 28px rgba(0,0,0,.18);display:flex;flex-direction:column;justify-content:space-between;background:linear-gradient(135deg,#353b48,#20242d)}
.wallet-account-card::before{content:"";position:absolute;z-index:-1;width:190px;height:190px;left:-60px;top:-105px;border-radius:50%;border:34px solid rgba(255,255,255,.055)}
.wallet-account-card.wallet-accent-red{background:linear-gradient(135deg,#a50810,#242730 72%)}
.wallet-account-card.wallet-accent-blue{background:linear-gradient(135deg,#155e75,#202837 72%)}
.wallet-account-card.wallet-accent-gold{background:linear-gradient(135deg,#8a5a0a,#292821 72%)}
.wallet-account-card.active{border-color:var(--brand-red-light);box-shadow:0 0 0 2px rgba(242,13,24,.17),0 12px 30px rgba(0,0,0,.22)}
.wallet-card-top,.wallet-card-bottom{display:flex;align-items:center;justify-content:space-between;gap:14px}
.wallet-card-icon{width:38px;height:38px;display:grid;place-items:center;border:1px solid rgba(255,255,255,.2);border-radius:8px;background:rgba(0,0,0,.13)}
.wallet-card-icon svg{width:23px;height:23px}
.wallet-active-badge{padding:3px 9px;border:1px solid rgba(255,255,255,.2);border-radius:20px;background:rgba(0,0,0,.16);font-size:10px}
.wallet-card-balance small,.wallet-card-bottom small{display:block;color:rgba(255,255,255,.7)}
.wallet-card-balance strong{font-size:25px;line-height:1.4}
.wallet-card-bottom>div{min-width:0}
.wallet-card-bottom>div strong{display:block;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.wallet-card-bottom button{min-width:62px;padding:6px 10px;border:1px solid rgba(255,255,255,.28);border-radius:6px;color:#fff;background:rgba(0,0,0,.2);font-size:11px;font-weight:800}
.wallet-card-bottom button:hover:not(:disabled){background:rgba(255,255,255,.15)}
.wallet-card-bottom button:disabled{cursor:default;border-color:rgba(255,255,255,.13);color:rgba(255,255,255,.72)}
.wallet-card-actions{display:flex;align-items:center;gap:6px;flex-shrink:0}
.wallet-card-history{display:inline-flex;align-items:center;gap:4px;padding:6px 8px;color:#fff;border-radius:6px;font-size:11px;white-space:nowrap}
.wallet-card-history:hover,.wallet-card-history:focus-visible{color:#fff;background:rgba(255,255,255,.15)}
.wallet-card-history span{font-size:16px;line-height:1}

.wallet-history-hero {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  margin-bottom:18px;
  padding:clamp(16px,3vw,26px);
  border:1px solid var(--border-color);
  border-radius:12px;
  background:linear-gradient(125deg,rgba(242,13,24,.09),transparent 58%),var(--bg-surface);
}
.wallet-history-heading{display:flex;align-items:center;gap:14px;min-width:0}
.wallet-history-heading h1{font-size:clamp(21px,3vw,30px);line-height:1.55}
.wallet-history-heading p{margin-block-start:3px;color:var(--text-secondary);font-size:13px}
.wallet-history-hero-icon {
  display:grid;
  flex:none;
  place-items:center;
  inline-size:50px;
  block-size:50px;
  border:1px solid rgba(242,13,24,.18);
  border-radius:12px;
  background:rgba(242,13,24,.09);
  color:var(--brand-red-light);
}
.wallet-history-hero-icon svg{width:24px;height:24px}
.wallet-history-hero > .btn{flex:none}
.account-filter.wallet-history-filter {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  align-items:end;
  gap:12px;
  margin-bottom:18px;
  padding:16px;
  border:1px solid var(--border-color);
  border-radius:12px;
  background:var(--bg-surface);
}
.wallet-history-filter .field{margin:0;min-width:0}
.wallet-history-filter .field label{font-size:12px;color:var(--text-secondary)}
.wallet-history-filter .select,.wallet-history-filter .input{width:100%;min-width:0;min-height:42px}
.wallet-history-filter-actions{grid-column:1/-1;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}
.wallet-history-pages{display:flex;justify-content:flex-end;gap:8px;margin-block-start:14px}
.wallet-history-validation{padding:14px;border:1px solid var(--border-color);border-inline-start:3px solid var(--brand-red);border-radius:8px;background:var(--bg-surface)}
.wallet-history-validation ul{margin-inline-start:16px;list-style:disc}
.wallet-history-empty{display:grid;justify-items:center;gap:12px;padding:34px 16px;border:1px dashed var(--border-color);border-radius:12px;background:var(--bg-surface);color:var(--text-secondary)}
.wallet-history-table{overflow-x:auto;border:1px solid var(--border-color);border-radius:12px;background:var(--bg-surface)}
.wallet-history-table table{width:100%;border-collapse:collapse}
.wallet-history-table th,.wallet-history-table td{text-align:start;padding:12px 14px}
.wallet-history-table th{color:var(--text-secondary);background:var(--bg-secondary);font-size:11px;font-weight:700}
.wallet-history-table td{border-block-start:1px solid var(--border-color);font-size:13px}
.wallet-history-row:hover{background:var(--bg-card)}
.wallet-history-kind>div{display:flex;align-items:center;gap:9px}
.wallet-history-kind strong,.wallet-history-kind small{display:block}
.wallet-history-kind small,.wallet-history-amount small,.wallet-history-date,.wallet-history-journal{color:var(--text-secondary)}
.wallet-history-kind small,.wallet-history-amount small{font-size:11px}
.wallet-history-row{--wallet-entry-color:var(--text-primary);--wallet-entry-bg:var(--bg-card)}
.wallet-history-row.credit{--wallet-entry-color:#3bd688;--wallet-entry-bg:rgba(34,197,94,.12)}
.wallet-history-row.debit{--wallet-entry-color:#ff8a91;--wallet-entry-bg:rgba(242,13,24,.11)}
[data-theme="light"] .wallet-history-row.credit{--wallet-entry-color:#147447}
[data-theme="light"] .wallet-history-row.debit{--wallet-entry-color:#b02637}
.wallet-history-direction{display:grid;flex:none;place-items:center;inline-size:34px;block-size:34px;border-radius:10px;background:var(--wallet-entry-bg);color:var(--wallet-entry-color)}
.wallet-history-direction svg{width:17px;height:17px}
.wallet-history-amount bdi{color:var(--wallet-entry-color);font-weight:800;font-variant-numeric:tabular-nums;white-space:nowrap}
.wallet-history-amount small{margin-inline-start:5px}
.wallet-history-table .wallet-history-date,.wallet-history-table .wallet-history-journal{font-size:11px}
.wallet-history-wallet a{overflow-wrap:anywhere;text-decoration:underline;text-underline-offset:.2em;text-decoration-color:var(--text-muted)}
.wallet-history-mobile-label{display:none}

@media(max-width:1000px) {
  .account-filter.wallet-history-filter{grid-template-columns:repeat(2,minmax(0,1fr))}
  .wallet-history-table{overflow:visible;border:0;background:transparent}
  .wallet-history-table table,.wallet-history-table tbody{display:block}
  .wallet-history-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  .wallet-history-row {
    display:grid;
    grid-template-columns:minmax(0,1fr) max-content;
    grid-template-areas:"kind amount" "wallet date" "journal journal";
    align-items:center;
    gap:10px 12px;
    padding:13px;
    margin-bottom:9px;
    border:1px solid var(--border-color);
    border-radius:10px;
    background:var(--bg-surface);
  }
  .wallet-history-table td{display:block;min-width:0;padding:0;border:0}
  .wallet-history-kind{grid-area:kind}
  .wallet-history-table .wallet-history-amount{grid-area:amount;text-align:end}
  .wallet-history-wallet{grid-area:wallet}
  .wallet-history-table .wallet-history-date{grid-area:date;text-align:end;white-space:nowrap}
  .wallet-history-table .wallet-history-journal{grid-area:journal;display:flex;justify-content:space-between;align-items:center;gap:8px;padding-block-start:9px;border-block-start:1px solid var(--border-color)}
  .wallet-history-mobile-label{display:inline}
}
@media(max-width:480px) {
  .wallet-history-hero{align-items:flex-start;flex-direction:column;gap:12px}
  .wallet-history-hero > .btn{align-self:stretch}
  .wallet-history-heading{gap:10px}
  .wallet-history-hero-icon{inline-size:40px;block-size:40px}
  .wallet-history-hero-icon svg{width:20px;height:20px}
  .wallet-history-heading p{font-size:12px}
  .account-filter.wallet-history-filter{padding:12px;gap:9px}
  .wallet-history-filter-actions .btn{flex:1}
  .wallet-card-bottom{gap:6px}
  .wallet-card-actions{gap:2px}
}
.wallet-add-card{border:1px dashed var(--text-disabled);background:var(--bg-surface);color:var(--text-secondary);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px}
.wallet-add-card:hover{border-color:var(--brand-red-light);color:var(--text-primary);background:var(--bg-card)}
.wallet-add-card>span{width:42px;height:42px;display:grid;place-items:center;border-radius:50%;background:var(--bg-card);font-size:25px;color:var(--brand-red-light)}
.wallet-add-card small{color:var(--text-muted)}
.wallet-just-charged{animation:walletCharged .7s ease}

.wallet-management-grid{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(300px,.75fr);gap:18px;margin-bottom:12px}
.dashboard-layout>div{min-width:0}
.wallet-charge-panel{display:grid;gap:17px}
.wallet-secure-badge{padding:4px 9px;border-radius:20px;color:var(--success);background:rgba(34,197,94,.09);border:1px solid rgba(34,197,94,.2);font-size:10px;white-space:nowrap}
.wallet-charge-summary{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:13px 14px;border:1px solid var(--border-color);border-radius:7px;background:var(--bg-secondary)}
.wallet-charge-summary>strong{font-size:18px;color:var(--success)}
.wallet-insight{min-height:100%}
.wallet-mini-icon{width:38px;height:38px;display:grid;place-items:center;border-radius:8px;color:var(--brand-red-light);background:rgba(242,13,24,.1);font-size:23px}
.wallet-active-detail{margin:24px 0 8px;padding:16px;border-right:3px solid var(--brand-red);background:var(--bg-secondary);border-radius:7px}
.wallet-active-detail span,.wallet-active-detail small{display:block;color:var(--text-muted)}
.wallet-active-detail strong{display:block;margin:3px 0;font-size:24px;color:var(--success)}
.wallet-modal-hint{margin-top:12px;font-size:12px}

[data-theme="light"] .wallet-account-card{box-shadow:0 10px 25px rgba(23,26,33,.14)}
[data-theme="light"] .wallet-add-card{background:#fff}

@keyframes walletCharged{0%{transform:scale(1)}42%{transform:scale(1.018);box-shadow:0 0 0 4px rgba(34,197,94,.22),0 12px 30px rgba(0,0,0,.22)}100%{transform:scale(1)}}

@media(max-width:960px){
  .wallet-overview{grid-template-columns:repeat(2,minmax(0,1fr))}
  .wallet-overview>div:first-child{grid-column:1/-1}
  .wallet-management-grid{grid-template-columns:1fr}
}
@media(max-width:768px){
  body[data-page="wallet"] .page-main{padding-top:18px;padding-bottom:118px;overflow:hidden}
  body[data-page="wallet"] .dashboard-layout{display:block}
  body[data-page="wallet"] .page-head{margin-bottom:18px;gap:12px}
  body[data-page="wallet"] .page-head h1{font-size:25px}
  body[data-page="wallet"] .page-head .eyebrow{font-size:10px}
  body[data-page="wallet"] .page-head p{font-size:12px;line-height:1.65}
  body[data-page="wallet"] .page-head>.btn{width:100%;min-height:42px}

  .wallet-overview{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-bottom:27px}
  .wallet-overview>div{min-height:98px;padding:13px 14px}
  .wallet-overview>div:first-child{grid-column:1/-1;min-height:112px;padding-inline:17px;background:linear-gradient(135deg,rgba(34,197,94,.09),var(--bg-surface) 62%)}
  .wallet-overview>div:first-child strong{font-size:30px}
  .wallet-overview span{font-size:11px}
  .wallet-overview small{font-size:9px;line-height:1.55}
  .wallet-overview strong{margin:3px 0;font-size:15px;line-height:1.55;overflow-wrap:anywhere}
  .wallet-overview .wallet-status-ok{font-size:13px}

  .wallet-collection{margin-bottom:23px}
  .wallet-section-head{align-items:flex-end;margin-bottom:12px;gap:10px}
  .wallet-section-head>div{min-width:0}
  .wallet-section-head h2,.wallet-panel-title h2{font-size:18px}
  .wallet-section-head p{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .wallet-section-head .btn{min-height:38px;padding:6px 11px;font-size:11px;white-space:nowrap}
  .wallet-cards{width:calc(100% + 28px);margin-inline:-14px;gap:11px;padding:2px 14px 10px;scroll-padding-inline:14px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  .wallet-cards::-webkit-scrollbar{display:none}
  .wallet-account-card{flex-basis:min(84vw,300px);height:168px;padding:16px}
  .wallet-add-card{flex-basis:min(58vw,210px);height:168px}
  .wallet-card-balance strong{font-size:23px}
  .wallet-card-bottom button{min-width:66px;min-height:38px}

  .wallet-management-grid{gap:13px;margin-bottom:4px}
  .wallet-management-grid .panel{padding:16px;border-radius:8px}
  .wallet-charge-panel{gap:15px}
  .wallet-panel-title{align-items:flex-start;gap:10px}
  .wallet-secure-badge{max-width:98px;white-space:normal;text-align:center;line-height:1.45}
  .wallet-charge-panel .field{gap:6px}
  .wallet-charge-panel .field label{font-size:12px}
  .wallet-charge-panel .select,.wallet-charge-panel .input{min-height:48px;font-size:14px}
  .wallet-charge-panel .amount-options{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .wallet-charge-panel .amount-option{min-height:48px;padding:9px 6px;font-size:12px}
  .wallet-charge-summary{padding:12px;gap:10px}
  .wallet-charge-summary span{font-size:12px}
  .wallet-charge-summary>strong{font-size:15px;white-space:nowrap}
  .wallet-charge-panel [data-pay]{min-height:49px}
  .wallet-active-detail{margin-top:17px}
  .wallet-active-detail strong{font-size:22px}
  .wallet-insight .chart{height:140px;margin-bottom:22px}

  body[data-page="wallet"] .section{margin-top:30px}
  body[data-page="wallet"] .section-head{margin-bottom:12px}
  body[data-page="wallet"] .section-head h2{font-size:18px}
  body[data-page="wallet"] .table-wrap{border:0;overflow:visible;background:transparent}
  body[data-page="wallet"] .table-responsive tr{display:grid;gap:0;margin-bottom:9px;padding:11px 13px;border:1px solid var(--border-color);border-radius:8px;background:var(--bg-surface)}
  body[data-page="wallet"] .table-responsive td{display:grid;grid-template-columns:minmax(82px,.7fr) minmax(0,1fr);align-items:center;gap:10px;padding:6px 0;border-bottom:1px solid var(--border-light);white-space:normal;text-align:left;overflow-wrap:anywhere}
  body[data-page="wallet"] .table-responsive td:last-child{display:flex;justify-content:flex-end;padding-top:10px;border-bottom:0}
  body[data-page="wallet"] .table-responsive td::before{min-width:0;text-align:right;font-size:10px}
  body[data-page="wallet"] .table-responsive td:last-child::before{display:none}
  body[data-page="wallet"] .table-responsive .btn{width:100%;min-height:38px}
}
@media(max-width:480px){
  body[data-page="wallet"] .page-head{align-items:stretch}
  .wallet-charge-summary{align-items:flex-start;flex-direction:column}
  .wallet-charge-summary>strong{font-size:16px}
}
@media(max-width:360px){
  body[data-page="wallet"] .page-head h1{font-size:23px}
  .wallet-overview>div{padding-inline:11px}
  .wallet-overview>div:first-child strong{font-size:27px}
  .wallet-account-card{flex-basis:calc(100vw - 42px)}
  .wallet-card-bottom>div strong{max-width:125px}
  .wallet-section-head .btn{padding-inline:9px}
  .wallet-secure-badge{display:none}
  .wallet-charge-panel .amount-option{font-size:11px}
}
@media(prefers-reduced-motion:reduce){.wallet-just-charged{animation:none}}
