.affiliate-dashboard-wrapper,
.withdrawal-modal {
    font-family: sans-serif;
}

/* =====================================================
   Affiliate Top Card
   ===================================================== */

.affiliate-card {
    background: linear-gradient(135deg, #101ec7 0%, #ccff00 100%);
    border-radius: 20px;
    padding: 40px;
    color: #fff;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, .15);
}

.affiliate-card::after {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 250px;
    height: 250px;
    background: rgba(255, 255, 255, .08);
    border-radius: 50%;
}

.affiliate-code-box {
    background: rgba(255, 255, 255, .15);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 16px;
    padding: 30px;
    margin-top: 25px;
}

.affiliate-code {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 12px;
}

.copy-btn {
    background: #fff;
    color: #667eea;
    border: none;
    padding: 12px 35px;
    border-radius: 30px;
    font-weight: 600;
    transition: .3s ease;
}

.copy-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, .2);
}

.info-badge {
    background: rgba(255, 255, 255, .2);
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: 500;
    display: inline-block;
    backdrop-filter: blur(8px);
}


/* =====================================================
   Stats Cards
   ===================================================== */

.stats-card {
    background: #fff;
    border-radius: 18px;
    padding: 28px;
    height: 100%;
    border: 1px solid #f0f0f0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, .05);
    transition: .3s ease;
}

.stats-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, .08);
}

.stats-icon {
    width: 55px;
    height: 55px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .1);
}

.stats-value {
    font-size: 30px;
    font-weight: 700;
    color: #222;
}

.stats-label {
    color: #777;
    font-size: 14px;
    margin-top: 5px;
}


/* =====================================================
   Cards
   ===================================================== */

.card {
    border: none;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .05);
    overflow: hidden;
}

.card-header {
    border-bottom: 1px solid #f1f1f1;
    padding: 20px 25px;
    font-weight: 600;
    font-size: 16px;
}

.card-body {
    padding: 25px;
}


/* =====================================================
   Buttons
   ===================================================== */

.withdraw-btn {
    background: linear-gradient(135deg, #0d1cc1 0%, #ccff00 100%);
    color: #fff;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-weight: 600;
    transition: .3s ease;
    font-size: 15px;
    width: 100%;
}

.withdraw-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, .35);
}


/* =====================================================
   Transaction Table
   ===================================================== */

.transaction-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.transaction-table thead th {
    background: #f9fafc;
    padding: 18px;
    font-weight: 600;
    color: #444;
    border-bottom: 1px solid #eee;
}

.transaction-table tbody td {
    padding: 18px;
    border-bottom: 1px solid #f3f3f3;
    vertical-align: middle;
}

.transaction-table tbody tr {
    transition: background .2s ease;
}

.transaction-table tbody tr:hover {
    background: #fafbff;
}

.transactions-scroll {
    max-height: 250px;
    overflow-y: auto;
}

.transactions-scroll thead th {
    position: sticky;
    top: 0;
    background: #f9fafc;
    z-index: 2;
}

/* scrollbar */

.transactions-scroll::-webkit-scrollbar {
    width: 6px;
}

.transactions-scroll::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}


/* =====================================================
   Badges
   ===================================================== */

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #e6f9f0;
    color: #00a86b;
}

.badge-warning {
    background: #fff5e6;
    color: #d68910;
}

.badge-info {
    background: #eef3ff;
    color: #4a6cf7;
}


/* =====================================================
   Withdrawal Modal
   ===================================================== */

.withdrawal-modal .modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .15);
}

.withdrawal-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 20px 20px 0 0;
    padding: 20px 25px;
}

.withdrawal-modal .modal-body {
    padding: 25px;
}

.amount-input {
    width: 100%;
    border-radius: 12px;
    padding: 16px 18px;
    border: 1px solid #ddd;
    font-size: 16px;
    transition: .3s;
}

.amount-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, .1);
    outline: none;
}


/* =====================================================
   Referral Timeline
   ===================================================== */

.referrals-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.referral-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
    transition: .3s ease;
}

.referral-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}

.referral-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: .2s ease;
}

.referral-header:hover {
    background: #f1f3f5;
}

.referral-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.referral-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
}

.referral-info h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
}

.referral-info p {
    margin: .25rem 0 0;
    font-size: .85rem;
    color: #718096;
}

.referral-stats {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-badge {
    background: #e2e8f0;
    padding: .35rem 0.5rem;
    border-radius: 20px;
    font-size: .85rem;
    color: #4a5568;
}

.completed-count {
    background: #48bb78;
    color: #fff;
    padding: .35rem 1rem;
    border-radius: 20px;
    font-size: .85rem;
    font-weight: 600;
}

.expired-badge {
    background: #f56565;
    color: #fff;
    padding: .35rem 1rem;
    border-radius: 20px;
    font-size: .85rem;
}

.arrow-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 50%;
    color: #667eea;
    transition: transform .3s ease;
}

.arrow-icon.rotated {
    transform: rotate(180deg);
}


/* =====================================================
   Campaign Timeline
   ===================================================== */

.referral-campaigns {
    padding: 1.5rem;
    background: #fff;
    border-top: 1px solid #e9ecef;
}

.campaign-timeline {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.campaign-timeline:last-child {
    margin-bottom: 0;
}

.campaign-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: .5rem;
    cursor: pointer;
    border-radius: 8px;
    transition: .2s ease;
    padding: 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.2s;
}

.campaign-header:hover {
    background: #f1f5f9;
}

.campaign-title {
    font-weight: 600;
    color: #2d3748;
}

.campaign-role {
    font-size: .8rem;
    padding: .25rem .75rem;
    border-radius: 15px;
    background: #667eea;
    color: #fff;
}

.campaign-id {
    font-family: monospace;
}


/* timeline steps */

.timeline-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 12px;
    position: relative;
    padding-left: 2rem;
}

.timeline-steps::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 4px;
    bottom: 24px;
    width: 2px;
    background: #cbd5e0;
}

.timeline-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    position: relative;
}

.step-icon {
    width: 32px;
    height: 32px;
    background: #fff;
    border: 2px solid #cbd5e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0aec0;
    font-size: 1rem;
    z-index: 1;
    flex-shrink: 0;
}

.timeline-step.completed .step-icon {
    background: #ccff00;
    border-color: #000;
    color: #000;
}

.timeline-step.current .step-icon {
    animation: pulse 2s infinite;
}

.timeline-step.current .step-title {
    font-weight: 700;
}

.step-content {
    flex: 1;
    padding-bottom: 1rem;
}

.step-title {
    font-weight: 500;
    color: #2d3748;
    margin-bottom: .25rem;
}

.step-date {
    font-size: .85rem;
    color: #718096;
}

.step-amount {
    display: inline-block;
    margin-top: .25rem;
    padding: .2rem .75rem;
    background: #fef3c7;
    color: #d97706;
    border-radius: 15px;
    font-size: .8rem;
    font-weight: 600;
}

.step-pending {
    display: flex;
    align-items: center;
    gap: .25rem;
    margin-top: .25rem;
}

.step-pending i {
    font-size: .75rem;
}

.status-badge {
    transition: .2s ease;
}

.status-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
}

.no-campaigns {
    text-align: center;
    padding: 2rem;
    color: #718096;
    background: #f8fafc;
    border-radius: 10px;
}

/* =====================================================
   Animations
   ===================================================== */

@keyframes pulse {

    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, .4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }

}


/* =====================================================
   Responsive
   ===================================================== */

@media (max-width:768px) {

    .affiliate-card {
        padding: 25px;
    }

    .affiliate-code {
        font-size: 26px;
    }

    .referral-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .referral-stats {
        width: 100%;
        justify-content: space-between;
    }

    .timeline-steps {
        padding-left: 1rem;
    }

}

/* User History Page Styles */
.user-history-link {
    text-decoration: none;
}

.user-history-link:hover {
    text-decoration: none;
}

.user-avatar-large {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Campaign List Styles */
.campaigns-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* =====================================================
   Updated Timeline Filter Bar & Year Navigation
   ===================================================== */

.timeline-filter-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    flex-wrap: wrap;
}

.year-navigation {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 280px;
}

.years-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: thin;
    padding: 5px 0;
    flex: 1;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.years-container::-webkit-scrollbar {
    display: none;
    height: 4px;
}

.years-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.years-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.years-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.year-nav-btn {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #4a5568;
    flex-shrink: 0;
    font-size: 16px;
    padding: 0;
}

.year-nav-btn:hover:not(:disabled) {
    background: #f7fafc;
    border-color: #101ec7;
    color: #101ec7;
}

.year-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f7fafc;
}

/* Filter Chip - Updated to match your design */
.filter-chip {
    padding: 6px 14px;
    border-radius: 20px;
    background: #f1f5f9;
    cursor: pointer;
    font-size: 13px;
    transition: 0.25s;
    white-space: nowrap;
    border: 1px solid transparent;
    font-weight: 500;
}

.filter-chip:hover {
    background: #101ec7;
    color: #fff;
}

.filter-chip.active {
    background: #101ec7;
    color: #fff;
    border-color: #101ec7;
}

/* Month Dropdown - Enhanced */
.month-dropdown {
    position: relative;
    z-index: 1000;
    margin-left: auto;
}

.month-dropdown .btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    transition: all 0.2s;
}

.month-dropdown .btn:hover {
    background: #e2e8f0;
    border-color: #101ec7;
    color: #101ec7;
}

.month-dropdown .btn:focus {
    box-shadow: none;
    outline: none;
}

.month-dropdown .btn::after {
    margin-left: 8px;
}

.month-menu {
    overflow-y: auto;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    padding: 8px;
    min-width: 180px;
    max-height: 200px;
    border: 1px solid #e2e8f0;
}

.month-item {
    border-radius: 8px;
    font-size: 14px;
    padding: 8px 12px;
    margin: 2px 0;
    transition: 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    color: #4a5568;
}

.month-item:hover {
    background: #f1f5ff;
    color: #101ec7;
}

.month-item.active {
    background: #101ec7;
    color: #fff;
    font-weight: 600;
}

.month-item.active::after {
    content: "✓";
    font-size: 13px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .timeline-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .year-navigation {
        width: 100%;
        min-width: auto;
    }
    
    .month-dropdown {
        width: 100%;
        margin-left: 0;
    }
    
    .month-dropdown .btn {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .month-dropdown .btn::after {
        margin-left: auto;
    }
    
    .month-menu {
        width: 100%;
    }
    
    .years-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* For very small screens */
@media (max-width: 480px) {
    .filter-chip {
        padding: 5px 12px;
        font-size: 12px;
    }
    
    .year-nav-btn {
        width: 32px;
        height: 32px;
    }
}

/* Center pagination */
nav .pagination {
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 25px;
}

/* Page buttons */
.pagination .page-item .page-link {
    border: none;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 500;
    color: #101fc4;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: all 0.25s ease;
}

/* Hover effect */
.pagination .page-item .page-link:hover {
    background: #101fc4;
    color: #fff;
    transform: translateY(-2px);
}

/* Active page */
.pagination .page-item.active .page-link {
    background: #101fc4;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Disabled buttons */
.pagination .page-item.disabled .page-link {
    background: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
}

/* Previous / Next buttons */
.pagination .page-item:first-child .page-link,
.pagination .page-item:last-child .page-link {
    font-size: 18px;
    padding: 8px 16px;
}

/* Affiliate Wallet Panel */
.affiliate-wallet {
    width: 100%;
    max-width: 400px;
    background: #1322c7; /* deep blue base */
    color: #ccff00; /* lime accent */
    border-radius: 16px;
    padding: 24px 28px;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 15px;
}

/* Header */
.wallet-header {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wallet-center{
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.wallet-logo { width: 150px; }
.wallet-title { font-size: 14px; font-weight: 600; margin-top: 1px; color: #ffffff; }

/* Balance */
.wallet-balance {
    display: flex;
    flex-direction: column;
}
.label { font-size: 16px; font-weight: 600; }
.amount { font-size: 20px; font-weight: 600; color: #ddd; }

/* Toggle */
.wallet-toggle {
    display: grid;
    gap: 5px;
}
.toggle-wrapper {
    position: relative;
    width: 46px;
    height: 24px;
}
.toggle-wrapper input { display: none; }
.slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.4);
    border-radius: 50px;
    transition: 0.3s;
}
.slider:before {
    content: "";
    position: absolute;
    width: 20px; height: 20px;
    left: 2px; bottom: 2px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}
.toggle-wrapper input:checked + .slider { background: #ccff00; }
.toggle-wrapper input:checked + .slider:before { transform: translateX(22px); }
.toggle-text { font-size: 16px; font-weight: 600; }

/* Empty Wallet */
.affiliate-wallet-empty {
    width: 100%;
    max-width: 400px;
    background: #1322c7;
    border-radius: 16px;
    padding: 12px 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Inter', sans-serif;
    color: #fff;
    margin-bottom: 10px;
}

.no-balance-card {
    background-color: #ccff00;
    color: #000000;
    padding: 8px;
    border-radius: 1rem;
    font-weight: 500;
    display: inline-block;
}
.affiliate-wallet-empty .empty-logo { width: 130px; margin-top: 2px; }

.stats-row-fix {
    row-gap: 16px;
}

/* ===== STATS CARDS FIX ===== */

/* Equal height + clean layout */
.stats-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Fix spacing between rows */
.row.mb-4 {
    row-gap: 16px;
}

/* Tablet: 2 cards per row */
@media (max-width: 991px) {
    .row.mb-4 > div {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Mobile: 1 card per row */
@media (max-width: 575px) {
    .row.mb-4 > div {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .stats-card {
        padding: 14px;
    }

    .stats-value {
        font-size: 18px;
    }

    .stats-label {
        font-size: 12px;
    }

    .affiliate-code-box{
        text-align: center;
    }
}


/* ===== YOUR REFERRALS FIX ===== */

@media (max-width: 768px) {

    .referral-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        position: relative;
    }

    .referral-header-left {
        width: 100%;
    }

    .referral-info h4 {
        font-size: 14px;
    }

    .referral-info p {
        font-size: 12px;
    }

    .referral-avatar {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .referral-stats {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 6px;
    }

    .stat-badge,
    .completed-count,
    .expired-badge {
        font-size: 11px;
        padding: 4px 8px;
    }

    .arrow-icon {
        position: absolute;
        right: 10px;
        top: 10px;
        width: 26px;
        height: 26px;
    }

    .affiliate-code-box{
        text-align: center;
    }
}


/* ===== TIMELINE FIX ===== */

@media (max-width: 768px) {

    .campaign-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .campaign-title {
        font-size: 14px;
    }

    .campaign-role {
        font-size: 11px;
    }

    .timeline-steps {
        padding-left: 1.5rem;
    }

    .step-title {
        font-size: 13px;
    }

    .step-date {
        font-size: 11px;
    }

    .step-amount {
        font-size: 11px;
    }

    .affiliate-code-box{
        text-align: center;
    }
}


/* ===== FILTER BAR FIX ===== */

@media (max-width: 768px) {

    .timeline-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .year-navigation {
        width: 100%;
    }

    .years-container {
        overflow-x: auto;
    }

    .month-dropdown {
        width: 100%;
    }

    .month-dropdown .btn {
        width: 100%;
        justify-content: space-between;
    }

    .affiliate-code-box{
        text-align: center;
    }
}


/* ===== SMALL MOBILE POLISH ===== */

@media (max-width: 480px) {

    .affiliate-card {
        padding: 15px;
    }

    .affiliate-code {
        font-size: 18px;
    }

    .copy-btn {
        font-size: 12px;
        padding: 10px;
    }

    .card-header {
        font-size: 14px;
        padding: 12px;
    }

    .card-body {
        padding: 12px;
    }

    .affiliate-code-box{
        text-align: center;
    }
}