/* =========================================================
   AFFILIATE V2
   Ehon25k
   CLEAN CSS - DEDUPED + SHARE POPUP
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    background: #f5f7fb;
    color: #222;
    font-family: Arial, Helvetica, sans-serif;
}

#af-app,
.af-app {
    width: 100%;
    min-height: 100vh;
    background: #f5f7fb;
}


/* =========================================================
   CONTENT
========================================================= */

#afContent {
    padding: 18px;
    max-width: 1400px;
    margin: auto;
}


/* =========================================================
   CARD
========================================================= */

.af-card {
    background: #fff;
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .06);
}


/* =========================================================
   TITLE
========================================================= */

.af-card h2 {
    font-size: 24px;
    margin-bottom: 18px;
}

.af-card h3 {
    font-size: 18px;
    margin-bottom: 15px;
}


/* =========================================================
   INPUT
========================================================= */

.af-card input,
.af-card select {
    width: 100%;
    height: 48px;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 0 15px;
    margin-bottom: 15px;
    outline: none;
    background: #fff;
}

.af-card input:focus,
.af-card select:focus {
    border-color: #f26522;
}


/* =========================================================
   BUTTON
========================================================= */

.af-card button:hover {
    background: #d8571d;
}


/* =========================================================
   BUTTON COLOR
========================================================= */

.af-secondary {
    background: #f5f5f5 !important;
    color: #222 !important;
}

.af-danger {
    background: #ef4444 !important;
}


/* =========================================================
   EMPTY
========================================================= */

.af-empty {
    text-align: center;
    color: #888;
    padding: 40px 20px;
}


/* =========================================================
   LABEL
========================================================= */

.af-form label {
    display: block;
    margin-bottom: 8px;
    color: #666;
    font-size: 13px;
}


/* =========================================================
   HEADER
========================================================= */

.af-header {
    position: sticky;
    top: 0;
    z-index: 10000;

    background: #ffffff;
    border-bottom: 1px solid #ececec;

    padding: 10px 20px;
}

.af-user {
    display: flex;
    flex-direction: row;
    align-items: center;

    width: 100%;
    gap: 8px;
}


/* =========================================================
   AVATAR
========================================================= */

.af-avatar {
    width: 28px;
    height: 28px;
    min-width: 28px;

    border-radius: 50%;

    background: #f26522;
    color: #fff;

    display: flex;
    justify-content: center;
    align-items: center;

    font-size: 14px;
    font-weight: bold;

    flex-shrink: 0;
}


/* =========================================================
   NAME
========================================================= */

.af-name {
    font-size: 14px;
    font-weight: 700;
    color: #222;

    line-height: 28px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    flex-shrink: 1;
}


/* =========================================================
   AFFILIATE STATUS
========================================================= */

.affiliate-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 3px 8px;

    border-radius: 999px;

    font-size: 11px;
    line-height: 18px;
    font-weight: 600;

    white-space: nowrap;
    flex-shrink: 0;
}

.affiliate-status.approved {
    background: #e8f7ea;
    color: #16a34a;
}

.affiliate-status.pending {
    background: #fff7e6;
    color: #d97706;
}
/* =========================================================
   TAB ICON
========================================================= */

.af-tab-icon {
    width: 26px;
    height: 26px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 22px;
    line-height: 1;

    color: currentColor;
}


/* Nếu dùng SVG icon */

.af-tab svg {
    width: 26px;
    height: 26px;

    display: block;

    fill: none;
    stroke: currentColor;

    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* Không cho CSS cũ biến icon thành chữ/tab dọc */

.af-tab > span {
    margin: 0;
    padding: 0;

    font-size: inherit;
    font-weight: inherit;
    line-height: 1;
}


/* =========================================================
   SHARE TAB
========================================================= */

.af-share {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.af-action {
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

/* Chỉ hiện 3 nút Copy / Share / QR sau khi bấm nút Chia sẻ */
.af-action.af-action-show {
    display: grid;
}

/* Nút mở nhóm chia sẻ */
.af-share-toggle {
    width: 100%;
    min-height: 44px;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    background: #fff;
    color: #444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0,0,0,.05);
    transition: .2s;
}

.af-share-toggle:hover {
    background: #fafafa;
    box-shadow: 0 4px 10px rgba(0,0,0,.08);
}

.af-share-toggle:active {
    transform: translateY(1px);
}

.af-share-toggle span {
    line-height: 1.2;
}


.af-action button {
    height: 46px;

    border: none;
    border-radius: 10px;

    background: #fff;

    cursor: pointer;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    gap: 0;

    color: #444;
    font-size: 10px;
    font-weight: 600;

    padding: 2px 4px;

    box-shadow: 0 2px 6px rgba(0, 0, 0, .05);

    transition: .2s;
}

.af-action button i {
    font-size: 18px;
    margin-bottom: 2px;
}

.af-action button span {
    font-size: 10px;
    line-height: 1;
}

.af-action button:first-child {
    border-top: 3px solid #3b82f6;
}

.af-action button:nth-child(2) {
    border-top: 3px solid #22c55e;
}

.af-action button:nth-child(3) {
    border-top: 3px solid #f59e0b;
}


/* =========================================================
   CURRENT PAGE
========================================================= */

.af-current-page {
    background: #fff;
    border-radius: 12px;

    padding: 10px 14px;

    box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
}

.af-current-page div {
    color: #e85d04;
    font-size: 12px;
	 font-weight: 700;
    margin-bottom: 3px;
}

#afCurrentTitle {
    color: #8b5e3c;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.3;
}


/* =========================================================
   WEBSITE FRAME
========================================================= */

#afFrame {
    width: 100%;
    height: 75vh;

    border: none;
    border-radius: 18px;

    background: #fff;

    box-shadow: 0 5px 18px rgba(0, 0, 0, .08);
}


/* =========================================================
   MOBILE - HEADER + TAB
========================================================= */

@media (max-width: 768px) {

    .af-header {
        padding: 8px 15px;
    }

    .af-user {
        gap: 7px;
    }

    .af-avatar {
        width: 28px;
        height: 28px;
        min-width: 28px;

        font-size: 14px;
    }

    .af-name {
        font-size: 13px;
        line-height: 28px;
    }

    .affiliate-status {
        padding: 3px 7px;
        font-size: 10px;
        line-height: 17px;
    }
.af-tab {
        width: 100%;
        height: 38px;

        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;

        padding: 0;
        margin: 0;
    }

    .af-tab-icon {
        width: 24px;
        height: 24px;
        font-size: 21px;
    }

    .af-tab svg {
        width: 24px;
        height: 24px;
    }


    .af-share {
        gap: 8px;
    }

    .af-action {
        gap: 6px;
    }

    .af-action.af-action-show {
        display: grid;
    }

    .af-share-toggle {
        min-height: 38px;
        border-radius: 8px;
        font-size: 11px;
        padding: 6px 10px;
    }

    .af-action button {
        height: 38px;
        border-radius: 8px;

        gap: 0;
        font-size: 10px;
        padding: 2px;
    }

    .af-action button i {
        font-size: 15px;
        margin-bottom: 1px;
    }

    .af-action button span {
        font-size: 9px;
        line-height: 1;
    }


    .af-current-page {
        padding: 6px 10px;
        border-radius: 10px;
    }

    #afCurrentTitle {
        font-size: 13px;
        line-height: 1.2;
    }

    #afFrame {
        height: 68vh;
        border-radius: 12px;
    }
}
/* =========================================================
   DASHBOARD
========================================================= */

.af-dashboard {
    display: flex;
    flex-direction: column;
    gap: 18px;
}


/* =========================================================
   COMMISSION
========================================================= */

.af-money-card {
    background: linear-gradient(
        135deg,
        #f26522,
        #ff8c42
    );

    color: #fff;

    border-radius: 18px;

    padding: 25px;

    box-shadow:
        0 10px 25px rgba(242, 101, 34, .25);
}

.af-money-title {
    font-size: 14px;
    opacity: .9;
}

.af-money-value {
    margin-top: 12px;

    font-size: 38px;
    font-weight: 700;
}


/* =========================================================
   SUMMARY
========================================================= */

.af-summary {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 15px;
}

.af-box {
    background: #fff;

    border-radius: 16px;

    padding: 18px;

    text-align: center;

    box-shadow:
        0 4px 15px rgba(0, 0, 0, .06);
}

.af-box-title {
    color: #888;
    font-size: 13px;
}

.af-box-value {
    margin-top: 10px;

    font-size: 24px;
    font-weight: bold;

    color: #222;
}


/* =========================================================
   FILTER
========================================================= */

.af-filter {
    display: grid;

    grid-template-columns:
        160px 160px;

    gap: 12px;
}

.af-filter select {
    width: 100%;
    height: 46px;

    border: 1px solid #ddd;
    border-radius: 10px;

    padding: 0 12px;

    background: #fff;
}


/* =========================================================
   ORDER LIST
========================================================= */

#afOrderList {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.af-order {
    background: #fff;

    border-radius: 16px;

    padding: 16px 18px;

    box-shadow:
        0 4px 12px rgba(0, 0, 0, .05);

    display: grid;

    grid-template-columns:
        180px 150px 1fr auto;

    align-items: center;

    gap: 15px;
}

.af-order > div {
    font-size: 14px;
}

.af-order b {
    color: #f26522;
}


/* =========================================================
   DASHBOARD MOBILE
========================================================= */

@media (max-width: 768px) {

    .af-dashboard {
        gap: 12px;
    }

    .af-money-card {
        padding: 18px;
    }

    .af-money-value {
        font-size: 30px;
    }

    .af-summary {
        grid-template-columns:
            repeat(2, 1fr);

        gap: 10px;
    }

    .af-box {
        padding: 14px;
    }

    .af-box-value {
        font-size: 20px;
    }

    .af-filter {
        grid-template-columns:
            1fr 1fr;

        gap: 10px;
    }

    .af-filter select {
        height: 42px;
    }

    .af-order {
        display: flex;

        flex-direction: column;

        align-items: flex-start;

        gap: 8px;
    }
}
/* =========================================================
   PROFILE
========================================================= */

.af-card {
    background: #fff;

    border-radius: 18px;

    padding: 25px;

    margin-bottom: 18px;

    box-shadow:
        0 5px 20px rgba(0, 0, 0, .06);
}

.af-card h3 {
    margin-bottom: 25px;
}


/* =========================================================
   PROFILE FORM
========================================================= */

.af-form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 20px;
}

.af-field {
    display: flex;
    flex-direction: column;
}

.af-field label {
    font-size: 13px;
    color: #666;

    margin-bottom: 8px;
}

.af-field input {
    width: 100%;
    height: 46px;

    border: 1px solid #ddd;
    border-radius: 10px;

    padding: 0 15px;

    font-size: 15px;

    outline: none;

    background: #fff;
}

.af-field input:focus {
    border-color: #f26522;
}

.af-field input:disabled,
.af-field input[readonly] {
    background: #f7f7f7;
    color: #666;
}


/* =========================================================
   PROFILE ACTIONS
========================================================= */

.af-profile-actions {
    display: flex;

    gap: 15px;

    margin-top: 30px;
}

.af-profile-actions button {
    flex: 1;

    height: 50px;

    border: none;
    border-radius: 12px;

    font-size: 15px;
    font-weight: 600;

    cursor: pointer;
}

.af-profile-actions .af-secondary {
    background: #f5f5f5;
    color: #333;
}

.af-profile-actions .af-danger {
    background: #ef4444;
    color: #fff;
}

.af-profile-actions .af-danger:hover {
    background: #dc2626;
}


/* =========================================================
   PROFILE STATUS
========================================================= */

.af-profile-status {
    margin: 15px 0 25px;

    padding: 12px 16px;

    border-radius: 8px;

    font-size: 14px;
    font-weight: 600;
}

.af-profile-status.pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.af-profile-status.approved {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}


/* =========================================================
   PROFILE MOBILE
========================================================= */

@media (max-width: 768px) {

    .af-card {
        padding: 18px;
    }

    .af-card h3 {
        margin-bottom: 20px;
    }

    .af-form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .af-profile-actions {
        flex-direction: column;
        gap: 10px;
    }

    .af-profile-actions button {
        width: 100%;
    }
}
/* =========================================================
   AUTH
========================================================= */

.af-auth {
    display: flex;

    justify-content: center;
    align-items: center;

    min-height: 70vh;
}

.af-auth-card {
    width: 100%;
    max-width: 420px;

    background: #fff;

    border-radius: 20px;

    padding: 35px;

    box-shadow:
        0 10px 35px rgba(0, 0, 0, .08);
}

.af-logo {
    display: block;

    width: 180px;

    margin: 0 auto 20px;
}

.af-auth-card h2 {
    text-align: center;

    margin-bottom: 10px;
}

.af-auth-card p {
    text-align: center;

    color: #777;

    margin-bottom: 25px;
}

.af-auth-card input {
    width: 100%;

    height: 48px;

    margin-bottom: 15px;
}

.af-auth-card button {
    width: 100%;

    height: 48px;

    margin-top: 10px;
}

.af-links {
    text-align: center;

    margin-top: 20px;
}

.af-links a {
    color: #ff6b00;

    text-decoration: none;
}


/* =========================================================
   CHANGE PASSWORD MODAL
========================================================= */

.af-modal {
    position: fixed;

    inset: 0;

    display: none;

    justify-content: center;
    align-items: center;

    background: rgba(0, 0, 0, .45);

    z-index: 9999;

    padding: 20px;
}

.af-modal.show {
    display: flex;
}

.af-modal-box {
    width: 100%;
    max-width: 420px;

    background: #fff;

    border-radius: 20px;

    padding: 28px;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, .25);

    animation: afPopup .25s ease;
}

.af-modal-box h3 {
    text-align: center;

    margin-bottom: 22px;

    font-size: 22px;
}

.af-modal-box input {
    width: 100%;

    height: 48px;

    margin-bottom: 15px;

    border: 1px solid #ddd;
    border-radius: 10px;

    padding: 0 15px;

    font-size: 15px;

    outline: none;
}

.af-modal-box input:focus {
    border-color: #ff6b00;
}

.af-modal-buttons {
    display: flex;

    gap: 12px;

    margin-top: 10px;
}

.af-modal-buttons button {
    flex: 1;

    height: 48px;
}


/* =========================================================
   MODAL ANIMATION
========================================================= */

@keyframes afPopup {

    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =========================================================
   AUTH + MODAL MOBILE
========================================================= */

@media (max-width: 768px) {

    .af-auth {
        min-height: 65vh;
    }

    .af-auth-card {
        padding: 25px;
        margin: 15px;
    }

    .af-modal {
        padding: 15px;
    }

    .af-modal-box {
        padding: 22px;

        border-radius: 16px;
    }

    .af-modal-buttons {
        gap: 10px;
    }
}


/* =========================================================
   CURRENT PAGE LABEL
========================================================= */

.af-current-page .af-current-label {
    color: #f26522 !important;

    font-weight: 800 !important;
}
/* ======================================
   AFFILIATE INVITE
   ====================================== */

.af-invite {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 10px 0 30px;
}


/* ======================================
   CARD
   ====================================== */

.af-invite .af-card {
    background: #ffffff;
    border: 1px solid #e9edf2;
    border-radius: 18px;
    padding: 28px 30px;
    margin-bottom: 18px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.05);
}


/* ======================================
   TITLE
   ====================================== */

.af-invite .af-card h3 {
    margin: 0 0 10px;
    font-size: 22px;
    line-height: 1.4;
    font-weight: 700;
    color: #173f35;
}


.af-invite .af-card p {
    margin: 0 0 25px;
    color: #667085;
    font-size: 15px;
    line-height: 1.6;
}


/* ======================================
   LABEL
   ====================================== */

.af-invite .af-label {
    display: block;
    margin-bottom: 8px;
    color: #475467;
    font-size: 14px;
    font-weight: 600;
}


/* ======================================
   AFFILIATE CODE
   ====================================== */

.af-invite-code {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f0faf6;
    border: 1px solid #ccebdd;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 22px;
}


.af-invite-code .af-label {
    margin: 0;
}


.af-invite-code strong {
    color: #006b4f;
    font-size: 19px;
    letter-spacing: 0.5px;
}


/* ======================================
   INVITE LINK
   ====================================== */

.af-invite-link {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 14px;
}


.af-invite-link input {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0 14px;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    background: #f8fafc;
    color: #344054;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}


.af-invite-link input:focus {
    border-color: #006b4f;
    box-shadow: 0 0 0 3px rgba(0,107,79,0.10);
}


/* ======================================
   BUTTON
   ====================================== */

.af-invite button {
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}


.af-invite button:hover {
    transform: translateY(-1px);
}


.af-invite button:active {
    transform: translateY(0);
}


/* COPY */

#afInviteCopyBtn {
    flex: 0 0 auto;
    min-width: 105px;
    padding: 0 18px;
    background: #ffffff;
    border: 1px solid #d0d5dd;
    color: #344054;
}


#afInviteCopyBtn:hover {
    background: #f8fafc;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}


/* SHARE */

#afInviteShareBtn {
    width: 100%;
    height: 46px;
    background: #006b4f;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0,107,79,0.18);
}


#afInviteShareBtn:hover {
    background: #005a42;
    box-shadow: 0 6px 16px rgba(0,107,79,0.24);
}


/* ======================================
   MESSAGE
   ====================================== */

#afInviteMessage {
    min-height: 20px;
    margin-top: 10px;
    color: #087443;
    font-size: 13px;
    font-weight: 500;
}


/* ======================================
   HOW IT WORKS
   ====================================== */

.af-invite-step {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 20px;
    align-items: start;
    padding: 16px 0;
    border-bottom: 1px solid #eef1f4;
}


.af-invite-step:first-of-type {
    padding-top: 5px;
}


.af-invite-step:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}


.af-invite-step strong {
    color: #173f35;
    font-size: 15px;
}


.af-invite-step span {
    color: #667085;
    font-size: 14px;
    line-height: 1.6;
}


/* ======================================
   MOBILE
   ====================================== */

@media (max-width: 768px) {

    .af-invite {
        padding: 5px 10px 25px;
    }


    .af-invite .af-card {
        padding: 20px;
        border-radius: 14px;
    }


    .af-invite .af-card h3 {
        font-size: 19px;
    }


    .af-invite-code {
        display: block;
    }


    .af-invite-code .af-label {
        margin-bottom: 6px;
    }


    .af-invite-link {
        display: flex;
        flex-direction: column;
    }


    .af-invite-link input {
        width: 100%;
    }


    #afInviteCopyBtn {
        width: 100%;
        height: 44px;
    }


    #afInviteShareBtn {
        height: 44px;
    }


    .af-invite-step {
        display: block;
    }


    .af-invite-step strong {
        display: block;
        margin-bottom: 5px;
    }

}


/* ======================================
   VERY SMALL MOBILE
   ====================================== */

@media (max-width: 480px) {

    .af-invite {
        padding-left: 6px;
        padding-right: 6px;
    }


    .af-invite .af-card {
        padding: 17px;
    }


    .af-invite-code strong {
        display: block;
        margin-top: 5px;
        font-size: 17px;
    }


    .af-invite-step {
        padding: 13px 0;
    }

}
/* ======================================
   REFERRAL SLIDER UI
   ====================================== */

.af-referral-dashboard{
    margin-top:32px;
    padding-top:28px;
    border-top:1px solid #e8e8e8;
}

.af-referral-title{
    font-size:22px;
    font-weight:700;
    margin-bottom:20px;
    color:#222;
}

.af-referral-money{
    background:linear-gradient(135deg,#fff4ec,#ffffff);
    border:1px solid #ffd9c2;
    border-radius:18px;
    padding:22px 24px;
    margin-bottom:18px;
}

.af-referral-money-title{
    font-size:14px;
    color:#777;
    margin-bottom:8px;
}

.af-referral-money-value{
    font-size:30px;
    font-weight:800;
    color:#ff641f;
}

.af-referral-summary{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:16px;
    margin-bottom:26px;
}

.af-referral-kpi{
    background:#fff;
    border:1px solid #eee;
    border-radius:16px;
    padding:20px;
    text-align:center;
    box-shadow:0 4px 14px rgba(0,0,0,.04);
}

.af-referral-kpi-title{
    font-size:13px;
    color:#777;
    margin-bottom:8px;
}

.af-referral-kpi-value{
    font-size:25px;
    font-weight:800;
    color:#222;
}

.af-referral-section{
    margin-top:26px;
}

.af-referral-section-title{
    font-size:18px;
    font-weight:700;
    color:#222;
    margin-bottom:12px;
}

.af-referral-slider{
    width:100%;
    overflow-x:auto;
    overflow-y:hidden;
    scroll-snap-type:x mandatory;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:thin;
    padding-bottom:10px;
}

.af-referral-slider-track{
    display:flex;
    gap:14px;
    width:max-content;
}

.af-referral-card{
    width:300px;
    min-width:300px;
    min-height:110px;
    box-sizing:border-box;
    background:#fff;
    border:1px solid #eee;
    border-radius:16px;
    padding:20px;
    box-shadow:0 4px 14px rgba(0,0,0,.05);
    scroll-snap-align:start;
    display:flex;
    flex-direction:column;
    justify-content:center;
    gap:12px;
}

.af-referral-card-name{
    font-size:18px;
    font-weight:700;
    color:#222;
}

.af-referral-card-code{
    font-size:14px;
    color:#777;
}

.af-referral-card-code b{
    color:#ff641f;
}

.af-referral-card-order{
    font-size:22px;
    font-weight:800;
    color:#ff641f;
}

.af-referral-card-commission{
    font-size:14px;
    color:#666;
}

.af-referral-card-commission b{
    color:#ff641f;
    font-size:18px;
}

.af-referral-empty{
    width:100%;
    box-sizing:border-box;
    background:#fff;
    border:1px solid #eee;
    border-radius:16px;
    padding:25px;
    text-align:center;
    color:#888;
}

@media(max-width:700px){

    .af-referral-summary{
        grid-template-columns:1fr 1fr;
        gap:10px;
    }

    .af-referral-kpi{
        padding:15px 10px;
    }

    .af-referral-card{
        width:270px;
        min-width:270px;
    }

}


/* =========================================================
   ONE CARD HORIZONTAL SLIDER
   - Direct orders
   - Referral people
   - Referral orders
   ========================================================= */


/* =========================================================
   VIEWPORT
   ========================================================= */

#afOrderList{
    width:100%;
    max-width:100%;
    overflow:hidden;
    display:block;
    box-sizing:border-box;
}


.af-referral-slider{
    width:100%;
    max-width:100%;
    overflow:hidden;
    box-sizing:border-box;
    position:relative;
    padding-bottom:10px;
}


/* =========================================================
   HORIZONTAL TRACK
   ========================================================= */

#afOrderList .af-referral-slider-track,
.af-referral-slider .af-referral-slider-track{
    display:flex;
    flex-wrap:nowrap;

    width:100%;
    max-width:100%;

    overflow-x:auto;
    overflow-y:hidden;

    gap:0;

    scroll-snap-type:x mandatory;
    -webkit-overflow-scrolling:touch;

    scrollbar-width:none;

    box-sizing:border-box;
}


/* Hide scrollbar */

#afOrderList .af-referral-slider-track::-webkit-scrollbar,
.af-referral-slider .af-referral-slider-track::-webkit-scrollbar{
    display:none;
}


/* =========================================================
   ONE CARD = 100% VIEWPORT
   ========================================================= */

#afOrderList .af-referral-slider-track > .af-slider-item,
.af-referral-slider .af-referral-slider-track > .af-slider-item{

    flex:0 0 100%;

    width:100%;
    min-width:100%;
    max-width:100%;

    box-sizing:border-box;

    scroll-snap-align:start;
    scroll-snap-stop:always;
}


/* =========================================================
   DIRECT ORDER CARD
   ========================================================= */

#afOrderList .af-referral-slider-track > .af-order{

    display:flex;

    flex-direction:column;

    align-items:stretch;

    gap:0;

    text-align:left;

    box-sizing:border-box;
}


/* =========================================================
   REFERRAL CARDS
   ========================================================= */

.af-referral-slider .af-referral-slider-track > .af-referral-card{

    width:100%;
    min-width:100%;
    max-width:100%;

    box-sizing:border-box;

    margin:0;

    text-align:left;
}


/* =========================================================
   ORDER CARD
   LABEL LEFT / VALUE RIGHT
   ========================================================= */

.af-order-row{

    width:100%;

    display:flex;

    align-items:center;

    justify-content:space-between;

    gap:20px;

    padding:9px 0;

    box-sizing:border-box;

    border-bottom:1px solid #f1e8e1;
}


/* Last row */

.af-order-row:last-child{
    border-bottom:none;
}


/* =========================================================
   LABEL - LEFT
   ========================================================= */

.af-order-label{

    flex:0 0 auto;

    min-width:0;

    color:#8a7568;

    font-size:13px;

    line-height:1.4;

    font-weight:500;

    text-align:left;

    white-space:nowrap;
}


/* =========================================================
   VALUE - RIGHT
   ========================================================= */

.af-order-value{

    flex:1 1 auto;

    min-width:0;

    color:#3a2417;

    font-size:14px;

    line-height:1.4;

    font-weight:600;

    text-align:right;

    word-break:break-word;
}


/* =========================================================
   ORDER NUMBER
   ========================================================= */

.af-order-number{

    color:#3a2417;

    font-size:15px;

    font-weight:700;

    text-align:right;
}


/* =========================================================
   REVENUE
   ========================================================= */

.af-order-revenue{

    color:#3a2417;

    font-weight:700;

    text-align:right;
}


/* =========================================================
   COMMISSION
   ========================================================= */

.af-order-commission{

    color:#d98232;

    font-weight:700;

    text-align:right;
}


/* =========================================================
   REFERRAL COMMISSION
   ========================================================= */

.af-referral-commission-value{

    color:#d98232;

    font-weight:700;

    text-align:right;
}


/* =========================================================
   STATUS
   ========================================================= */

.af-order-status-value{

    color:#4b8b57;

    font-weight:600;

    text-align:right;
}


/* =========================================================
   REFERRAL CARD TITLE
   ========================================================= */

.af-referral-card-order{

    color:#3a2417;

    font-size:15px;

    font-weight:700;

    text-align:left;
}


/* =========================================================
   REFERRAL PEOPLE CARD
   ========================================================= */

.af-referral-card-name{

    color:#3a2417;

    font-size:16px;

    font-weight:700;

    text-align:left;
}


.af-referral-card-code{

    color:#8a7568;

    font-size:13px;

    text-align:left;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width:768px){

    #afOrderList,
    .af-referral-slider{

        width:100%;
        max-width:100%;

        overflow:hidden;
    }


    #afOrderList .af-referral-slider-track,
    .af-referral-slider .af-referral-slider-track{

        width:100%;
        max-width:100%;

        gap:0;

        overflow-x:auto;
        overflow-y:hidden;

        scroll-snap-type:x mandatory;
    }


    #afOrderList .af-referral-slider-track > .af-slider-item,
    .af-referral-slider .af-referral-slider-track > .af-slider-item{

        flex:0 0 100%;

        width:100%;
        min-width:100%;
        max-width:100%;

        scroll-snap-align:start;
        scroll-snap-stop:always;
    }


    .af-referral-slider .af-referral-slider-track > .af-referral-card{

        width:100%;
        min-width:100%;
        max-width:100%;

        margin:0;

        box-sizing:border-box;
    }


    /* -----------------------------------------
       ORDER ROW MOBILE
       ----------------------------------------- */

    .af-order-row{

        gap:12px;

        padding:8px 0;
    }


    .af-order-label{

        font-size:12px;

        white-space:nowrap;
    }


    .af-order-value{

        font-size:13px;
    }


    .af-order-number{

        font-size:14px;
    }

}


/* =========================================================
   VERY SMALL MOBILE
   ========================================================= */

@media (max-width:380px){

    .af-order-row{

        gap:8px;
    }


    .af-order-label{

        font-size:11px;
    }


    .af-order-value{

        font-size:12px;
    }

}


/* =========================================================
/* =========================================================
   SHARE / IFRAME / BOTTOM NAV - FINAL CLEAN
   - Iframe sát mép trên
   - Chỉ khi bấm Chia sẻ mới hiện 3 nút theo chiều dọc
   - Copy link / Chia sẻ / Lấy QR code
   - Bottom tab cố định ở chân màn hình
========================================================= */

/* Ẩn dòng trang cũ */
.af-current-page{
    display:none !important;
}

/* IFRAME */
#afContent{
    margin:0 !important;
    padding:0 0 55px 0 !important;
    max-width:none !important;
    box-sizing:border-box !important;
}

#afContent > *,
.af-share-container,
.af-share-page,
.af-content{
    margin-top:0 !important;
    padding-top:0 !important;
}

.af-frame-wrap{
    display:block !important;
    position:relative !important;
    width:100% !important;
    height:calc(100vh - 110px) !important;
    min-height:0 !important;
    margin:0 !important;
    padding:0 !important;
    border:0 !important;
    overflow:hidden !important;
    line-height:0 !important;
    font-size:0 !important;
}

.af-frame-wrap #afFrame{
    display:block !important;
    position:absolute !important;
    top:0 !important;
    right:0 !important;
    bottom:0 !important;
    left:0 !important;
    width:100% !important;
    height:100% !important;
    margin:0 !important;
    padding:0 !important;
    border:0 !important;
    border-radius:0 !important;
    box-shadow:none !important;
}

/* SHARE POPUP */
.af-share-popup{
    position:fixed !important;
    left:0 !important;
    right:0 !important;
    bottom:44px !important;
    width:100% !important;
    margin:0 !important;
    padding:0 !important;
    z-index:2147482990 !important;
    background:#fff !important;
    border-top:1px solid #e8e8e8 !important;
    box-shadow:0 -4px 18px rgba(0,0,0,.12) !important;
    box-sizing:border-box !important;
}

/* Dòng tiêu đề + nút Chia sẻ */
.af-share-bar{
    width:100% !important;
    min-height:47px !important;
    height:47px !important;
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    gap:8px !important;
    padding:5px 10px !important;
    margin:0 !important;
    background:#fff !important;
    border-bottom:1px solid #eee !important;
    box-sizing:border-box !important;
}

.af-share-title{
    flex:1 1 auto !important;
    min-width:0 !important;
    overflow:hidden !important;
}

.af-share-title strong{
    display:block !important;
    margin:0 !important;
    color:#444 !important;
    font-size:12px !important;
    font-weight:600 !important;
    line-height:1.3 !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
}

/* Nút Chia sẻ */
#afShare{
    flex:0 0 auto !important;
    width:auto !important;
    height:34px !important;
    min-width:72px !important;
    margin:0 !important;
    padding:0 12px !important;
    border:0 !important;
    border-radius:7px !important;
    background:#f26522 !important;
    color:#fff !important;
    font-family:inherit !important;
    font-size:12px !important;
    font-weight:700 !important;
    cursor:pointer !important;
}

#afShare:hover{
    background:#d95716 !important;
}

#afShare:active{
    transform:translateY(1px);
}

/* 3 nút chia sẻ: MẶC ĐỊNH ẨN */
.af-share-actions{
    display:none !important;
    width:100% !important;
    grid-template-columns:1fr !important;
    gap:6px !important;
    padding:6px 8px !important;
    margin:0 !important;
    background:#fff !important;
    border-bottom:1px solid #eee !important;
    box-sizing:border-box !important;
}

/* Chỉ hiện khi bấm Chia sẻ */
.af-share-actions.show{
    display:grid !important;
}

/* 3 nút xếp DỌC */
.af-share-actions button{
    width:100% !important;
    min-height:46px !important;
    height:46px !important;
    display:flex !important;
    flex-direction:row !important;
    align-items:center !important;
    justify-content:flex-start !important;
    gap:10px !important;
    margin:0 !important;
    padding:0 14px !important;
    border:1px solid #e5e5e5 !important;
    border-radius:9px !important;
    background:#fff !important;
    color:#444 !important;
    font-family:inherit !important;
    font-size:12px !important;
    font-weight:600 !important;
    cursor:pointer !important;
    box-sizing:border-box !important;
}

/* Icon */
.af-share-actions button span:first-child{
    flex:0 0 24px !important;
    width:24px !important;
    font-size:20px !important;
    line-height:1 !important;
    text-align:center !important;
}

/* Chữ */
.af-share-actions button span:last-child{
    flex:1 1 auto !important;
    font-size:12px !important;
    line-height:1.2 !important;
    text-align:left !important;
}

/* Màu nhận diện từng nút */
.af-share-actions button:nth-child(1){
    border-left:3px solid #3b82f6 !important;
}

.af-share-actions button:nth-child(2){
    border-left:3px solid #22c55e !important;
}

.af-share-actions button:nth-child(3){
    border-left:3px solid #f59e0b !important;
}

/* BOTTOM TAB BAR - DUY NHẤT */
.af-tabs{
    position:fixed !important;
    top:auto !important;
    right:0 !important;
    bottom:0 !important;
    left:0 !important;
    width:100% !important;
    height:44px !important;
    min-height:44px !important;
    margin:0 !important;
    padding:0 !important;
    display:flex !important;
    flex-direction:row !important;
    align-items:stretch !important;
    justify-content:space-around !important;
    z-index:2147483000 !important;
    background:#fff !important;
    border-top:1px solid #e5e5e5 !important;
    border-bottom:0 !important;
    box-shadow:0 -4px 14px rgba(0,0,0,.10) !important;
    box-sizing:border-box !important;
}

.af-tabs .af-tab{
    position:relative !important;
    flex:1 1 20% !important;
    width:20% !important;
    height:44px !important;
    min-height:44px !important;
    margin:0 !important;
    padding:0 !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    border:0 !important;
    border-radius:0 !important;
    background:transparent !important;
    cursor:pointer !important;
    pointer-events:auto !important;
    z-index:2147483001 !important;
    font-size:20px !important;
    line-height:1 !important;
    -webkit-tap-highlight-color:transparent;
}

.af-tabs .af-tab.active{
    border-top:3px solid #f26522 !important;
    background:#fff !important;
}

.af-tabs .af-tab > span{
    margin:0 !important;
    padding:0 !important;
    line-height:1 !important;
}

/* Nếu markup bottom-nav cũ vẫn tồn tại */
.af-bottom-nav{
    width:100% !important;
    height:44px !important;
    display:grid !important;
    grid-template-columns:repeat(5,1fr) !important;
    margin:0 !important;
    padding:0 !important;
    background:#fff !important;
}

.af-nav-item{
    width:100% !important;
    height:44px !important;
    display:flex !important;
    flex-direction:column !important;
    align-items:center !important;
    justify-content:center !important;
    gap:1px !important;
    margin:0 !important;
    padding:0 !important;
    border:0 !important;
    border-radius:0 !important;
    background:#fff !important;
    color:#777 !important;
    font-family:inherit !important;
    font-size:9px !important;
    font-weight:500 !important;
    line-height:1 !important;
    cursor:pointer !important;
}

.af-nav-item span:first-child{
    display:block !important;
    font-size:18px !important;
    line-height:19px !important;
}

.af-nav-item span:last-child{
    display:block !important;
    font-size:8px !important;
    line-height:10px !important;
}

.af-nav-item.active{
    color:#f26522 !important;
    font-weight:700 !important;
}

/* MOBILE */
@media(max-width:768px){

    .af-frame-wrap{
        height:calc(100vh - 105px) !important;
    }

    .af-share-popup{
        bottom:44px !important;
    }

    .af-share-bar{
        height:44px !important;
        min-height:44px !important;
        padding:5px 10px !important;
    }

    .af-share-title strong{
        font-size:12px !important;
    }

    #afShare{
        height:32px !important;
        min-width:70px !important;
        padding:0 11px !important;
        font-size:12px !important;
    }

    .af-share-actions{
        grid-template-columns:1fr !important;
        gap:5px !important;
        padding:5px 7px !important;
    }

    .af-share-actions button{
        min-height:44px !important;
        height:44px !important;
        padding:0 13px !important;
    }

    .af-share-actions button span:first-child{
        font-size:19px !important;
    }

    .af-share-actions button span:last-child{
        font-size:11px !important;
    }

    .af-tabs,
    .af-tabs .af-tab{
        height:44px !important;
        min-height:44px !important;
    }

    .af-tabs .af-tab{
        font-size:20px !important;
    }

    .af-bottom-nav,
    .af-nav-item{
        height:44px !important;
    }

    #afContent{
        padding-bottom:54px !important;
    }
}

/* VERY SMALL MOBILE */
@media(max-width:380px){

    .af-share-title strong{
        font-size:11px !important;
    }

    #afShare{
        min-width:66px !important;
        padding:0 9px !important;
    }

    .af-tabs .af-tab{
        font-size:19px !important;
    }

    .af-share-actions button{
        min-height:42px !important;
        height:42px !important;
    }
}


/* =========================================================
   SHARE MESSAGE - BOLD + BLINK
   Chỉ áp dụng cho dòng "Chia sẻ đúng link này..."
   ========================================================= */

.af-share-title strong,
.af-share-title .af-share-message,
.af-share-title [class*="share-message"] {
    font-weight: 800 !important;
    animation: afShareMessageBlink 3.2s ease-in-out infinite !important;
}

@keyframes afShareMessageBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.35;
    }
}