:root {
    --bg-dark: #0b0d0c;
    --panel: #0f1413;
    --chip-bg: rgba(255, 255, 255, 0.06);
    --muted: #9aa0a6;
    --accent-gradient: linear-gradient(90deg, #1fe59b 0%, #10c776 100%);
    --neon: #12e08e;
    --radius: 14px;
    font-family: 'Montserrat', sans-serif;
    color-scheme: dark;
}

/* ===================================================================
   Wallet CSS (match VIP bottom menu)
   =================================================================== */

/* Global */
* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    background: var(--bg-dark);
    color: #e8f8f0;
    -webkit-font-smoothing: antialiased;
    font-family: 'Montserrat', sans-serif;
    padding-bottom: 72px;
    /* espaço para bottombar como no VIP */
}

/* App shell / container */
.app-shell {
    max-width: 420px;
    margin: 0 auto;
    position: relative;
}

.wallet-container {
    max-width: 420px;
    margin: 18px auto;
    padding: 10px;
}

/* Header */
.topbar {
    padding: 18px 12px 6px;
    text-align: center;
}

.topbar .topbar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.topbar .info-btn {
    position: absolute;
    right: 14px;
    top: 14px;
    background: transparent;
    border: none;
    color: #d0d8d0;
}

.app-title,
header h1 {
    color: var(--neon);
    margin: 0;
    letter-spacing: 2px;
    font-weight: 800;
    font-size: 26px;
}

/* Wallet card */
.wallet-header {
    background: linear-gradient(180deg, rgba(6, 10, 8, 0.95), rgba(10, 12, 11, 0.95));
    padding: 18px;
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

.wallet-h2 {
    color: var(--neon);
    margin: 0 0 4px 0;
    font-weight: 700;
}

.wallet-sub {
    color: #9acfb2;
    font-size: 13px;
    margin-bottom: 6px;
}

.wallet-balance {
    font-size: 44px;
    font-weight: 800;
    margin: 6px 0 12px 0;
    color: #fff;
}

/* chips */
.balance-pieces {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.chip {
    background: var(--chip-bg);
    padding: 10px;
    border-radius: 10px;
    flex: 1;
    text-align: center;
    color: #bfead0;
    box-shadow: inset 0 -6px 10px rgba(0, 0, 0, 0.4);
    font-size: 13px;
}

.chip-value {
    font-weight: 700;
    margin-top: 6px;
    color: #fff;
}

/* actions */
.wallet-actions {
    display: flex;
    gap: 12px;
    margin-top: 6px;
}

.btn {
    border: none;
    padding: 11px 16px;
    border-radius: 22px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 14px;
}

.btn.primary {
    background: var(--accent-gradient);
    color: #00160e;
    flex: 1;
    box-shadow: 0 8px 18px rgba(16, 200, 120, 0.12);
}

.btn.ghost {
    background: rgba(255, 255, 255, 0.03);
    color: #dbeee1;
    flex: 1;
}

/* list */
.wallet-list {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 24px;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: linear-gradient(180deg, rgba(9, 10, 9, 0.9), rgba(12, 14, 13, 0.9));
    border-radius: 12px;
    text-decoration: none;
    color: #e7f6ee;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

.list-item .icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex: 0 0 44px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

/* icon gradients */
.item-account .icon {
    background: linear-gradient(180deg, #3dd1bf, #2bb9a8);
}

.item-agent .icon {
    background: linear-gradient(180deg, #6ea6ff, #4b7cf2);
}

.item-withdraw .icon {
    background: linear-gradient(180deg, #ff8f7a, #ff6755);
}

.item-password .icon {
    background: linear-gradient(180deg, #3fe07f, #10c469);
}

/* Novo: estilo para Alterar senha de transação - combina com o estilo dos outros, cor diferenciada */
.item-transaction-password .icon {
    background: linear-gradient(180deg, #b388ff, #7a5cff);
}

/* Utilitárias (opcionais) para reaproveitamento de cores em outros itens */
.icon--green {
    background: linear-gradient(180deg, #3fe07f, #10c469);
    color: #fff;
    box-shadow: 0 6px 18px rgba(8, 36, 20, 0.45);
}

.icon--blue {
    background: linear-gradient(180deg, #6ea6ff, #4b7cf2);
    color: #fff;
    box-shadow: 0 6px 18px rgba(8, 20, 36, 0.45);
}

.icon--coral {
    background: linear-gradient(180deg, #ff8f7a, #ff6755);
    color: #fff;
    box-shadow: 0 6px 18px rgba(36, 8, 8, 0.45);
}

.list-label {
    flex: 1;
    font-size: 15px;
    color: #dff7e8;
    font-weight: 600;
}

.list-item .right {
    color: rgba(255, 255, 255, 0.45);
    font-size: 14px;
    margin-left: auto;
}

/* modal */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    padding: 20px;
}

.modal[aria-hidden="false"] {
    display: flex;
}

.modal-content {
    width: 360px;
    max-width: 96%;
    border-radius: 14px;
    padding: 18px;
    background: linear-gradient(180deg, #0b0f0d, #0f1413);
    color: #dfffe9;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6);
    position: relative;
    box-sizing: border-box;
}

.modal-close {
    position: absolute;
    left: 12px;
    top: 12px;
    background: transparent;
    border: none;
    color: #d0d8d0;
    font-size: 14px;
}

.modal h3 {
    text-align: center;
    color: var(--neon);
    margin: 0 0 10px 0;
    letter-spacing: 1px;
    font-weight: 700;
}

.withdraw-instructions ul {
    margin: 0 0 12px 16px;
    padding-left: 6px;
    color: #79f6a8;
    font-size: 13px;
}

/* modal form layout */
.modal-body {
    color: #cfe7d9;
    font-size: 14px;
}

.modal-body label {
    display: block;
    margin-top: 8px;
    color: #cfe7d9;
    font-weight: 600;
    font-size: 13px;
}

.modal-body input[type="number"],
.modal-body input[type="password"],
.modal-body select {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    color: #eaf7ef;
    border-radius: 8px;
    box-sizing: border-box;
}

.modal-note {
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
}

.modal-balance-line {
    margin-top: 12px;
    font-size: 14px;
    color: #b9f3c8;
    font-weight: 700;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    align-items: center;
    justify-content: flex-end;
}

.modal-actions .btn.ghost {
    padding: 10px 14px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.35);
    color: #e2efe6;
}

.modal-actions .btn.primary {
    padding: 10px 24px;
    border-radius: 28px;
    background: var(--accent-gradient);
    color: #00160e;
}

/* ===================================================================
   Bottombar styled like VIP (full-width bottom)
   =================================================================== */
nav.bottombar,
.bottombar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 62px;
    background: #17252b;
    display: flex;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    z-index: 1000;
    box-sizing: border-box;
}

.bottombar .tab,
nav.bottombar .tab {
    flex: 1;
    text-align: center;
    color: #bbb;
    text-decoration: none;
    padding-top: 8px;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.bottombar .tab i,
nav.bottombar .tab i {
    font-size: 18px;
    margin-bottom: 4px;
}

.bottombar .tab.active,
nav.bottombar .tab.active {
    color: var(--neon);
}

/* small adjustments */
@media(min-width:720px) {
    .wallet-container {
        max-width: 420px;
        margin: 18px auto;
    }
}

@media (max-width:420px) {
    .modal-content {
        width: 96%;
        padding: 16px;
        border-radius: 12px;
    }

    .wallet-balance {
        font-size: 36px;
    }
}

/* -----------------------
   Transaction card styles (scoped safe, appended to original CSS)
   Keep them minimal and matching the wallet aesthetic.
   ----------------------- */

.tx-list {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 6px 0 20px 0;
}

.tx-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.04));
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.tx-left {
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tx-badge {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #00221a;
    font-size: 18px;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.15);
}

.tx-badge.credit {
    background: linear-gradient(180deg, #9ff4d2, #19b176);
}

.tx-badge.debit {
    background: linear-gradient(180deg, #ffb0a2, #ff6b6b);
}

.tx-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tx-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tx-title {
    font-weight: 700;
    color: #eafff3;
    font-size: 15px;
}

.tx-amount {
    font-weight: 800;
    font-size: 14px;
}

.tx-amount.credit {
    color: #9ff4d2;
}

.tx-amount.debit {
    color: #ff8a80;
}

.tx-row-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
}

.tx-ref {
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.9;
}

.tx-date {
    color: rgba(255, 255, 255, 0.45);
    font-size: 12px;
}

@media (max-width:420px) {
    .tx-row-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .tx-row-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .tx-ref {
        max-width: 100%;
    }
}

/* === Correções para a lista de transações: rolagem interna e evitar corte de conteúdo === */

/* Garante que o painel de transações não encolha quando o conteúdo aumentar */
.tx-panel {
    max-width: 420px;
    margin: 0 auto 96px;
    background: var(--tx-bg);
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    /* NÃO permite encolher no fluxo */
    height: auto;
    /* deixa a altura fluir, mas lista por dentro será limitada */
}

/* Área rolável interna: fixa altura máxima e permite scroll interno */
.tx-list {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px;
    /* Ajuste a altura conforme desejar; 60vh costuma funcionar bem em mobile/desktop */
    max-height: calc(60vh);
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-sizing: border-box;
}

/* Se quiser uma altura exata em px (mais previsível), substitua a linha anterior por:
   max-height: 360px;
*/

/* Evita que cartões de transação encolham e garante espaçamento visível */
.tx-item,
.tx-card {
    flex: 0 0 auto;
    min-height: 48px;
    /* garante altura mínima */
    overflow: hidden;
}

/* Se a lista aparece dentro de um layout flex no resto da página, impedir shrink em irmãos */
.wallet-container>* {
    flex-shrink: 0;
}

/* Pequenas melhorias visuais para evitar corte vertical do texto */
.tx-title {
    line-height: 1.2;
    max-height: 2.6em;
    /* até duas linhas aproximadamente */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Ajuste para o caso da página Carteira (onde o histórico aparece em um card menor)
   garante que o painel não ultrapasse o conteúdo vizinho */
.wallet-list,
.tx-panel {
    width: 100%;
    box-sizing: border-box;
}

/* Responsivo: em telas muito pequenas podemos reduzir a altura do tx-list */
@media (max-height:640px) and (max-width:420px) {
    .tx-list {
        max-height: calc(55vh);
    }
}