.welcome-section {
    background: linear-gradient(135deg, #007DB3 0%, #056C99 100%);
    color: white;
    overflow: hidden;
    position: relative;
}

.welcome-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    min-height: 400px;
    padding: 60px 40px;
    gap: 20px;
}

.welcome-text h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    line-height: 1.2;
}

.welcome-text p {
    font-size: 1.3rem;
    opacity: 0.9;
    line-height: 1.6;
}

.welcome-image {
    position: relative;
    text-align: center;
    height: 150px; /* Chiều cao cố định cho div, dễ responsive */
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 50%, #90CAF9 100%); /* Gradient xanh nhạt sáng, tự tạo */
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-placeholder {
    position: absolute;
    max-height: 60%;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit; /* Kế thừa gradient từ parent */
}

.wave-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, rgba(255,255,255,0.6) 0%, transparent 100%); /* Sóng trắng nhạt dưới cùng */
    border-radius: 0 0 15px 15px;
}

.image-overlay {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.25), rgba(255, 179, 71, 0.2)); /* Giữ vàng nhạt ấm */
    padding: 15px 25px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 215, 0, 0.3);
    z-index: 2; /* Đảm bảo overlay nổi lên */
}

@keyframes pulse-scale {
    0%, 100% { transform: scale(1.0); }
    50% { transform: scale(1.1); } /* To nhỏ nhẹ, chú ý mà không rối */
}

.image-overlay h2 {
    color: #333;
    font-size: 1.2rem;
    margin: 0;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    font-weight: 600;
    animation: pulse-scale 2s ease-in-out infinite; /* Áp dụng animation, lặp vô tận */
}

.dashboard-section {
    padding: 40px;
    background: white;
    border-bottom: 1px solid #e9ecef;
}

.user-overview {
    max-width: 1200px;
    margin: 0 auto;
}

.overview-header {
    text-align: center;
    margin-bottom: 40px;
}

.overview-header h2 {
    color: #333;
    font-size: 2.2rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.overview-header p {
    color: #666;
    font-size: 1.1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.stat-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    border-left: 5px solid;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    opacity: 0.05;
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.stat-card.primary {
    border-left-color: #007DB3;
}

.stat-card.primary::before {
    background: #007DB3;
}

.stat-card.success {
    border-left-color: #28a745;
}

.stat-card.success::before {
    background: #28a745;
}

.stat-card.info {
    border-left-color: #17a2b8;
}

.stat-card.info::before {
    background: #17a2b8;
}

.stat-card.warning {
    border-left-color: #ffc107;
}

.stat-card.warning::before {
    background: #ffc107;
}

.stat-icon {
    width: 70px;
    height: 70px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.stat-card.primary .stat-icon {
    background: rgba(0, 125, 179, 0.1);
    color: #007DB3;
}

.stat-card.success .stat-icon {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.stat-card.info .stat-icon {
    background: rgba(23, 162, 184, 0.1);
    color: #17a2b8;
}

.stat-card.warning .stat-icon {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.stat-info {
    flex: 1;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #333;
    line-height: 1;
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 1rem;
    font-weight: 500;
}

.stat-trend {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.stat-trend.positive {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.stat-trend.premium {
    background: rgba(23, 162, 184, 0.1);
    color: #17a2b8;
}

.stat-trend.spent {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.stat-trend:not(.positive):not(.premium):not(.spent) {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

.actions-section {
    padding: 50px 40px;
    background: #f8f9fa;
}

.actions-header {
    text-align: center;
    margin-bottom: 50px;
}

.actions-header h2 {
    color: #333;
    font-size: 2.2rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.actions-header p {
    color: #666;
    font-size: 1.1rem;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.action-card {
    background: white;
    border-radius: 20px;
    padding: 35px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.4s ease;
    border: 2px solid transparent;
    display: flex;
    align-items: flex-start;
    gap: 25px;
    position: relative;
    overflow: hidden;
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    transition: all 0.3s ease;
}

.action-card.primary::before {
    background: linear-gradient(135deg, #007DB3 0%, #056C99 100%);
}

.action-card.success::before {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.action-card.info::before {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.action-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.action-card.primary:hover {
    border-color: #007DB3;
}

.action-card.success:hover {
    border-color: #28a745;
}

.action-card.info:hover {
    border-color: #17a2b8;
}

.card-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.action-card.primary .card-icon {
    background: rgba(0, 125, 179, 0.1);
    color: #007DB3;
}

.action-card.success .card-icon {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.action-card.info .card-icon {
    background: rgba(23, 162, 184, 0.1);
    color: #17a2b8;
}

.action-card:hover .card-icon {
    transform: scale(1.1);
}

.card-content {
    flex: 1;
}

.card-content h3 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 12px;
    font-weight: 600;
}

.card-content p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 1rem;
}

.card-features {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-features span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #495057;
}

.card-features i {
    width: 16px;
    color: #28a745;
    font-size: 0.8rem;
}

.card-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    align-self: center;
}

.action-card.primary .card-arrow {
    background: rgba(0, 125, 179, 0.1);
    color: #007DB3;
}

.action-card.success .card-arrow {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.action-card.info .card-arrow {
    background: rgba(23, 162, 184, 0.1);
    color: #17a2b8;
}

.action-card:hover .card-arrow {
    transform: translateX(5px);
}

.features-section {
    padding: 50px 40px;
    background: white;
}

.features-header {
    text-align: center;
    margin-bottom: 50px;
}

.features-header h2 {
    color: #333;
    font-size: 2.2rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.features-header p {
    color: #666;
    font-size: 1.1rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 35px;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-item {
    text-align: center;
    padding: 30px 25px;
    border-radius: 15px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    border: 2px solid transparent;
}

.feature-item:hover {
    background: white;
    border-color: #007DB3;
    box-shadow: 0 10px 30px rgba(0, 125, 179, 0.1);
    transform: translateY(-5px);
}

.feature-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007DB3 0%, #056C99 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 20px;
    transition: all 0.3s ease;
}

.feature-item:hover .feature-icon {
    transform: scale(1.1);
    box-shadow: 0 10px 25px rgba(0, 125, 179, 0.3);
}

.feature-item h4 {
    color: #333;
    font-size: 1.3rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.feature-item p {
    color: #666;
    line-height: 1.6;
    font-size: 1rem;
}
.welcome-text h1 {
    color: white;
}
@media (max-width: 1024px) {
    .welcome-content {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 50px 30px;
    }
    
    .welcome-text h1 {
        font-size: 2.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .actions-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .welcome-content {
        padding: 40px 20px;
    }
    
    .welcome-text h1 {
        font-size: 2rem; /* Giữ nguyên, hoặc giảm xuống 1.9rem nếu cần gọn hơn */
        flex-direction: row; /* Thay column thành row để icon + text nằm ngang */
        gap: 8px; /* Giảm gap từ 10px xuống 8px để dính sát hơn */
        align-items: center; /* Giữ align center để icon giữa text */
        line-height: 1.1; /* Giảm line-height để text ngắn gọn, không tràn */
    }
    
    .welcome-text p {
        font-size: 1.1rem; /* Giữ nguyên, hoặc giảm xuống 1rem nếu muốn siêu gọn */
        line-height: 1.4; /* Giảm line-height để p ngắn hơn */
    }
    
    .dashboard-section,
    .actions-section,
    .features-section {
        padding: 30px 20px;
        margin-bottom: 6rem;
    }
    
    .overview-header h2,
    .actions-header h2,
    .features-header h2 {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .action-card {
        padding: 25px;
        flex-direction: row;
        text-align: center;
        gap: 20px;
    }
    
    .card-arrow {
        align-self: center;
    }
    
    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 25px;
    }
    
    .feature-item {
        padding: 25px 20px;
    }
}

@media (max-width: 576px) {
    .welcome-text h1 {
        font-size: 1.8rem;
    }
    
    .image-overlay h2 {
        font-size: 1rem;
    }
    
    .stat-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .card-icon {
        width: 70px;
        height: 70px;
        font-size: 2rem;
    }
    
    .feature-icon {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
}
/* Letter Popup Styles */
.letter-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.letter-popup.active {
    opacity: 1;
    visibility: visible;
}

.letter-container {
    background: #f9f7f4;
    width: 90%;
    max-width: 600px;
    border-radius: 15px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.8) rotateY(-10deg);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 3px solid #d4af37;
    background-image: 
        linear-gradient(45deg, transparent 24%, rgba(255, 255, 255, 0.1) 25%, rgba(255, 255, 255, 0.1) 26%, transparent 27%),
        linear-gradient(-45deg, transparent 24%, rgba(255, 255, 255, 0.1) 25%, rgba(255, 255, 255, 0.1) 26%, transparent 27%);
    background-size: 20px 20px;
    max-height: 90vh;
overflow-y: auto;
}

.letter-popup.active .letter-container {
    transform: scale(1) rotateY(0deg);
}

.letter-header {
    display: flex;
align-items: center;
justify-content: center;
    background: linear-gradient(135deg, #007DB3 0%, #056C99 100%);
    padding: 25px 30px;
    border-radius: 12px 12px 0 0;
    position: relative;
    overflow: hidden;
}

.letter-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><defs><pattern id="stamp" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="2" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="20" fill="url(%23stamp)"/></svg>');
    opacity: 0.3;
}

.letter-title {
    text-align: center; 
    margin: 0 auto; 
    color: white;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.letter-stamp {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 60px;
    height: 45px;
    background: #dc3545;
    border: 2px dashed white;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: white;
    font-weight: bold;
    transform: rotate(15deg);
    z-index: 3;
}

.letter-content {
    padding: 35px 35px;
    background: #fff;
    position: relative;
}

.letter-content::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgb(194, 25, 25);
}

.letter-greeting {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
}

.letter-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
    margin-bottom: 25px;
    text-align: justify;
}

.letter-body p {
    margin-bottom: 15px;
}

.letter-signature {
    text-align: right;
    margin-top: 30px;
    padding-right: 20px;
}

.signature-line {
    font-family: 'Brush Script MT', cursive;
    font-size: 1.5rem;
    color: #007DB3;
    margin-bottom: 5px;
}

.signature-title {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

.letter-wax-seal {
    position: absolute;
    bottom: -20px;
    right: 40px;
    width: 40px;
    height: 40px;
    background: #d4af37;
    border-radius: 50%;
    border: 3px solid #b8941f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #8b7319;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

.close-letter {
    position: absolute;
    top: 15px;
    right: 5px;
    width: 35px;
    height: 35px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 4;
}

.close-letter:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

@media (max-width: 768px) {
    .letter-container {
        width: 95%;
        margin: 20px;
    }
    
    .letter-header {
        padding: 20px 25px;
    }
    
    .letter-title {
        font-size: 1.4rem;
    }
    
    .letter-content {
        padding: 30px 25px;
    }
    
    .letter-stamp {
        width: 50px;
        height: 38px;
        font-size: 0.8rem;
    }
}
.stat-sub-info {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
    color: #555;
}

.sub-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #dc3545; /* Màu đỏ để phân biệt điểm đã sử dụng */
}

.sub-label {
    font-size: 0.9rem;
    color: #777;
}

/* Tối ưu mobile */
@media (max-width: 768px) {
    .close-letter{
        right: -5px;

    }
    .stat-card {
        flex-direction: row;
        align-items: center;
        text-align: center;
        gap: 15px;
    }
    
    .stat-info {
        width: 100%;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .sub-number {
        font-size: 1.2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr; /* Một cột trên mobile nhỏ */
        gap: 20px;
    }
}

@media (max-width: 576px) {
    .stat-number {
        font-size: 1.8rem;
    }
    
    .sub-number {
        font-size: 1rem;
    }
}