.affiliate-space-dashboard {
    --dash-bg: #010719;
    --dash-panel: rgba(4, 20, 59, .9);
    --dash-panel-deep: rgba(1, 9, 39, .95);
    --dash-border: #1658d5;
    --dash-border-soft: rgba(44, 113, 255, .42);
    --dash-text: #f8fbff;
    --dash-muted: #b4bedb;
    --dash-blue: #24c8ff;
    --dash-purple: #bf5dff;
    --dash-orange: #ff9c11;
    --dash-green: #06d9b3;
    --dash-red: #ff3b4b;
    width: calc(100vw - 14px);
    max-width: none;
    margin: 6px calc(50% - 50vw + 7px) 36px;
    padding: 6px;
    color: var(--dash-text);
    background:
        radial-gradient(circle at 15% 10%, rgba(0, 116, 255, .15), transparent 25rem),
        radial-gradient(circle at 87% 15%, rgba(126, 73, 255, .18), transparent 25rem),
        linear-gradient(145deg, #010719 0%, #020b29 53%, #01051a 100%);
    border-radius: 18px;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.affiliate-space-dashboard::before,
.affiliate-space-dashboard .dashboard-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 9% 14%, rgba(26, 132, 255, .95) 0 1px, transparent 2px),
        radial-gradient(circle at 74% 26%, rgba(114, 92, 255, .76) 0 1px, transparent 2px),
        linear-gradient(118deg, transparent 25%, rgba(25, 110, 255, .08) 25.5%, transparent 26%);
    background-size: 93px 77px, 137px 113px, 210px 190px;
    opacity: .5;
    pointer-events: none;
}

.affiliate-space-dashboard::before {
    z-index: -1;
}

.affiliate-space-dashboard a {
    color: inherit;
    text-decoration: none;
}

.affiliate-space-dashboard .bi {
    line-height: 1;
}

.affiliate-shell-row {
    --bs-gutter-x: 16px;
    --bs-gutter-y: 14px;
    align-items: stretch;
    margin: 0;
}

.affiliate-main-column {
    min-width: 0;
}

.affiliate-space-dashboard .dashboard-panel {
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 17px;
    background:
        linear-gradient(140deg, rgba(6, 29, 83, .88), rgba(1, 9, 39, .94)) padding-box,
        linear-gradient(105deg, #126ecf 0%, #164fd6 50%, #6441ff 79%, #9b43f4 100%) border-box;
    box-shadow: inset 0 0 24px rgba(0, 85, 255, .09), 0 12px 28px rgba(0, 0, 0, .17);
}

.affiliate-space-dashboard .dashboard-panel > *,
.affiliate-sidebar-card > * {
    position: relative;
    z-index: 1;
}

.affiliate-space-dashboard .dashboard-panel::before,
.affiliate-sidebar-card::before,
.affiliate-stat-card::before,
.affiliate-commission-card::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 14px;
    width: 92px;
    height: 2px;
    border-radius: 99px;
    background: linear-gradient(90deg, transparent, currentColor 44%, transparent);
    box-shadow: 0 0 10px currentColor;
    pointer-events: none;
    z-index: 3;
}

@media (min-width: 1200px) {
    .affiliate-sidebar-column {
        width: 224px;
        max-width: 224px;
        flex: 0 0 224px;
    }

    .affiliate-main-column {
        width: calc(100% - 224px);
        max-width: calc(100% - 224px);
        flex: 1 1 0;
    }
}

.affiliate-mobile-menu {
    min-height: 44px;
    margin-bottom: 14px;
    color: var(--dash-text);
    border: 1px solid rgba(75, 162, 255, .55);
    border-radius: 14px;
    background: rgba(4, 20, 59, .82);
}

.affiliate-space-dashboard .offcanvas-xl {
    color: var(--dash-text);
}

.affiliate-space-dashboard .offcanvas-header {
    color: var(--dash-text);
    background: #071642 !important;
    border-bottom: 1px solid rgba(75, 162, 255, .25);
}

.affiliate-space-dashboard .offcanvas-body > .affiliate-sidebar-card {
    position: relative;
    min-height: calc(100vh - 14px);
    max-height: none;
    padding: 0 12px 12px !important;
    overflow: hidden;
    border-color: rgba(49, 84, 167, .85) !important;
    border-radius: 20px !important;
    background: linear-gradient(180deg, rgba(5, 24, 73, .97), rgba(2, 11, 43, .99)) !important;
    box-shadow: inset 0 0 35px rgba(28, 64, 170, .17), 0 0 26px rgba(10, 94, 255, .15);
}

.affiliate-sidebar-card::before {
    color: #72dfff;
    left: 18px;
    width: 104px;
}

.affiliate-sidebar-brand {
    height: 86px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #e8f0ff;
    border-bottom: 1px solid rgba(75, 111, 199, .22);
    font-size: 11px;
}

.affiliate-sidebar-brand strong {
    color: #1787ff;
    font-size: 30px;
    font-weight: 900;
    letter-spacing: -5px;
    text-shadow: 0 0 14px rgba(0, 122, 255, .55);
}

.affiliate-space-dashboard .affiliate-sidebar-nav {
    padding-top: 0;
}

.affiliate-space-dashboard .list-group-item {
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 0;
    padding: 0 8px;
    color: #eef4ff !important;
    background: transparent !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(68, 98, 172, .22) !important;
    border-radius: 0 !important;
    font-size: .82rem;
    font-weight: 800;
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.affiliate-space-dashboard .list-group-item i {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0 !important;
    color: #9ab8ff;
    border: 1px solid rgba(54, 100, 203, .38);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(74, 133, 255, .15);
}

.affiliate-space-dashboard .list-group-item:hover {
    color: #fff !important;
    background: rgba(43, 151, 255, .12) !important;
    transform: translateX(-3px);
}

.affiliate-space-dashboard .list-group-item.active {
    min-height: 52px;
    margin: 12px 0 4px;
    color: #fff !important;
    border: 1px solid #ffad2e !important;
    border-radius: 13px !important;
    background: linear-gradient(135deg, #df7907, #f7a21c 55%, #bd5505) !important;
    box-shadow:
        0 0 10px rgba(255, 184, 52, .9),
        0 0 28px rgba(255, 143, 15, .62),
        0 0 52px rgba(255, 111, 0, .28),
        inset 0 0 14px #ffd061;
}

.affiliate-space-dashboard .list-group-item.active i {
    color: #fff;
    border-color: rgba(255, 255, 255, .35);
    background: rgba(255, 255, 255, .16);
}

.affiliate-space-dashboard .text-danger {
    color: var(--dash-red) !important;
}

.affiliate-hero {
    min-height: 166px;
    display: grid;
    grid-template-columns: minmax(330px, .9fr) minmax(420px, 1.45fr);
    align-items: stretch;
    gap: 0;
}

.affiliate-profile {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 15px 24px;
}

.affiliate-avatar {
    width: 136px;
    height: 136px;
    flex: 0 0 136px;
    display: grid;
    place-items: center;
    color: #ffac3c;
    font-size: 3.8rem;
    border: 4px solid transparent;
    border-radius: 50%;
    background:
        radial-gradient(circle, #ffcc68 0 10%, #ff8430 32%, #132054 35% 56%, #040c2b 58%) padding-box,
        conic-gradient(from 0deg, #23d7ff, #116fff 37%, #8e52ff 57%, #24bfff 78%, #23d7ff) border-box;
    box-shadow: 0 0 10px #18c7ff, 0 0 24px #165dff, 0 0 38px rgba(124, 59, 255, .55), inset 0 0 20px #1356dd;
}

.affiliate-avatar i {
    filter: drop-shadow(0 0 8px #ff8b2e);
}

.affiliate-profile h1,
.affiliate-promo h2,
.affiliate-section-title {
    color: var(--dash-text);
    font-weight: 900;
    letter-spacing: -.02em;
}

.affiliate-profile h1 {
    margin: 0 0 6px;
    font-size: 1.35rem;
}

.affiliate-profile p {
    margin: 0 0 8px;
    color: var(--dash-muted);
    font-size: .84rem;
}

.affiliate-profile strong[dir="ltr"],
.affiliate-code-text {
    direction: ltr;
    unicode-bidi: isolate;
    letter-spacing: .06em;
}

.affiliate-access-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    color: #dce5ff;
    background: rgba(2, 17, 57, .78);
    border: 1px solid #164ea3;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 900;
}

.affiliate-access-badge i {
    color: #00d99b;
}

.affiliate-wallet-line {
    display: grid;
    grid-template-columns: 34px auto;
    column-gap: 8px;
    align-items: center;
    margin-top: 10px;
    color: var(--dash-muted);
    font-size: .72rem;
}

.affiliate-wallet-line i {
    grid-row: span 2;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    color: #16caff;
    border: 1px solid #1253a9;
    border-radius: 9px;
}

.affiliate-wallet-line strong {
    color: #fff;
    font-size: .95rem;
    font-weight: 800;
}

.affiliate-promo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 17px 24px;
    text-align: right;
}

.affiliate-promo-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    direction: ltr;
}

.affiliate-promo-message > div {
    direction: rtl;
}

.affiliate-target-icon {
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    color: #6c95ff;
    font-size: 3.15rem;
    filter: drop-shadow(0 0 8px #256bff);
}

.affiliate-promo h2 {
    margin: 0;
    font-size: 1.35rem;
}

.affiliate-promo strong {
    color: #ff7316;
    font-size: 1.34rem;
}

.affiliate-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
}

.affiliate-action-btn,
.affiliate-outline-btn {
    min-width: 165px;
    min-height: 45px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    color: var(--dash-text) !important;
    border: 1px solid rgba(90, 159, 255, .55);
    border-radius: 11px;
    font-size: .85rem;
    font-weight: 900;
    transition: transform .18s ease, box-shadow .18s ease;
}

.affiliate-action-btn {
    border-color: #ffc446;
    background: linear-gradient(135deg, #f5a30b, #df7107);
    box-shadow: 0 0 19px rgba(255, 143, 10, .52), inset 0 0 12px #ffc85d;
}

.affiliate-outline-btn {
    background: rgba(4, 20, 59, .66);
}

.affiliate-action-btn:hover,
.affiliate-outline-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(34, 211, 238, .18);
}

.affiliate-stat-grid,
.affiliate-performance-grid,
.affiliate-commission-grid,
.affiliate-table-grid {
    margin-top: 14px;
}

.affiliate-stat-grid > div,
.affiliate-commission-grid .row > div {
    display: flex;
}

.affiliate-stat-card {
    width: 100%;
    min-height: 102px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    color: var(--dash-blue);
    direction: rtl;
}

.affiliate-stat-card > div {
    max-width: 68%;
    color: var(--dash-text);
}

.affiliate-stat-card h3 {
    margin: 0 0 7px;
    color: #cbd3ea;
    font-size: .76rem;
    font-weight: 800;
}

.affiliate-stat-card strong {
    display: block;
    margin-bottom: 2px;
    color: #fff;
    font-size: 1.42rem;
    font-weight: 900;
    line-height: 1.35;
}

.affiliate-stat-card p {
    margin: 0;
    color: var(--dash-muted);
    font-size: .68rem;
}

.affiliate-stat-icon {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    display: grid;
    place-items: center;
    color: currentColor;
    border: 1px solid rgba(86, 151, 255, .18);
    border-radius: 18px;
    background: radial-gradient(circle, rgba(22, 46, 104, .72), rgba(3, 13, 44, .5) 62%);
    box-shadow: 0 0 22px rgba(36, 200, 255, .2);
    font-size: 2.05rem;
    filter: drop-shadow(0 0 7px currentColor);
}

.affiliate-stat-card.purple {
    color: var(--dash-purple);
}

.affiliate-stat-card.green {
    color: var(--dash-green);
}

.affiliate-stat-card.orange {
    color: var(--dash-orange);
}

.affiliate-performance-panel {
    min-height: 218px;
    padding: 12px 15px 13px;
}

.affiliate-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 6px 9px;
}

.affiliate-section-title {
    margin: 0;
    font-size: 1.12rem;
}

.affiliate-section-head a,
.affiliate-section-head select {
    order: 2;
    min-height: 30px;
    padding: 5px 14px;
    color: #b9c5e4 !important;
    background: #03133e;
    border: 1px solid #1e4b9f;
    border-radius: 999px;
    outline: none;
    font-size: .66rem;
}

.affiliate-chart-filter {
    order: 2;
    margin: 0;
}

.affiliate-chart-filter select {
    cursor: pointer;
}

.affiliate-performance-panel .row {
    --bs-gutter-x: 12px;
    --bs-gutter-y: 10px;
}

.affiliate-metric-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.affiliate-metric {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(3, 18, 59, .74);
    border: 1px solid rgba(35, 86, 184, .58);
    border-radius: 11px;
}

.affiliate-metric i {
    color: #6fa2ff;
    font-size: 1.35rem;
}

.affiliate-metric span {
    display: block;
    margin-bottom: 2px;
    color: #c4cce1;
    font-size: .64rem;
}

.affiliate-metric strong {
    color: #fff;
    font-size: .76rem;
    font-weight: 800;
}

.affiliate-metric-wide {
    grid-column: 1 / -1;
    min-height: 56px;
    justify-content: center;
    text-align: center;
}

.affiliate-metric-wide strong {
    font-size: 1.28rem;
}

.affiliate-chart-card {
    min-height: 154px;
    padding: 4px 8px 6px;
    background:
        linear-gradient(rgba(64, 137, 255, .08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(64, 137, 255, .08) 1px, transparent 1px);
    background-size: 52px 38px;
}

.affiliate-chart-title {
    margin: 0 0 2px;
    color: #d9e0f5;
    text-align: center;
    font-size: .72rem;
    font-weight: 800;
}

.affiliate-chart-svg {
    width: 100%;
    height: 148px;
    display: block;
    overflow: visible;
    direction: ltr;
}

.affiliate-chart-area {
    fill: rgba(34, 163, 255, .1);
}

.affiliate-chart-stroke {
    fill: none;
    stroke: #58c8ff;
    stroke-width: 2.25;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 4px #29a9ff) drop-shadow(0 0 9px rgba(32, 132, 255, .48));
}

.affiliate-chart-dot {
    fill: #bdf4ff;
    stroke: #38bdf8;
    stroke-width: 1.2;
    filter: drop-shadow(0 0 4px #38bdf8);
}

.affiliate-chart-label {
    margin: 1px 0 0;
    color: var(--dash-muted);
    text-align: center;
    font-size: .62rem;
}

.affiliate-commission-panel,
.affiliate-table-panel {
    padding: 11px 16px 13px;
}

.affiliate-commission-panel .affiliate-section-head {
    justify-content: flex-start;
}

.affiliate-commission-card {
    width: 100%;
    min-height: 118px;
    position: relative;
    padding: 14px 86px 14px 16px;
    color: var(--dash-orange);
    background: radial-gradient(circle at 7% 35%, rgba(255, 121, 21, .18), transparent 40%), rgba(3, 17, 55, .88);
    border: 1px solid currentColor;
    border-radius: 13px;
    overflow: hidden;
}

.affiliate-commission-card > div {
    color: #dce3f7;
}

.affiliate-commission-card h3 {
    display: none;
}

.affiliate-commission-card > div span {
    display: block;
    color: #b8c1dd;
    font-size: .65rem;
}

.affiliate-commission-card strong {
    display: block;
    color: #fff;
    font-size: 1.28rem;
    font-weight: 900;
}

.affiliate-commission-card p {
    margin: 0;
    color: #fff;
    font-size: .88rem;
    font-weight: 900;
}

.affiliate-commission-card hr {
    margin: 7px 0;
    border-color: rgba(84, 107, 169, .36);
    opacity: 1;
}

.affiliate-commission-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    color: currentColor;
    background: radial-gradient(circle, rgba(12, 28, 70, .92), rgba(3, 13, 44, .52) 66%);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 18px;
    box-shadow: 0 0 24px rgba(255, 156, 17, .2), inset 0 0 16px rgba(255, 255, 255, .03);
    transform: translateY(-50%);
    font-size: 2.45rem;
    filter: drop-shadow(0 0 7px currentColor);
}

.affiliate-commission-icon i,
.affiliate-commission-icon i::before {
    width: 1em;
    height: 1em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    color: currentColor;
    font-size: 1em;
    line-height: 1;
    vertical-align: middle;
}

.affiliate-commission-card.tone-exam {
    color: #22e0c5;
    background: radial-gradient(circle at 7% 35%, rgba(0, 218, 177, .17), transparent 40%), rgba(3, 17, 55, .88);
}

.affiliate-commission-card.tone-package {
    color: #42bfff;
    background: radial-gradient(circle at 7% 35%, rgba(29, 157, 255, .18), transparent 40%), rgba(3, 17, 55, .88);
}

.affiliate-commission-card.tone-course {
    color: #bf5dff;
    background: radial-gradient(circle at 7% 35%, rgba(161, 59, 255, .18), transparent 40%), rgba(3, 17, 55, .88);
}

.percent-range,
.percent-value {
    direction: rtl;
    unicode-bidi: isolate;
}

.percent-range {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    white-space: nowrap;
}

.affiliate-table-panel {
    min-height: 150px;
}

.affiliate-table-wrap {
    overflow-x: auto;
    background: rgba(3, 13, 44, .38);
    border: 1px solid rgba(33, 77, 166, .48);
    border-radius: 10px;
}

.affiliate-table {
    width: 100%;
    min-width: 720px;
    margin: 0;
    color: var(--dash-text);
    border-collapse: collapse;
    font-size: .68rem;
}

.affiliate-table th,
.affiliate-table td {
    padding: 9px 15px;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    border-bottom: 1px solid rgba(46, 76, 146, .25);
}

.affiliate-table tbody tr:last-child td {
    border-bottom: 0;
}

.affiliate-table th {
    color: #aebbdc;
    background: rgba(3, 17, 55, .72);
    font-weight: 500;
}

.affiliate-code-pill {
    min-width: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .22rem .5rem;
    color: #bdf4ff;
    background: rgba(34, 211, 238, .12);
    border: 1px solid rgba(34, 211, 238, .45);
    border-radius: 999px;
    direction: ltr;
    font-weight: 900;
    letter-spacing: .04em;
    unicode-bidi: isolate;
}

.affiliate-money,
.affiliate-date {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    unicode-bidi: isolate;
}

.affiliate-date {
    display: inline-block;
    direction: ltr;
}

.affiliate-transaction-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #cbd5ef;
}

.affiliate-transaction-type i {
    color: #6b88ff;
    font-size: .95rem;
}

.affiliate-status-success,
.affiliate-money-plus {
    color: #22d777;
    font-weight: 900;
}

.affiliate-empty {
    margin: 0;
    padding: 18px;
    color: var(--dash-muted);
    background: rgba(3, 13, 44, .42);
    border: 1px dashed rgba(78, 143, 255, .38);
    border-radius: 18px;
}

.affiliate-space-dashboard .pagination,
.affiliate-space-dashboard .page-link {
    color: #cfe3ff;
    background: rgba(3, 13, 44, .65);
    border-color: rgba(78, 143, 255, .38);
}

.affiliate-space-dashboard .page-item.active .page-link {
    background: linear-gradient(135deg, #ffb33b, #ff8b1a);
    border-color: transparent;
}

@media (max-width: 1399.98px) {
    .affiliate-hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1199.98px) {
    .affiliate-space-dashboard {
        width: 100%;
        margin: 0 0 32px;
        padding: 10px;
        border-radius: 0;
    }

    .affiliate-sidebar-column,
    .affiliate-main-column {
        width: 100%;
        max-width: 100%;
    }

    .affiliate-space-dashboard .offcanvas-body > .affiliate-sidebar-card {
        min-height: auto;
        overflow-y: auto;
    }
}

@media (max-width: 767.98px) {
    .affiliate-profile,
    .affiliate-promo-message {
        flex-direction: column;
        text-align: center;
    }

    .affiliate-profile {
        justify-content: center;
    }

    .affiliate-wallet-line {
        justify-content: center;
    }

    .affiliate-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .affiliate-action-btn {
        grid-column: 1 / -1;
    }

    .affiliate-stat-card > div {
        max-width: 72%;
    }
}

@media (max-width: 575.98px) {
    .affiliate-space-dashboard {
        padding: 9px;
    }

    .affiliate-avatar {
        width: 104px;
        height: 104px;
        flex-basis: 104px;
        font-size: 3rem;
    }

    .affiliate-promo h2,
    .affiliate-promo strong {
        font-size: 1rem;
    }

    .affiliate-action-btn,
    .affiliate-outline-btn {
        min-width: 0;
        padding-inline: 10px;
        font-size: .72rem;
    }

    .affiliate-stat-card {
        min-height: 98px;
        padding: 12px 10px;
    }

    .affiliate-stat-icon {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
        font-size: 1.65rem;
    }

    .affiliate-metric-list {
        grid-template-columns: 1fr;
    }

    .affiliate-chart-svg {
        height: 142px;
    }

    .affiliate-commission-card {
        padding: 76px 14px 14px;
        text-align: center;
    }

    .affiliate-commission-icon {
        top: 14px;
        left: 50%;
        transform: translateX(-50%);
    }
}

.affiliate-sidebar-column .offcanvas-xl {
    color: var(--dash-text);
}

.affiliate-sidebar-column .offcanvas-header {
    color: var(--dash-text);
    background: #071642 !important;
    border-bottom: 1px solid rgba(75, 162, 255, .25);
}

.affiliate-sidebar-column .offcanvas-body > .affiliate-sidebar-card {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 14px);
    max-height: none;
    padding: 0 12px 12px !important;
    overflow: hidden;
    border-color: rgba(49, 84, 167, .85) !important;
    border-radius: 20px !important;
    background: linear-gradient(180deg, rgba(5, 24, 73, .97), rgba(2, 11, 43, .99)) !important;
    box-shadow: inset 0 0 35px rgba(28, 64, 170, .17), 0 0 26px rgba(10, 94, 255, .15);
}

.affiliate-sidebar-column .affiliate-sidebar-card::before {
    color: #72dfff;
    left: 18px;
    width: 104px;
}

.affiliate-sidebar-column .affiliate-sidebar-nav {
    padding-top: 0;
}

.affiliate-sidebar-column .list-group-item {
    min-height: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0 8px !important;
    color: #eef4ff !important;
    background: transparent !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(68, 98, 172, .22) !important;
    border-radius: 0 !important;
    font-size: .78rem;
    font-weight: 800;
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.affiliate-sidebar-column .list-group-item i {
    width: 31px;
    height: 31px;
    flex: 0 0 31px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0 !important;
    margin-right: 0 !important;
    color: #9ab8ff;
    background: rgba(19, 56, 120, .5);
    border: 1px solid rgba(80, 139, 255, .45);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(69, 154, 255, .2), inset 0 0 12px rgba(56, 126, 255, .1);
    text-shadow: 0 0 8px rgba(159, 211, 255, .62);
}

.affiliate-sidebar-column .list-group-item:hover {
    color: #fff !important;
    background: linear-gradient(90deg, rgba(0, 191, 255, .16), rgba(104, 76, 255, .08)) !important;
    box-shadow: inset 0 0 16px rgba(36, 111, 255, .11);
    transform: translateX(-2px);
}

.affiliate-sidebar-column .list-group-item.active {
    min-height: 50px;
    margin: 10px 0 4px;
    color: #fff !important;
    border: 1px solid #ffad2e !important;
    border-radius: 13px !important;
    background: linear-gradient(135deg, #df7907, #f7a21c 55%, #bd5505) !important;
    box-shadow:
        0 0 10px rgba(255, 184, 52, .9),
        0 0 28px rgba(255, 143, 15, .62),
        inset 0 0 14px #ffd061;
}

.affiliate-sidebar-column .list-group-item.active i {
    color: #fff;
    background: rgba(255, 255, 255, .16);
    border-color: rgba(255, 255, 255, .38);
    box-shadow: 0 0 12px rgba(255, 205, 97, .7), inset 0 0 12px rgba(255, 255, 255, .18);
}

.sales-agent-shared-header {
    margin-bottom: 14px;
    border: 1px solid transparent;
    background:
        linear-gradient(140deg, rgba(6, 29, 83, .9), rgba(1, 9, 39, .95)) padding-box,
        linear-gradient(105deg, #1588ff 0%, #155ee7 42%, #573cff 74%, #a13cff 100%) border-box;
    box-shadow: inset 0 0 26px rgba(28, 83, 255, .09), 0 0 18px rgba(29, 85, 255, .08);
}

.sales-agent-shared-header::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .42;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 9% 14%, #1a84ff 0 1px, transparent 2px),
        radial-gradient(circle at 74% 26%, #725cff 0 1px, transparent 2px),
        linear-gradient(118deg, transparent 25%, rgba(25, 110, 255, .08) 25.5%, transparent 26%);
    background-size: 93px 77px, 137px 113px, 210px 190px;
}

.sales-agent-shared-header > * {
    position: relative;
    z-index: 1;
}

.affiliate-avatar--image {
    padding: 9px;
    font-size: 0;
    background:
        linear-gradient(#06133a, #020a23) padding-box,
        conic-gradient(from 0deg, #8b77c8 0deg, #25c9ff 28deg, #168cff 145deg, #7d70c0 180deg, #ffad32 215deg, #ff7025 330deg, #8b77c8 360deg) border-box;
    box-shadow:
        8px 0 12px rgba(0, 197, 255, .72),
        15px 0 26px rgba(30, 84, 255, .45),
        -8px 0 12px rgba(255, 157, 39, .66),
        -15px 0 26px rgba(255, 89, 16, .34),
        inset 0 0 12px rgba(57, 106, 220, .5);
}

.affiliate-avatar--image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border: 1px solid rgba(113, 150, 229, .55);
    border-radius: 50%;
    background: #071642;
}

@media (min-width: 1200px) {
    .affiliate-sidebar-column + .col-xl-9 {
        width: calc(100% - 224px);
        max-width: calc(100% - 224px);
        flex: 0 0 calc(100% - 224px);
    }
}

@media (max-width: 1199.98px) {
    .affiliate-sidebar-column .offcanvas-body > .affiliate-sidebar-card {
        min-height: auto;
        overflow-y: auto;
    }

    .sales-agent-shared-header {
        margin-top: 10px;
    }
}

@media (max-width: 767.98px) {
    .sales-agent-shared-header {
        min-height: 0;
    }
}

/* Theme layer: light by default, neon only in dark mode. */
.affiliate-space-dashboard,
.sales-agent-layout {
    --dash-text: #17233c;
    --dash-muted: #62728a;
    --dash-blue: #0078d4;
    --dash-purple: #7952f6;
    --dash-orange: #f28a00;
    --dash-green: #0aa77d;
    --dash-red: #dc3545;
    --dash-panel-light: #ffffff;
    --dash-panel-light-soft: #f7faff;
    --dash-line-light: rgba(82, 142, 236, .32);
    color: var(--dash-text);
}

.affiliate-space-dashboard {
    background:
        radial-gradient(circle at 14% 10%, rgba(37, 145, 255, .08), transparent 24rem),
        linear-gradient(145deg, #f6f9fd 0%, #eef5ff 100%);
}

.sales-agent-layout {
    min-height: calc(100vh - 72px);
    margin-top: 0;
    padding: 8px 0 36px !important;
    background:
        radial-gradient(circle at 15% 8%, rgba(37, 145, 255, .08), transparent 24rem),
        linear-gradient(145deg, #f8fbff 0%, #eef5ff 100%);
}

.sales-agent-layout > .container {
    width: calc(100% - 16px);
    max-width: none;
}

.sales-agent-layout > .container > .row {
    --bs-gutter-x: 16px;
    --bs-gutter-y: 14px;
    align-items: stretch;
}

.affiliate-space-dashboard .dashboard-panel,
.sales-agent-shared-header,
.affiliate-stat-card,
.affiliate-performance-panel,
.affiliate-commission-panel,
.affiliate-table-panel,
.sales-agent-layout .affiliate-main-column > .card,
.sales-agent-layout .affiliate-main-column > .row .card,
.sales-agent-layout .discount-card,
.sales-agent-layout .sales-agent-sms-card,
.sales-agent-layout .sa-panel,
.sales-agent-layout .sa-card,
.sales-agent-layout .sa-stat-card {
    color: var(--dash-text);
    border: 1px solid var(--dash-line-light) !important;
    border-radius: 17px !important;
    background: linear-gradient(145deg, var(--dash-panel-light), var(--dash-panel-light-soft)) !important;
    box-shadow: 0 12px 28px rgba(33, 66, 110, .08) !important;
}

.affiliate-space-dashboard .dashboard-panel::after,
.sales-agent-shared-header::after {
    opacity: 0;
}

.affiliate-space-dashboard .dashboard-panel::before,
.affiliate-sidebar-card::before,
.affiliate-stat-card::before,
.affiliate-commission-card::before {
    color: #80b8ff;
    box-shadow: none;
    opacity: .55;
}

.affiliate-profile h1,
.affiliate-promo h2,
.affiliate-section-title,
.sales-agent-layout h1,
.sales-agent-layout h2,
.sales-agent-layout h3,
.sales-agent-layout h4,
.sales-agent-layout h5,
.sales-agent-layout h6,
.sales-agent-layout .card-header-title,
.sales-agent-layout .discount-title,
.sales-agent-layout .sa-panel-title,
.sales-agent-layout .sa-card-title,
.sales-agent-layout .sa-stat-value {
    color: var(--dash-text) !important;
}

.affiliate-profile p,
.affiliate-chart-label,
.affiliate-stat-card p,
.sales-agent-layout p,
.sales-agent-layout .text-secondary,
.sales-agent-layout .discount-subtitle,
.sales-agent-layout .sa-panel-subtitle,
.sales-agent-layout .sa-card-subtitle,
.sales-agent-layout .sa-stat-label,
.sales-agent-layout .sales-agent-password-subtitle {
    color: var(--dash-muted) !important;
}

.affiliate-stat-card > div,
.affiliate-commission-card > div,
.affiliate-table td,
.affiliate-transaction-type,
.affiliate-metric strong,
.affiliate-stat-card strong,
.affiliate-wallet-line strong,
.affiliate-commission-card strong,
.affiliate-commission-card p {
    color: var(--dash-text) !important;
}

.affiliate-wallet-line strong,
.affiliate-money-plus,
.affiliate-status-success {
    color: #078767 !important;
}

.affiliate-access-badge {
    color: #116149;
    background: rgba(10, 167, 125, .08);
    border-color: rgba(10, 167, 125, .38);
}

.affiliate-access-badge i {
    color: #0aa77d;
}

.affiliate-wallet-line i,
.affiliate-sidebar-column .list-group-item i,
.affiliate-space-dashboard .list-group-item i {
    color: #2f6fd2;
    background: rgba(57, 128, 235, .07);
    border-color: rgba(57, 128, 235, .25);
    box-shadow: none;
    text-shadow: none;
}

.affiliate-action-btn {
    color: #fff !important;
    border-color: #ffb43b;
    box-shadow: 0 8px 18px rgba(188, 107, 9, .2);
}

.affiliate-outline-btn,
.affiliate-section-head a,
.affiliate-section-head select,
.affiliate-mobile-menu {
    color: #1d3d6d !important;
    background: rgba(255, 255, 255, .74);
    border-color: rgba(57, 128, 235, .3);
    box-shadow: none;
}

.affiliate-target-icon {
    color: #3b7de5;
    filter: none;
}

.affiliate-avatar--image {
    background:
        linear-gradient(#ffffff, #eef6ff) padding-box,
        linear-gradient(135deg, #b9d5f5, #ffb347) border-box;
    box-shadow: 0 12px 24px rgba(37, 74, 120, .14);
}

.affiliate-avatar--image img {
    background: #f4f8ff;
}

.affiliate-sidebar-column .offcanvas-header,
.affiliate-space-dashboard .offcanvas-header {
    color: var(--dash-text);
    background: #f4f8ff !important;
    border-bottom-color: var(--dash-line-light);
}

.affiliate-sidebar-column .offcanvas-body > .affiliate-sidebar-card,
.affiliate-space-dashboard .offcanvas-body > .affiliate-sidebar-card {
    color: var(--dash-text);
    border-color: var(--dash-line-light) !important;
    background: linear-gradient(180deg, #ffffff, #f7f9fc) !important;
    box-shadow: 0 12px 28px rgba(33, 66, 110, .08) !important;
}

.affiliate-sidebar-brand {
    color: #3d4c66;
    border-bottom-color: rgba(82, 111, 161, .16);
}

.affiliate-sidebar-column .list-group-item,
.affiliate-space-dashboard .list-group-item {
    color: var(--dash-text) !important;
    border-bottom-color: rgba(82, 111, 161, .14) !important;
}

.affiliate-sidebar-column .list-group-item:hover,
.affiliate-space-dashboard .list-group-item:hover {
    color: #10213b !important;
    background: rgba(43, 151, 255, .08) !important;
    box-shadow: none;
}

.affiliate-sidebar-column .list-group-item.active,
.affiliate-space-dashboard .list-group-item.active {
    color: #fff !important;
    box-shadow: 0 8px 18px rgba(188, 107, 9, .2);
}

.affiliate-metric,
.affiliate-table-wrap,
.affiliate-chart-card {
    background-color: rgba(255, 255, 255, .55) !important;
    border-color: rgba(82, 142, 236, .28) !important;
}

.affiliate-chart-title,
.affiliate-table th {
    color: #314560 !important;
}

.affiliate-chart-stroke {
    stroke: #2383e8;
    filter: none;
}

.affiliate-chart-dot {
    fill: #ffffff;
    stroke: #2383e8;
    filter: none;
}

.affiliate-chart-area {
    fill: rgba(35, 131, 232, .08);
}

.affiliate-commission-card {
    background: rgba(255, 255, 255, .52) !important;
}

.affiliate-commission-icon,
.affiliate-stat-icon {
    background: rgba(57, 128, 235, .07);
    border-color: rgba(57, 128, 235, .14);
    box-shadow: none;
    filter: none;
}

.sales-agent-layout .card-header,
.sales-agent-layout .discount-card-header,
.sales-agent-layout .sales-agent-sms-card .card-header,
.sales-agent-layout .sa-panel-header,
.sales-agent-layout .sa-card-header {
    background: linear-gradient(180deg, #ffffff, #f8fbff) !important;
    border-bottom-color: rgba(82, 142, 236, .2) !important;
}

.sales-agent-layout .card-body,
.sales-agent-layout .discount-card-body,
.sales-agent-layout .sales-agent-sms-card .card-body,
.sales-agent-layout .sa-panel-body,
.sales-agent-layout .sa-card-body {
    background: transparent !important;
}

.sales-agent-layout .form-control,
.sales-agent-layout .form-select,
.sales-agent-layout .input-group-text,
.sales-agent-layout .select2-container--default .select2-selection--multiple,
.sales-agent-layout .select2-container--default .select2-selection--single {
    color: #17233c !important;
    background-color: #fff !important;
    border-color: #dbe7f5 !important;
}

.sales-agent-layout .table {
    color: var(--dash-text);
}

.sales-agent-layout .table > :not(caption) > * > * {
    color: var(--dash-text);
    background-color: transparent;
    border-bottom-color: rgba(82, 142, 236, .18);
}

html[data-theme="dark"] .affiliate-space-dashboard,
html[data-theme="dark"] .sales-agent-layout {
    --dash-text: #f8fbff;
    --dash-muted: #b4bedb;
    --dash-blue: #24c8ff;
    --dash-purple: #bf5dff;
    --dash-orange: #ff9c11;
    --dash-green: #06d9b3;
    --dash-red: #ff3b4b;
    color: var(--dash-text);
}

html[data-theme="dark"] .affiliate-space-dashboard {
    background:
        radial-gradient(circle at 15% 10%, rgba(0, 115, 255, 0), transparent 25rem),
        radial-gradient(circle at 87% 15%, rgba(125, 73, 255, 0), transparent 25rem),
        linear-gradient(145deg, #01071900 0%, #020b2900 53%, #01051a00 100%);
}

html[data-theme="dark"] .sales-agent-layout {
    background:
        radial-gradient(circle at 15% 10%, rgba(0, 116, 255, .15), transparent 25rem),
        radial-gradient(circle at 87% 15%, rgba(126, 73, 255, .12), transparent 25rem),
        linear-gradient(145deg, #010719 0%, #020b29 53%, #01051a 100%);
}

html[data-theme="dark"] .affiliate-space-dashboard .dashboard-panel,
html[data-theme="dark"] .sales-agent-shared-header,
html[data-theme="dark"] .affiliate-stat-card,
html[data-theme="dark"] .affiliate-performance-panel,
html[data-theme="dark"] .affiliate-commission-panel,
html[data-theme="dark"] .affiliate-table-panel,
html[data-theme="dark"] .sales-agent-layout .affiliate-main-column > .card,
html[data-theme="dark"] .sales-agent-layout .affiliate-main-column > .row .card,
html[data-theme="dark"] .sales-agent-layout .discount-card,
html[data-theme="dark"] .sales-agent-layout .sales-agent-sms-card,
html[data-theme="dark"] .sales-agent-layout .sa-panel,
html[data-theme="dark"] .sales-agent-layout .sa-card,
html[data-theme="dark"] .sales-agent-layout .sa-stat-card {
    color: var(--dash-text);
    border-color: transparent !important;
    background:
        linear-gradient(140deg, rgba(6, 29, 83, .88), rgba(1, 9, 39, .94)) padding-box,
        linear-gradient(105deg, #126ecf 0%, #164fd6 50%, #6441ff 79%, #9b43f4 100%) border-box !important;
    box-shadow: inset 0 0 24px rgba(0, 85, 255, .09), 0 12px 28px rgba(0, 0, 0, .17) !important;
}

html[data-theme="dark"] .affiliate-space-dashboard .dashboard-panel::after,
html[data-theme="dark"] .sales-agent-shared-header::after {
    opacity: .42;
}

html[data-theme="dark"] .affiliate-space-dashboard .dashboard-panel::before,
html[data-theme="dark"] .affiliate-sidebar-card::before,
html[data-theme="dark"] .affiliate-stat-card::before,
html[data-theme="dark"] .affiliate-commission-card::before {
    color: #72dfff;
    box-shadow: 0 0 10px currentColor;
    opacity: 1;
}

html[data-theme="dark"] .affiliate-wallet-line strong {
    color: #fff !important;
}

html[data-theme="dark"] .affiliate-access-badge {
    color: #dce5ff;
    background: rgba(2, 17, 57, .78);
    border-color: #164ea3;
}

html[data-theme="dark"] .affiliate-access-badge i {
    color: #00d99b;
}

html[data-theme="dark"] .affiliate-action-btn {
    box-shadow: 0 0 19px rgba(255, 143, 10, .52), inset 0 0 12px #ffc85d;
}

html[data-theme="dark"] .affiliate-outline-btn,
html[data-theme="dark"] .affiliate-section-head a,
html[data-theme="dark"] .affiliate-section-head select,
html[data-theme="dark"] .affiliate-mobile-menu {
    color: var(--dash-text) !important;
    background: rgba(4, 20, 59, .66);
    border-color: rgba(90, 159, 255, .55);
}

html[data-theme="dark"] .affiliate-target-icon {
    color: #6c95ff;
    filter: drop-shadow(0 0 8px #256bff);
}

html[data-theme="dark"] .affiliate-avatar--image {
    background:
        linear-gradient(#06133a, #020a23) padding-box,
        conic-gradient(from 0deg, #8b77c8 0deg, #25c9ff 28deg, #168cff 145deg, #7d70c0 180deg, #ffad32 215deg, #ff7025 330deg, #8b77c8 360deg) border-box;
    box-shadow:
        8px 0 12px rgba(0, 197, 255, .72),
        15px 0 26px rgba(30, 84, 255, .45),
        -8px 0 12px rgba(255, 157, 39, .66),
        -15px 0 26px rgba(255, 89, 16, .34),
        inset 0 0 12px rgba(57, 106, 220, .5);
}

html[data-theme="dark"] .affiliate-avatar--image img {
    background: #071642;
}

html[data-theme="dark"] .affiliate-sidebar-column .offcanvas-header,
html[data-theme="dark"] .affiliate-space-dashboard .offcanvas-header {
    color: var(--dash-text);
    background: #071642 !important;
    border-bottom-color: rgba(75, 162, 255, .25);
}

html[data-theme="dark"] .affiliate-sidebar-column .offcanvas-body > .affiliate-sidebar-card,
html[data-theme="dark"] .affiliate-space-dashboard .offcanvas-body > .affiliate-sidebar-card {
    color: var(--dash-text);
    border-color: rgba(49, 84, 167, .85) !important;
    background: linear-gradient(180deg, rgba(5, 24, 73, .97), rgba(2, 11, 43, .99)) !important;
    box-shadow: inset 0 0 35px rgba(28, 64, 170, .17), 0 0 26px rgba(10, 94, 255, .15) !important;
}

html[data-theme="dark"] .affiliate-sidebar-brand {
    color: #e8f0ff;
    border-bottom-color: rgba(75, 111, 199, .22);
}

html[data-theme="dark"] .affiliate-sidebar-column .list-group-item,
html[data-theme="dark"] .affiliate-space-dashboard .list-group-item {
    color: #eef4ff !important;
    border-bottom-color: rgba(68, 98, 172, .22) !important;
}

html[data-theme="dark"] .affiliate-sidebar-column .list-group-item i,
html[data-theme="dark"] .affiliate-space-dashboard .list-group-item i {
    color: #9ab8ff;
    background: rgba(19, 56, 120, .5);
    border-color: rgba(80, 139, 255, .45);
    box-shadow: 0 0 10px rgba(69, 154, 255, .2), inset 0 0 12px rgba(56, 126, 255, .1);
    text-shadow: 0 0 8px rgba(159, 211, 255, .62);
}

html[data-theme="dark"] .affiliate-sidebar-column .list-group-item:hover,
html[data-theme="dark"] .affiliate-space-dashboard .list-group-item:hover {
    color: #fff !important;
    background: linear-gradient(90deg, rgba(0, 191, 255, .16), rgba(104, 76, 255, .08)) !important;
    box-shadow: inset 0 0 16px rgba(36, 111, 255, .11);
}

html[data-theme="dark"] .affiliate-sidebar-column .list-group-item.active,
html[data-theme="dark"] .affiliate-space-dashboard .list-group-item.active {
    color: #fff !important;
    box-shadow:
        0 0 10px rgba(255, 184, 52, .9),
        0 0 28px rgba(255, 143, 15, .62),
        inset 0 0 14px #ffd061;
}

html[data-theme="dark"] .affiliate-metric,
html[data-theme="dark"] .affiliate-table-wrap,
html[data-theme="dark"] .affiliate-chart-card {
    background-color: rgba(3, 18, 59, .74) !important;
    border-color: rgba(35, 86, 184, .58) !important;
}

html[data-theme="dark"] .affiliate-chart-title,
html[data-theme="dark"] .affiliate-table th {
    color: #d9e0f5 !important;
}

html[data-theme="dark"] .affiliate-chart-stroke {
    stroke: #58c8ff;
    filter: drop-shadow(0 0 4px #29a9ff) drop-shadow(0 0 9px rgba(32, 132, 255, .48));
}

html[data-theme="dark"] .affiliate-chart-dot {
    fill: #bdf4ff;
    stroke: #38bdf8;
    filter: drop-shadow(0 0 4px #38bdf8);
}

html[data-theme="dark"] .affiliate-chart-area {
    fill: rgba(34, 163, 255, .1);
}

html[data-theme="dark"] .affiliate-commission-icon,
html[data-theme="dark"] .affiliate-stat-icon {
    background: radial-gradient(circle, rgba(12, 28, 70, .92), rgba(3, 13, 44, .52) 66%);
    border-color: rgba(255, 255, 255, .08);
    box-shadow: 0 0 24px rgba(255, 156, 17, .2), inset 0 0 16px rgba(255, 255, 255, .03);
    filter: drop-shadow(0 0 7px currentColor);
}

html[data-theme="dark"] .sales-agent-layout .card-header,
html[data-theme="dark"] .sales-agent-layout .discount-card-header,
html[data-theme="dark"] .sales-agent-layout .sales-agent-sms-card .card-header,
html[data-theme="dark"] .sales-agent-layout .sa-panel-header,
html[data-theme="dark"] .sales-agent-layout .sa-card-header {
    background: rgba(3, 17, 55, .72) !important;
    border-bottom-color: rgba(75, 162, 255, .22) !important;
}

html[data-theme="dark"] .sales-agent-layout .form-control,
html[data-theme="dark"] .sales-agent-layout .form-select,
html[data-theme="dark"] .sales-agent-layout .input-group-text,
html[data-theme="dark"] .sales-agent-layout .select2-container--default .select2-selection--multiple,
html[data-theme="dark"] .sales-agent-layout .select2-container--default .select2-selection--single {
    color: #f8fbff !important;
    background-color: rgba(3, 13, 44, .78) !important;
    border-color: rgba(80, 139, 255, .42) !important;
}

html[data-theme="dark"] .sales-agent-layout .form-control::placeholder {
    color: rgba(224, 234, 255, .55);
}

html[data-theme="dark"] .sales-agent-layout .table > :not(caption) > * > * {
    color: var(--dash-text);
    border-bottom-color: rgba(78, 143, 255, .22);
}

/* Shared sales-agent page polish. Keep this scoped so the busy public pages stay untouched. */
.sales-agent-layout .form-label,
.sales-agent-layout label,
.sales-agent-layout .form-check-label,
.sales-agent-layout .text-dark,
.sales-agent-layout .text-white:not(.btn):not(.badge),
.sales-agent-layout .modal-title {
    color: var(--dash-text) !important;
}

.sales-agent-layout .text-muted,
.sales-agent-layout small,
.sales-agent-layout .small {
    color: var(--dash-muted) !important;
}

.sales-agent-layout .border,
.sales-agent-layout .border-top,
.sales-agent-layout .border-bottom,
.sales-agent-layout .border-start,
.sales-agent-layout .border-end,
.sales-agent-layout .table-responsive {
    border-color: var(--dash-line-light) !important;
}

.sales-agent-layout .table-responsive,
.sales-agent-layout .alert,
.sales-agent-layout .modal-content {
    border-radius: 16px;
}

.sales-agent-layout .modal-content {
    color: var(--dash-text);
    border: 1px solid var(--dash-line-light);
    background: #fff;
}

.sales-agent-layout .modal-header,
.sales-agent-layout .modal-footer {
    border-color: rgba(82, 142, 236, .2);
}

.sales-agent-layout .alert {
    color: #24344e;
    border-color: rgba(82, 142, 236, .22) !important;
    background: rgba(255, 255, 255, .78);
}

.sales-agent-layout .alert-info {
    color: #155b80;
    background: rgba(36, 177, 255, .09);
}

.sales-agent-layout .alert-warning,
.sales-agent-layout .sa-soft-alert-warning {
    color: #80520d;
    background: rgba(255, 165, 29, .11) !important;
    border-color: rgba(255, 165, 29, .28) !important;
}

.sales-agent-layout .alert-danger,
.sales-agent-layout .sa-soft-alert-danger {
    color: #8b2430;
    background: rgba(220, 53, 69, .08) !important;
    border-color: rgba(220, 53, 69, .22) !important;
}

.sales-agent-layout .sa-soft-alert,
.sales-agent-layout .sa-soft-alert-info {
    color: #155b80;
    background: rgba(36, 177, 255, .08) !important;
    border-color: rgba(36, 177, 255, .22) !important;
}

.sales-agent-layout .select2-dropdown,
.sales-agent-layout .select2-container--default .select2-search--dropdown .select2-search__field,
.sales-agent-layout .select2-container--default .select2-results__option {
    color: var(--dash-text);
    border-color: rgba(82, 142, 236, .28) !important;
    background: #fff !important;
}

.sales-agent-layout .select2-container--default .select2-results__option--highlighted[aria-selected] {
    color: #fff !important;
    background: #1b82e8 !important;
}

html[data-theme="dark"] .sales-agent-layout .border,
html[data-theme="dark"] .sales-agent-layout .border-top,
html[data-theme="dark"] .sales-agent-layout .border-bottom,
html[data-theme="dark"] .sales-agent-layout .border-start,
html[data-theme="dark"] .sales-agent-layout .border-end,
html[data-theme="dark"] .sales-agent-layout .table-responsive {
    border-color: rgba(75, 162, 255, .22) !important;
}

html[data-theme="dark"] .sales-agent-layout .modal-content {
    color: var(--dash-text);
    border-color: rgba(80, 139, 255, .35);
    background:
        linear-gradient(140deg, rgba(6, 29, 83, .96), rgba(1, 9, 39, .98)) padding-box,
        linear-gradient(105deg, #126ecf, #7442ff) border-box;
}

html[data-theme="dark"] .sales-agent-layout .modal-header,
html[data-theme="dark"] .sales-agent-layout .modal-footer {
    border-color: rgba(75, 162, 255, .22);
}

html[data-theme="dark"] .sales-agent-layout .btn-close {
    filter: invert(1) grayscale(1) brightness(1.7);
}

html[data-theme="dark"] .sales-agent-layout .alert,
html[data-theme="dark"] .sales-agent-layout .alert-light,
html[data-theme="dark"] .sales-agent-layout .sa-soft-alert {
    color: var(--dash-text) !important;
    border-color: rgba(80, 139, 255, .3) !important;
    background: rgba(3, 17, 55, .74) !important;
}

html[data-theme="dark"] .sales-agent-layout .alert-info,
html[data-theme="dark"] .sales-agent-layout .sa-soft-alert-info {
    color: #d8f3ff !important;
    border-color: rgba(36, 200, 255, .32) !important;
    background: rgba(10, 61, 101, .42) !important;
}

html[data-theme="dark"] .sales-agent-layout .alert-warning,
html[data-theme="dark"] .sales-agent-layout .sa-soft-alert-warning {
    color: #ffe7bd !important;
    border-color: rgba(255, 156, 17, .36) !important;
    background: rgba(103, 65, 5, .36) !important;
}

html[data-theme="dark"] .sales-agent-layout .alert-danger,
html[data-theme="dark"] .sales-agent-layout .sa-soft-alert-danger {
    color: #ffd6db !important;
    border-color: rgba(255, 59, 75, .36) !important;
    background: rgba(105, 18, 31, .38) !important;
}

html[data-theme="dark"] .sales-agent-layout .alert-link {
    color: #8fd8ff !important;
}

html[data-theme="dark"] .sales-agent-layout .select2-dropdown,
html[data-theme="dark"] .sales-agent-layout .select2-container--default .select2-search--dropdown .select2-search__field,
html[data-theme="dark"] .sales-agent-layout .select2-container--default .select2-results__option {
    color: var(--dash-text) !important;
    border-color: rgba(80, 139, 255, .38) !important;
    background: #061642 !important;
}

html[data-theme="dark"] .sales-agent-layout .select2-container--default .select2-results__option--selected {
    background: rgba(36, 200, 255, .16) !important;
}

html[data-theme="dark"] .sales-agent-layout .select2-container--default .select2-results__option--highlighted[aria-selected] {
    color: #fff !important;
    background: rgba(255, 156, 17, .9) !important;
}

/* Dashboard dark-mode refinements requested from the visual reference. */
.affiliate-hero.sales-agent-shared-header {
    min-height: 146px;
    grid-template-columns: minmax(300px, .82fr) minmax(420px, 1.18fr);
}

.sales-agent-shared-header .affiliate-profile {
    gap: 18px;
    padding: 12px 20px;
}

.sales-agent-shared-header .affiliate-avatar {
    width: 116px;
    height: 116px;
    flex-basis: 116px;
}

.sales-agent-shared-header .affiliate-promo {
    gap: 13px;
    padding: 12px 18px;
}

.sales-agent-shared-header .affiliate-promo-message {
    gap: 18px;
}

.sales-agent-shared-header .affiliate-target-icon {
    width: 64px;
    height: 64px;
    font-size: 2.45rem;
}

.sales-agent-shared-header .affiliate-promo h2 {
    font-size: 1.15rem;
}

.sales-agent-shared-header .affiliate-promo strong {
    font-size: 1.14rem;
}

.sales-agent-shared-header .affiliate-actions {
    gap: 10px;
}

.sales-agent-shared-header .affiliate-action-btn,
.sales-agent-shared-header .affiliate-outline-btn {
    min-width: 142px;
    min-height: 39px;
    padding: 7px 13px;
    font-size: .74rem;
}

.affiliate-performance-panel {
    min-height: 205px;
}

.affiliate-performance-panel .row {
    align-items: stretch;
}

.affiliate-chart-card {
    height: 100%;
    min-height: 164px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6px 10px 5px;
    border: 0;
}

.affiliate-chart-svg {
    height: 154px;
}

.affiliate-metric-list {
    height: 100%;
}

.affiliate-metric {
    min-height: 51px;
}

.affiliate-commission-card {
    min-height: 112px;
    padding: 14px 88px 14px 18px;
}

.affiliate-commission-icon {
    right: 18px;
    left: auto;
    width: 58px;
    height: 58px;
    font-size: 2.35rem;
}

html[data-theme="dark"] .affiliate-space-dashboard .affiliate-commission-card {
    color: var(--dash-orange);
    border-color: currentColor !important;
    background:
        radial-gradient(circle at 88% 40%, rgba(255, 156, 17, .22), transparent 35%),
        linear-gradient(135deg, rgba(57, 36, 42, .7), rgba(4, 15, 51, .92) 48%, rgba(3, 12, 41, .96)) !important;
    box-shadow: inset 0 0 18px rgba(255, 156, 17, .06), 0 0 0 1px rgba(255, 156, 17, .04) !important;
}

html[data-theme="dark"] .affiliate-space-dashboard .affiliate-commission-card.tone-exam {
    color: #22e0c5;
    background:
        radial-gradient(circle at 88% 40%, rgba(0, 218, 177, .2), transparent 35%),
        linear-gradient(135deg, rgba(5, 61, 69, .66), rgba(4, 15, 51, .92) 48%, rgba(3, 12, 41, .96)) !important;
}

html[data-theme="dark"] .affiliate-space-dashboard .affiliate-commission-card.tone-package {
    color: #42bfff;
    background:
        radial-gradient(circle at 88% 40%, rgba(29, 157, 255, .21), transparent 35%),
        linear-gradient(135deg, rgba(5, 44, 80, .7), rgba(4, 15, 51, .92) 48%, rgba(3, 12, 41, .96)) !important;
}

html[data-theme="dark"] .affiliate-space-dashboard .affiliate-commission-card.tone-course {
    color: #bf5dff;
    background:
        radial-gradient(circle at 88% 40%, rgba(161, 59, 255, .22), transparent 35%),
        linear-gradient(135deg, rgba(44, 25, 87, .74), rgba(4, 15, 51, .92) 48%, rgba(3, 12, 41, .96)) !important;
}

html[data-theme="dark"] .affiliate-space-dashboard .affiliate-commission-card > div,
html[data-theme="dark"] .affiliate-space-dashboard .affiliate-commission-card strong,
html[data-theme="dark"] .affiliate-space-dashboard .affiliate-commission-card p {
    color: #fff !important;
}

html[data-theme="dark"] .affiliate-space-dashboard .affiliate-commission-card > div span {
    color: #c7d1ea !important;
}

html[data-theme="dark"] .affiliate-space-dashboard .affiliate-commission-icon {
    color: currentColor;
    background: radial-gradient(circle, rgba(21, 34, 73, .92), rgba(4, 12, 42, .7) 68%);
    border-color: rgba(255, 255, 255, .08);
    box-shadow: 0 0 23px currentColor, inset 0 0 15px rgba(255, 255, 255, .04);
    filter: drop-shadow(0 0 6px currentColor);
}

@media (max-width: 1399.98px) {
    .affiliate-hero.sales-agent-shared-header {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .sales-agent-shared-header .affiliate-avatar {
        width: 96px;
        height: 96px;
        flex-basis: 96px;
    }

    .affiliate-commission-card {
        padding: 74px 14px 14px;
    }

    .affiliate-commission-icon {
        top: 14px;
        right: 50%;
        left: auto;
        transform: translateX(50%);
    }
}

/* Sales-agent sidebar and request pages: dark-mode polish pass. */
html[data-theme="dark"] .affiliate-sidebar-column .affiliate-sidebar-brand strong,
html[data-theme="dark"] .affiliate-space-dashboard .affiliate-sidebar-brand strong {
    color: #27a8ff;
    text-shadow: 0 0 12px rgba(39, 168, 255, .85), 0 0 25px rgba(39, 168, 255, .35);
}

html[data-theme="dark"] .affiliate-sidebar-column .list-group-item,
html[data-theme="dark"] .affiliate-space-dashboard .list-group-item {
    min-height: 48px;
    padding-inline: 9px !important;
    color: #f5f9ff !important;
    background: rgba(8, 29, 78, .18) !important;
    border: 1px solid rgba(54, 116, 221, .34) !important;
    border-radius: 12px !important;
    margin-bottom: 8px;
}

html[data-theme="dark"] .affiliate-sidebar-column .list-group-item i,
html[data-theme="dark"] .affiliate-space-dashboard .list-group-item i {
    color: #d7ecff !important;
    background:
        radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .2), transparent 28%),
        linear-gradient(145deg, rgba(55, 126, 244, .62), rgba(16, 48, 111, .78)) !important;
    border-color: rgba(105, 180, 255, .7) !important;
    box-shadow:
        0 0 10px rgba(58, 178, 255, .46),
        0 0 20px rgba(58, 131, 255, .24),
        inset 0 0 13px rgba(255, 255, 255, .08) !important;
}

html[data-theme="dark"] .affiliate-sidebar-column .list-group-item.active,
html[data-theme="dark"] .affiliate-space-dashboard .list-group-item.active {
    border-color: #ffbb45 !important;
    background: linear-gradient(135deg, #ffab35, #f39818 58%, #e27607) !important;
    box-shadow:
        0 0 14px rgba(255, 181, 55, .72),
        0 0 30px rgba(255, 134, 11, .42),
        inset 0 0 12px rgba(255, 255, 255, .22) !important;
}

html[data-theme="dark"] .affiliate-sidebar-column .list-group-item.active i,
html[data-theme="dark"] .affiliate-space-dashboard .list-group-item.active i {
    color: #0b2852 !important;
    background: rgba(255, 255, 255, .26) !important;
    border-color: rgba(255, 255, 255, .45) !important;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, .18) !important;
}

html[data-theme="dark"] .sales-agent-shared-header .affiliate-action-btn {
    min-height: 38px;
    min-width: 136px;
    background: linear-gradient(135deg, #ffb63f, #ff9418 58%, #dd6d05) !important;
    border-color: rgba(255, 206, 106, .8);
    border-radius: 12px;
    box-shadow:
        0 0 12px rgba(255, 156, 17, .48),
        0 8px 18px rgba(255, 121, 21, .22),
        inset 0 0 9px rgba(255, 255, 255, .2) !important;
}

html[data-theme="dark"] .sa-withdraw-page .sa-empty-state,
html[data-theme="dark"] .sa-withdraw-page .sa-form-box,
html[data-theme="dark"] .sa-withdraw-page .sa-table-wrap,
html[data-theme="dark"] .sa-transfer-page .sa-transfer-form-card,
html[data-theme="dark"] .sa-transfer-page .sa-transfer-info-box,
html[data-theme="dark"] .sa-transfer-page .sa-transfer-input-card,
html[data-theme="dark"] .sa-transfer-page .sa-table-wrap {
    color: var(--dash-text) !important;
    border-color: rgba(80, 139, 255, .34) !important;
    background:
        linear-gradient(140deg, rgba(5, 24, 73, .82), rgba(2, 11, 43, .9)) padding-box,
        linear-gradient(105deg, rgba(36, 200, 255, .44), rgba(151, 73, 255, .38)) border-box !important;
    box-shadow: inset 0 0 18px rgba(36, 121, 255, .08) !important;
}

html[data-theme="dark"] .sa-withdraw-page .sa-empty-icon,
html[data-theme="dark"] .sa-transfer-page .sa-transfer-icon {
    color: #bfe8ff !important;
    background:
        radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .18), transparent 30%),
        rgba(22, 70, 142, .54) !important;
    border: 1px solid rgba(99, 184, 255, .42);
    box-shadow: 0 0 16px rgba(45, 173, 255, .34), inset 0 0 13px rgba(255, 255, 255, .06);
}

html[data-theme="dark"] .sa-withdraw-page .sa-empty-icon i {
    font-size: 1.45rem;
}

html[data-theme="dark"] .sa-withdraw-page .sa-bank-number,
html[data-theme="dark"] .sa-transfer-page .sa-transfer-info-title {
    color: #f8fbff !important;
}

html[data-theme="dark"] .sa-transfer-page .sa-transfer-info-text,
html[data-theme="dark"] .sa-withdraw-page .sa-help-text {
    color: #b4bedb !important;
}

html[data-theme="dark"] .sa-transfer-page .sa-transfer-route {
    border-top-color: rgba(80, 139, 255, .22) !important;
}

html[data-theme="dark"] .sa-transfer-page .sa-route-chip {
    color: #eaf4ff !important;
    background: rgba(2, 13, 45, .68) !important;
    border-color: rgba(80, 139, 255, .34) !important;
}

html[data-theme="dark"] .sa-transfer-page .sa-route-arrow {
    color: #69d3ff !important;
    filter: drop-shadow(0 0 7px rgba(58, 178, 255, .55));
}

html[data-theme="dark"] .sa-transfer-page .sa-available-hint {
    color: #bdfce8 !important;
    background: rgba(9, 128, 96, .2) !important;
    border: 1px solid rgba(23, 216, 176, .32);
}

html[data-theme="dark"] .sa-transfer-page .table-light > :not(caption) > * > *,
html[data-theme="dark"] .sa-withdraw-page .table-light > :not(caption) > * > * {
    color: #d9e6ff !important;
    background-color: rgba(5, 26, 76, .78) !important;
}

html[data-theme="dark"] .sa-withdraw-page .btn-outline-primary,
html[data-theme="dark"] .sa-transfer-page .btn-outline-primary {
    color: #8fd8ff !important;
    border-color: rgba(63, 175, 255, .5) !important;
    background: rgba(3, 17, 55, .46) !important;
}

/* FINAL V81 - Dark withdrawal status badges. */
html[data-theme="dark"] .sa-withdraw-page .sa-status-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 30px !important;
    border: 1px solid transparent !important;
    box-shadow: inset 0 0 14px rgba(255, 255, 255, .045), 0 0 14px rgba(0, 0, 0, .14) !important;
}

html[data-theme="dark"] .sa-withdraw-page .sa-status-pending {
    color: #ffd77a !important;
    background: rgba(146, 94, 0, .22) !important;
    border-color: rgba(255, 193, 72, .42) !important;
}

html[data-theme="dark"] .sa-withdraw-page .sa-status-approved {
    color: #9bd7ff !important;
    background: rgba(22, 111, 210, .22) !important;
    border-color: rgba(93, 178, 255, .40) !important;
}

html[data-theme="dark"] .sa-withdraw-page .sa-status-completed {
    color: #8ff5c8 !important;
    background: rgba(0, 135, 91, .22) !important;
    border-color: rgba(51, 225, 157, .38) !important;
}

html[data-theme="dark"] .sa-withdraw-page .sa-status-rejected {
    color: #ffb0ba !important;
    background: rgba(190, 31, 54, .20) !important;
    border-color: rgba(255, 105, 125, .38) !important;
}

/* Affiliate commission cards: compact, readable, and neon only in dark mode. */
.affiliate-commission-panel {
    padding: 13px 16px 14px;
}

.affiliate-commission-panel .affiliate-section-head {
    margin-bottom: 11px;
}

.affiliate-commission-card {
    min-height: 110px;
    padding: 13px 86px 12px 18px;
    background: linear-gradient(145deg, rgba(255, 255, 255, .86), rgba(245, 249, 255, .72)) !important;
    box-shadow: 0 10px 22px rgba(33, 66, 110, .07) !important;
}

.affiliate-commission-card > div {
    display: flex;
    min-height: 84px;
    flex-direction: column;
    justify-content: center;
}

.affiliate-commission-card > div > span {
    color: #5d6e86 !important;
    font-size: .74rem;
    font-weight: 850;
    line-height: 1.55;
}

.affiliate-commission-card strong {
    margin-top: 1px;
    color: #14233c !important;
    font-size: 1.18rem;
    line-height: 1.35;
}

.affiliate-commission-card p {
    color: #14233c !important;
    font-size: .9rem;
    line-height: 1.45;
}

.affiliate-commission-card hr {
    width: 100%;
    margin: 7px 0 6px;
}

.affiliate-commission-card .percent-range {
    display: inline-flex !important;
    width: auto;
    align-items: center;
    gap: .28rem;
    white-space: nowrap;
}

.affiliate-commission-card .percent-range span,
.affiliate-commission-card .percent-value {
    display: inline-flex !important;
    width: auto;
}

.affiliate-commission-icon {
    width: 52px;
    height: 52px;
    right: 18px;
    left: auto;
    border-radius: 15px;
    background: rgba(69, 103, 154, .13) !important;
    box-shadow: 0 8px 18px rgba(38, 73, 124, .12), inset 0 0 10px rgba(255, 255, 255, .45) !important;
    filter: none !important;
    font-size: 2.05rem;
}

html[data-theme="dark"] .affiliate-space-dashboard .affiliate-commission-card {
    min-height: 110px;
    padding: 13px 86px 12px 18px;
}

html[data-theme="dark"] .affiliate-space-dashboard .affiliate-commission-card > div > span {
    color: #cbd6ef !important;
    font-size: 9px;
}

html[data-theme="dark"] .affiliate-space-dashboard .affiliate-commission-card strong {
    font-size: 1.18rem;
    line-height: 1.35;
}

html[data-theme="dark"] .affiliate-space-dashboard .affiliate-commission-card p {
    font-size: .9rem;
    line-height: 1.45;
}

html[data-theme="dark"] .affiliate-space-dashboard .affiliate-commission-icon {
    width: 52px;
    height: 52px;
    right: 18px;
    left: auto;
    color: currentColor;
    background:
        radial-gradient(circle at 35% 28%, rgba(255, 255, 255, .22), transparent 30%),
        linear-gradient(145deg, rgba(92, 105, 134, .82), rgba(41, 51, 77, .96)) !important;
    border-color: rgba(255, 255, 255, .12);
    box-shadow: 0 0 10px rgba(255, 255, 255, .36), 0 0 18px color-mix(in srgb, currentColor 38%, transparent), inset 0 0 12px rgba(255, 255, 255, .08) !important;
    filter: none !important;
    font-size: 2.05rem;
}

@supports not (color: color-mix(in srgb, white, transparent)) {
    html[data-theme="dark"] .affiliate-space-dashboard .affiliate-commission-icon {
        box-shadow: 0 0 10px rgba(255, 255, 255, .36), 0 0 18px rgba(95, 175, 255, .22), inset 0 0 12px rgba(255, 255, 255, .08) !important;
    }
}

@media (max-width: 575.98px) {
    .affiliate-commission-card,
    html[data-theme="dark"] .affiliate-space-dashboard .affiliate-commission-card {
        min-height: 142px;
        padding: 72px 14px 14px;
        text-align: center;
    }

    .affiliate-commission-card > div {
        align-items: center;
    }

    .affiliate-commission-icon,
    html[data-theme="dark"] .affiliate-space-dashboard .affiliate-commission-icon {
        top: 13px;
        right: 50%;
        left: auto;
        transform: translateX(50%);
    }
}

/* Mobile dashboard layout: prevent horizontal overflow and keep cards readable. */
@media (max-width: 767.98px) {
    .affiliate-space-dashboard {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 8px 8px 22px;
        overflow-x: hidden;
        border-radius: 0;
    }

    .affiliate-space-dashboard .container-fluid,
    .affiliate-main-column {
        width: 100%;
        max-width: 100%;
        padding-inline: 0;
        overflow-x: hidden;
    }

    .affiliate-shell-row,
    .affiliate-stat-grid,
    .affiliate-performance-panel .row,
    .affiliate-commission-grid .row {
        --bs-gutter-x: 10px;
        --bs-gutter-y: 10px;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }

    .affiliate-shell-row > *,
    .affiliate-stat-grid > *,
    .affiliate-performance-panel .row > *,
    .affiliate-commission-grid .row > * {
        padding-right: calc(var(--bs-gutter-x) * .5);
        padding-left: calc(var(--bs-gutter-x) * .5);
    }

    .affiliate-hero.sales-agent-shared-header {
        min-height: 0;
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 14px 12px;
    }

    .sales-agent-shared-header .affiliate-profile,
    .sales-agent-shared-header .affiliate-promo {
        width: 100%;
        padding: 0;
    }

    .sales-agent-shared-header .affiliate-profile {
        align-items: center;
        text-align: center;
    }

    .sales-agent-shared-header .affiliate-avatar {
        width: 94px;
        height: 94px;
        flex-basis: 94px;
    }

    .sales-agent-shared-header .affiliate-promo-message {
        flex-direction: row;
        justify-content: center;
        gap: 12px;
        text-align: right;
    }

    .sales-agent-shared-header .affiliate-target-icon {
        width: 46px;
        height: 46px;
        font-size: 1.9rem;
    }

    .sales-agent-shared-header .affiliate-actions {
        width: 100%;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .sales-agent-shared-header .affiliate-action-btn,
    .sales-agent-shared-header .affiliate-outline-btn {
        width: 100%;
        min-width: 0;
        min-height: 38px;
    }

    .affiliate-stat-grid > [class*="col-"] {
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }

    .affiliate-stat-card {
        min-height: 86px;
        padding: 12px 13px;
    }

    .affiliate-stat-card > div {
        max-width: calc(100% - 54px);
    }

    .affiliate-stat-card h3 {
        font-size: .74rem;
    }

    .affiliate-stat-card strong {
        font-size: 1.05rem;
    }

    .affiliate-stat-icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        font-size: 1.55rem;
    }

    .affiliate-performance-panel,
    .affiliate-commission-panel,
    .affiliate-table-panel {
        padding: 12px;
    }

    .affiliate-section-head {
        align-items: flex-start;
        flex-direction: column;
        margin-inline: 0;
    }

    .affiliate-section-head select,
    .affiliate-section-head a,
    .affiliate-chart-filter {
        width: 100%;
        text-align: center;
    }

    .affiliate-metric-list {
        grid-template-columns: 1fr;
    }

    .affiliate-chart-card {
        min-height: 156px;
    }

    .affiliate-chart-svg {
        height: 126px;
    }

    .affiliate-table-wrap {
        margin-inline: -2px;
        border-radius: 12px;
    }
}

@media (max-width: 399.98px) {
    .sales-agent-shared-header .affiliate-promo-message {
        flex-direction: column;
        text-align: center;
    }

    .sales-agent-shared-header .affiliate-promo h2,
    .sales-agent-shared-header .affiliate-promo strong {
        font-size: .96rem;
    }

    .affiliate-commission-card,
    html[data-theme="dark"] .affiliate-space-dashboard .affiliate-commission-card {
        min-height: 136px;
    }
}

/* Empty sales table state: clear in light mode, atmospheric in dark mode. */
.affiliate-space-dashboard .affiliate-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 72px;
    margin: 0;
    padding: 18px 20px;
    color: #40536f !important;
    text-align: center;
    line-height: 1.9;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .9), rgba(246, 250, 255, .82)) padding-box,
        linear-gradient(105deg, rgba(47, 128, 237, .34), rgba(255, 171, 47, .22)) border-box !important;
    border: 1px solid transparent !important;
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(33, 66, 110, .06);
}

.affiliate-space-dashboard .affiliate-empty::before {
    content: "\F1F8";
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1f7bd9;
    background: rgba(47, 128, 237, .1);
    border: 1px solid rgba(47, 128, 237, .18);
    border-radius: 11px;
    font-family: "bootstrap-icons";
    font-size: 1.05rem;
    line-height: 1;
}

html[data-theme="dark"] .affiliate-space-dashboard .affiliate-empty {
    color: #b9c5e4 !important;
    background: rgba(3, 13, 44, .42) !important;
    border: 1px dashed rgba(78, 143, 255, .38) !important;
    box-shadow: none;
}

html[data-theme="dark"] .affiliate-space-dashboard .affiliate-empty::before {
    color: #8fd8ff;
    background: rgba(34, 117, 255, .14);
    border-color: rgba(90, 159, 255, .32);
    box-shadow: 0 0 12px rgba(58, 178, 255, .22);
}

@media (max-width: 575.98px) {
    .affiliate-space-dashboard .affiliate-empty {
        align-items: flex-start;
        flex-direction: column;
        min-height: 0;
        padding: 16px;
        text-align: right;
    }
}

/* Light mode should feel clean and non-neon. */
html:not([data-theme="dark"]) .affiliate-space-dashboard,
html:not([data-theme="dark"]) .sales-agent-layout {
    background: #ffffff !important;
    background-image: none !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard::before,
html:not([data-theme="dark"]) .affiliate-space-dashboard .dashboard-panel::before,
html:not([data-theme="dark"]) .affiliate-sidebar-card::before,
html:not([data-theme="dark"]) .affiliate-stat-card::before,
html:not([data-theme="dark"]) .affiliate-commission-card::before {
    opacity: 0 !important;
    box-shadow: none !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard .dashboard-panel,
html:not([data-theme="dark"]) .sales-agent-shared-header,
html:not([data-theme="dark"]) .affiliate-stat-card,
html:not([data-theme="dark"]) .affiliate-performance-panel,
html:not([data-theme="dark"]) .affiliate-commission-panel,
html:not([data-theme="dark"]) .affiliate-table-panel {
    border-color: #d9e6f4 !important;
    background: #fff !important;
    box-shadow: 0 8px 22px rgba(31, 58, 91, .055) !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard .dashboard-panel::after,
html:not([data-theme="dark"]) .sales-agent-shared-header::after {
    opacity: 0 !important;
}

html:not([data-theme="dark"]) .affiliate-action-btn {
    background: linear-gradient(135deg, #f5a32c, #ed8d13) !important;
    border-color: #e5962e !important;
    box-shadow: none !important;
}

html:not([data-theme="dark"]) .affiliate-outline-btn,
html:not([data-theme="dark"]) .affiliate-section-head a,
html:not([data-theme="dark"]) .affiliate-section-head select,
html:not([data-theme="dark"]) .affiliate-mobile-menu {
    background: #fff !important;
    border-color: #d8e5f4 !important;
    box-shadow: none !important;
}

html:not([data-theme="dark"]) .affiliate-avatar--image,
html:not([data-theme="dark"]) .affiliate-commission-icon,
html:not([data-theme="dark"]) .affiliate-stat-icon {
    filter: none !important;
    box-shadow: 0 7px 16px rgba(37, 74, 120, .11) !important;
}

html:not([data-theme="dark"]) .affiliate-target-icon {
    filter: none !important;
}

html:not([data-theme="dark"]) .affiliate-sidebar-column .offcanvas-body > .affiliate-sidebar-card,
html:not([data-theme="dark"]) .affiliate-space-dashboard .offcanvas-body > .affiliate-sidebar-card {
    border-color: #d9e6f4 !important;
    background: #fff !important;
    box-shadow: 0 8px 22px rgba(31, 58, 91, .055) !important;
}

html:not([data-theme="dark"]) .affiliate-sidebar-brand {
    color: #50617a !important;
    border-bottom-color: #e8eef6 !important;
}

html:not([data-theme="dark"]) .affiliate-sidebar-brand strong {
    color: #1976d2 !important;
    text-shadow: none !important;
}

html:not([data-theme="dark"]) .affiliate-sidebar-column .list-group-item,
html:not([data-theme="dark"]) .affiliate-space-dashboard .list-group-item {
    color: #22324b !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    border-bottom-color: #e8eef6 !important;
    box-shadow: none !important;
}

html:not([data-theme="dark"]) .affiliate-sidebar-column .list-group-item i,
html:not([data-theme="dark"]) .affiliate-space-dashboard .list-group-item i {
    color: #326ec4 !important;
    background: #f3f7fd !important;
    border-color: #dce9f8 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

html:not([data-theme="dark"]) .affiliate-sidebar-column .list-group-item:hover,
html:not([data-theme="dark"]) .affiliate-space-dashboard .list-group-item:hover {
    color: #17233c !important;
    background: #f3f7fd !important;
    border-color: #d9e6f4 !important;
    box-shadow: none !important;
    transform: none !important;
}

html:not([data-theme="dark"]) .affiliate-sidebar-column .list-group-item:hover i,
html:not([data-theme="dark"]) .affiliate-space-dashboard .list-group-item:hover i {
    color: #1d5fb1 !important;
    background: #e8f2ff !important;
    border-color: #cfe0f4 !important;
}

html:not([data-theme="dark"]) .affiliate-sidebar-column .list-group-item.active,
html:not([data-theme="dark"]) .affiliate-space-dashboard .list-group-item.active {
    color: #744400 !important;
    background: #fff4dd !important;
    border-color: #f0c36e !important;
    box-shadow: none !important;
}

html:not([data-theme="dark"]) .affiliate-sidebar-column .list-group-item.active i,
html:not([data-theme="dark"]) .affiliate-space-dashboard .list-group-item.active i {
    color: #8a5408 !important;
    background: #ffe8bc !important;
    border-color: #efc36d !important;
    box-shadow: none !important;
}

/* FINAL V61 - Sales agent panel aligned with the student dashboard rhythm. */
.affiliate-space-dashboard {
    padding: 8px;
}

.affiliate-space-dashboard .dashboard-panel {
    border-radius: 16px;
}

.sales-agent-shared-header {
    min-height: 154px;
    grid-template-columns: minmax(320px, .95fr) minmax(320px, 1.05fr);
}

.sales-agent-shared-header .affiliate-profile {
    gap: 16px;
    padding: 14px 18px;
}

.sales-agent-shared-header .affiliate-avatar {
    width: 116px;
    height: 116px;
    flex-basis: 116px;
}

.sales-agent-shared-header .affiliate-profile h1 {
    font-size: 1.16rem;
    margin-bottom: 5px;
}

.sales-agent-shared-header .affiliate-profile p {
    margin-bottom: 6px;
    font-size: .76rem;
}

.sales-agent-shared-header .affiliate-access-badge {
    padding: 4px 10px;
    font-size: .66rem;
}

.sales-agent-shared-header .affiliate-wallet-line {
    display: inline-grid;
    grid-template-columns: 28px auto;
    margin-top: 8px;
    padding: 6px 9px;
    border: 1px solid rgba(34, 211, 238, .26);
    border-radius: 12px;
    background: rgba(2, 13, 49, .38);
}

.sales-agent-shared-header .affiliate-wallet-line i {
    width: 28px;
    height: 28px;
}

.sales-agent-shared-header .affiliate-promo {
    align-items: stretch;
    gap: 12px;
    padding: 14px 18px;
}

.sales-agent-shared-header .affiliate-promo-message {
    justify-content: flex-start;
    gap: 12px;
}

.sales-agent-shared-header .affiliate-target-icon {
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    border: 1px solid rgba(90, 159, 255, .38);
    border-radius: 15px;
    background: rgba(4, 20, 59, .58);
    font-size: 1.9rem;
}

.sales-agent-shared-header .affiliate-promo h2 {
    font-size: 1rem;
}

.sales-agent-shared-header .affiliate-promo strong {
    font-size: .92rem;
}

.sales-agent-shared-header .affiliate-actions {
    justify-content: flex-start;
    gap: 8px;
}

.sales-agent-shared-header .affiliate-action-btn,
.sales-agent-shared-header .affiliate-outline-btn {
    min-width: 0;
    min-height: 38px;
    border-radius: 11px;
    padding: 7px 12px;
    font-size: .74rem;
}

.affiliate-stat-grid,
.affiliate-performance-grid,
.affiliate-commission-grid,
.affiliate-table-grid {
    margin-top: 10px;
}

.affiliate-stat-grid {
    --bs-gutter-x: 10px;
    --bs-gutter-y: 10px;
}

.affiliate-stat-card {
    min-height: 92px;
    padding: 13px 14px;
    gap: 9px;
}

.affiliate-stat-card > div {
    max-width: none;
    min-width: 0;
}

.affiliate-stat-card h3 {
    margin-bottom: 5px;
    font-size: .72rem;
}

.affiliate-stat-card strong {
    font-size: 1.12rem;
}

.affiliate-stat-icon {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
    border-radius: 14px;
    font-size: 1.56rem;
}

.affiliate-performance-panel,
.affiliate-commission-panel,
.affiliate-table-panel {
    padding: 13px;
}

.affiliate-metric {
    min-height: 50px;
    padding: 8px 10px;
}

.affiliate-commission-card {
    min-height: 104px;
    padding: 12px 74px 12px 14px;
}

.affiliate-commission-icon {
    left: 14px;
    width: 48px;
    height: 48px;
    border-radius: 15px;
    font-size: 2rem;
}

.affiliate-table th,
.affiliate-table td {
    padding: 8px 12px;
}

@media (max-width: 1199.98px) {
    .affiliate-space-dashboard .offcanvas-xl {
        top: 90px !important;
        bottom: 10px !important;
        height: auto !important;
        max-width: min(86vw, 330px);
        border: 1px solid rgba(58, 144, 255, .72);
        border-radius: 18px 0 0 18px;
        background: linear-gradient(180deg, rgba(8, 29, 78, .98), rgba(1, 7, 28, .99));
        overflow: hidden;
    }

    .affiliate-space-dashboard .offcanvas-header {
        min-height: 58px;
        padding: 10px 12px;
    }

    .affiliate-space-dashboard .offcanvas-header .btn-close {
        position: relative;
        width: 24px;
        height: 24px;
        flex: 0 0 5px;
        border: 1px solid rgba(80, 139, 255, .52);
        border-radius: 12px;
        background: rgba(19, 56, 120, .56) !important;
        background-image: none !important;
        opacity: 1;
        box-shadow: inset 0 0 12px rgba(56, 126, 255, .16);
    }

    .offcanvas-header .btn-close {
        padding: calc(var(--bs-offcanvas-padding-y) * 0.5) calc(var(--bs-offcanvas-padding-x) * 0.5);
        margin-top: calc(0.5 * var(--bs-offcanvas-padding-y));
        margin-left: calc(0.5 * var(--bs-offcanvas-padding-x));
        margin-bottom: calc(0.5 * var(--bs-offcanvas-padding-y));
    }

    .affiliate-space-dashboard .offcanvas-header .btn-close::before,
    .affiliate-space-dashboard .offcanvas-header .btn-close::after {
        content: "";
        position: absolute;
        top: 18px;
        left: 10px;
        width: 16px;
        height: 2px;
        border-radius: 999px;
        background: #f4f6ff;
    }

    .affiliate-space-dashboard .offcanvas-header .btn-close::before {
        transform: rotate(45deg);
    }

    .affiliate-space-dashboard .offcanvas-header .btn-close::after {
        transform: rotate(-45deg);
    }

    html:not([data-theme="dark"]) .affiliate-space-dashboard .offcanvas-xl {
        border-color: #d9e6f4;
        background: #fff;
    }

    html:not([data-theme="dark"]) .affiliate-space-dashboard .offcanvas-header .btn-close {
        border-color: #dce9f8;
        background: #f3f7fd !important;
        box-shadow: none;
    }

    html:not([data-theme="dark"]) .affiliate-space-dashboard .offcanvas-header .btn-close::before,
    html:not([data-theme="dark"]) .affiliate-space-dashboard .offcanvas-header .btn-close::after {
        background: #22324b;
    }
}

@media (max-width: 767.98px) {
    .affiliate-mobile-menu {
        min-height: 42px;
        margin-bottom: 8px;
        border-radius: 14px;
        font-size: .78rem;
    }

    .affiliate-hero.sales-agent-shared-header {
        gap: 9px;
        padding: 11px;
        border-radius: 18px;
    }

    .sales-agent-shared-header .affiliate-profile {
        flex-direction: row;
        justify-content: space-between;
        gap: 10px;
        text-align: right;
    }

    .sales-agent-shared-header .affiliate-profile > div:last-child {
        flex: 1 1 auto;
        min-width: 0;
    }

    .sales-agent-shared-header .affiliate-avatar {
        width: 96px;
        height: 96px;
        flex-basis: 96px;
    }

    .sales-agent-shared-header .affiliate-profile h1 {
        font-size: .98rem;
    }

    .sales-agent-shared-header .affiliate-access-badge {
        font-size: .62rem;
    }

    .sales-agent-shared-header .affiliate-wallet-line {
        width: auto;
        max-width: 100%;
        margin-top: 7px;
        font-size: .64rem;
    }

    .sales-agent-shared-header .affiliate-wallet-line strong {
        font-size: .76rem;
    }

    .sales-agent-shared-header .affiliate-promo {
        display: none;
    }

    .sales-agent-shared-header .affiliate-promo-message {
        display: none;
    }

    .sales-agent-shared-header .affiliate-actions {
        display: none;
    }

    .sales-agent-shared-header .affiliate-action-btn,
    .sales-agent-shared-header .affiliate-outline-btn {
        width: 100%;
        min-height: 36px;
        padding: 6px 10px;
        font-size: .68rem;
    }

    .affiliate-stat-grid {
        --bs-gutter-x: 6px;
        --bs-gutter-y: 6px;
        margin-top: 7px;
    }

    .affiliate-stat-grid > [class*="col-"] {
        width: 50%;
        flex: 0 0 50%;
        max-width: 50%;
        display: flex;
    }

    .affiliate-stat-card {
        width: 100%;
        min-height: 82px;
        padding: 9px;
        border-radius: 14px;
        gap: 6px;
    }

    .affiliate-stat-card > div {
        flex: 1 1 auto;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: baseline;
        column-gap: 6px;
        row-gap: 2px;
    }

    .affiliate-stat-card h3 {
        grid-column: 1;
        margin: 0;
        font-size: .62rem;
        line-height: 1.45;
    }

    .affiliate-stat-card strong {
        grid-column: 2;
        grid-row: 1;
        margin: 0;
        font-size: .78rem;
        line-height: 1.45;
        white-space: nowrap;
    }

    .affiliate-stat-card p {
        grid-column: 1 / -1;
        font-size: .52rem;
        line-height: 1.55;
    }

    .affiliate-stat-icon {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
        border-radius: 12px;
        font-size: 1.22rem;
    }

    .affiliate-performance-grid,
    .affiliate-commission-grid,
    .affiliate-table-grid {
        margin-top: 8px;
    }

    .affiliate-performance-panel,
    .affiliate-commission-panel,
    .affiliate-table-panel {
        padding: 12px;
        border-radius: 15px;
    }

    .affiliate-section-head {
        gap: 8px;
        margin-bottom: 8px;
    }

    .affiliate-section-title {
        font-size: .96rem;
    }

    .affiliate-metric-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .affiliate-metric {
        min-height: 62px;
        align-items: flex-start;
        padding: 8px;
        border-radius: 12px;
    }

    .affiliate-metric span {
        font-size: .55rem;
    }

    .affiliate-metric strong {
        font-size: .62rem;
        line-height: 1.6;
    }

    .affiliate-metric i {
        font-size: 1rem;
    }

    .affiliate-metric-wide {
        grid-column: 1 / -1;
        min-height: 48px;
    }

    .affiliate-chart-card {
        min-height: 132px;
        padding: 3px 4px 5px;
    }

    .affiliate-chart-svg {
        height: 108px;
    }

    .affiliate-commission-grid .row {
        --bs-gutter-x: 6px;
        --bs-gutter-y: 6px;
    }

    .affiliate-commission-grid .row > [class*="col-"] {
        width: 50%;
        flex: 0 0 50%;
        max-width: 50%;
        display: flex;
    }

    .affiliate-commission-card,
    html[data-theme="dark"] .affiliate-space-dashboard .affiliate-commission-card {
        width: 100%;
        min-height: 124px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) 38px;
        align-items: start;
        gap: 7px;
        padding: 9px;
        border-radius: 14px;
        text-align: right;
    }

    .affiliate-commission-card h3 {
        display: block;
        margin: 0 0 5px;
        color: #fff;
        font-size: .66rem;
        font-weight: 900;
        line-height: 1.5;
    }

    .affiliate-commission-card > div {
        min-width: 0;
        grid-column: 1;
        grid-row: 1;
    }

    .affiliate-commission-card strong {
        font-size: .82rem;
        line-height: 1.55;
    }

    .affiliate-commission-card p {
        font-size: .64rem;
        line-height: 1.5;
    }

    .affiliate-commission-card > div span {
        font-size: .5rem;
        line-height: 1.6;
    }

    .affiliate-commission-card hr {
        margin: 5px 0;
    }

    .affiliate-commission-icon,
    html[data-theme="dark"] .affiliate-space-dashboard .affiliate-commission-icon {
        position: static;
        grid-column: 2;
        grid-row: 1;
        width: 38px;
        height: 38px;
        border-radius: 13px;
        font-size: 1.28rem;
        transform: none;
    }

    .affiliate-table {
        min-width: 640px;
        font-size: .62rem;
    }

    .affiliate-table th,
    .affiliate-table td {
        padding: 7px 9px;
    }

    .affiliate-table-panel .affiliate-section-head {
        align-items: stretch;
    }

    .affiliate-table-panel .affiliate-section-head > div {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px !important;
        width: 100%;
    }

    .affiliate-table-panel .affiliate-section-head a {
        width: 100%;
        min-height: 34px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 5px 8px;
        border-radius: 999px;
        font-size: .64rem;
        white-space: nowrap;
    }

    .affiliate-space-dashboard .affiliate-table-panel .affiliate-empty {
        align-items: center;
        flex-direction: row;
        justify-content: flex-start;
        min-height: 94px;
        gap: 9px;
        padding: 14px;
        border-radius: 15px;
        font-size: .78rem;
        line-height: 2;
        text-align: right;
    }
}

@media (max-width: 399.98px) {
    .affiliate-stat-card strong {
        font-size: .7rem;
    }

    .affiliate-stat-card h3 {
        font-size: .58rem;
    }

    .affiliate-commission-card,
    html[data-theme="dark"] .affiliate-space-dashboard .affiliate-commission-card {
        min-height: 132px;
        grid-template-columns: minmax(0, 1fr) 34px;
        gap: 6px;
    }

    .affiliate-commission-icon,
    html[data-theme="dark"] .affiliate-space-dashboard .affiliate-commission-icon {
        width: 34px;
        height: 34px;
        font-size: 1.12rem;
    }
}

html:not([data-theme="dark"]) .sales-agent-shared-header .affiliate-wallet-line {
    color: #5e6d86;
    background: #f8fbff;
    border-color: #dce9f8;
}

html:not([data-theme="dark"]) .sales-agent-shared-header .affiliate-wallet-line strong {
    color: #17233c;
}

html:not([data-theme="dark"]) .sales-agent-shared-header .affiliate-target-icon {
    background: #f3f7fd;
    border-color: #dce9f8;
}

html:not([data-theme="dark"]) .affiliate-commission-card h3 {
    color: #17233c;
}

html:not([data-theme="dark"]) .affiliate-stat-card p,
html:not([data-theme="dark"]) .affiliate-metric span,
html:not([data-theme="dark"]) .affiliate-commission-card > div span {
    color: #5e6d86 !important;
}

/* FINAL V65 - Use only the shared inner-page star background. */
.affiliate-space-dashboard::before,
.affiliate-space-dashboard .dashboard-panel::after {
    display: none !important;
    background-image: none !important;
}

/* FINAL V66 - Light sales-agent dashboard colored summary cards. */
html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-stat-card {
    background: #f8fbff !important;
    border-color: #cfe0f5 !important;
    box-shadow: 0 10px 22px rgba(31, 58, 91, .07) !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-stat-card.purple {
    background: #f4f0ff !important;
    border-color: #b7a3ff !important;
    box-shadow: 0 10px 22px rgba(124, 92, 255, .10) !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-stat-card.cyan {
    background: #eef7ff !important;
    border-color: #86c5ff !important;
    box-shadow: 0 10px 22px rgba(47, 140, 255, .10) !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-stat-card.green {
    background: #ebfbf7 !important;
    border-color: #83ddce !important;
    box-shadow: 0 10px 22px rgba(0, 184, 148, .10) !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-stat-card.orange {
    background: #fff4df !important;
    border-color: #ffc36f !important;
    box-shadow: 0 10px 22px rgba(255, 159, 34, .12) !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-stat-grid > div:nth-child(4) .affiliate-stat-card {
    background: #fff4df !important;
    border-color: #ffc36f !important;
    box-shadow: 0 10px 22px rgba(255, 159, 34, .12) !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-stat-card .affiliate-stat-icon {
    background: #ffffff !important;
    border: 1px solid currentColor !important;
    box-shadow: 0 8px 16px rgba(31, 58, 91, .08) !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-stat-card.purple .affiliate-stat-icon { color: #6f4cff !important; }
html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-stat-card.cyan .affiliate-stat-icon { color: #1677d2 !important; }
html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-stat-card.green .affiliate-stat-icon { color: #008f78 !important; }
html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-stat-card.orange .affiliate-stat-icon { color: #e47b00 !important; }
html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-stat-grid > div:nth-child(4) .affiliate-stat-icon { color: #e47b00 !important; }

html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-stat-card h3 {
    color: #43536d !important;
    opacity: 1 !important;
    font-weight: 900 !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-stat-card strong {
    color: #071a38 !important;
    opacity: 1 !important;
    font-weight: 950 !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-stat-card p {
    color: #50617a !important;
    opacity: 1 !important;
    font-weight: 750 !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-commission-card {
    background: #f8fbff !important;
    border-color: #cfe0f5 !important;
    box-shadow: 0 10px 22px rgba(31, 58, 91, .07) !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-commission-card.tone-shop {
    background: #fff4df !important;
    border-color: #ffc36f !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-commission-card.tone-exam {
    background: #ebfbf7 !important;
    border-color: #83ddce !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-commission-card.tone-package {
    background: #eef7ff !important;
    border-color: #86c5ff !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-commission-card.tone-course {
    background: #f4f0ff !important;
    border-color: #b7a3ff !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-commission-icon {
    background: #ffffff !important;
    border: 1px solid currentColor !important;
    box-shadow: 0 8px 16px rgba(31, 58, 91, .08) !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-commission-card.tone-shop .affiliate-commission-icon { color: #e47b00 !important; }
html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-commission-card.tone-exam .affiliate-commission-icon { color: #008f78 !important; }
html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-commission-card.tone-package .affiliate-commission-icon { color: #1677d2 !important; }
html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-commission-card.tone-course .affiliate-commission-icon { color: #6f4cff !important; }

html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-metric {
    background: #f8fbff !important;
    border-color: #cfe0f5 !important;
    box-shadow: 0 8px 18px rgba(31, 58, 91, .06) !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-metric:nth-child(1) {
    background: #eef7ff !important;
    border-color: #86c5ff !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-metric:nth-child(2) {
    background: #f4f0ff !important;
    border-color: #b7a3ff !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-metric:nth-child(3) {
    background: #ebfbf7 !important;
    border-color: #83ddce !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-metric:nth-child(4) {
    background: #fff4df !important;
    border-color: #ffc36f !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-metric:nth-child(5) {
    background: #f0f7ff !important;
    border-color: #b8d8ff !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-metric i {
    color: #296fe0 !important;
    background: #ffffff !important;
    border-color: #cfe0f5 !important;
    box-shadow: 0 6px 14px rgba(31, 58, 91, .075) !important;
}

/* FINAL V67 - Solid light sales-agent pages and shared mobile close button. */
html:not([data-theme="dark"]) .affiliate-space-dashboard,
html:not([data-theme="dark"]) .sales-agent-layout {
    background: #ffffff !important;
    background-image: none !important;
    box-shadow: none !important;
}

html:not([data-theme="dark"]) .sales-agent-layout > .container {
    background: transparent !important;
}

html:not([data-theme="dark"]) .sales-agent-layout .affiliate-main-column > .card,
html:not([data-theme="dark"]) .sales-agent-layout .affiliate-main-column > .row .card,
html:not([data-theme="dark"]) .sales-agent-layout .discount-card,
html:not([data-theme="dark"]) .sales-agent-layout .sales-agent-sms-card,
html:not([data-theme="dark"]) .sales-agent-layout .sa-panel,
html:not([data-theme="dark"]) .sales-agent-layout .sa-card,
html:not([data-theme="dark"]) .sales-agent-layout .sa-stat-card,
html:not([data-theme="dark"]) .sales-agent-layout .sales-agent-password-card,
html:not([data-theme="dark"]) .sales-agent-shared-header {
    background: #ffffff !important;
    background-image: none !important;
    border-color: #d8e5f5 !important;
    box-shadow: 0 8px 22px rgba(15, 35, 75, .06) !important;
}

html:not([data-theme="dark"]) .sales-agent-layout .card-header,
html:not([data-theme="dark"]) .sales-agent-layout .discount-card-header,
html:not([data-theme="dark"]) .sales-agent-layout .sales-agent-sms-card .card-header,
html:not([data-theme="dark"]) .sales-agent-layout .sa-panel-header,
html:not([data-theme="dark"]) .sales-agent-layout .sa-card-header,
html:not([data-theme="dark"]) .sales-agent-layout .sales-agent-password-card .card-header {
    background: #f8fbff !important;
    background-image: none !important;
    border-bottom-color: #d8e5f5 !important;
    box-shadow: none !important;
}

html:not([data-theme="dark"]) .sales-agent-layout .form-control,
html:not([data-theme="dark"]) .sales-agent-layout .form-select,
html:not([data-theme="dark"]) .sales-agent-layout .input-group-text,
html:not([data-theme="dark"]) .sales-agent-layout .select2-container--default .select2-selection--multiple,
html:not([data-theme="dark"]) .sales-agent-layout .select2-container--default .select2-selection--single {
    background: #ffffff !important;
    background-image: none !important;
    border-color: #d8e5f5 !important;
    box-shadow: none !important;
}

html:not([data-theme="dark"]) .sales-agent-password-icon,
html:not([data-theme="dark"]) .sales-agent-password-help {
    background: #eef7ff !important;
    background-image: none !important;
    border-color: #cfe0f5 !important;
    box-shadow: none !important;
}

html:not([data-theme="dark"]) .sales-agent-password-icon {
    color: #1677d2 !important;
}

@media (max-width: 1199.98px) {
    .sales-agent-layout .offcanvas-xl {
        top: 90px !important;
        bottom: 10px !important;
        height: auto !important;
        max-width: min(86vw, 330px);
        border: 1px solid rgba(58, 144, 255, .72);
        border-radius: 18px 0 0 18px;
        background: linear-gradient(180deg, rgba(8, 29, 78, .98), rgba(1, 7, 28, .99));
        overflow: hidden;
    }

    .sales-agent-layout .offcanvas-header {
        min-height: 58px;
        padding: 10px 12px;
        color: #f4f6ff;
        background: #071642 !important;
        border-bottom: 1px solid rgba(75, 162, 255, .25);
    }

    .sales-agent-layout .offcanvas-header .btn-close {
        position: relative;
        width: 34px;
        height: 34px;
        flex: 0 0 34px;
        border: 1px solid rgba(80, 139, 255, .52);
        border-radius: 12px;
        background: rgba(19, 56, 120, .56) !important;
        background-image: none !important;
        opacity: 1;
        box-shadow: inset 0 0 12px rgba(56, 126, 255, .16);
    }

    .sales-agent-layout .offcanvas-header .btn-close::before,
    .sales-agent-layout .offcanvas-header .btn-close::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 15px;
        height: 2px;
        border-radius: 999px;
        background: #f4f6ff;
    }

    .sales-agent-layout .offcanvas-header .btn-close::before {
        transform: translate(-50%, -50%) rotate(45deg);
    }

    .sales-agent-layout .offcanvas-header .btn-close::after {
        transform: translate(-50%, -50%) rotate(-45deg);
    }

    html:not([data-theme="dark"]) .sales-agent-layout .offcanvas-xl {
        border-color: #d9e6f4;
        background: #ffffff;
        box-shadow: 0 8px 22px rgba(15, 35, 75, .08);
    }

    html:not([data-theme="dark"]) .sales-agent-layout .offcanvas-header {
        color: #17233c;
        background: #f8fbff !important;
        border-bottom-color: #d8e5f5;
    }

    html:not([data-theme="dark"]) .sales-agent-layout .offcanvas-header .btn-close {
        border-color: #cfe0f5;
        background: #ffffff !important;
        box-shadow: 0 6px 14px rgba(15, 35, 75, .08) !important;
    }

    html:not([data-theme="dark"]) .sales-agent-layout .offcanvas-header .btn-close::before,
    html:not([data-theme="dark"]) .sales-agent-layout .offcanvas-header .btn-close::after {
        background: #17233c;
    }
}

/* FINAL V68 - Cleaner light mobile sales-agent menu trigger. */
@media (min-width: 1200px) {
    .affiliate-mobile-menu {
        display: none !important;
    }
}

@media (max-width: 1199.98px) {
    html:not([data-theme="dark"]) .affiliate-mobile-menu {
        min-height: 46px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 9px !important;
        color: #082654 !important;
        font-weight: 900 !important;
        border: 1px solid #cfe0f5 !important;
        border-radius: 16px !important;
        background: #ffffff !important;
        background-image: none !important;
        box-shadow: 0 8px 20px rgba(15, 35, 75, .065) !important;
    }

    html:not([data-theme="dark"]) .affiliate-mobile-menu i {
        width: 28px;
        height: 28px;
        margin: 0 !important;
        display: inline-grid;
        place-items: center;
        color: #1677d2 !important;
        background: #eef7ff;
        border: 1px solid #cfe0f5;
        border-radius: 10px;
        box-shadow: none !important;
    }

    html:not([data-theme="dark"]) .affiliate-mobile-menu:hover,
    html:not([data-theme="dark"]) .affiliate-mobile-menu:focus {
        color: #061b43 !important;
        border-color: #9cc7f2 !important;
        background: #f8fbff !important;
        box-shadow: 0 10px 24px rgba(15, 35, 75, .08) !important;
    }

    html:not([data-theme="dark"]) .affiliate-mobile-menu:hover i,
    html:not([data-theme="dark"]) .affiliate-mobile-menu:focus i {
        color: #ffffff !important;
        background: #1677d2;
        border-color: #1677d2;
    }
}

/* FINAL V69 - Let inner sales-agent pages use the shared dark star layer only. */
html[data-theme="dark"] .sales-agent-layout {
    background: transparent !important;
    background-image: none !important;
}

html[data-theme="dark"] .sales-agent-layout .sales-agent-shared-header::after,
html[data-theme="dark"] .sales-agent-layout .affiliate-main-column > .card::after,
html[data-theme="dark"] .sales-agent-layout .affiliate-main-column > .row .card::after,
html[data-theme="dark"] .sales-agent-layout .discount-card::after,
html[data-theme="dark"] .sales-agent-layout .sales-agent-sms-card::after,
html[data-theme="dark"] .sales-agent-layout .sa-panel::after,
html[data-theme="dark"] .sales-agent-layout .sa-card::after,
html[data-theme="dark"] .sales-agent-layout .sa-stat-card::after {
    display: none !important;
    opacity: 0 !important;
    background-image: none !important;
}

/* FINAL V71 - Minimal premium dashboard sales chart. */
.affiliate-space-dashboard .affiliate-chart-card {
    position: relative;
    min-height: 154px !important;
    padding: 12px 14px 10px !important;
    border: 1px solid rgba(82, 142, 236, .16) !important;
    border-radius: 16px !important;
    background:
        linear-gradient(rgba(82, 142, 236, .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(82, 142, 236, .035) 1px, transparent 1px),
        linear-gradient(180deg, rgba(255, 255, 255, .54), rgba(255, 255, 255, .34)) !important;
    background-size: 100% 42px, 56px 100%, auto !important;
    box-shadow: none !important;
    color: #2ea7f2;
    isolation: isolate;
}

.affiliate-space-dashboard .affiliate-chart-card::before {
    content: "";
    position: absolute;
    inset: 12px 14px 31px;
    z-index: -1;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(46, 167, 242, .055), transparent 74%);
    pointer-events: none;
}

.affiliate-space-dashboard .affiliate-chart-title {
    margin-bottom: 4px !important;
    font-size: .7rem !important;
    font-weight: 800 !important;
    opacity: .82;
}

.affiliate-space-dashboard .affiliate-chart-svg {
    height: 124px !important;
    overflow: hidden !important;
    color: #2ea7f2;
}

.affiliate-space-dashboard .affiliate-chart-baseline {
    stroke: currentColor;
    stroke-width: .65;
    stroke-opacity: .22;
    vector-effect: non-scaling-stroke;
}

.affiliate-space-dashboard .affiliate-chart-area {
    fill: url("#affiliateSalesChartArea") !important;
    color: #2ea7f2;
}

.affiliate-space-dashboard .affiliate-chart-stroke {
    stroke: url("#affiliateSalesChartStroke") !important;
    stroke-width: 1.85 !important;
    vector-effect: non-scaling-stroke;
    filter: none !important;
    transition: stroke .2s ease, opacity .2s ease;
}

.affiliate-space-dashboard .affiliate-chart-dot {
    r: .42;
    fill: #ffffff !important;
    stroke: #38bdf8 !important;
    stroke-width: .85 !important;
    vector-effect: non-scaling-stroke;
    filter: none !important;
    opacity: .42;
}

.affiliate-space-dashboard .affiliate-chart-dot-last {
    r: 1.05;
    fill: #fff8e6 !important;
    stroke: #fbbf24 !important;
    stroke-width: 1.25 !important;
    opacity: 1;
}

.affiliate-space-dashboard .affiliate-chart-label {
    margin-top: 4px !important;
    font-size: .6rem !important;
    opacity: .74;
}

html[data-theme="dark"] .affiliate-space-dashboard .affiliate-chart-card {
    color: #53bff5;
    border-color: rgba(111, 193, 255, .14) !important;
    background:
        linear-gradient(rgba(111, 193, 255, .028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(111, 193, 255, .024) 1px, transparent 1px),
        linear-gradient(180deg, rgba(6, 27, 76, .42), rgba(3, 17, 52, .18)) !important;
    background-color: rgba(3, 17, 52, .38) !important;
}

html[data-theme="dark"] .affiliate-space-dashboard .affiliate-chart-card::before {
    background: radial-gradient(ellipse at 78% 28%, rgba(251, 191, 36, .10), transparent 34%),
        linear-gradient(180deg, rgba(83, 191, 245, .07), transparent 74%);
}

html[data-theme="dark"] .affiliate-space-dashboard .affiliate-chart-title {
    color: #dcecff !important;
}

html[data-theme="dark"] .affiliate-space-dashboard .affiliate-chart-area {
    color: #53bff5;
}

html[data-theme="dark"] .affiliate-space-dashboard .affiliate-chart-baseline {
    stroke-opacity: .18;
}

html[data-theme="dark"] .affiliate-space-dashboard .affiliate-chart-dot {
    fill: #071f59 !important;
    stroke: #78d5ff !important;
    opacity: .36;
}

html[data-theme="dark"] .affiliate-space-dashboard .affiliate-chart-dot-last {
    fill: #071f59 !important;
    stroke: #fbbf24 !important;
    opacity: 1;
}

/* FINAL V70 - Responsive sales-agent Excel export actions. */
.sales-agent-layout .card-header a:has(.bi-file-earmark-excel),
.sales-agent-layout .discount-card-header a:has(.bi-file-earmark-excel),
.sales-agent-layout .sa-panel-header a:has(.bi-file-earmark-excel),
.sales-agent-layout .sa-card-header a:has(.bi-file-earmark-excel),
.affiliate-space-dashboard .affiliate-section-head a:has(.bi-file-earmark-excel) {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: .35rem !important;
    white-space: nowrap !important;
}

@media (max-width: 575.98px) {
    .sales-agent-layout .card-header:has(a .bi-file-earmark-excel),
    .sales-agent-layout .discount-card-header:has(a .bi-file-earmark-excel),
    .sales-agent-layout .sa-panel-header:has(a .bi-file-earmark-excel),
    .sales-agent-layout .sa-card-header:has(a .bi-file-earmark-excel),
    .affiliate-space-dashboard .affiliate-section-head:has(a .bi-file-earmark-excel) {
        align-items: stretch !important;
        flex-direction: column !important;
        gap: .75rem !important;
    }

    .sales-agent-layout .card-header:has(a .bi-file-earmark-excel) > div,
    .sales-agent-layout .discount-card-header:has(a .bi-file-earmark-excel) > div,
    .sales-agent-layout .sa-panel-header:has(a .bi-file-earmark-excel) > div,
    .sales-agent-layout .sa-card-header:has(a .bi-file-earmark-excel) > div,
    .affiliate-space-dashboard .affiliate-section-head:has(a .bi-file-earmark-excel) > div {
        width: 100% !important;
        min-width: 0 !important;
    }

    .sales-agent-layout .card-header a:has(.bi-file-earmark-excel),
    .sales-agent-layout .discount-card-header a:has(.bi-file-earmark-excel),
    .sales-agent-layout .sa-panel-header a:has(.bi-file-earmark-excel),
    .sales-agent-layout .sa-card-header a:has(.bi-file-earmark-excel) {
        width: 100% !important;
        min-height: 42px !important;
        white-space: normal !important;
    }

    .affiliate-space-dashboard .affiliate-section-head > div:has(a .bi-file-earmark-excel) {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: .5rem !important;
    }

    .affiliate-space-dashboard .affiliate-section-head a:has(.bi-file-earmark-excel),
    .affiliate-space-dashboard .affiliate-section-head > div:has(a .bi-file-earmark-excel) a {
        width: 100% !important;
        min-height: 40px !important;
        padding: .55rem .75rem !important;
        border-radius: 12px !important;
        text-align: center !important;
        white-space: normal !important;
    }
}

/* FINAL V80 - Light dashboard table header readability. */
html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-table-panel {
    background: #ffffff !important;
    background-image: none !important;
    border-color: #d8e5f5 !important;
    box-shadow: 0 8px 22px rgba(15, 35, 75, .06) !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-table-wrap {
    background: #ffffff !important;
    border-color: #cfe0f5 !important;
    box-shadow: none !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-table {
    color: #17233c !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-table th {
    color: #12345f !important;
    background: #eef6ff !important;
    border-bottom-color: #cfe0f5 !important;
    font-weight: 900 !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-table td {
    color: #17233c !important;
    border-bottom-color: #dbe8f7 !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-transaction-type {
    color: #17233c !important;
}

html:not([data-theme="dark"]) .affiliate-space-dashboard .affiliate-code-pill {
    color: #0d6f8a !important;
    background: #ecfbff !important;
    border-color: #9de8f5 !important;
}

/* FINAL V82 - RTL offcanvas sidebars open from the right, so round the left edge less. */
@media (max-width: 1199.98px) {
    html[dir="rtl"] .affiliate-space-dashboard .offcanvas-xl,
    html[dir="rtl"] .sales-agent-layout .offcanvas-xl {
        border-radius: 0 18px 18px 0 !important;
    }

    html[dir="ltr"] .affiliate-space-dashboard .offcanvas-xl,
    html[dir="ltr"] .sales-agent-layout .offcanvas-xl {
        border-radius: 18px 0 0 18px !important;
    }
}
