@font-face {
    font-family: 'KoniBlack';
    src: url('assets/fonts/iCiel Koni Black.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --primary: #9354B9;
    --primary-light: #f8f0ff;
    --secondary: #6c5ce7;
    --accent: #ffd1e3;
    --success: #00b894;
    --warning: #fab1a0;
    --bg-color: #fcfaff;
    --card-bg: #ffffff;
    --text-main: #2d3436;
    --text-light: #b2bec3;
    --nav-bg: rgba(255, 255, 255, 0.9);
    --shadow: 0 10px 30px rgba(147, 84, 185, 0.15);
    --radius: 24px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

/* Ẩn thanh cuộn cho toàn bộ ứng dụng */
::-webkit-scrollbar {
    display: none;
}

body {
    -ms-overflow-style: none;
    /* IE và Edge */
    scrollbar-width: none;
    /* Firefox */
}

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Lexend:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    height: 100vh;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    background: var(--bg-color);
}

/* WinChat Authentication Styles */
.auth-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    font-family: 'Lexend', sans-serif;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.auth-logo-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
}

.win-logo {
    width: 130px;
    height: auto;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px rgba(255, 143, 177, 0.5));
    animation: winLogoPulse 3s infinite ease-in-out;
}

@keyframes winLogoPulse {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(255, 143, 177, 0.5));
    }

    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 25px rgba(255, 143, 177, 0.8));
    }
}

.win-title-group {
    display: flex;
    flex-direction: column;
}

.win-title {
    font-size: 28px;
    font-weight: 800;
    color: #4a4a4a;
    line-height: 1;
}

.win-subtitle {
    font-size: 14px;
    color: #999;
    font-weight: 500;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 5px;
    display: inline-block;
}

@font-face {
    font-family: 'CandyLove';
    src: url('assets/fonts/0297-LNTH-Candy Love FREE.ttf') format('truetype');
}

#auth-brand {
    font-family: 'CandyLove', cursive;
    font-size: 55px;
    color: #ff8fb1;
    margin-top: -10px;
    margin-bottom: 10px;
    text-shadow: 2px 2px 0px rgba(255, 255, 255, 1),
        4px 4px 15px rgba(255, 143, 177, 0.3);
    letter-spacing: 1px;
}

#auth-brand .color-orig {
    color: #ff8fb1;
}

#auth-brand .color-light {
    color: #ffb6cc;
}

#auth-brand .color-dark {
    color: #ff5e8e;
}



.win-input-group {
    margin-bottom: 25px;
    position: relative;
}

.win-input-group input,
.win-input-group select,
.win-gender-toggle {
    width: 100%;
    padding: 18px 25px;
    border: 2px solid #f0f0f0;
    border-radius: 20px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s;
    background: #ffffff;
    appearance: none;
    cursor: pointer;
    box-sizing: border-box;
}

.win-gender-toggle {
    display: flex;
    padding: 4px;
    /* Space for the inner options */
    height: 58px;
    /* Match input height */
    align-items: center;
    gap: 4px;
}

.gender-option {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    font-size: 14px;
    color: #ccc;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

.gender-option.active {
    background: #ffb6cc;
    color: white;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(255, 182, 204, 0.3);
}

.win-input-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ccc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 18px;
}

.win-input-group label {
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    background: #ffffff;
    padding: 0 6px;
    color: #ccc;
    font-size: 13px;
    pointer-events: none;
    transition: all 0.2s;
    z-index: 10;
}

.win-input-group input:focus,
.win-input-group select:focus {
    border-color: #ffb6cc;
    background: #fff;
    box-shadow: 0 0 15px rgba(255, 182, 204, 0.4);
}

.win-input-group input:focus+label,
.win-input-group input:not(:placeholder-shown)+label,
.win-input-group select:focus+label,
.win-input-group select:not(:invalid)+label,
.win-gender-toggle+label {
    top: 0;
    font-size: 12px;
    color: #ffb6cc;
    font-weight: 600;
}

.win-primary-btn {
    width: 100%;
    padding: 18px;
    background: #ff8fb1;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
    box-shadow: 0 10px 20px rgba(255, 143, 177, 0.3);
    transition: transform 0.2s, background 0.3s;
}

.win-primary-btn:active {
    transform: scale(0.98);
    background: #e57e9e;
}

.win-google-btn {
    width: 100%;
    padding: 14px;
    background: white;
    color: #555;
    border: 2px solid #f0f0f0;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.win-google-btn:hover {
    background: #fdfdfd;
    border-color: #ffb6cc;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.win-google-btn:active {
    transform: scale(0.98);
}

.auth-links {
    margin-top: 25px;
    font-size: 13px;
    color: #999;
    font-weight: 400;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.auth-links span {
    cursor: pointer;
}

.auth-links .divider {
    color: #eee;
    cursor: default;
}

.auth-switch {
    margin-top: 25px;
    font-size: 14px;
    color: #666;
}

.auth-switch span {
    color: #999;
    font-weight: 400;
    cursor: pointer;
    text-decoration: underline;
}

.auth-form.hidden {
    display: none;
}

.auth-screen.hidden {
    display: none !important;
}

main {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    padding-bottom: 100px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

header h1 {
    font-size: clamp(24px, 8.5vw, 32px);
}

header h2 {
    font-size: clamp(12px, 4vw, 16px);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: var(--nav-bg);
    backdrop-filter: blur(15px);
    height: 60px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-radius: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
}

.nav-item i {
    width: 21px;
    height: 21px;
}

.nav-item span {
    display: none;
}

.nav-item.active {
    color: var(--primary);
    transform: translateY(-5px);
}

.nav-item.active i {
    fill: color-mix(in srgb, var(--primary) 30%, transparent);
}

/* Home Screen Styles */
.balance-card {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 30px;
    border-radius: var(--radius);
    color: white;
    box-shadow: 0 15px 35px color-mix(in srgb, var(--primary) 30%, transparent);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.balance-card::after {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.balance-label {
    font-size: 14px;
    opacity: 0.9;
}

.balance-amount {
    font-size: 32px;
    font-weight: 700;
    margin: 8px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 24px;
}

.stat-item {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.income {
    background-color: rgba(160, 231, 229, 0.2);
    color: #48c5c1;
}

.stat-icon.expense {
    background-color: color-mix(in srgb, var(--primary) 30%, transparent);
    color: var(--primary);
}

.stat-info span {
    font-size: 11px;
    color: var(--text-light);
    display: block;
}

.stat-info p {
    font-weight: 700;
    font-size: 14px;
}

/* Transaction Screen Styles */
.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.kute-btn {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

/* Glossy Shine Sweep Effect */
.kute-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -150%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.3) 50%,
            rgba(255, 255, 255, 0) 100%);
    transform: rotate(30deg);
    transition: all 0.5s;
    pointer-events: none;
    animation: shine 6s infinite ease-in-out;
}

@keyframes shine {
    0% {
        left: -150%;
    }

    15% {
        left: 150%;
    }

    /* Slower sweep */
    100% {
        left: 150%;
    }

    /* Longer pause */
}

.kute-btn.income {
    background: url('assets/images/thu.png') no-repeat center;
    background-size: contain;
    border: none;
    box-shadow: none;
    height: 135px;
    width: 100%;
    filter: brightness(1.15) saturate(1.3) drop-shadow(0 10px 15px rgba(96, 239, 255, 0.2));
}

.kute-btn.income span,
.kute-btn.income i,
.kute-btn.income .btn-bubble {
    display: none;
}

.kute-btn.income:active {
    transform: scale(0.95);
}

.kute-btn.transfer {
    background: url('assets/images/cen.png?v=1') no-repeat center;
    background-size: contain;
    border: none;
    border-radius: 50%;
    height: 52px;
    width: 52px;
    min-width: 52px;
    padding: 0;
    margin: 0;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    position: absolute;
    right: 23px;
    bottom: -22px;
    z-index: 10;
}

.kute-btn.transfer:active {
    transform: scale(0.95);
}

.kute-btn.expense {
    background: url('assets/images/chi.png') no-repeat center;
    background-size: contain;
    border: none;
    box-shadow: none;
    height: 135px;
    width: 100%;
    margin-top: -15px;
    /* Kéo nút chi lại gần nút thu hơn */
    filter: brightness(1.15) saturate(1.3) drop-shadow(0 10px 15px rgba(255, 94, 94, 0.2));
}

.kute-btn.expense span,
.kute-btn.expense i,
.kute-btn.expense .btn-bubble {
    display: none;
}

.kute-btn.expense:active {
    transform: scale(0.95);
}

/* Modal Styles - Centered like note.png */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    /* Centered */
    justify-content: center;
    padding: 20px;
}

.modal.hidden {
    display: none !important;
}

/* Ben Animation */
.ben-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.ben-animation {
    width: 260px;
    height: 260px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    animation: benToggle 1.5s infinite steps(1);
}

@keyframes benToggle {

    0%,
    100% {
        background-image: url('assets/images/ben1.png');
    }

    50% {
        background-image: url('assets/images/ben2.png');
    }
}

.wavy-text {
    display: flex;
    justify-content: center;
    gap: 1px;
    /* Tighter gap for smoother curve */
}

.wavy-text span {
    display: inline-block;
    transform: translateY(var(--offset));
    /* Vị trí tĩnh uốn lượn */
}

.modal-content {
    background-color: transparent;
    width: 100%;
    max-width: 420px;
    height: 440px;
    padding: 85px 75px 85px 75px;
    /* Đẩy chữ lên sát viền mây hơn nữa */
    animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    border: none;
    border-radius: 40px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('assets/images/khungnhap.jpg') no-repeat center !important;
    background-size: 100% 100% !important;
    z-index: -1;
    border-radius: 40px;
}

/* Giao diện Bước 2 dùng khung hình mới khungnhap2.png */
.modal-content.step-2-active {
    background: url('assets/images/khungnhap2.png?v=2') no-repeat center !important;
    background-size: contain !important;
    border: none !important;
    box-shadow: none !important;
    max-width: 450px !important;
    height: 440px !important;
    padding: 85px 75px 85px 75px !important;
}

.modal-content.step-2-active::before {
    display: none !important;
}

.modal-content.step-2-active #modal-title {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 24px;
    font-family: 'KoniBlack', sans-serif;
}

#amount-input {
    width: 100%;
    padding: 12px;
    border-radius: 20px;
    border: 2px solid var(--primary);
    background: white;
    font-family: 'KoniBlack', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #5d5d5d;
    outline: none;
    text-align: center;
}

.modal-header {
    text-align: center;
    margin-bottom: 5px;
}

.modal-header h3 {
    font-family: 'KoniBlack', sans-serif;
    font-size: 22px;
    /* Giảm xuống một chút cho cân đối */
    color: var(--primary);
}

header h1 {
    font-family: 'KoniBlack', sans-serif;
    color: var(--primary);
    font-weight: normal;
}

.close-btn {
    position: absolute;
    top: 35px;
    right: 45px;
    background: rgba(0, 0, 0, 0.05);
    color: #555;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

.method-btn {
    flex: 1;
    background: #f9f9f9;
    border: 2px solid transparent;
    padding: 4px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    transition: all 0.2s;
    color: #888;
    /* Màu nhạt hơn */
}

.method-btn i {
    width: 18px;
    /* Thu nhỏ icon thêm chút */
    height: 18px;
    opacity: 0.8;
    /* Làm icon nhạt hơn */
}

.photo-btn {
    position: absolute;
    top: 72px;
    /* Dịch xuống thêm 2px */
    left: 23px;
    /* Dịch sang phải thêm 3px */
    background: none;
    border: none;
    color: #a0a0a0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 5px;
    z-index: 10;
}

.photo-btn i,
.photo-btn svg {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
}

.photo-btn:hover i {
    color: var(--primary);
    /* Đổi màu khi di chuột vào */
}

.method-btn span {
    font-size: 10px;
}

/* Ẩn chữ ở nút nguồn tiền trên App (Mobile), giữ lại trên Web */
@media (max-width: 768px) {
    .method-btn span {
        display: none;
    }
    
    .method-btn {
        padding: 10px 4px !important;
        justify-content: center;
    }
    
    .method-btn i {
        width: 22px;
        height: 22px;
    }
}

.method-btn.active {
    background: var(--bg-color);
    border-color: var(--primary);
    color: var(--primary);
}

.primary-btn {
    width: 100%;
    padding: 12px;
    border-radius: 15px;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.input-group {
    margin-bottom: 25px;
    /* Ép tạo khoảng cách với phần chọn nguồn tiền */
}

#note-input {
    width: 100%;
    padding: 16px;
    border-radius: 18px;
    border: none;
    background: transparent !important;
    font-family: 'KoniBlack', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #8b5e3c;
    outline: none;
    transition: all 0.3s;
    text-align: center;
}

#note-input::placeholder {
    color: color-mix(in srgb, var(--primary) 50%, transparent);
    font-size: 16px;
}

#note-input:focus {
    background: transparent !important;
    border: none !important;
}

#amount-input:focus {
    border-color: var(--primary);
    background: white;
}

#transfer-amount {
    font-size: 20px;
    padding: 12px 16px;
}

#transfer-amount::placeholder {
    font-size: 14px;
    font-weight: 600;
    color: #a0a0a0;
}

/* Override generic modal-content for transfer modal */
#transfer-modal .modal-content {
    height: auto !important;
    padding: 18px !important;
    justify-content: flex-start !important;
    background: white !important;
    border-radius: 20px !important;
    overflow: visible !important;
}

#transfer-modal .modal-content::before {
    display: none !important;
}

#transfer-modal .input-group {
    margin-bottom: 2px !important;
}

.method-selector p {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 12px;
}

.method-options {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
}

.method-btn {
    flex: 1;
    background: #f8f8f8;
    border: 2px solid transparent;
    padding: 15px;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.method-btn i {
    width: 24px;
}

.method-btn span {
    font-size: 12px;
    font-weight: 600;
}

.method-btn.active {
    background: white;
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 5px 15px color-mix(in srgb, var(--primary) 30%, transparent);
}

#save-btn {
    width: 35px;
    /* Thu nhỏ 50% */
    height: 35px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 0 auto;
    /* Đẩy sang bên phải */
    font-size: 12px;
    /* Thu nhỏ chữ cho vừa nút */
}

.primary-btn {
    width: 100%;
    padding: 18px;
    border-radius: 20px;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 20px color-mix(in srgb, var(--primary) 30%, transparent);
}

.action-btn {
    background: none;
    border: none;
    padding: 10px;
    width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-light);
    cursor: pointer;
    margin: 0 auto 20px auto;
}

/* History List */
.history-section {
    margin-top: 10px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.home-history-title {
    font-size: 15px;
    color: var(--text-light);
    font-weight: 600;
}

/* Adjust for web specifically if needed */
body.web-layout .home-history-title {
    font-size: 18px;
    color: var(--primary);
    font-weight: 700;
}

.history-item {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.history-item:active {
    transform: scale(0.98);
}

.item-icon {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    color: var(--primary);
    overflow: hidden;
    /* Để ảnh bo góc tròn theo container */
}

.item-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-info {
    flex: 1;
}

.item-info h4 {
    font-size: 15px;
    font-weight: 600;
}

.item-info p {
    font-size: 12px;
    color: var(--text-light);
}

.item-amount {
    font-weight: 700;
    font-size: 15px;
}

.item-amount.income {
    color: #48c5c1;
}

.item-amount.expense {
    color: var(--primary);
}

.hidden {
    display: none !important;
}

/* Thống kê - Slider ngang */
.stats-slider {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 16px;
    padding: 10px 20px 30px 20px;
    margin: 0 -24px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    cursor: grab;
    user-select: none;
    touch-action: pan-x;
    /* Đảm bảo trình duyệt ưu tiên lướt ngang */
}

.stats-slider:active {
    cursor: grabbing;
}

.stats-slider::-webkit-scrollbar {
    display: none;
}

.stats-card-item {
    flex: 0 0 92%;
    /* Phóng to gần hết chiều ngang */
    min-width: 300px;
    aspect-ratio: 1 / 1.1;
    background: url('assets/images/khungchitieu.png') no-repeat center;
    background-size: contain;
    /* Đảm bảo ảnh không bị méo */
    padding: 50px 40px 40px 40px;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 10px 15px color-mix(in srgb, var(--primary) 30%, transparent));
}

.stats-card-item:active {
    transform: scale(0.98);
}

/* Image Overlay */
.image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    transition: opacity 0.3s ease;
}

.image-overlay.hidden {
    display: none;
    opacity: 0;
}

.image-overlay img {
    max-width: 90%;
    max-height: 80%;
    border-radius: 15px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.image-overlay:not(.hidden) img {
    transform: scale(1);
}

/* Settings Tab Styles */
.settings-profile {
    text-align: center;
    margin-bottom: 35px;
}

.avatar-wrapper {
    width: 110px;
    height: 110px;
    background: var(--bg-color);
    /* Light pink background */
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 5px solid white;
    box-shadow: 0 10px 25px color-mix(in srgb, var(--primary) 30%, transparent);
}

.avatar-wrapper i {
    width: 55px;
    height: 55px;
    color: var(--primary);
}

.user-name {
    color: var(--primary);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.user-email {
    color: var(--text-light);
    font-size: 14px;
    font-weight: 500;
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-item {
    background: white;
    padding: 18px 20px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-item:active {
    transform: scale(0.97);
    background: var(--bg-color);
}

.item-icon-pink {
    width: 44px;
    height: 44px;
    background: var(--bg-color);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.item-icon-pink i {
    width: 22px;
    height: 22px;
}

.item-text {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: #555;
}

.chevron {
    width: 18px;
    height: 18px;
    color: #ccc;
}

.logout {
    margin-top: 10px;
}

.logout-icon {
    background: #fff2f2;
    color: #ff5e5e;
}

.logout-text {
    color: #ff5e5e;
}

/* Toggle Switch Styles */
.toggle-switch {
    width: 44px;
    height: 24px;
    background: #e0e0e0;
    border-radius: 20px;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.toggle-switch.active {
    background: var(--primary);
}

.toggle-dot {
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toggle-switch.active .toggle-dot {
    left: 23px;
}

/* Security Sub-page Styles */
.back-btn {
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    cursor: pointer;
}

.security-card {
    background: linear-gradient(135deg, #fff, var(--bg-color));
    border-radius: var(--radius);
    padding: 25px;
    text-align: center;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
    border: 1px solid var(--bg-color);
}

.security-icon-large {
    width: 70px;
    height: 70px;
    background: var(--bg-color);
    border-radius: 20px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.security-header h3 {
    margin-bottom: 5px;
}

.security-header p {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 20px;
}

.security-header .toggle-switch {
    margin: 0 auto;
}

.security-options {
    transition: all 0.3s ease;
}

.disabled-area {
    opacity: 0.5;
    filter: grayscale(0.5);
    transition: all 0.3s;
}

.security-type-item {
    background: white;
    padding: 15px 20px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.security-type-item.active {
    border-color: var(--primary);
    background: var(--bg-color);
}

.type-icon {
    width: 44px;
    height: 44px;
    background: #f8f8f8;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.active .type-icon {
    background: var(--bg-color);
    color: var(--primary);
}

.type-info {
    flex: 1;
}

.type-info h5 {
    font-size: 15px;
    color: #444;
}

.type-info p {
    font-size: 11px;
    color: var(--text-light);
}

.type-check {
    display: none;
    color: var(--primary);
}

.active .type-check {
    display: block;
}

/* Security Entry Modal Styles */
.security-entry {
    max-width: 350px !important;
    height: auto !important;
    padding: 30px !important;
}

.security-entry::before {
    background: white !important;
    border-radius: 40px !important;
}

.pin-display {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.pin-dot {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #eee;
    transition: all 0.2s;
}

.pin-dot.active {
    background: var(--primary);
    transform: scale(1.2);
    box-shadow: 0 0 10px color-mix(in srgb, var(--primary) 30%, transparent);
}

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 10px;
}

.key,
.key-del {
    background: #f9f9f9;
    border: none;
    height: 60px;
    border-radius: 15px;
    font-size: 20px;
    font-weight: 700;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.key:active,
.key-del:active {
    background: var(--bg-color);
    color: var(--primary);
    transform: scale(0.95);
}

.key-del {
    color: #ff5e5e;
}

.pattern-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    touch-action: none;
    /* Prevent scrolling while drawing */
}

.pattern-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    place-items: center;
}

.pattern-grid .dot {
    width: 18px;
    height: 18px;
    background: #ddd;
    border-radius: 50%;
    position: relative;
    transition: all 0.2s;
    pointer-events: none;
    /* Let the grid handle touch events */
}

.pattern-grid .dot.active {
    background: var(--primary);
    transform: scale(1.3);
}

.pattern-grid .dot.active::after {
    content: '';
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    opacity: 0.2;
}

/* Toast Styles */
.kute-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: white;
    padding: 12px 24px;
    border-radius: 20px;
    box-shadow: 0 10px 25px color-mix(in srgb, var(--primary) 30%, transparent);
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
    z-index: 5000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    border: 2px solid var(--bg-color);
}

.kute-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* App Lock Screen Styles */
.lock-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-color), var(--bg-color));
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-out;
}

.lock-screen.hidden {
    opacity: 0;
    pointer-events: none;
    /* Do not use display: none here so animation works */
}

.lock-content {
    text-align: center;
    width: 100%;
    max-width: 350px;
    padding: 20px;
}

.lock-content h2 {
    color: var(--primary);
    font-family: 'KoniBlack', sans-serif;
    font-size: 32px;
    margin-bottom: 5px;
}

.error-shake {
    animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* =========================================
   WEB DESKTOP LAYOUT OVERRIDES
   Scoped entirely under body.web-layout
   so Android layout is NEVER affected.
   ========================================= */

/* ---------- Base ---------- */
body.web-layout {
    background: linear-gradient(160deg,
            color-mix(in srgb, var(--primary) 6%, white),
            color-mix(in srgb, var(--primary) 12%, #f8f8f8));
    height: 100vh;
    overflow: hidden;
}

/* ---------- App Container — full viewport ---------- */
body.web-layout .app-container {
    max-width: 100%;
    width: 100%;
    height: 100vh;
    margin: 0;
    border-radius: 0;
    flex-direction: row;
    overflow: hidden;
    background: transparent;
}

/* ---------- Sidebar Navigation ---------- */
body.web-layout .bottom-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 240px;
    height: 100vh;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 30px 0 20px;
    border-top: none;
    border-radius: 0;
    border-right: 1px solid color-mix(in srgb, var(--primary) 10%, transparent);
    background: var(--card-bg);
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(20px);
    z-index: 200;
    gap: 4px;
}

/* App brand area at the top of sidebar */
body.web-layout .bottom-nav::before {
    content: 'Smoney';
    display: block;
    font-family: 'KoniBlack', sans-serif;
    font-size: 28px;
    color: var(--primary);
    padding: 10px 30px 30px;
    border-bottom: 1px solid color-mix(in srgb, var(--primary) 8%, transparent);
    margin-bottom: 15px;
}

body.web-layout .nav-item {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    padding: 14px 30px;
    margin: 2px 12px;
    width: auto;
    gap: 14px;
    flex: none;
    border-radius: 12px;
    transition: all 0.2s ease;
    position: relative;
}

body.web-layout .nav-item:hover {
    background: color-mix(in srgb, var(--primary) 6%, transparent);
}

body.web-layout .nav-item i {
    margin-bottom: 0;
    width: 22px;
    height: 22px;
}

body.web-layout .nav-item span {
    display: block;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

body.web-layout .nav-item.active {
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--primary);
    transform: none;
    border-radius: 12px;
}

body.web-layout .nav-item.active i {
    fill: color-mix(in srgb, var(--primary) 25%, transparent);
}

body.web-layout .nav-item.active span {
    color: var(--primary);
}

/* ---------- Main Content ---------- */
body.web-layout main {
    flex: 1;
    height: 100vh;
    overflow-y: auto;
    margin-left: 240px;
    padding: 36px 48px 36px;
    padding-bottom: 40px;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--primary) 20%, transparent) transparent;
}

body.web-layout main::-webkit-scrollbar {
    display: block;
    width: 6px;
}

body.web-layout main::-webkit-scrollbar-track {
    background: transparent;
}

body.web-layout main::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--primary) 18%, transparent);
    border-radius: 10px;
}

/* ---------- Unified Centered Layout for Web ---------- */
body.web-layout main>header,
body.web-layout main>.balance-card,
body.web-layout main>.funds-grid,
body.web-layout main>.stats-grid,
body.web-layout main>.history-section,
body.web-layout main>.stat-card,
body.web-layout main>.hero-buttons,
body.web-layout main>.ben-container,
body.web-layout main>.settings-item {
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
}

body.web-layout main>header {
    margin-bottom: 35px !important;
    text-align: left;
}

/* ---------- Home: Balance Card ---------- */
body.web-layout .balance-card {
    padding: 40px;
    border-radius: 24px;
    margin-bottom: 25px;
    /* Giảm margin dưới vì có funds-grid */
}

/* ---------- Transaction List ---------- */
body.web-layout .transaction-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

body.web-layout .transaction-item,
body.web-layout .history-item {
    border-radius: 18px;
    padding: 18px 24px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

/* ---------- Modals ---------- */
body.web-layout .modal-content {
    max-width: 480px !important;
    border-radius: 20px !important;
}

/* ---------- Settings ---------- */
body.web-layout .settings-item {
    border-radius: 16px;
    padding: 18px 20px;
}

/* ---------- Toast position (avoid sidebar) ---------- */
body.web-layout .kute-toast {
    left: calc(50% + 120px);
}

/* ---------- Stats: Smaller cards on web ---------- */
body.web-layout .stats-slider {
    display: flex;
    flex-wrap: wrap;
    overflow-x: visible;
    overflow-y: visible;
    gap: 20px;
    padding: 10px 0 30px;
    margin: 0;
    scroll-snap-type: none;
    cursor: default;
    justify-content: center;
}

body.web-layout .stats-card-item {
    flex: 0 0 420px;
    min-width: 380px;
    max-width: 480px;
    aspect-ratio: 1 / 1.1;
    padding: 50px 40px 40px;
    filter: drop-shadow(0 10px 15px color-mix(in srgb, var(--primary) 20%, transparent));
}

body.web-layout .stats-card-item .item-amount {
    font-size: 26px !important;
}

body.web-layout .stats-card-item .item-info h4 {
    font-size: 17px !important;
}

/* ---------- Transaction: Web Transfer Button ---------- */
body.web-layout .web-transfer-btn {
    position: relative !important;
    bottom: auto !important;
    right: auto !important;
    background-image: none !important;
    /* Remove cen.png background */
    display: flex !important;
    width: 350px !important;
    /* Match visual width of income/expense images */
    height: 60px !important;
    margin: 20px auto 0 auto;
    border-radius: 30px !important;
    border: 2px solid var(--primary) !important;
    background-color: white !important;
    color: var(--primary) !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

body.web-layout .web-transfer-btn:hover {
    background-color: var(--primary) !important;
    color: white !important;
}

/* ==========================================
   PHONE EMULATOR (Dev only)
   Trigger: ?emulate=1 in URL
   ========================================== */
body.emulator-mode {
    background: #1a1a1a;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255, 143, 177, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(255, 143, 177, 0.1) 0%, transparent 40%);
    height: 100vh;
    width: 100vw;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-family: 'Outfit', sans-serif;
}

/* The outer frame container */
.phone-emulator-frame {
    position: relative;
    width: 380px;
    height: 780px;
    z-index: 9999;
    filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.5));
    animation: phoneBounce 1s ease-out;
}

@keyframes phoneBounce {
    0% {
        transform: translateY(50px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* The actual phone body */
.phone-case {
    position: relative;
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    border-radius: 55px;
    padding: 12px;
    box-sizing: border-box;
    border: 3px solid #222;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.1);
}

/* Screen container where the app lives */
.phone-screen-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 45px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* The app container itself inside the screen */
body.emulator-mode .app-container {
    width: 100%;
    height: 100%;
    position: relative;
    margin: 0;
    max-width: none;
    border-radius: 0;
    box-shadow: none;
}

/* Notch / Dynamic Island style */
.phone-notch {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 25px;
    background: #000;
    border-radius: 20px;
    z-index: 10000;
}

/* Hardware buttons */
.phone-buttons .button-vol-up,
.phone-buttons .button-vol-down,
.phone-buttons .button-power {
    position: absolute;
    background: #111;
    width: 4px;
    border-radius: 2px 0 0 2px;
}

.phone-buttons .button-vol-up {
    top: 120px;
    left: -4px;
    height: 50px;
}

.phone-buttons .button-vol-down {
    top: 180px;
    left: -4px;
    height: 50px;
}

.phone-buttons .button-power {
    top: 140px;
    right: -4px;
    height: 70px;
    border-radius: 0 2px 2px 0;
}

/* Hide emulator frame in normal or web-layout modes */
body:not(.emulator-mode) .phone-emulator-frame {
    display: none;
}

/* Ensure bottom nav stays inside the phone screen */
body.emulator-mode .bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding-bottom: 20px;
    /* Space for the bottom curve */
}