body.er-affiliate-portal {
    margin: 0;
    font-family: "Inter", "Segoe UI", sans-serif;
    overflow-x: hidden;
    background: #f3f4f6;
    color: #1f2937;
}

body.er-affiliate-portal .admin-panel {
    min-height: 100vh;
    width: 100%;
}

body.er-affiliate-portal a {
    color: inherit;
    text-decoration: none;
}



body.er-affiliate-portal #main-content {
    min-width: 0;
}

body.er-affiliate-portal #sidebar {
    width: 240px;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    will-change: transform;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

body.er-affiliate-portal .nav-item-inner {
    transition: background-color 0.2s ease, color 0.2s ease;
}

body.er-affiliate-portal .nav-item.active .nav-item-inner {
    background: #2563eb;
    color: #ffffff;
}

body.er-affiliate-portal .page-content {
    width: 100%;
    box-sizing: border-box;
}

body.er-affiliate-portal .bg-white {
    background: #ffffff;
}

body.er-affiliate-portal .rounded,
body.er-affiliate-portal .rounded-lg,
body.er-affiliate-portal .rounded-xl {
    border-radius: 0.75rem;
}

body.er-affiliate-portal .shadow,
body.er-affiliate-portal .shadow-sm {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

body.er-affiliate-portal .p-4 {
    padding: 1rem;
}

body.er-affiliate-portal .p-6 {
    padding: 1.5rem;
}

body.er-affiliate-portal .mb-4 {
    margin-bottom: 1rem;
}

body.er-affiliate-portal .mb-6 {
    margin-bottom: 1.5rem;
}

body.er-affiliate-portal table.er-table {
    border-collapse: collapse;
    background: #ffffff;
}

body.er-affiliate-portal table.er-table th,
body.er-affiliate-portal table.er-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem;
    text-align: left;
    vertical-align: middle;
}

body.er-affiliate-portal table.er-table th {
    font-weight: 600;
    color: #374151;
    background: #f9fafb;
}

body.er-affiliate-portal .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 40px;
    padding: 0.55rem 1rem;
    border-radius: 0.65rem;
    border: 1px solid #d1d5db;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.1;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

body.er-affiliate-portal .btn:hover {
    border-color: #94a3b8;
    background: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

body.er-affiliate-portal .btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

body.er-affiliate-portal .btn:focus,
body.er-affiliate-portal .btn:focus-visible {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

body.er-affiliate-portal .btn:disabled,
body.er-affiliate-portal .btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}


body.er-affiliate-portal select.btn {
    padding-right: 2.1rem;
    appearance: none;
    -webkit-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #475569 50%), linear-gradient(135deg, #475569 50%, transparent 50%);
    background-position: calc(100% - 16px) calc(50% - 3px), calc(100% - 10px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

body.er-affiliate-portal .er-pagination {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

body.er-affiliate-portal .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    padding: 0.4rem 0.7rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: #ffffff;
    color: #1f2937;
    font-weight: 600;
    font-size: 0.87rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

body.er-affiliate-portal .page-link:hover {
    border-color: #94a3b8;
    background: #f8fafc;
    transform: translateY(-1px);
}

body.er-affiliate-portal .page-link.active {
    border-color: #3b82f6;
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

body.er-affiliate-portal .page-link.active:hover {
    border-color: #2563eb;
    background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
}

body.er-affiliate-portal .page-link[aria-disabled="true"],
body.er-affiliate-portal .page-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

body.er-affiliate-portal button,
body.er-affiliate-portal .button,
body.er-affiliate-portal input,
body.er-affiliate-portal select,
body.er-affiliate-portal textarea {
    font: inherit;
}

body.er-affiliate-portal button {
    cursor: pointer;
}

body.er-affiliate-portal input,
body.er-affiliate-portal select,
body.er-affiliate-portal textarea {
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #fff;
}

body.er-affiliate-portal .text-white {
    color: #fff;
}

body.er-affiliate-portal .hover\:bg-er-brand:hover {
    background: #2563eb;
}

body.er-affiliate-portal .hover\:text-white:hover {
    color: #fff;
}

body.er-affiliate-portal .er-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

body.er-affiliate-portal .er-table-responsive table,
body.er-affiliate-portal table.er-table {
    min-width: 100%;
}

body.er-affiliate-portal img,
body.er-affiliate-portal canvas,
body.er-affiliate-portal video {
    max-width: 100%;
    height: auto;
}

body.er-affiliate-portal .page-head,
body.er-affiliate-portal .page-actions,
body.er-affiliate-portal .seach_filter_member_wrap,
body.er-affiliate-portal .seach_filter_product_wrap,
body.er-affiliate-portal .field-inputs,
body.er-affiliate-portal .submitForm,
body.er-affiliate-portal .er-modal-body,
body.er-affiliate-portal .tabs {
    min-width: 0;
}

body.er-affiliate-portal input,
body.er-affiliate-portal select,
body.er-affiliate-portal textarea {
    max-width: 100%;
}

body.er-affiliate-portal .whitespace-nowrap {
    white-space: nowrap;
}

body.er-affiliate-portal td {
    white-space: nowrap;
}

body.er-affiliate-portal #er-modalBackdrop {
    transition: opacity 0.3s ease;
}

body.er-affiliate-portal #er-modalBackdrop.hidden {
    display: none !important;
    opacity: 0;
}

body.er-affiliate-portal #er-modalContent {
    max-height: 78vh;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

body.er-affiliate-portal #closeModal {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    width: 2rem;
    height: 2rem;
    margin-left: auto;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

body.er-affiliate-portal #er-modalContent.scale-95 {
    transform: scale(0.95);
    opacity: 0;
}

body.er-affiliate-portal #er-modalContent.scale-100 {
    transform: scale(1);
    opacity: 1;
}

body.er-affiliate-portal .tab-item-modal {
    padding: 0.5rem;
    display: flex;
    align-items: center;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    color: #1f2937;
    background: transparent;
    border: none;
    text-align: left;
}

body.er-affiliate-portal .tab-item-modal:hover {
    background: #f3f4f6;
}

body.er-affiliate-portal .tab-item-modal.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

body.er-affiliate-portal .tab-content-modal {
    transition: all 0.2s ease;
}

body.er-affiliate-portal .tab-content-modal.hidden {
    display: none !important;
}

body.er-affiliate-portal .modal-transition {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

body.er-affiliate-portal #er-openModal {
    cursor: pointer;
    position: relative;
    z-index: auto;
}

body.er-affiliate-portal #er-openModal:hover .nav-item-inner {
    background: #3b82f6;
    color: #ffffff;
}

body.er-affiliate-portal .statics-item {
    flex: 1;
    min-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

@media (min-width: 640px) {
    body.er-affiliate-portal .statics-item {
        min-width: calc(50% - 0.5rem);
    }
}

@media (min-width: 1024px) {
    body.er-affiliate-portal .statics-item {
        min-width: calc(25% - 0.75rem);
    }
}

@media (max-width: 767px) {
    body.er-affiliate-portal #sidebar {
        transform: translateX(-100%);
        width: min(86vw, 320px);
        box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    }

    body.er-affiliate-portal #main-content {
        margin-left: 0 !important;
    }

    body.er-affiliate-portal .p-6 {
        padding: 1rem;
    }

    body.er-affiliate-portal .btn {
        min-height: 38px;
        padding: 0.5rem 0.85rem;
    }

    body.er-affiliate-portal.sidebar-open #sidebar {
        transform: translateX(0);
    }

    body.er-affiliate-portal #overlay-sidebar {
        display: block;
        pointer-events: none;
    }

    body.er-affiliate-portal.sidebar-open #overlay-sidebar {
        pointer-events: auto;
    }

    body.er-affiliate-portal .page-head,
    body.er-affiliate-portal .page-actions,
    body.er-affiliate-portal .seach_filter_member_wrap,
    body.er-affiliate-portal .seach_filter_product_wrap,
    body.er-affiliate-portal .field-inputs,
    body.er-affiliate-portal .submitForm,
    body.er-affiliate-portal .page-content>div,
    body.er-affiliate-portal .page-content>form {
        width: 100%;
    }

    body.er-affiliate-portal .page-actions,
    body.er-affiliate-portal .seach_filter_member_wrap,
    body.er-affiliate-portal .seach_filter_product_wrap,
    body.er-affiliate-portal .field-inputs,
    body.er-affiliate-portal .submitForm {
        flex-direction: column;
        align-items: stretch;
    }

    body.er-affiliate-portal .page-actions>*,
    body.er-affiliate-portal .seach_filter_member_wrap>*,
    body.er-affiliate-portal .seach_filter_product_wrap>*,
    body.er-affiliate-portal .field-inputs>*,
    body.er-affiliate-portal .submitForm>* {
        width: 100%;
    }

    body.er-affiliate-portal .form-input,
    body.er-affiliate-portal .form-select,
    body.er-affiliate-portal select,
    body.er-affiliate-portal input{
        width: 100% !important;
        min-width: 0 !important;
    }

    body.er-affiliate-portal .page-head h1,
    body.er-affiliate-portal .page-head h2,
    body.er-affiliate-portal .page-head p {
        max-width: 100%;
    }

    body.er-affiliate-portal .er-modal-body,
    body.er-affiliate-portal .modal__left,
    body.er-affiliate-portal .modal__right {
        width: 100%;
    }

    body.er-affiliate-portal #er-modalContent,
    body.er-affiliate-portal #addOrderModalContent {
        max-width: calc(100vw - 1rem);
        padding: 0.75rem;
    }

    body.er-affiliate-portal .er-levels-scroll {
        max-height: none;
    }


    body.er-affiliate-portal table select,
    body.er-affiliate-portal table input {
        width: max-content !important;
    }
}

/* Input and Select Elements - Full Content Display */
body.er-affiliate-portal input,
body.er-affiliate-portal select,
body.er-affiliate-portal textarea {
    min-height: auto;
    height: auto;
    overflow: visible;
    word-break: break-word;
    white-space: normal;
}

body.er-affiliate-portal input[type="text"],
body.er-affiliate-portal input[type="email"],
body.er-affiliate-portal input[type="number"],
body.er-affiliate-portal input[type="tel"],
body.er-affiliate-portal input[type="date"],
body.er-affiliate-portal input[type="password"] {
    min-height: 2.75rem;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.er-affiliate-portal select,
body.er-affiliate-portal .form-select {
    min-height: 2.75rem;
    height: auto;
    overflow: visible;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
}

body.er-affiliate-portal select option {
    padding: 0.5rem;
    overflow: visible;
}

body.er-affiliate-portal .form-input {
    min-height: 2.75rem;
    height: auto;
    overflow: hidden;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
}

body.er-affiliate-portal input:disabled,
body.er-affiliate-portal select:disabled,
body.er-affiliate-portal textarea:disabled {
    background: #f3f4f6;
    opacity: 0.7;
}

/* Admin affiliate group management */
body.er-affiliate-portal .er-admin-member-tabs { display:flex; gap:8px; padding:5px; background:#eef2f7; border-radius:12px; }
body.er-affiliate-portal .er-admin-member-tab { border:0; background:transparent; color:#64748b; font-weight:700; padding:10px 16px; border-radius:9px; cursor:pointer; }
body.er-affiliate-portal .er-admin-member-tab span { display:inline-flex; min-width:22px; height:22px; align-items:center; justify-content:center; margin-left:6px; border-radius:999px; background:#dbe3ee; font-size:12px; }
body.er-affiliate-portal .er-admin-member-tab.is-active { color:#111827; background:#fff; box-shadow:0 1px 3px rgba(15,23,42,.1); }
body.er-affiliate-portal .er-admin-member-panel { display:none; width:100%; }
body.er-affiliate-portal .er-admin-member-panel.is-active { display:block; }
body.er-affiliate-portal .er-group-toolbar { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-bottom:22px; }
body.er-affiliate-portal .er-group-toolbar h2 { margin:0 0 5px; font-size:20px; color:#111827; }
body.er-affiliate-portal .er-group-toolbar p, body.er-affiliate-portal .er-group-modal-head p { margin:0; color:#64748b; font-size:14px; }
body.er-affiliate-portal .er-group-layout { display:grid; grid-template-columns:minmax(280px, 340px) minmax(0, 1fr); min-height:560px; border:1px solid #e2e8f0; border-radius:14px; overflow:hidden; background:#fff; }
body.er-affiliate-portal .er-group-leaders { padding:20px 14px; background:#f8fafc; border-right:1px solid #e2e8f0; }
body.er-affiliate-portal .er-group-leaders>label { display:block; margin:0 6px 8px; color:#475569; font-size:13px; font-weight:700; }
body.er-affiliate-portal .er-group-leader-list { display:flex; flex-direction:column; gap:7px; margin-top:14px; max-height:465px; overflow:auto; }
body.er-affiliate-portal .er-group-leader-card { display:flex; align-items:center; gap:10px; width:100%; padding:11px; border:1px solid transparent; border-radius:10px; background:transparent; text-align:left; cursor:pointer; }
body.er-affiliate-portal .er-group-leader-card[hidden], body.er-affiliate-portal .er-ungrouped-item[hidden], body.er-affiliate-portal #er-group-members-table tr[hidden] { display:none !important; }
body.er-affiliate-portal .er-group-leader-card:hover { background:#fff; border-color:#e2e8f0; }
body.er-affiliate-portal .er-group-leader-card.is-active { background:#fff; border-color:#93c5fd; box-shadow:0 2px 8px rgba(59,130,246,.1); }
body.er-affiliate-portal .er-group-avatar { flex:0 0 38px; height:38px; display:flex; align-items:center; justify-content:center; border-radius:10px; color:#1d4ed8; background:#dbeafe; font-weight:800; }
body.er-affiliate-portal .er-group-leader-info { min-width:0; flex:1; }
body.er-affiliate-portal .er-group-leader-info strong, body.er-affiliate-portal .er-group-leader-info small { display:block; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
body.er-affiliate-portal .er-group-leader-info strong { color:#172033; font-size:14px; }
body.er-affiliate-portal .er-group-leader-info small { color:#7c8aa0; font-size:11px; margin-top:3px; }
body.er-affiliate-portal .er-group-count { min-width:26px; padding:3px 6px; border-radius:999px; background:#e2e8f0; color:#475569; text-align:center; font-size:12px; font-weight:700; }
body.er-affiliate-portal .er-group-members { min-width:0; padding:22px; }
body.er-affiliate-portal .er-group-members-head { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:20px; }
body.er-affiliate-portal .er-group-members-head h3 { margin:3px 0 0; color:#111827; font-size:20px; }
body.er-affiliate-portal .er-group-eyebrow { color:#64748b; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; }
body.er-affiliate-portal .er-group-members td strong, body.er-affiliate-portal .er-group-members td small { display:block; }
body.er-affiliate-portal .er-group-members td small { margin-top:4px; color:#64748b; font-size:12px; }
body.er-affiliate-portal .er-remove-group-member { border:1px solid #fecdd3; background:#fff1f2; color:#be123c; padding:7px 10px; border-radius:7px; font-size:12px; font-weight:700; cursor:pointer; white-space:nowrap; }
body.er-affiliate-portal .er-promote-member-leader { border:1px solid #bfdbfe; background:#eff6ff; color:#1d4ed8; padding:7px 10px; border-radius:7px; font-size:12px; font-weight:700; cursor:pointer; white-space:nowrap; }
body.er-affiliate-portal .er-member-actions { display:flex; align-items:center; justify-content:flex-end; gap:6px; min-width:112px; }
body.er-affiliate-portal .er-member-icon-action { width:34px; height:34px; display:inline-flex; align-items:center; justify-content:center; padding:0; border-radius:8px; font-size:15px; line-height:1; font-weight:800; cursor:pointer; white-space:nowrap; }
body.er-affiliate-portal .er-member-icon-action svg { width:17px; height:17px; display:block; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
body.er-affiliate-portal .er-view-member-detail { border:1px solid #cbd5e1; background:#f8fafc; color:#334155; }
body.er-affiliate-portal .er-set-member-status { border:1px solid #bbf7d0; background:#f0fdf4; color:#15803d; padding:7px 10px; border-radius:7px; font-size:12px; font-weight:700; cursor:pointer; white-space:nowrap; }
body.er-affiliate-portal .er-set-member-status.is-deactivate { border-color:#fecdd3; background:#fff1f2; color:#be123c; }
body.er-affiliate-portal .er-member-icon-action.er-set-member-status, body.er-affiliate-portal .er-member-icon-action.er-promote-member-leader { padding:0; border-radius:8px; font-size:15px; }
body.er-affiliate-portal .er-member-icon-action:disabled { opacity:.6; cursor:wait; }
body.er-affiliate-portal .er-member-detail-popup { border-radius:14px; }
body.er-affiliate-portal .er-member-detail-shell { text-align:left; color:#111827; }
body.er-affiliate-portal .er-member-detail-hero { display:flex; align-items:center; gap:16px; padding:18px; border:1px solid #e2e8f0; border-radius:12px; background:#f8fafc; }
body.er-affiliate-portal .er-member-detail-avatar { flex:0 0 52px; height:52px; display:flex; align-items:center; justify-content:center; border-radius:12px; background:#2563eb; color:#fff; font-size:24px; font-weight:800; }
body.er-affiliate-portal .er-member-detail-hero h3 { margin:0; color:#0f172a; font-size:22px; line-height:1.2; }
body.er-affiliate-portal .er-member-detail-hero p { margin:4px 0 7px; color:#64748b; font-size:14px; }
body.er-affiliate-portal .er-member-detail-hero code { color:#1d4ed8; background:#dbeafe; border-radius:6px; padding:4px 7px; font-weight:800; }
body.er-affiliate-portal .er-member-status-pill { margin-left:auto; border-radius:999px; background:#dcfce7; color:#15803d; padding:6px 10px; font-size:12px; font-weight:800; white-space:nowrap; }
body.er-affiliate-portal .er-member-detail-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:14px; }
body.er-affiliate-portal .er-member-detail-grid section, body.er-affiliate-portal .er-member-identity-section { border:1px solid #e2e8f0; border-radius:12px; padding:14px; background:#fff; }
body.er-affiliate-portal .er-member-detail-grid h4, body.er-affiliate-portal .er-member-identity-section h4 { margin:0 0 12px; color:#334155; font-size:13px; font-weight:800; text-transform:uppercase; }
body.er-affiliate-portal .er-member-detail-item { display:flex; justify-content:space-between; gap:12px; padding:8px 0; border-top:1px solid #f1f5f9; }
body.er-affiliate-portal .er-member-detail-item:first-of-type { border-top:0; padding-top:0; }
body.er-affiliate-portal .er-member-detail-item span { color:#64748b; font-size:13px; }
body.er-affiliate-portal .er-member-detail-item strong { color:#0f172a; font-size:13px; text-align:right; overflow-wrap:anywhere; }
body.er-affiliate-portal .er-member-referrer { display:flex; flex-direction:column; gap:5px; padding:10px; border-radius:10px; background:#f8fafc; }
body.er-affiliate-portal .er-member-referrer strong { color:#0f172a; }
body.er-affiliate-portal .er-member-referrer span, body.er-affiliate-portal .er-member-referrer.is-empty { color:#64748b; font-size:13px; }
body.er-affiliate-portal .er-member-referral-list { display:flex; flex-direction:column; gap:7px; max-height:140px; margin:0; padding:0; overflow:auto; list-style:none; }
body.er-affiliate-portal .er-member-referral-list li { padding:8px 10px; border-radius:10px; background:#f8fafc; }
body.er-affiliate-portal .er-member-referral-list strong, body.er-affiliate-portal .er-member-referral-list span { display:block; }
body.er-affiliate-portal .er-member-referral-list strong { color:#0f172a; font-size:13px; }
body.er-affiliate-portal .er-member-referral-list span, body.er-affiliate-portal .er-member-referral-list.is-empty { color:#64748b; font-size:12px; }
body.er-affiliate-portal .er-member-identity-section { margin-top:14px; }
body.er-affiliate-portal .er-member-identity-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
body.er-affiliate-portal .er-member-identity-preview { position:relative; display:flex; min-height:190px; align-items:center; justify-content:center; overflow:hidden; border:1px solid #e2e8f0; border-radius:10px; background:#f8fafc; color:#64748b; text-decoration:none; }
body.er-affiliate-portal .er-member-identity-preview img { width:100%; height:230px; object-fit:cover; display:block; }
body.er-affiliate-portal .er-member-identity-preview span { position:absolute; left:10px; bottom:10px; border-radius:999px; background:rgba(15,23,42,.78); color:#fff; padding:5px 9px; font-size:12px; font-weight:800; }
body.er-affiliate-portal .er-member-identity-preview.is-empty { flex-direction:column; min-height:160px; border-style:dashed; }
body.er-affiliate-portal .er-member-identity-preview.is-empty span { position:static; background:transparent; color:#64748b; padding:0; }
body.er-affiliate-portal .er-member-identity-preview.is-empty strong { margin-top:6px; color:#334155; }
@media (max-width: 782px) {
    body.er-affiliate-portal .er-member-detail-grid, body.er-affiliate-portal .er-member-identity-grid { grid-template-columns:1fr; }
    body.er-affiliate-portal .er-member-detail-hero { align-items:flex-start; }
    body.er-affiliate-portal .er-member-status-pill { margin-left:0; }
}
body.er-affiliate-portal .er-aff-tree-filter { display:flex; flex-wrap:wrap; align-items:flex-end; gap:12px; }
body.er-affiliate-portal .er-aff-tree-filter label { flex:0 0 100%; color:#334155; font-size:13px; font-weight:800; }
body.er-affiliate-portal .er-aff-tree-filter select { min-width:320px; flex:1 1 360px; }
@media (max-width: 640px) {
    body.er-affiliate-portal .er-aff-tree-filter select,
    body.er-affiliate-portal .er-aff-tree-filter .btn { width:100%; min-width:0; }
}
body.er-affiliate-portal .er-aff-tree-wrap { min-width:760px; overflow:auto; padding:6px 0 18px; }
body.er-affiliate-portal .er-aff-tree-list { position:relative; display:flex; flex-direction:column; gap:12px; margin:0; padding:0 0 0 26px; list-style:none; }
body.er-affiliate-portal .er-aff-tree-list[data-depth="0"] { padding-left:0; }
body.er-affiliate-portal .er-aff-tree-list:not([data-depth="0"])::before { content:""; position:absolute; left:9px; top:-12px; bottom:18px; width:1px; background:#dbe3ef; }
body.er-affiliate-portal .er-aff-tree-node { position:relative; }
body.er-affiliate-portal .er-aff-tree-list:not([data-depth="0"])>.er-aff-tree-node::before { content:""; position:absolute; left:-17px; top:28px; width:18px; height:1px; background:#dbe3ef; }
body.er-affiliate-portal .er-aff-tree-card { display:flex; align-items:center; gap:12px; width:min(760px,100%); padding:12px; border:1px solid #e2e8f0; border-radius:12px; background:#fff; box-shadow:0 1px 2px rgba(15,23,42,.04); }
body.er-affiliate-portal .er-aff-tree-avatar { flex:0 0 42px; height:42px; display:flex; align-items:center; justify-content:center; border-radius:10px; background:#dbeafe; color:#1d4ed8; font-size:18px; font-weight:800; }
body.er-affiliate-portal .er-aff-tree-main { min-width:0; flex:1; }
body.er-affiliate-portal .er-aff-tree-name { color:#0f172a; font-size:15px; font-weight:800; }
body.er-affiliate-portal .er-aff-tree-meta { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:4px; color:#64748b; font-size:12px; }
body.er-affiliate-portal .er-aff-tree-meta code { color:#1d4ed8; background:#eff6ff; border-radius:6px; padding:2px 6px; font-weight:800; }
body.er-affiliate-portal .er-aff-tree-tags { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
body.er-affiliate-portal .er-aff-tree-tags span { border-radius:999px; background:#f1f5f9; color:#475569; padding:4px 8px; font-size:11px; font-weight:700; }
body.er-affiliate-portal .er-aff-tree-status { flex:0 0 auto; border-radius:999px; padding:5px 8px; font-size:11px; font-weight:800; }
body.er-affiliate-portal .er-aff-tree-status.is-active { background:#dcfce7; color:#15803d; }
body.er-affiliate-portal .er-aff-tree-status.is-inactive { background:#fee2e2; color:#b91c1c; }
body.er-affiliate-portal .er-aff-tree-node.is-search-muted>.er-aff-tree-card { opacity:.28; }
body.er-affiliate-portal .er-aff-tree-node.is-search-hit>.er-aff-tree-card { border-color:#2563eb; box-shadow:0 0 0 3px rgba(37,99,235,.12); }
body.er-affiliate-portal .er-group-no-members td, body.er-affiliate-portal .er-group-empty { padding:36px; color:#64748b; text-align:center; }
body.er-affiliate-portal .er-group-modal { position:fixed; inset:0; z-index:10000; display:none; align-items:center; justify-content:center; padding:16px; }
body.er-affiliate-portal .er-group-modal.is-open { display:flex; }
body.er-affiliate-portal .er-group-modal-backdrop { position:absolute; inset:0; background:rgba(15,23,42,.55); }
body.er-affiliate-portal .er-group-modal-dialog { position:relative; width:min(620px, 100%); max-height:88vh; overflow:auto; padding:24px; border-radius:15px; background:#fff; box-shadow:0 24px 70px rgba(15,23,42,.3); }
body.er-affiliate-portal .er-group-modal-head { display:flex; align-items:flex-start; justify-content:space-between; gap:15px; margin-bottom:20px; }
body.er-affiliate-portal .er-group-modal-head h3 { margin:0 0 5px; color:#111827; font-size:20px; }
body.er-affiliate-portal .er-group-modal-head button { border:0; background:#f1f5f9; width:34px; height:34px; border-radius:8px; font-size:24px; line-height:1; cursor:pointer; }
body.er-affiliate-portal .er-group-modal-dialog>label { display:block; margin:12px 0 7px; color:#334155; font-size:13px; font-weight:700; }
body.er-affiliate-portal #er-ungrouped-search { margin-top:14px; }
body.er-affiliate-portal .er-ungrouped-list { max-height:330px; overflow:auto; margin-top:12px; border:1px solid #e2e8f0; border-radius:10px; }
body.er-affiliate-portal .er-ungrouped-item { display:flex; align-items:center; gap:12px; padding:12px 14px; border-bottom:1px solid #eef2f7; cursor:pointer; }
body.er-affiliate-portal .er-ungrouped-item:last-child { border-bottom:0; }
body.er-affiliate-portal .er-ungrouped-item:hover { background:#f8fafc; }
body.er-affiliate-portal .er-ungrouped-item input { width:18px !important; height:18px; min-height:0; }
body.er-affiliate-portal .er-ungrouped-item strong, body.er-affiliate-portal .er-ungrouped-item small { display:block; }
body.er-affiliate-portal .er-ungrouped-item small { margin-top:3px; color:#64748b; font-size:12px; }
body.er-affiliate-portal .er-group-modal-actions { display:flex; align-items:center; justify-content:space-between; gap:15px; margin-top:18px; color:#64748b; font-size:13px; }
@media (max-width: 900px) {
    body.er-affiliate-portal .er-group-layout { grid-template-columns:1fr; }
    body.er-affiliate-portal .er-group-leaders { border-right:0; border-bottom:1px solid #e2e8f0; }
    body.er-affiliate-portal .er-group-leader-list { max-height:230px; }
}
@media (max-width: 640px) {
    body.er-affiliate-portal .er-admin-member-tabs, body.er-affiliate-portal .er-group-toolbar, body.er-affiliate-portal .er-group-members-head, body.er-affiliate-portal .er-group-modal-actions { align-items:stretch; flex-direction:column; }
    body.er-affiliate-portal .er-admin-member-tab { width:100%; }
    body.er-affiliate-portal .er-group-members { padding:14px; }
}
