/* ========== Trang nạp tiền + tài khoản ========== */

.wallet-page {
    position: relative;
    padding: 104px 0 72px;
    min-height: calc(100vh - 80px);
    background:
        radial-gradient(ellipse 70% 45% at 100% 0%, rgba(59, 130, 246, 0.1), transparent 55%),
        radial-gradient(ellipse 50% 40% at 0% 100%, rgba(99, 102, 241, 0.08), transparent 50%),
        var(--bg);
}

.wallet-title {
    font-size: clamp(1.45rem, 2.5vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0 0 6px;
    color: var(--text);
}

.wallet-balance {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 20px;
}

/* --- Nạp tiền --- */
.wallet-notice {
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.32);
    border-radius: 16px;
    padding: 16px 18px;
    margin-bottom: 28px;
    color: var(--text);
    max-width: 900px;
}

.wallet-notice strong {
    display: block;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.wallet-notice ul {
    margin: 0;
    padding-left: 18px;
    color: var(--text-light);
    line-height: 1.65;
    font-size: 0.9rem;
}

.wallet-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 900px;
}

.wallet-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 22px;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.04),
        0 12px 32px rgba(15, 23, 42, 0.06);
}

[data-theme="dark"] .wallet-card {
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

.wallet-card h2 {
    font-size: 1.02rem;
    font-weight: 700;
    margin: 0 0 14px;
}

.wallet-qr {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #fff;
}

.wallet-qr img {
    width: 100%;
    display: block;
    max-height: 420px;
    object-fit: contain;
}

.wallet-info {
    list-style: none;
    padding: 0;
    margin: 0 0 14px;
}

.wallet-info li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}

.wallet-info li span {
    color: var(--text-light);
}

.wallet-hint {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.55;
    margin-bottom: 14px;
}

.wallet-hint code {
    font-size: 0.78rem;
    background: var(--bg-alt);
    padding: 2px 6px;
    border-radius: 5px;
}

/* ========== Tài khoản người dùng ========== */
.account-wrap {
    max-width: 820px;
    margin: 0 auto;
}

.account-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
    padding: 20px 22px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.04),
        0 10px 28px rgba(15, 23, 42, 0.05);
}

[data-theme="dark"] .account-header {
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3);
}

.account-header-text {
    min-width: 0;
    flex: 1;
}

.account-greeting {
    margin: 0 0 4px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
    letter-spacing: 0.02em;
}

.account-name {
    font-size: clamp(1.5rem, 3vw, 1.95rem) !important;
    font-weight: 800 !important;
    letter-spacing: -0.035em !important;
    margin: 0 0 6px !important;
    background: linear-gradient(135deg, var(--primary), #6366f1 60%, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--primary);
}

.account-meta {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
    word-break: break-word;
    display: flex;
    align-items: center;
    gap: 6px;
}

.account-meta::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z'/%3E%3Cpolyline points='22,6 12,13 2,6'/%3E%3C/svg%3E") center / contain no-repeat;
    opacity: 0.85;
}

.account-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.28);
    white-space: nowrap;
    align-self: center;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.12);
}

.account-chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
    animation: account-pulse 2s ease-in-out infinite;
}

@keyframes account-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25); }
    50% { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.12); }
}

.account-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.account-balance-card {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(59, 130, 246, 0.18), rgba(99, 102, 241, 0.1) 40%, transparent 72%),
        var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 28px 26px 24px;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.04),
        0 14px 40px rgba(15, 23, 42, 0.07);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.account-balance-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.06),
        0 18px 48px rgba(15, 23, 42, 0.1);
}

[data-theme="dark"] .account-balance-card {
    background:
        linear-gradient(145deg, rgba(59, 130, 246, 0.25), rgba(99, 102, 241, 0.12) 45%, transparent 75%),
        var(--card-bg);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .account-balance-card:hover {
    box-shadow: 0 20px 56px rgba(0, 0, 0, 0.5);
}

.account-balance-card::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.22), transparent 70%);
    top: -70px;
    right: -50px;
    pointer-events: none;
}

.account-balance-label {
    position: relative;
    z-index: 1;
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-light);
}

.account-balance-value {
    position: relative;
    z-index: 1;
    font-size: clamp(1.85rem, 4.2vw, 2.35rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    color: var(--primary);
    margin: 12px 0 20px;
    line-height: 1.1;
}

.account-actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.account-actions .btn {
    border-radius: 12px;
    font-weight: 600;
    padding: 11px 16px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.account-actions .btn:hover {
    transform: translateY(-1px);
}

.account-actions .btn-primary {
    box-shadow: 0 8px 22px rgba(59, 130, 246, 0.3);
}

.account-actions .btn-primary:hover {
    box-shadow: 0 10px 28px rgba(59, 130, 246, 0.38);
}

.account-tx {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 22px 22px 18px;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.04),
        0 10px 28px rgba(15, 23, 42, 0.05);
}

[data-theme="dark"] .account-tx {
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3);
}

.account-tx-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 16px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.account-tx-head h2 {
    font-size: 1.08rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
}

.account-tx-head .form-hint {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-light);
}

.tx-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tx-item {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-alt);
    transition: border-color 0.2s ease, transform 0.15s ease;
}

.tx-item:hover {
    border-color: rgba(59, 130, 246, 0.35);
    transform: translateY(-1px);
}

.tx-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.tx-icon.plus {
    background: rgba(34, 197, 94, 0.14);
    color: #16a34a;
}

.tx-icon.minus {
    background: rgba(220, 38, 38, 0.12);
    color: #dc2626;
}

.tx-body {
    min-width: 0;
}

.tx-body strong {
    display: block;
    font-size: 0.92rem;
    font-weight: 650;
    color: var(--text);
    margin-bottom: 2px;
}

.tx-body p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-light);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tx-body small {
    display: block;
    margin-top: 4px;
    color: var(--text-light);
    font-size: 0.72rem;
}

.tx-right {
    text-align: right;
    flex-shrink: 0;
}

.tx-right .tx-plus,
.tx-right .tx-minus {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.tx-plus { color: #16a34a; }
.tx-minus { color: #dc2626; }

.tx-right small {
    display: block;
    margin-top: 3px;
    font-size: 0.7rem;
    color: var(--text-light);
}

.tx-empty {
    margin: 0;
    padding: 28px 16px;
    text-align: center;
    color: var(--text-light);
    font-size: 0.92rem;
    border: 1px dashed var(--border);
    border-radius: 14px;
    background: var(--bg-alt);
}

.tx-detail-btn {
    display: inline-flex;
    align-items: center;
    margin-top: 8px;
    padding: 5px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.22);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.tx-detail-btn:hover {
    background: rgba(59, 130, 246, 0.18);
    transform: translateY(-1px);
}

.tx-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tx-modal[hidden] {
    display: none !important;
}

.tx-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
}

.tx-modal-panel {
    position: relative;
    width: min(440px, 100%);
    max-height: min(80vh, 560px);
    overflow: auto;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.tx-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--card-bg);
    z-index: 1;
}

.tx-modal-head h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.tx-modal-close {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: var(--bg-alt);
    color: var(--text);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.tx-modal-close:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.tx-modal-body {
    padding: 16px 18px 20px;
}

.tx-detail-meta {
    font-size: 0.9rem;
    margin-bottom: 14px;
}

.tx-detail-meta p {
    margin: 0 0 6px;
}

.tx-detail-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tx-detail-item {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-alt);
}

.tx-detail-img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tx-detail-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tx-detail-ph {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-light);
}

.tx-detail-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tx-detail-info strong {
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tx-detail-info span {
    font-size: 0.78rem;
    color: var(--text-light);
}

.tx-detail-line {
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
}

.tx-detail-total {
    margin: 14px 0 0;
    text-align: right;
    font-size: 0.95rem;
}

.tx-detail-empty {
    margin: 0;
    padding: 14px;
    text-align: center;
    color: var(--text-light);
    font-size: 0.88rem;
    border: 1px dashed var(--border);
    border-radius: 12px;
}

.price-old {
    text-decoration: line-through;
    color: var(--text-light);
    font-weight: 500;
    margin-right: 6px;
    font-size: 0.85em;
}

@media (max-width: 768px) {
    .wallet-page {
        padding: 92px 0 48px;
    }

    .wallet-grid {
        grid-template-columns: 1fr;
    }

    .account-header {
        padding: 16px 16px;
        margin-bottom: 20px;
        border-radius: 16px;
    }

    .account-chip {
        width: 100%;
        justify-content: center;
    }

    .account-balance-card,
    .account-tx {
        padding: 20px 16px;
        border-radius: 18px;
    }

    .tx-item {
        grid-template-columns: 36px 1fr;
        gap: 10px;
    }

    .tx-right {
        grid-column: 2;
        text-align: left;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .tx-right small {
        margin-top: 0;
    }
}

.tx-detail-delivery {
    margin: 0 0 14px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-alt);
    font-size: 0.88rem;
}

.tx-detail-delivery h4 {
    margin: 0 0 8px;
    font-size: 0.92rem;
    font-weight: 700;
}

.tx-detail-delivery p {
    margin: 0 0 4px;
}
