/* Modern monthly report dashboard for account.php. */

#referrals-section.monthly-report-dashboard {
    --report-brand: #078b54;
    --report-brand-dark: #056b41;
    --report-brand-soft: #edf9f3;
    --report-ink: #17251e;
    --report-muted: #748179;
    --report-border: #e1e9e4;
    --report-shadow: 0 12px 30px rgba(26,61,43,.07);
    color: var(--report-ink);
}

#referrals-section .monthly-report-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
    padding: 23px 25px;
    border-radius: 20px;
    color: #fff;
    background:
        radial-gradient(circle at 88% 18%, rgba(255,255,255,.16), transparent 28%),
        linear-gradient(135deg,#057447 0%,#0a9258 58%,#13a667 100%);
    box-shadow: 0 16px 38px rgba(7,139,84,.16);
}

#referrals-section .monthly-report-hero-icon {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: rgba(255,255,255,.14);
    font-size: 22px;
}

#referrals-section .monthly-report-hero-copy {
    min-width: 0;
    flex: 1;
}

#referrals-section .monthly-report-eyebrow {
    display: block;
    margin-bottom: 3px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .75px;
    text-transform: uppercase;
    opacity: .84;
}

#referrals-section .monthly-report-hero h4 {
    margin: 0 0 4px;
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -.35px;
}

#referrals-section .monthly-report-hero p {
    margin: 0;
    color: rgba(255,255,255,.82);
    font-size: 13px;
    line-height: 1.5;
}

#referrals-section .monthly-report-refresh {
    flex: 0 0 auto;
    min-height: 43px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 15px;
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 12px;
    color: #fff;
    background: rgba(255,255,255,.12);
    font-size: 11px;
    font-weight: 800;
}

#referrals-section .monthly-report-refresh:hover {
    color: #fff;
    background: rgba(255,255,255,.20);
}

#referrals-section .monthly-report-panel {
    margin-bottom: 18px;
    padding: 21px;
    border: 1px solid var(--report-border);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--report-shadow);
}

#referrals-section .monthly-report-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

#referrals-section .monthly-report-panel-kicker {
    color: var(--report-brand);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .75px;
    text-transform: uppercase;
}

#referrals-section .monthly-report-panel-heading h5 {
    margin: 2px 0 0;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.2px;
}

#referrals-section .monthly-report-panel-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--report-brand);
    background: var(--report-brand-soft);
}

#referrals-section .monthly-report-primary-grid {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 11px;
}

#referrals-section .monthly-kpi-card {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 15px;
    border: 1px solid #e0e8e3;
    border-radius: 14px;
    background: #fbfcfb;
}

#referrals-section .monthly-kpi-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg,#078b54,#12a66a);
    font-size: 16px;
    box-shadow: 0 6px 14px rgba(7,139,84,.13);
}

#referrals-section .monthly-kpi-card.is-company .monthly-kpi-icon {
    background: linear-gradient(135deg,#315d9a,#4e7fc0);
}

#referrals-section .monthly-kpi-card.is-personal .monthly-kpi-icon {
    background: linear-gradient(135deg,#3b728c,#55a0bf);
}

#referrals-section .monthly-kpi-card.is-income .monthly-kpi-icon {
    background: linear-gradient(135deg,#078b54,#12a66a);
}

#referrals-section .monthly-kpi-card > div:last-child {
    min-width: 0;
}

#referrals-section .monthly-kpi-card span,
#referrals-section .monthly-kpi-card strong,
#referrals-section .monthly-kpi-card small {
    display: block;
}

#referrals-section .monthly-kpi-card span {
    color: #78867e;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .35px;
    text-transform: uppercase;
}

#referrals-section .monthly-kpi-card strong {
    margin: 4px 0 3px;
    color: #2f4137;
    font-size: 15px;
    font-weight: 850;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

#referrals-section .monthly-kpi-card small {
    color: #909b95;
    font-size: 8px;
    line-height: 1.4;
}

#referrals-section .monthly-report-metric-grid {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 9px;
}

#referrals-section .monthly-metric-card {
    min-width: 0;
    padding: 12px;
    border: 1px solid #e3ebe6;
    border-radius: 12px;
    background: #fbfcfb;
}

#referrals-section .monthly-metric-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    margin-bottom: 9px;
    border-radius: 10px;
    color: var(--report-brand);
    background: var(--report-brand-soft);
    font-size: 13px;
}

#referrals-section .monthly-metric-card span,
#referrals-section .monthly-metric-card strong {
    display: block;
}

#referrals-section .monthly-metric-card span {
    min-height: 31px;
    color: #7c8981;
    font-size: 8px;
    font-weight: 700;
    line-height: 1.4;
}

#referrals-section .monthly-metric-card strong {
    margin-top: 4px;
    color: #32443a;
    font-size: 12px;
    font-weight: 850;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

#referrals-section .monthly-panel-refresh {
    flex: 0 0 auto;
    min-height: 37px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 11px;
    border: 1px solid #d4e0d9;
    border-radius: 10px;
    color: #536259;
    background: #fff;
    font-size: 9px;
    font-weight: 750;
}

#referrals-section .monthly-panel-refresh:hover {
    color: var(--report-brand);
    border-color: #b8d2c4;
    background: #f7fbf9;
}

#referrals-section .monthly-group-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding: 14px 15px;
    border-radius: 14px;
    color: #fff;
    background:
        radial-gradient(circle at 90% 15%, rgba(255,255,255,.12), transparent 30%),
        linear-gradient(135deg,#163c2c,#08744a);
}

#referrals-section .monthly-group-summary-icon {
    width: 43px;
    height: 43px;
    flex: 0 0 43px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(255,255,255,.13);
    font-size: 17px;
}

#referrals-section .monthly-group-summary span,
#referrals-section .monthly-group-summary strong {
    display: block;
}

#referrals-section .monthly-group-summary span {
    color: rgba(255,255,255,.70);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .4px;
    text-transform: uppercase;
}

#referrals-section .monthly-group-summary strong {
    margin-top: 3px;
    font-size: 18px;
    font-weight: 850;
}

#referrals-section .monthly-group-list-wrap {
    padding-top: 2px;
}

#referrals-section .monthly-subheading {
    margin-bottom: 9px;
}

#referrals-section .monthly-subheading span {
    display: block;
    color: var(--report-brand);
    font-size: 7px;
    font-weight: 800;
    letter-spacing: .45px;
    text-transform: uppercase;
}

#referrals-section .monthly-subheading h6 {
    margin: 2px 0 0;
    color: #34463c;
    font-size: 11px;
    font-weight: 800;
}

#referrals-section .monthly-group-list,
#referrals-section .monthly-referral-list {
    display: grid;
    gap: 8px;
}

#referrals-section .monthly-group-member {
    display: grid;
    grid-template-columns: 28px 38px minmax(0,1fr) auto;
    gap: 9px;
    align-items: center;
    padding: 10px 11px;
    border: 1px solid #e4ebe7;
    border-radius: 11px;
    background: #fbfcfb;
}

#referrals-section .monthly-member-rank,
#referrals-section .monthly-referral-index {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: #68776f;
    background: #eef3f0;
    font-size: 8px;
    font-weight: 800;
}

#referrals-section .monthly-member-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(135deg,#078b54,#12a66a);
    font-size: 10px;
    font-weight: 850;
}

#referrals-section .monthly-member-copy,
#referrals-section .monthly-referral-member-copy {
    min-width: 0;
}

#referrals-section .monthly-member-copy strong,
#referrals-section .monthly-member-copy span,
#referrals-section .monthly-member-value span,
#referrals-section .monthly-member-value strong,
#referrals-section .monthly-referral-member-copy strong,
#referrals-section .monthly-referral-member-copy span {
    display: block;
}

#referrals-section .monthly-member-copy strong,
#referrals-section .monthly-referral-member-copy strong {
    color: #35473d;
    font-size: 10px;
    line-height: 1.4;
}

#referrals-section .monthly-member-copy span,
#referrals-section .monthly-referral-member-copy span {
    margin-top: 2px;
    color: #849088;
    font-size: 8px;
    line-height: 1.4;
}

#referrals-section .monthly-member-value {
    min-width: 120px;
    text-align: right;
}

#referrals-section .monthly-member-value span {
    color: #89958e;
    font-size: 7px;
    text-transform: uppercase;
}

#referrals-section .monthly-member-value strong {
    margin-top: 2px;
    color: var(--report-brand);
    font-size: 10px;
}

#referrals-section .monthly-referral-stats {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 10px;
    margin-bottom: 13px;
}

#referrals-section .monthly-referral-stats article {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    padding: 13px;
    border: 1px solid #e2eae5;
    border-radius: 12px;
    background: #fbfcfb;
}

#referrals-section .monthly-referral-stat-icon {
    width: 39px;
    height: 39px;
    flex: 0 0 39px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: var(--report-brand);
    background: var(--report-brand-soft);
}

#referrals-section .monthly-referral-stats span,
#referrals-section .monthly-referral-stats strong {
    display: block;
}

#referrals-section .monthly-referral-stats span {
    color: #7d8a82;
    font-size: 8px;
    line-height: 1.4;
}

#referrals-section .monthly-referral-stats strong {
    margin-top: 2px;
    color: #304239;
    font-size: 19px;
    font-weight: 850;
}

#referrals-section .monthly-referral-link-card {
    padding: 13px;
    border: 1px solid #dce8e1;
    border-radius: 13px;
    background: linear-gradient(145deg,#fbfefc,#f3faf6);
}

#referrals-section .monthly-referral-link-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

#referrals-section .monthly-referral-link-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--report-brand);
    background: var(--report-brand-soft);
}

#referrals-section .monthly-referral-link-heading strong,
#referrals-section .monthly-referral-link-heading span {
    display: block;
}

#referrals-section .monthly-referral-link-heading strong {
    color: #34463c;
    font-size: 10px;
}

#referrals-section .monthly-referral-link-heading span {
    margin-top: 2px;
    color: #7f8c84;
    font-size: 8px;
}

#referrals-section .monthly-referral-link-row {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto auto;
    gap: 7px;
}

#referrals-section .monthly-referral-link-row .form-control {
    min-width: 0;
    min-height: 40px;
    border: 1px solid #dce6e0;
    border-radius: 10px;
    color: #526159;
    background: #fff;
    box-shadow: none;
    font-size: 9px;
}

#referrals-section .monthly-copy-btn,
#referrals-section .monthly-share-btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 11px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 750;
}

#referrals-section .monthly-copy-btn {
    color: #526159;
    border: 1px solid #d4e0d9;
    background: #fff;
}

#referrals-section .monthly-share-btn {
    color: #fff;
    border: 1px solid var(--report-brand);
    background: var(--report-brand);
}

#referrals-section .monthly-report-loading,
#referrals-section .monthly-report-error,
#referrals-section .monthly-list-empty {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 22px 15px;
    border-radius: 13px;
    text-align: center;
}

#referrals-section .monthly-report-loading {
    color: #748179;
    background: #fafcfb;
}

#referrals-section .monthly-report-loading .spinner-border {
    color: var(--report-brand);
}

#referrals-section .monthly-report-loading strong,
#referrals-section .monthly-list-empty strong,
#referrals-section .monthly-report-error strong {
    color: #405048;
    font-size: 11px;
}

#referrals-section .monthly-report-loading span,
#referrals-section .monthly-list-empty span,
#referrals-section .monthly-report-error span {
    max-width: 440px;
    color: #829087;
    font-size: 8px;
    line-height: 1.5;
}

#referrals-section .monthly-referral-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    color: #66776e;
    background: #edf8f2;
    font-size: 8px;
    line-height: 1.5;
}

#referrals-section .monthly-referral-tip i {
    margin-top: 2px;
    color: var(--report-brand);
}

#referrals-section .monthly-referral-member {
    display: grid;
    grid-template-columns: 28px 38px minmax(0,1fr);
    gap: 9px;
    align-items: center;
    padding: 10px 11px;
    border: 1px solid #e4ebe7;
    border-radius: 11px;
    background: #fbfcfb;
}

#referrals-section .monthly-referral-member-copy i {
    width: 12px;
    margin-right: 4px;
    color: #93a099;
    text-align: center;
}

#referrals-section .monthly-list-empty {
    border: 1px dashed #d8e4dd;
    color: #7d8a82;
    background: #fafcfb;
}

#referrals-section .monthly-list-empty > i {
    color: var(--report-brand);
    font-size: 22px;
}

#referrals-section .monthly-report-error {
    border: 1px dashed #e8c4c4;
    background: #fff9f9;
}

#referrals-section .monthly-report-error-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    color: #b54b4b;
    background: #ffeded;
    font-size: 21px;
}

#referrals-section .monthly-report-error button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding: 0 12px;
    border: 1px solid #dfb9b9;
    border-radius: 10px;
    color: #9f4747;
    background: #fff;
    font-size: 9px;
    font-weight: 750;
}

@media (max-width: 991.98px) {
    #referrals-section .monthly-report-primary-grid {
        grid-template-columns: 1fr;
    }

    #referrals-section .monthly-report-metric-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }
}

@media (max-width: 600px) {
    #referrals-section .monthly-report-hero {
        align-items: flex-start;
        gap: 12px;
        padding: 18px 16px;
        border-radius: 17px;
    }

    #referrals-section .monthly-report-hero-icon {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
        border-radius: 13px;
        font-size: 19px;
    }

    #referrals-section .monthly-report-hero h4 {
        font-size: 20px;
    }

    #referrals-section .monthly-report-hero p {
        font-size: 11px;
    }

    #referrals-section .monthly-report-refresh {
        width: 42px;
        height: 42px;
        min-height: 42px;
        padding: 0;
    }

    #referrals-section .monthly-report-refresh span {
        display: none;
    }

    #referrals-section .monthly-report-panel {
        padding: 16px;
        border-radius: 16px;
    }

    #referrals-section .monthly-report-metric-grid {
        grid-template-columns: 1fr 1fr;
    }

    #referrals-section .monthly-referral-stats {
        grid-template-columns: 1fr;
    }

    #referrals-section .monthly-referral-link-row {
        grid-template-columns: 1fr 42px 42px;
    }

    #referrals-section .monthly-copy-btn,
    #referrals-section .monthly-share-btn {
        width: 42px;
        padding: 0;
    }

    #referrals-section .monthly-copy-btn span,
    #referrals-section .monthly-share-btn span {
        display: none;
    }

    #referrals-section .monthly-group-member {
        grid-template-columns: 26px 36px minmax(0,1fr);
    }

    #referrals-section .monthly-member-value {
        grid-column: 2 / -1;
        min-width: 0;
        padding-top: 7px;
        border-top: 1px solid #edf1ef;
        text-align: left;
    }

    #referrals-section .monthly-panel-refresh span {
        display: none;
    }
}

@media (max-width: 380px) {
    #referrals-section .monthly-report-metric-grid {
        grid-template-columns: 1fr;
    }
}
