/* =========================================================
   MEMBER DASHBOARD
   Uses the brand tokens from style.css (:root)
   ========================================================= */

.dashboard-container {
    --sidebar-width: 264px;
    --header-height: 68px;
    --dash-bg: #f3f6fb;
    --card-radius: 18px;
    --card-shadow: 0 1px 2px rgba(23, 36, 59, .04), 0 8px 24px rgba(23, 36, 59, .06);

    min-height: 100vh;
    background: var(--dash-bg);
    color: var(--ink);
}

.dashboard-container .btn {
    padding: 10px 16px;
}

.dashboard-container .btn-primary,
.wallet-dialog .btn-primary {
    background: var(--green);
    border-color: var(--green);
}

.dashboard-container .btn-primary:hover,
.wallet-dialog .btn-primary:hover {
    background: var(--green-dark);
    border-color: var(--green-dark);
}

.dashboard-container .form-control,
.wallet-dialog .form-control {
    border-radius: 12px;
    border-color: #dbe3ec;
    padding: 10px 14px;
}

.dashboard-container .form-control:focus,
.wallet-dialog .form-control:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 .2rem rgba(0, 111, 230, .12);
}

.min-w-0 {
    min-width: 0;
}

/* ===================== SIDEBAR ===================== */

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid var(--line);
    transition: transform .25s ease;
}

.sidebar.close {
    transform: translateX(-100%);
}

.sidebar .logo {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 22px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}

.sidebar .logo img {
    height: 38px;
    max-width: 100%;
    object-fit: contain;
}

.sidebar nav {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    scrollbar-width: thin;
}

.sidebar .nav-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar .nav-section + .nav-section {
    margin-top: 14px;
}

.sidebar .nav-heading {
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #a3adbd;
    padding: 0 12px 6px;
}

/* ----- profile card ----- */
.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 16px;
    color: #fff;
    background:
        radial-gradient(circle at 100% 0%, rgba(255, 255, 255, .18) 0, transparent 45%),
        linear-gradient(140deg, #0a7bf2, #083b7b);
    box-shadow: 0 10px 24px rgba(0, 70, 145, .22);
}

.sidebar-avatar {
    position: relative;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: rgba(255, 255, 255, .18);
    font-size: 1.25rem;
}

.sidebar-avatar-dot {
    position: absolute;
    right: -3px;
    bottom: -3px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 2px solid #0a62c9;
    background: #f5a623;
}

.sidebar-avatar-dot.on {
    background: #22c06d;
}

.sidebar-profile strong {
    display: block;
    font-family: 'Manrope', sans-serif;
    font-size: 1.02rem;
    letter-spacing: .03em;
}

.sidebar-profile small {
    font-size: .78rem;
    opacity: .8;
}

/* ----- links ----- */
.sidebar .nav-link-item,
.sidebar .nav-group-toggle {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    font-size: .93rem;
    font-weight: 600;
    color: var(--muted);
    text-align: left;
    transition: background .15s ease, color .15s ease;
}

.sidebar .nav-link-item i,
.sidebar .nav-group-toggle > i:first-child {
    width: 20px;
    font-size: 1.02rem;
    text-align: center;
}

.sidebar .nav-link-item span,
.sidebar .nav-group-toggle span:first-of-type {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar .nav-link-item:hover,
.sidebar .nav-group-toggle:hover {
    background: var(--bg);
    color: var(--ink);
}

.sidebar .nav-link-item.active {
    background: var(--mint);
    color: var(--green);
    font-weight: 700;
}

/* accent bar on the sidebar edge for top-level links */
.sidebar .nav-section > .nav-link-item.active::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 7px;
    bottom: 7px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--green);
}

/* ----- collapsible groups ----- */
.sidebar .nav-group-toggle.has-active {
    color: var(--ink);
}

.nav-group-count {
    margin-left: auto;
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 50px;
    background: var(--bg);
    color: #95a0b2;
    font-size: .7rem;
    font-weight: 700;
    text-align: center;
}

.nav-group-chevron {
    font-size: .72rem;
    color: #b6c0cf;
    transition: transform .25s ease;
}

.nav-group.open .nav-group-chevron {
    transform: rotate(180deg);
}

.nav-group-items {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .28s ease;
}

.nav-group.open .nav-group-items {
    grid-template-rows: 1fr;
}

.nav-group-items > div {
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-left: 21px;
    padding-left: 10px;
    border-left: 1px solid var(--line);
    visibility: hidden;
    transition: visibility .28s;
}

.nav-group.open .nav-group-items > div {
    visibility: visible;
}

.nav-group.open .nav-group-items > div > :first-child {
    margin-top: 2px;
}

.nav-group.open .nav-group-items > div > :last-child {
    margin-bottom: 6px;
}

.sidebar .nav-group-items .nav-link-item {
    padding: 8px 10px;
    font-size: .89rem;
}

.sidebar .nav-group-items .nav-link-item i {
    font-size: .95rem;
}

/* long income names wrap instead of being cut off */
.sidebar .nav-group-items .nav-link-item span {
    white-space: normal;
    line-height: 1.3;
}

/* ----- help card ----- */
.sidebar-help {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding: 12px;
    border-radius: 16px;
    background: linear-gradient(140deg, #f0f6fe, #f1f0fe);
    border: 1px solid #dce8f8;
    color: var(--ink);
    transition: border-color .15s ease, box-shadow .15s ease;
}

/* keeps a gap above the help card, which is pushed to the bottom by margin-top: auto */
.sidebar nav > .nav-section:last-of-type {
    margin-bottom: 16px;
}

.sidebar-help:hover,
.sidebar-help.active {
    color: var(--ink);
    border-color: #b9d4f3;
    box-shadow: 0 8px 20px rgba(0, 111, 230, .1);
}

.sidebar-help-icon {
    position: relative;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #fff;
    color: var(--green);
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(23, 36, 59, .08);
}

.sidebar-help-icon .nav-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    margin: 0;
    border: 2px solid #fff;
}

.sidebar-help strong {
    display: block;
    font-size: .92rem;
}

.sidebar-help small {
    font-size: .78rem;
    color: var(--muted);
}

.sidebar-help > .bi-chevron-right {
    margin-left: auto;
    font-size: .8rem;
    color: #b6c0cf;
}

/* ----- footer: password + logout ----- */
.sidebar-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 12px 16px;
    border-top: 1px solid var(--line);
}

.sidebar .account-link,
.sidebar .logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px;
    border-radius: 12px;
    font-size: .9rem;
    font-weight: 700;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.sidebar .account-link {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
}

.sidebar .account-link:hover,
.sidebar .account-link.active {
    border-color: #c9dcf3;
    background: var(--mint);
    color: var(--green);
}

.sidebar .account-link.full-width {
    grid-column: 1 / -1;
}

.sidebar .logout-btn {
    border: 1px solid #fde2e2;
    background: #fff5f5;
    color: #d93838;
}

.sidebar .logout-btn:hover:not(:disabled) {
    background: #d93838;
    color: #fff;
}

.sidebar-backdrop {
    display: none;
}

/* ===================== MAIN ===================== */

.main-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .25s ease;
}

.main-content.sidebar-open {
    margin-left: var(--sidebar-width);
}

.page-content {
    flex: 1;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
}

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

.header {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 24px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.menu-toggle {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    font-size: 1.25rem;
}

.menu-toggle:hover {
    background: var(--mint);
    color: var(--green);
}

.mobile_logo {
    display: none;
    height: 30px;
}

.header-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 14px 5px 5px;
    border: 1px solid var(--line);
    border-radius: 50px;
    background: #fff;
}

.header-avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--mint);
    color: var(--green);
}

.header-user-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.header-user-text small {
    font-size: .76rem;
    color: #95a0b2;
    font-weight: 600;
}

.header-user-text strong {
    font-size: .94rem;
}

/* ----- user menu ----- */

.user-menu {
    position: relative;
    flex-shrink: 0;
}

button.header-user {
    color: var(--ink);
    text-align: left;
    transition: border-color .15s ease, box-shadow .15s ease;
}

button.header-user:hover,
button.header-user.open {
    border-color: #c9dcf3;
    box-shadow: 0 4px 14px rgba(0, 111, 230, .1);
}

.user-menu-caret {
    font-size: .75rem;
    color: #95a0b2;
    transition: transform .2s ease;
}

.header-user.open .user-menu-caret {
    transform: rotate(180deg);
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 250px;
    padding: 8px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 20px 45px rgba(23, 36, 59, .14);
    animation: menuDrop .18s ease;
}

.user-menu-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 14px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--line);
}

.user-menu-head small {
    display: block;
    font-size: .76rem;
    font-weight: 600;
    color: #95a0b2;
}

.user-menu-head strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    font-size: .95rem;
    font-weight: 600;
    color: var(--muted);
    transition: background .15s ease, color .15s ease;
}

.user-menu-item i {
    width: 20px;
    font-size: 1.05rem;
    text-align: center;
}

.user-menu-item:hover {
    background: var(--mint);
    color: var(--green);
}

.user-menu-item.logout {
    color: #d93838;
}

.user-menu-item.logout:hover:not(:disabled) {
    background: #fff5f5;
    color: #d93838;
}

/* ===================== FOOTER ===================== */

.footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    padding: 18px 24px;
    font-size: .9rem;
    color: #8792a5;
    border-top: 1px solid var(--line);
    background: #fff;
}

/* ===================== DASHBOARD PAGE ===================== */

.dashboard-page {
    padding: 24px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: .88rem;
    font-weight: 700;
}

.status-pill i {
    font-size: .5rem;
}

.status-pill.active {
    background: #e7f8ef;
    color: #12825a;
}

.status-pill.inactive {
    background: #fff3e6;
    color: #c26a00;
}

/* ----- wallet cards ----- */

.wallet-card {
    --tone-from: #0a7bf2;
    --tone-to: #004691;

    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 22px;
    overflow: hidden;
    border-radius: var(--card-radius);
    color: #fff;
    background: linear-gradient(140deg, var(--tone-from) 0%, var(--tone-to) 100%);
    box-shadow: 0 12px 28px rgba(0, 70, 145, .18);
}

.wallet-card::after {
    content: "";
    position: absolute;
    top: -60px;
    right: -60px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    pointer-events: none;
}

.wallet-teal {
    --tone-from: #10a58f;
    --tone-to: #0a6b60;
    box-shadow: 0 12px 28px rgba(10, 107, 96, .18);
}

.wallet-indigo {
    --tone-from: #5b54ea;
    --tone-to: #322b99;
    box-shadow: 0 12px 28px rgba(50, 43, 153, .18);
}

.wallet-card-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.wallet-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, .18);
    font-size: 1.3rem;
}

.wallet-title {
    margin: 0;
    font-weight: 700;
    font-size: 1rem;
    opacity: .95;
}

.compound-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    padding: 2px 9px;
    border-radius: 50px;
    font-size: .78rem;
    font-weight: 700;
    background: rgba(255, 255, 255, .16);
}

.compound-badge.on {
    background: #fff;
    color: #0a6b60;
}

.wallet-balance {
    margin: 22px 0 2px;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -.03em;
    word-break: break-all;
}

.wallet-caption {
    margin: 0 0 18px;
    font-size: .88rem;
    opacity: .75;
}

.wallet-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    position: relative;
    z-index: 1;
}

.btn.btn-wallet {
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 12px;
    font-size: .9rem;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .35);
    background: rgba(255, 255, 255, .1);
}

.btn.btn-wallet:hover:not(:disabled) {
    color: #fff;
    background: rgba(255, 255, 255, .22);
    border-color: rgba(255, 255, 255, .55);
}

.btn.btn-wallet.primary {
    background: #fff;
    border-color: #fff;
    color: var(--tone-to);
}

.btn.btn-wallet.primary:hover:not(:disabled) {
    background: rgba(255, 255, 255, .9);
    color: var(--tone-to);
}

.btn.btn-wallet:disabled {
    color: #fff;
    opacity: .7;
}

.wallet-link {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    margin-top: 16px;
    font-size: .9rem;
    font-weight: 600;
    color: #fff;
    opacity: .85;
}

.wallet-link:hover {
    color: #fff;
    opacity: 1;
    text-decoration: underline;
}

/* ----- panels ----- */

.panel {
    padding: 20px;
    border-radius: var(--card-radius);
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--card-shadow);
}

.referral-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
}

.referral-text {
    display: flex;
    align-items: center;
    gap: 12px;
}

.referral-input {
    max-width: 560px;
}

.referral-input .form-control {
    background: var(--bg);
}

.referral-input .btn {
    border-top-right-radius: 12px !important;
    border-bottom-right-radius: 12px !important;
}

.dashboard-container .section-title {
    margin: 28px 0 12px;
    font-size: .84rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #8792a5;
}

/* ----- stat tiles ----- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}

.stat-tile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--card-shadow);
    color: var(--ink);
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.stat-tile:hover {
    color: var(--ink);
    transform: translateY(-2px);
    border-color: #c9dcf3;
    box-shadow: 0 12px 28px rgba(0, 111, 230, .1);
}

.stat-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: var(--mint);
    color: var(--green);
    font-size: 1.2rem;
}

.dashboard-container .stat-label {
    margin: 0 0 2px;
    font-size: .86rem;
    font-weight: 600;
    color: var(--muted);
}

.stat-value {
    margin: 0;
    font-weight: 800;
    font-size: 1.15rem;
    word-break: break-all;
}

.stat-sub {
    color: #95a0b2;
    font-size: .82rem;
}

.stat-arrow {
    margin-left: auto;
    color: #b6c0cf;
    transition: color .15s ease;
}

.stat-tile:hover .stat-arrow {
    color: var(--green);
}

/* ===================== LEVEL TEAM ===================== */

.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 14px;
}

.level-card {
    display: flex;
    flex-direction: column;
    padding: 16px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--card-shadow);
    color: var(--ink);
}

.level-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.level-card-head h6 {
    margin: 0;
    font-weight: 800;
}

.level-count {
    padding: 3px 10px;
    border-radius: 50px;
    background: var(--mint);
    color: var(--green);
    font-size: .82rem;
    font-weight: 700;
}

.level-stats {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
    margin: 0 0 14px;
    font-size: .88rem;
}

.level-stats dt {
    font-weight: 600;
    color: var(--muted);
}

.level-stats dd {
    margin: 0;
    font-weight: 700;
    text-align: right;
}

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

.password-panel {
    max-width: 520px;
}

/* ===================== SUPPORT CHAT ===================== */

.nav-badge {
    margin-left: auto;
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 50px;
    background: #d93838;
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    text-align: center;
}

.new-reply-badge {
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 50px;
    background: #d93838;
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
}

.chat-box {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height) - 120px);
    min-height: 420px;
    border-radius: var(--card-radius);
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.chat-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}

.chat-back {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 10px;
    background: var(--dash-bg);
    color: var(--ink);
}

.chat-title {
    margin: 0;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    background: var(--dash-bg);
}

.chat-row {
    display: flex;
    margin-bottom: 12px;
}

.chat-row.mine {
    justify-content: flex-end;
}

.chat-bubble {
    max-width: min(75%, 560px);
    padding: 10px 14px;
    border-radius: 14px 14px 14px 4px;
    background: #fff;
    border: 1px solid var(--line);
}

.chat-row.mine .chat-bubble {
    border-radius: 14px 14px 4px 14px;
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

.chat-bubble p {
    margin: 2px 0 4px;
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-sender {
    font-size: .78rem;
    font-weight: 700;
    opacity: .8;
}

.chat-bubble small {
    display: block;
    font-size: .72rem;
    opacity: .7;
    text-align: right;
}

.chat-input {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    padding: 12px 14px;
    border-top: 1px solid var(--line);
}

.chat-input textarea {
    resize: none;
}

.chat-input .btn {
    height: 44px;
    flex-shrink: 0;
}

.chat-closed {
    padding: 14px 18px;
    border-top: 1px solid var(--line);
    background: #fff8ec;
    color: #8a5a00;
    font-size: .9rem;
}

@media (max-width: 575px) {
    .chat-bubble {
        max-width: 88%;
    }
}

/* ===================== REPORT TABLES ===================== */

.table-theme-box {
    padding: 4px;
    border-radius: var(--card-radius);
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.table-theme-box .p-datatable .p-datatable-thead > tr > th {
    background: var(--bg);
    color: var(--muted);
    font-size: .86rem;
    font-weight: 700;
    white-space: nowrap;
}

.table-theme-box .p-datatable .p-datatable-tbody > tr > td {
    font-size: .94rem;
    white-space: nowrap;
}

.table-theme-box .p-paginator {
    border: 0;
}

/* PrimeReact dropdown panels are attached to <body>; undo Bootstrap's default <ul> spacing */
.p-dropdown-panel {
    margin-top: 6px;
    border-radius: 14px;
    border: 1px solid var(--line);
    box-shadow: 0 16px 36px rgba(23, 36, 59, .14);
    overflow: hidden;
}

.p-dropdown-panel .p-dropdown-items {
    margin: 0;
    padding: 6px;
}

.p-dropdown-panel .p-dropdown-items .p-dropdown-item {
    padding: 9px 14px;
    border-radius: 9px;
    font-size: .95rem;
    font-weight: 600;
    justify-content: center;
}

.p-dropdown-panel .p-dropdown-items .p-dropdown-item.p-highlight {
    background: var(--mint);
    color: var(--green);
}

.report-search {
    position: relative;
    display: block;
}

.report-search > i {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: #95a0b2;
    font-size: .95rem;
    pointer-events: none;
}

.report-search .p-inputtext {
    width: 240px;
    height: 42px;
    padding: 0 14px 0 40px;
    border-radius: 12px;
    border-color: #dbe3ec;
    background: var(--bg);
    font-size: .95rem;
}

.report-search .p-inputtext:enabled:focus {
    border-color: var(--green);
    background: #fff;
    box-shadow: 0 0 0 .2rem rgba(0, 111, 230, .12);
}

.report-search:focus-within > i {
    color: var(--green);
}

/* light "refreshing" overlay instead of PrimeReact's dark one */
.table-theme-box .p-datatable .p-datatable-loading-overlay {
    background: rgba(255, 255, 255, .7) !important;
    backdrop-filter: blur(2px);
}

.report-loading-ring {
    position: relative;
    display: block;
    width: 40px;
    height: 40px;
}

.report-skeleton.p-skeleton {
    max-width: 120px;
    border-radius: 6px;
    background: #e9eef5;
}

/* sidebar close button (mobile drawer only) */
.sidebar-close-btn {
    display: none;
}

/* ===================== DIALOGS ===================== */

.wallet-dialog.p-dialog {
    border-radius: 20px;
    overflow: hidden;
    font-family: 'DM Sans', sans-serif;
}

.wallet-dialog .p-dialog-header {
    padding: 22px 24px 8px;
    align-items: flex-start;
}

.wallet-dialog .p-dialog-content {
    padding: 12px 24px 8px;
}

.wallet-dialog .p-dialog-footer {
    padding: 16px 24px 22px;
}

.wallet-dialog .p-dialog-footer .btn {
    padding: 10px 18px;
    margin: 0;
}

.wallet-dialog .p-confirm-dialog-icon {
    color: var(--green);
    font-size: 1.6rem;
}

.dialog-balance {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--mint);
    font-size: .96rem;
    color: var(--muted);
}

.dialog-balance strong {
    color: var(--green-dark);
    font-size: 1.1rem;
}

.segmented {
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: var(--bg);
    border: 1px solid var(--line);
}

.segmented button {
    flex: 1;
    padding: 8px 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    font-size: .92rem;
    font-weight: 700;
    color: var(--muted);
}

.segmented button.active {
    background: #fff;
    color: var(--green);
    box-shadow: 0 1px 4px rgba(23, 36, 59, .12);
}

.fd-plans {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}

.fd-plan {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1.5px solid var(--line);
    background: #fff;
    text-align: left;
}

.fd-plan span {
    font-size: .86rem;
    color: #12825a;
    font-weight: 700;
}

.fd-plan.active {
    border-color: var(--green);
    background: var(--mint);
}

.field-spinner {
    position: absolute;
    right: 38px;
    top: 50%;
    margin-top: -.5rem;
}

.wallet-dialog .btn-max {
    border-top-right-radius: 12px !important;
    border-bottom-right-radius: 12px !important;
    padding: 0 16px;
}

/* ===================== RESPONSIVE ===================== */

@media (max-width: 991px) {

    .main-content.sidebar-open {
        margin-left: 0;
    }

    .sidebar {
        box-shadow: 0 0 40px rgba(23, 36, 59, .18);
    }

    .sidebar.close {
        box-shadow: none;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1035;
        background: rgba(23, 36, 59, .35);
    }

    .mobile_logo {
        display: block;
    }

    .header-title {
        display: none;
    }

    .referral-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .referral-input {
        max-width: none;
    }
}

@media (max-width: 575px) {

    .dashboard-page {
        padding: 16px;
    }

    .header {
        padding: 0 16px;
    }

    .header-user-text small {
        display: none;
    }

    .wallet-balance {
        font-size: 1.7rem;
    }

    .footer {
        padding: 16px;
        justify-content: center;
        text-align: center;
    }
}

/* ----- larger text on phones ----- */
@media (max-width: 575px) {

    .sidebar .nav-link-item,
    .sidebar .nav-group-toggle,
    .table-theme-box .p-datatable .p-datatable-tbody > tr > td,
    .wallet-title,
    .dialog-balance {
        font-size: 1.04rem;
    }

    .header-user-text strong,
    .footer,
    .status-pill,
    .wallet-caption,
    .wallet-link,
    .table-theme-box .p-datatable .p-datatable-thead > tr > th,
    .segmented button,
    .fd-plan span {
        font-size: .96rem;
    }

    .sidebar .nav-heading,
    .dashboard-container .section-title,
    .compound-badge,
    .stat-sub {
        font-size: .88rem;
    }

    .stat-value {
        font-size: 1.08rem;
    }

    .dashboard-container .stat-label {
        font-size: .88rem;
    }
}

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

.dashboard-container .section-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-container .section-title::before {
    content: "";
    width: 4px;
    height: 14px;
    border-radius: 4px;
    background: var(--green);
}

.mobile-nav {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media (max-width: 991px) {

    .dashboard-container {
        --header-height: 62px;
        --mobile-nav-height: 66px;
    }

    .main-content {
        padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
    }

    /* ----- sidebar drawer ----- */
    .sidebar {
        width: min(300px, 86vw);
        border-radius: 0 24px 24px 0;
        z-index: 1060;
    }

    .sidebar-backdrop {
        z-index: 1055;
        backdrop-filter: blur(3px);
        animation: fadeIn .2s ease;
    }

    .sidebar-footer {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }

    .sidebar .logo {
        justify-content: space-between;
        gap: 12px;
        padding-right: 14px;
    }

    .sidebar-close-btn {
        width: 38px;
        height: 38px;
        flex-shrink: 0;
        display: grid;
        place-items: center;
        border: 1px solid var(--line);
        border-radius: 11px;
        background: #fff;
        color: var(--ink);
        font-size: 1rem;
    }

    .sidebar-close-btn:hover {
        background: #fff5f5;
        border-color: #fde2e2;
        color: #d93838;
    }

    /* ----- header ----- */
    .menu-toggle {
        width: 38px;
        height: 38px;
        border-radius: 11px;
    }

    /* ----- bottom navigation ----- */
    .mobile-nav {
        position: fixed;
        inset: auto 0 0;
        z-index: 1045;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
        padding: 6px 6px env(safe-area-inset-bottom);
        background: rgba(255, 255, 255, .96);
        backdrop-filter: blur(12px);
        border-top: 1px solid var(--line);
        box-shadow: 0 -8px 24px rgba(23, 36, 59, .06);
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 0;
        border: 0;
        background: transparent;
        font-size: .74rem;
        font-weight: 700;
        color: #8792a5;
    }

    .mobile-nav-icon {
        position: relative;
        width: 46px;
        height: 30px;
        display: grid;
        place-items: center;
        border-radius: 50px;
        font-size: 1.2rem;
        transition: background .15s ease, color .15s ease;
    }

    .mobile-nav-item.active {
        color: var(--green);
    }

    .mobile-nav-item.active .mobile-nav-icon {
        background: var(--mint);
    }

    .mobile-nav-badge {
        position: absolute;
        top: -3px;
        right: 2px;
        min-width: 18px;
        padding: 1px 5px;
        border-radius: 50px;
        border: 2px solid #fff;
        background: #d93838;
        color: #fff;
        font-size: .65rem;
        line-height: 1.2;
    }

    /* ----- swipeable wallet cards ----- */
    .wallet-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 14px;
    }

    .wallet-row::-webkit-scrollbar {
        display: none;
    }

    .wallet-row > * {
        flex: 0 0 56%;
        max-width: 56%;
        scroll-snap-align: start;
    }

    .swipe-hint {
        margin: 2px 0 0;
    }

    /* ----- footer sits above the bottom bar ----- */
    .footer {
        padding: 14px 16px;
        font-size: .82rem;
        justify-content: center;
        text-align: center;
    }

    .footer-note {
        display: none;
    }

    /* ----- support chat fits between header and bottom bar ----- */
    .chat-box {
        height: calc(100dvh - var(--header-height) - var(--mobile-nav-height) - env(safe-area-inset-bottom) - 32px);
        min-height: 360px;
    }
}

@media (max-width: 575px) {

    .status-pill {
        flex-shrink: 0;
        padding: 5px 12px;
        font-size: .82rem;
    }

    /* ----- wallet cards ----- */
    .wallet-row > * {
        flex-basis: 88%;
        max-width: 88%;
    }

    .wallet-card {
        padding: 20px 18px 18px;
    }

    .wallet-balance {
        margin-top: 18px;
        font-size: 1.85rem;
    }

    .wallet-caption {
        margin-bottom: 16px;
    }

    .wallet-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
        gap: 8px;
    }

    .btn.btn-wallet {
        flex-direction: column;
        gap: 4px;
        padding: 10px 4px;
        border-radius: 14px;
        font-size: .8rem;
        line-height: 1.2;
        text-align: center;
    }

    .btn.btn-wallet i {
        font-size: 1.2rem;
    }

    .wallet-link {
        margin-top: 14px;
    }

    /* ----- referral ----- */
    .referral-panel {
        margin-top: 18px;
        padding: 16px;
        gap: 14px;
    }

    .referral-input .form-control {
        font-size: .9rem;
    }

    .dashboard-container .section-title {
        margin: 24px 0 10px;
    }

    /* ----- 2-column stat tiles ----- */
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .stat-tile {
        position: relative;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 14px;
    }

    .stat-tile:hover {
        transform: none;
    }

    .stat-tile .min-w-0 {
        width: 100%;
    }

    .stat-icon {
        width: 38px;
        height: 38px;
        border-radius: 12px;
        font-size: 1.05rem;
    }

    .stat-arrow {
        position: absolute;
        top: 14px;
        right: 12px;
        font-size: .8rem;
    }

    .dashboard-container .stat-label {
        line-height: 1.3;
        margin-bottom: 4px;
    }

    .stat-sub {
        font-size: .8rem;
    }

    /* ----- level team ----- */
    .level-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* ----- report tables ----- */
    .report-search,
    .report-search .p-inputtext {
        width: 100%;
        min-width: 0;
    }

    .table-theme-box .p-paginator {
        padding: 10px 4px 14px;
        gap: 2px;
        row-gap: 10px;
    }

    /* rows-per-page dropdown on its own centred line under the page numbers */
    .table-theme-box .p-paginator::after {
        content: "";
        flex-basis: 100%;
        order: 1;
    }

    .table-theme-box .p-paginator .p-dropdown {
        order: 2;
        height: 2.4rem;
        margin: 0;
        align-items: center;
        border-radius: 10px;
    }

    .table-theme-box .p-paginator .p-paginator-page,
    .table-theme-box .p-paginator .p-paginator-first,
    .table-theme-box .p-paginator .p-paginator-prev,
    .table-theme-box .p-paginator .p-paginator-next,
    .table-theme-box .p-paginator .p-paginator-last {
        min-width: 2.2rem;
        height: 2.2rem;
        margin: 0;
        border-radius: 10px;
    }

    /* ----- wallet dialogs open as bottom sheets ----- */
    .p-dialog-mask:has(> .wallet-dialog) {
        align-items: flex-end;
    }

    .p-dialog-mask .p-dialog.wallet-dialog {
        width: 100vw !important;
        max-height: 92dvh;
        margin: 0;
        border-radius: 24px 24px 0 0;
    }

    .wallet-dialog .p-dialog-header {
        position: relative;
        padding: 26px 20px 8px;
    }

    .wallet-dialog .p-dialog-header::before {
        content: "";
        position: absolute;
        top: 9px;
        left: 50%;
        width: 40px;
        height: 4px;
        margin-left: -20px;
        border-radius: 4px;
        background: #d5dce6;
    }

    .wallet-dialog .p-dialog-content {
        padding: 12px 20px 8px;
    }

    .wallet-dialog .p-dialog-footer {
        padding: 14px 20px calc(18px + env(safe-area-inset-bottom));
    }
}

/* =========================================================
   REPORTS: SUMMARY, TOOLBAR, CARDS, EMPTY STATE
   ========================================================= */

/* ----- summary cards ----- */
.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.report-stat {
    --tone: var(--green);
    --tone-soft: var(--mint);

    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--card-shadow);
}

.report-stat::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--tone);
    opacity: .85;
}

.report-stat.tone-green {
    --tone: #12a150;
    --tone-soft: #e8f8ef;
}

.report-stat.tone-red {
    --tone: #e5484d;
    --tone-soft: #fdecec;
}

.report-stat.tone-amber {
    --tone: #e08a00;
    --tone-soft: #fff4e2;
}

.report-stat.tone-indigo {
    --tone: #5b54ea;
    --tone-soft: #efeefe;
}

.report-stat-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: var(--tone-soft);
    color: var(--tone);
    font-size: 1.15rem;
}

.report-stat-label {
    margin: 0 0 2px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--muted);
}

.report-stat-value {
    margin: 0;
    font-family: 'Manrope', sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -.02em;
    word-break: break-word;
}

/* ----- toolbar ----- */
.report-toolbar {
    padding: 14px 14px 12px;
    border-bottom: 1px solid var(--line);
}

.report-toolbar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.report-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.report-title h6 {
    margin: 0;
    font-weight: 800;
}

.report-count {
    padding: 3px 10px;
    border-radius: 50px;
    background: var(--mint);
    color: var(--green);
    font-size: .76rem;
    font-weight: 700;
    white-space: nowrap;
}

.report-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.dashboard-container .btn.report-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    color: var(--ink);
    font-size: .95rem;
}

.dashboard-container .btn.report-icon-btn:hover:not(:disabled) {
    border-color: #c9dcf3;
    background: var(--mint);
    color: var(--green);
}

.spin {
    display: inline-block;
    animation: loaderSpin .8s linear infinite;
}

.report-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.report-search-clear {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    padding: 0;
    border: 0;
    background: transparent;
    color: #b6c0cf;
    line-height: 1;
}

.report-search-clear:hover {
    color: var(--muted);
}

.range-chips {
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: var(--bg);
    border: 1px solid var(--line);
}

.range-chips button {
    padding: 6px 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    font-size: .84rem;
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
    transition: background .15s ease, color .15s ease;
}

.range-chips button:hover {
    color: var(--ink);
}

.range-chips button.active {
    background: #fff;
    color: var(--green);
    box-shadow: 0 1px 4px rgba(23, 36, 59, .12);
}

/* ----- table polish ----- */
.table-theme-box .p-datatable .p-datatable-thead > tr > th {
    border-width: 0 0 1px;
    font-size: .76rem;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.table-theme-box .p-datatable .p-datatable-tbody > tr {
    transition: background .12s ease;
}

.table-theme-box .p-datatable .p-datatable-tbody > tr:hover {
    background: #f4f8fd;
}

.table-theme-box .p-datatable .p-datatable-tbody > tr > td {
    border-width: 0 0 1px;
    border-color: #eef2f6;
}

.table-theme-box .p-datatable .p-datatable-emptymessage > td {
    border: 0;
}

/* soft status pills */
.table-theme-box .p-tag {
    padding: 3px 10px;
    border-radius: 50px;
    font-size: .76rem;
    font-weight: 700;
}

.table-theme-box .p-tag.p-tag-success {
    background: #e7f8ef;
    color: #12825a;
}

.table-theme-box .p-tag.p-tag-warning {
    background: #fff3e0;
    color: #b86e00;
}

.table-theme-box .p-tag.p-tag-danger {
    background: #fdecec;
    color: #c93035;
}

.table-theme-box .p-tag.p-tag-info {
    background: #e6f0fc;
    color: #0059c1;
}

.table-theme-box .p-tag.p-tag-secondary {
    background: #eef1f5;
    color: #5b6679;
}

/* ----- empty + error ----- */
.report-empty {
    padding: 40px 20px;
    text-align: center;
    white-space: normal;
}

.report-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: var(--mint);
    color: var(--green);
    font-size: 1.6rem;
}

.report-empty h6 {
    margin: 0 0 4px;
    font-weight: 800;
}

.report-empty p {
    margin: 0 auto 14px;
    max-width: 320px;
    color: var(--muted);
    font-size: .9rem;
}

.report-error {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: var(--card-radius);
    background: #fff5f5;
    border: 1px solid #fde2e2;
    color: #9b2c2c;
}

.report-error > i {
    font-size: 1.5rem;
}

.report-error p {
    margin: 2px 0 0;
    font-size: .9rem;
}

.report-error .btn {
    margin-left: auto;
    flex-shrink: 0;
}

@media (max-width: 767.98px) {
    .report-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .report-search,
    .report-search .p-inputtext {
        width: 100%;
    }

    .range-chips button {
        flex: 1;
        padding: 7px 4px;
    }
}

@media (max-width: 575px) {
    .report-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .report-stat {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 14px;
    }

    .report-stat-icon {
        width: 36px;
        height: 36px;
        border-radius: 11px;
        font-size: 1rem;
    }

    .report-stat-value {
        font-size: 1.05rem;
    }

    /* three cards share one row: compact layout */
    .report-summary.count-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .report-summary.count-3 .report-stat {
        gap: 6px;
        padding: 10px;
        border-radius: 14px;
    }

    .report-summary.count-3 .report-stat::after {
        width: 3px;
    }

    .report-summary.count-3 .report-stat-icon {
        width: 30px;
        height: 30px;
        border-radius: 9px;
        font-size: .88rem;
    }

    .report-summary.count-3 .report-stat-label {
        font-size: .7rem;
        line-height: 1.25;
    }

    .report-summary.count-3 .report-stat-value {
        font-size: .92rem;
    }

    .report-toolbar {
        padding: 12px;
    }
}

/* =========================================================
   REPORTS: MOBILE TABLE
   ========================================================= */

.table-swipe-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(90deg, #eaf1f9, #f4f8fd);
    border-bottom: 1px solid var(--line);
    color: var(--green);
    font-size: .8rem;
    font-weight: 700;
}

.table-swipe-arrow.right {
    animation: swipeNudgeRight 1.4s ease-in-out infinite;
}

.table-swipe-arrow.left {
    animation: swipeNudgeLeft 1.4s ease-in-out infinite;
}

@keyframes swipeNudgeRight {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(5px);
    }
}

@keyframes swipeNudgeLeft {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(-5px);
    }
}

@media (max-width: 767.98px) {

    .table-theme-box .report-table-mobile .p-datatable-thead > tr > th {
        padding: .75rem .8rem;
        font-size: .68rem;
    }

    .table-theme-box .report-table-mobile .p-datatable-tbody > tr > td {
        padding: .8rem .8rem;
        font-size: .88rem;
    }

    .table-theme-box .report-table-mobile .p-datatable-wrapper {
        -webkit-overflow-scrolling: touch;
    }
}

@media (prefers-reduced-motion: reduce) {
    .table-swipe-arrow {
        animation: none;
    }
}

/* =========================================================
   DASHBOARD: HERO, SECTION TOTALS, TILE TONES, SHARE
   ========================================================= */

.dash-hero {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px 24px;
    margin-bottom: 20px;
    padding: 24px 26px;
    overflow: hidden;
    border-radius: 22px;
    color: #fff;
    background:
        radial-gradient(circle at 85% -20%, rgba(124, 192, 255, .45) 0, transparent 45%),
        radial-gradient(circle at 0% 120%, rgba(91, 84, 234, .45) 0, transparent 45%),
        linear-gradient(135deg, #0b2a55 0%, #0a4fa3 55%, #0a7bf2 100%);
    box-shadow: 0 18px 40px rgba(8, 59, 123, .25);
}

.dash-hero::after {
    content: "";
    position: absolute;
    width: 320px;
    height: 320px;
    right: -120px;
    bottom: -190px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 0 0 30px rgba(255, 255, 255, .04), 0 0 0 64px rgba(255, 255, 255, .03);
    pointer-events: none;
}

.dash-hero > * {
    position: relative;
    z-index: 1;
}

.dash-hero-greeting {
    margin: 0;
    font-size: .92rem;
    opacity: .8;
}

.dash-hero-title {
    margin: 2px 0 10px;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: .02em;
}

.dash-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    font-size: .9rem;
}

.dash-hero .status-pill.active {
    background: rgba(34, 192, 109, .2);
    color: #b8f5d2;
}

.dash-hero .status-pill.inactive {
    background: rgba(245, 166, 35, .2);
    color: #ffe0ad;
}

.dash-hero-sponsor {
    opacity: .85;
}

.dash-hero-sponsor i {
    margin-right: 4px;
}

.dash-hero-balance {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    text-align: right;
}

.dash-hero-balance span {
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    opacity: .75;
}

.dash-hero-balance strong {
    font-family: 'Manrope', sans-serif;
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.15;
}

.dash-hero-balance small {
    font-size: .8rem;
    opacity: .7;
}

/* section header with the group total on the right */
.dashboard-container .section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 28px 0 12px;
}

.dashboard-container .section-head .section-title {
    margin: 0;
}

.section-total {
    font-size: .84rem;
    color: #8792a5;
    white-space: nowrap;
}

.section-total strong {
    margin-left: 4px;
    color: var(--ink);
    font-family: 'Manrope', sans-serif;
    font-size: 1rem;
}

/* tile icon colour per section */
.stat-grid.tone-green .stat-icon {
    background: #e8f8ef;
    color: #12a150;
}

.stat-grid.tone-indigo .stat-icon {
    background: #efeefe;
    color: #5b54ea;
}

.stat-grid.tone-green .stat-tile:hover {
    border-color: #c4ecd5;
}

.stat-grid.tone-indigo .stat-tile:hover {
    border-color: #d8d6fb;
}

/* referral: copy + share */
.referral-controls {
    display: flex;
    gap: 8px;
    flex: 1;
    max-width: 640px;
    min-width: 0;
}

.referral-controls .referral-input {
    flex: 1;
    min-width: 0;
}

.dashboard-container .btn.referral-share {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    border: 1px solid #c9dcf3;
    border-radius: 12px;
    background: var(--mint);
    color: var(--green);
    font-weight: 700;
}

.dashboard-container .btn.referral-share:hover:not(:disabled) {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

@media (max-width: 991px) {
    .referral-controls {
        max-width: none;
    }
}

@media (max-width: 575px) {
    .dash-hero {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 20px 18px;
        border-radius: 20px;
    }

    .dash-hero-title {
        font-size: 1.45rem;
        margin-bottom: 8px;
    }

    .dash-hero-balance {
        align-items: flex-start;
        text-align: left;
        padding: 12px 14px;
        border-radius: 14px;
        background: rgba(255, 255, 255, .1);
    }

    .dash-hero-balance strong {
        font-size: 1.7rem;
    }

    .dashboard-container .section-head {
        margin: 24px 0 10px;
    }

    .referral-share span {
        display: none;
    }
}
