/* Affiliate add-on */
.affiliate-ref-code {
    font-size: 14px;
}
.affiliate-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}
.affiliate-status-unpaid {
    color: #b25e00;
    background: #fff2e0;
}
.affiliate-status-paid {
    color: #0b7a3e;
    background: #e3f7ec;
}
.affiliate-status-rejected {
    color: #c52127;
    background: #fdecec;
}
html[data-theme="dark"] .affiliate-ref-code {
    color: var(--dm-text-primary);
}

/* The shared table wrapper reserves a full screen height; these lists only need their rows. */
.responsive-table.affiliate-table {
    min-height: 0;
}

.affiliate-commission-help {
    margin: 0;
    padding-bottom: 12px;
    color: #667085;
    font-size: 14px;
}
html[data-theme="dark"] .affiliate-commission-help {
    color: var(--dm-text-secondary);
}
.affiliate-report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
    gap: 12px;
    padding: 0 16px 16px;
}
.affiliate-report-summary > div {
    padding: 14px;
    border: 1px solid #eaecf0;
    border-radius: 8px;
}
.affiliate-report-summary span {
    display: block;
    color: #667085;
    font-size: 13px;
}
.affiliate-report-summary strong {
    font-size: 20px;
}
html[data-theme="dark"] .affiliate-report-summary > div {
    border-color: var(--dm-border);
}
html[data-theme="dark"] .affiliate-report-summary span {
    color: var(--dm-text-secondary);
}

/* Referral code and sign-up link on Manage Links */
.affiliate-share-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    padding: 0 16px 16px;
}

.affiliate-share-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 14px 16px;
    border: 1px solid color-mix(in srgb, var(--clr-primary) 22%, #e5e7eb);
    border-inline-start: 4px solid var(--clr-primary);
    border-radius: 10px;
    background: color-mix(in srgb, var(--clr-primary) 5%, #fff);
}

.affiliate-share-item span {
    flex-basis: 100%;
    font-size: 13px;
    color: #4b5563;
}

.affiliate-share-item strong {
    flex: 1;
    min-width: 0;
    font-size: 16px;
    letter-spacing: 0.5px;
    color: #111827;
    overflow-wrap: anywhere;
}

.affiliate-share-item .affiliate-share-url {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
}

.affiliate-share-note {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 13px;
    color: #4b5563;
}

.affiliate-report-note {
    max-width: 900px;
    margin-top: 6px;
    font-size: 13px;
    color: #4b5563;
}

/* ---------- Affiliate sign-up page (left panel) ---------- */
.mybazar-login-section .afl-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: start;
}

.afl-hero-inner {
    width: 100%;
    max-width: 560px;
    padding: 24px;
}

.afl-hero-badge {
    display: inline-block;
    margin-bottom: 14px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--clr-primary);
    background: color-mix(in srgb, var(--clr-primary) 12%, #fff);
}

.afl-hero h1 {
    margin: 0 0 12px;
    font-size: 36px;
    font-weight: 800;
    line-height: 1.15;
    color: #111827;
}

.afl-hero p {
    margin: 0 0 24px;
    font-size: 16px;
    line-height: 1.6;
    color: #4b5563;
}

.afl-earn-card {
    position: relative;
    margin-bottom: 26px;
    padding: 20px 22px 18px;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(135deg, var(--clr-primary), color-mix(in srgb, var(--clr-primary) 45%, #1b1f3b));
    box-shadow: 0 24px 48px color-mix(in srgb, var(--clr-primary) 30%, transparent);
    animation: afl-float 6s ease-in-out infinite;
}

.afl-earn-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    opacity: 0.9;
}

.afl-earn-top em {
    padding: 4px 10px;
    border-radius: 999px;
    font-style: normal;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.18);
}

.afl-earn-card .afl-earn-total {
    display: block;
    color: #fff;
    margin: 6px 0 14px;
    font-size: 40px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.afl-earn-bars {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 70px;
}

.afl-earn-bars i {
    flex: 1;
    height: 100%;
    border-radius: 6px 6px 2px 2px;
    background: rgba(255, 255, 255, 0.85);
    transform-origin: bottom;
    animation: afl-bar 3.2s ease-in-out infinite;
}

.afl-earn-bars i:nth-child(1) { max-height: 30%; animation-delay: 0s; }
.afl-earn-bars i:nth-child(2) { max-height: 45%; animation-delay: 0.15s; }
.afl-earn-bars i:nth-child(3) { max-height: 38%; animation-delay: 0.3s; }
.afl-earn-bars i:nth-child(4) { max-height: 60%; animation-delay: 0.45s; }
.afl-earn-bars i:nth-child(5) { max-height: 55%; animation-delay: 0.6s; }
.afl-earn-bars i:nth-child(6) { max-height: 78%; animation-delay: 0.75s; }
.afl-earn-bars i:nth-child(7) { max-height: 100%; animation-delay: 0.9s; }

.afl-earn-toast {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    color: #111827;
    background: #fff;
    box-shadow: 0 12px 26px rgba(17, 24, 39, 0.18);
    opacity: 0;
    animation: afl-toast 8s ease-in-out infinite;
}

.afl-earn-toast .afl-toast-icon {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: #fff;
    background: #16a34a;
}

.afl-earn-toast-1 {
    top: -18px;
    inset-inline-end: -14px;
}

.afl-earn-toast-2 {
    bottom: -20px;
    inset-inline-start: -14px;
    animation-delay: 4s;
}

.afl-earn-toast-2 .afl-toast-icon {
    background: var(--clr-primary);
}

.afl-steps {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.afl-steps li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    opacity: 0;
    animation: afl-step-in 0.6s ease-out forwards;
}

.afl-steps li:nth-child(1) { animation-delay: 0.3s; }
.afl-steps li:nth-child(2) { animation-delay: 0.5s; }
.afl-steps li:nth-child(3) { animation-delay: 0.7s; }

.afl-steps .afl-step-no {
    flex: none;
    font-weight: 700;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 15px;
    color: var(--clr-primary);
    background: color-mix(in srgb, var(--clr-primary) 12%, #fff);
}

.afl-steps .afl-step-text {
    font-size: 14px;
    line-height: 1.45;
    color: #4b5563;
}

.afl-steps .afl-step-title {
    display: block;
    font-weight: 700;
    font-size: 15px;
    color: #111827;
}

/* Agree to the policy, and the policy window */
.afl-agree {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 4px 0 14px;
    font-size: 14px;
    color: #4b5563;
    cursor: pointer;
}

.afl-agree input {
    flex: none;
    width: 17px;
    height: 17px;
    margin-top: 2px;
    accent-color: var(--clr-primary);
}

.afl-agree a {
    color: var(--clr-primary);
    font-weight: 600;
}

.afl-policy-text {
    font-size: 14px;
    line-height: 1.7;
    color: #374151;
}

/* Super Admin › Affiliate › Settings */
.affiliate-settings-form {
    padding: 0 16px 16px;
}

.affiliate-settings-card {
    margin-bottom: 18px;
    padding: 18px 20px;
    border: 1px solid #eaecf0;
    border-radius: 12px;
}

.affiliate-settings-card h5 {
    margin-bottom: 6px;
    font-weight: 700;
}

.affiliate-switch-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0 16px;
    font-weight: 600;
}

.affiliate-settings-actions {
    display: flex;
    justify-content: flex-end;
}

@keyframes afl-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes afl-bar {
    0%, 100% { transform: scaleY(0.55); }
    50% { transform: scaleY(1); }
}

@keyframes afl-toast {
    0%, 8% { opacity: 0; transform: translateY(10px); }
    14%, 40% { opacity: 1; transform: translateY(0); }
    48%, 100% { opacity: 0; transform: translateY(-6px); }
}

@keyframes afl-step-in {
    from { opacity: 0; transform: translateX(-12px); }
    to { opacity: 1; transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .afl-earn-card,
    .afl-earn-bars i,
    .afl-earn-toast,
    .afl-steps li {
        animation: none;
        opacity: 1;
    }

    .afl-earn-toast-2 {
        display: none;
    }
}

/* Like the login page, the picture side is hidden on tablets and phones so the form has the full width. */
@media (max-width: 1200px) {
    .mybazar-login-section .afl-hero {
        display: none;
    }
}

.affiliate-paid-note {
    margin: 24px 0 0;
    font-weight: 600;
    text-align: center;
    color: #16a34a;
}

/* Period filter: keep the label clear of the arrow. */
.affiliate-filter select.affiliate-filter-period,
.affiliate-filter select.affiliate-filter-auto {
    min-width: 150px;
    padding-inline-start: 14px;
    padding-inline-end: 36px !important;
    text-align: start;
}

/* Report filter bar: Show on the left, search in the middle, date filter and CSV / PDF on the right. */
.affiliate-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    border-top: 1px solid #eaecf0;
}

.affiliate-filter-start,
.affiliate-filter-end {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.affiliate-filter-middle {
    flex: 1 1 260px;
    display: flex;
    justify-content: center;
}

.affiliate-filter-middle .table-search {
    width: 100%;
    max-width: 420px;
}

.affiliate-filter-middle .table-search input {
    padding-inline-end: 40px;
}

.affiliate-filter-middle .affiliate-filter-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    top: 4px;
    bottom: auto;
    width: 30px;
    height: calc(100% - 8px);
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    transform: none;
}

.affiliate-filter-end {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.affiliate-filter-middle {
    flex: 1 1 260px;
    display: flex;
    justify-content: center;
}

.affiliate-filter-middle .table-search {
    width: 100%;
    max-width: 420px;
}

.affiliate-filter-middle .table-search input {
    padding-inline-end: 40px;
}

.affiliate-filter-search-btn {
    position: absolute;
    top: 50%;
    inset-inline-end: 8px;
    display: inline-flex;
    padding: 4px;
    border: 0;
    color: #4d4d4d;
    background: transparent;
    transform: translateY(-50%);
}

.affiliate-filter-end {
    margin-inline-start: auto;
    justify-content: flex-end;
}

.affiliate-filter-export {
    display: flex;
    gap: 8px;
}

.affiliate-filter-export .export-btn {
    display: inline-flex;
}

.affiliate-filter-bar .custom-from-to input {
    min-width: 150px;
}

html[data-theme="dark"] .affiliate-filter-bar {
    border-color: var(--dm-border);
}

@media (max-width: 767.98px) {
    .affiliate-filter-middle,
    .affiliate-filter-end {
        flex-basis: 100%;
        justify-content: flex-start;
        margin-inline-start: 0;
    }

    .affiliate-filter-middle .table-search {
        max-width: none;
    }
}
