/* ===================================================
   THẦN – ACCOUNT CSS
   Dashboard người dùng, đơn hàng, ví
=================================================== */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --red: #E30613;
    --red-light: rgba(227, 6, 19, 0.1);
    --gold: #F5B800;
    --bg: #0d0d0d;
    --surface: #161616;
    --surface2: #1f1f1f;
    --surface3: #272727;
    --border: rgba(255, 255, 255, 0.07);
    --border2: rgba(255, 255, 255, 0.12);
    --text: #ffffff;
    --text2: rgba(255, 255, 255, 0.65);
    --text3: rgba(255, 255, 255, 0.35);
    --success: #00c853;
    --warning: #ffd600;
    --error: #ff4444;
    --info: #448aff;
    --radius: 16px;
}

body {
    font-family: 'Be Vietnam Pro', 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ===== NAVBAR (mini) ===== */
.mini-navbar {
    background: rgba(16, 16, 16, 0.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
    font-weight: 900;
    font-size: 20px;
    letter-spacing: 1px;
}

.nav-logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #E30613, #c00010);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    font-weight: 900;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-home-link {
    color: var(--text2);
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.nav-home-link:hover {
    color: var(--text);
}

.nav-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E30613, #ff6b6b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: white;
}

.nav-user-name {
    font-size: 14px;
    font-weight: 600;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-logout {
    padding: 7px 14px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text2);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    border-color: var(--red);
    color: var(--red);
}

/* ===== LAYOUT ===== */
.account-layout {
    display: flex;
    min-height: calc(100vh - 62px);
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 20px;
    gap: 24px;
}

/* ===== SIDEBAR ===== */
.account-sidebar {
    width: 240px;
    flex-shrink: 0;
}

.sidebar-user-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 12px;
    text-align: center;
}

.sidebar-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E30613, #ff6b6b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 24px;
    color: white;
    margin: 0 auto 12px;
}

.sidebar-name {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
}

.sidebar-role {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--red-light);
    color: var(--red);
    font-weight: 600;
    display: inline-block;
}

.sidebar-wallet {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.wallet-label {
    font-size: 11px;
    color: var(--text3);
    margin-bottom: 3px;
}

.wallet-balance {
    font-size: 18px;
    font-weight: 800;
    color: var(--gold);
}

.sidebar-menu {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.menu-section-title {
    padding: 12px 16px 6px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    color: var(--text2);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.15s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    font-family: inherit;
}

.menu-item:hover {
    background: var(--surface2);
    color: var(--text);
}

.menu-item.active {
    background: var(--red-light);
    color: var(--red);
    font-weight: 600;
}

.menu-item .menu-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.menu-item .menu-count {
    margin-left: auto;
    background: var(--red);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
}

/* ===== MAIN CONTENT ===== */
.account-main {
    flex: 1;
    min-width: 0;
}

.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text2);
}

/* ===== CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    transition: border-color 0.2s;
}

.stat-card:hover {
    border-color: var(--border2);
}

.stat-icon {
    font-size: 24px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 3px;
}

.stat-label {
    font-size: 12px;
    color: var(--text3);
    font-weight: 500;
}

.stat-card.highlight {
    border-color: rgba(227, 6, 19, 0.3);
    background: rgba(227, 6, 19, 0.04);
}

.stat-card.highlight .stat-value {
    color: var(--red);
}

.stat-card.gold {
    border-color: rgba(245, 184, 0, 0.3);
    background: rgba(245, 184, 0, 0.04);
}

.stat-card.gold .stat-value {
    color: var(--gold);
}

/* ===== SECTION ===== */
.section-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.section-title {
    font-size: 15px;
    font-weight: 700;
}

.section-action {
    font-size: 13px;
    color: var(--red);
    text-decoration: none;
    cursor: pointer;
}

/* ===== ORDER ITEMS ===== */
.order-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}

.order-card:hover {
    border-color: var(--border2);
}

.order-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.order-id {
    font-size: 12px;
    color: var(--text3);
}

.order-shop {
    font-size: 14px;
    font-weight: 600;
    color: var(--red);
}

.order-status {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.status-pending {
    background: rgba(255, 214, 0, 0.15);
    color: #ffd600;
}

.status-processing {
    background: rgba(68, 138, 255, 0.15);
    color: #448aff;
}

.status-shipping {
    background: rgba(255, 152, 0, 0.15);
    color: #ff9800;
}

.status-delivered {
    background: rgba(0, 200, 83, 0.15);
    color: #00c853;
}

.status-cancelled {
    background: rgba(255, 68, 68, 0.15);
    color: #ff4444;
}

.status-approved {
    background: rgba(0, 200, 83, 0.15);
    color: #00c853;
}

.order-items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.order-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.order-item-img {
    font-size: 28px;
    width: 44px;
    height: 44px;
    background: var(--surface3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.order-item-info {
    flex: 1;
    min-width: 0;
}

.order-item-name {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-item-qty {
    font-size: 12px;
    color: var(--text3);
}

.order-item-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--red);
}

.order-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.order-total-label {
    font-size: 12px;
    color: var(--text2);
}

.order-total-price {
    font-size: 16px;
    font-weight: 800;
    color: var(--red);
}

.order-actions {
    display: flex;
    gap: 8px;
}

.btn-order-action {
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text2);
    transition: all 0.2s;
}

.btn-order-action:hover {
    border-color: var(--red);
    color: var(--red);
}

.btn-order-action.primary {
    background: var(--red);
    color: white;
    border-color: var(--red);
}

.btn-order-action.primary:hover {
    background: var(--red-dark);
}

/* ===== FILTER TABS ===== */
.filter-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text2);
    font-family: inherit;
    transition: all 0.2s;
}

.filter-tab.active {
    background: var(--red);
    color: white;
    border-color: var(--red);
}

.filter-tab:hover:not(.active) {
    border-color: var(--border2);
    color: var(--text);
}

/* ===== WALLET ===== */
.wallet-hero {
    background: linear-gradient(135deg, #1a0a00, #3d1500, #1a0a00);
    border: 1px solid rgba(245, 184, 0, 0.2);
    border-radius: 20px;
    padding: 28px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.wallet-hero::before {
    content: '₫';
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 120px;
    font-weight: 900;
    color: rgba(245, 184, 0, 0.06);
}

.wallet-hero-label {
    font-size: 12px;
    color: rgba(245, 184, 0, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.wallet-hero-amount {
    font-size: 36px;
    font-weight: 900;
    color: var(--gold);
    margin-bottom: 16px;
}

.wallet-actions {
    display: flex;
    gap: 10px;
}

.btn-wallet {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    border: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-wallet.primary {
    background: var(--gold);
    color: #1a0a00;
}

.btn-wallet.primary:hover {
    background: #ffc400;
    transform: translateY(-1px);
}

.btn-wallet.outline {
    background: transparent;
    border: 1.5px solid rgba(245, 184, 0, 0.3);
    color: var(--gold);
}

.btn-wallet.outline:hover {
    background: rgba(245, 184, 0, 0.1);
}

/* Transaction list */
.transaction-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.transaction-item:last-child {
    border-bottom: none;
}

.tx-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.tx-icon.topup {
    background: rgba(0, 200, 83, 0.12);
}

.tx-icon.payment {
    background: rgba(227, 6, 19, 0.1);
}

.tx-icon.income {
    background: rgba(68, 138, 255, 0.1);
}

.tx-icon.withdraw {
    background: rgba(255, 152, 0, 0.1);
}

.tx-icon.refund {
    background: rgba(0, 200, 83, 0.12);
}

.tx-info {
    flex: 1;
}

.tx-desc {
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 3px;
}

.tx-date {
    font-size: 11px;
    color: var(--text3);
}

.tx-amount {
    font-size: 15px;
    font-weight: 800;
}

.tx-amount.positive {
    color: var(--success);
}

.tx-amount.negative {
    color: var(--red);
}

/* ===== PROFILE FORM ===== */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text2);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    background: var(--surface2);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s;
    outline: none;
}

.form-control:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.1);
}

.form-control::placeholder {
    color: var(--text3);
}

.btn-save {
    padding: 11px 24px;
    background: linear-gradient(135deg, #E30613, #c00010);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(227, 6, 19, 0.3);
}

.btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(227, 6, 19, 0.4);
}

/* ===== TOPUP MODAL ===== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.modal-backdrop.show {
    opacity: 1;
    pointer-events: all;
}

.modal-box {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: 20px;
    padding: 28px;
    width: 380px;
    max-width: 95vw;
    animation: fadeUp 0.3s ease;
}

.modal-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 8px;
}

.modal-sub {
    font-size: 13px;
    color: var(--text2);
    margin-bottom: 20px;
}

.amount-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.amount-preset {
    padding: 10px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
}

.amount-preset:hover,
.amount-preset.active {
    border-color: var(--gold);
    background: rgba(245, 184, 0, 0.08);
    color: var(--gold);
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: var(--surface2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--text2);
    transition: all 0.15s;
}

.modal-close:hover {
    color: white;
    background: var(--surface3);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 50px 20px;
}

.empty-icon {
    font-size: 56px;
    opacity: 0.3;
    margin-bottom: 12px;
}

.empty-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.empty-sub {
    font-size: 13px;
    color: var(--text3);
    margin-bottom: 20px;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(10px);
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .account-layout {
        flex-direction: column;
        padding: 16px;
    }

    .account-sidebar {
        width: 100%;
    }

    .sidebar-menu {
        display: flex;
        overflow-x: auto;
        gap: 4px;
        padding: 8px;
    }

    .menu-section-title {
        display: none;
    }

    .menu-item {
        white-space: nowrap;
        border-radius: 8px;
        flex-shrink: 0;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }
}