.bwlm-card,
.bwlm-toolbar,
.bwlm-stat {
    background: #fff;
    border: 1px solid #dfe7f1;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(24, 38, 56, 0.06);
}

.bwlm-card {
    margin: 0 0 24px;
    padding: 24px;
}

.bwlm-card h3 {
    margin-top: 0;
}

.bwlm-card-heading {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 16px;
}

.bwlm-card-heading h3,
.bwlm-card-heading p {
    margin: 0;
}

.bwlm-card-heading p {
    color: #64748b;
    font-weight: 700;
}

.bwlm-notification-list {
    display: grid;
    gap: 12px;
}

.bwlm-notification-item {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e5ebf2;
    border-radius: 8px;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 14px;
}

.bwlm-notification-item.is-unread {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.bwlm-notification-item h4,
.bwlm-notification-item p {
    margin: 0 0 4px;
}

.bwlm-notification-item small {
    color: #64748b;
}

.bwlm-notification-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.bwlm-notification-actions form {
    margin: 0;
}

.bwlm-community-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin: 0 0 16px;
}

.bwlm-portal-tabs {
    background: #fff;
    border: 1px solid #dfe7f1;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
    padding: 8px;
}

.bwlm-tab {
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: #24324a;
    cursor: pointer;
    font-weight: 700;
    min-height: 40px;
    padding: 9px 14px;
}

.bwlm-tab.is-active {
    background: #1f5eff;
    color: #fff;
}

.bwlm-tab-panel[hidden] {
    display: none;
}

.bwlm-view-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.bwlm-view-header h3,
.bwlm-view-header p {
    margin: 0;
}

.bwlm-view-header p {
    color: #64748b;
    margin-top: 4px;
}

.bwlm-report-panel[hidden],
.bwlm-referral-panel[hidden],
.bwlm-closed-business-form-panel[hidden] {
    display: none;
}

.bwlm-form {
    max-width: 920px;
}

.bwlm-field {
    margin: 0 0 22px;
}

.bwlm-field-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bwlm-field label,
.bwlm-options legend,
.bwlm-segmented-field legend,
.bwlm-heat-field legend,
.bwlm-toolbar label {
    color: #24324a;
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
}

.bwlm-field span,
.bwlm-options span {
    color: #d33;
}

.bwlm-field input[type="text"],
.bwlm-field input[type="email"],
.bwlm-field input[type="number"],
.bwlm-field input[type="date"],
.bwlm-field select,
.bwlm-field textarea,
.bwlm-toolbar select {
    border: 1px solid #cfd8e3;
    border-radius: 6px;
    box-sizing: border-box;
    color: #24324a;
    font-size: 16px;
    min-height: 44px;
    padding: 10px 12px;
    width: 100%;
}

.bwlm-field textarea {
    min-height: 120px;
}

.bwlm-help-text {
    color: #64748b;
    font-size: 13px;
    line-height: 1.45;
    margin: 8px 0 0;
}

.bwlm-options {
    border: 0;
    margin-left: 0;
    padding: 0;
}

.bwlm-options label {
    display: block;
    font-weight: 500;
    margin: 8px 0;
}

.bwlm-segmented-field {
    border: 0;
    margin-left: 0;
    padding: 0;
}

.bwlm-segmented {
    border: 1px solid #cfd8e3;
    border-radius: 6px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
}

.bwlm-segmented label {
    margin: 0;
}

.bwlm-segmented input {
    position: absolute;
    opacity: 0;
}

.bwlm-segmented span {
    background: #f3f6fa;
    color: #24324a;
    display: block;
    font-weight: 800;
    min-height: 44px;
    padding: 12px;
    text-align: center;
}

.bwlm-segmented input:checked + span {
    background: #1f5eff;
    color: #fff;
}

.bwlm-heat-field {
    border: 0;
    margin-left: 0;
    padding: 0;
}

.bwlm-heat-options {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 12px;
}

.bwlm-heat-options label {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 82px;
}

.bwlm-heat-options input {
    accent-color: #1f5eff;
    height: 20px;
    order: 2;
    width: 20px;
}

.bwlm-heat-options .bwlm-heat-bar {
    background: linear-gradient(180deg, #fbbf24, #ef4444);
    border-radius: 3px 3px 0 0;
    display: block;
    width: 56px;
}

.bwlm-heat-options input:checked + .bwlm-heat-bar {
    box-shadow: 0 0 0 3px rgba(31, 94, 255, 0.22);
}

.bwlm-heat-options strong {
    color: #24324a;
    font-size: 12px;
    line-height: 1.2;
    order: 3;
    text-align: center;
}

.bwlm-button {
    background: #1f5eff;
    border: 0;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    min-height: 42px;
    padding: 10px 18px;
}

.bwlm-button-secondary {
    background: #24324a;
}

.bwlm-button-light {
    background: #eef3f9;
    color: #24324a;
}

.bwlm-notice,
.bwlm-flash {
    border-radius: 6px;
    margin: 0 0 18px;
    padding: 12px 14px;
}

.bwlm-notice,
.bwlm-success {
    background: #eef8f1;
    border: 1px solid #b9e2c4;
    color: #14532d;
}

.bwlm-error {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #9f1239;
}

.bwlm-toolbar {
    align-items: start;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(180px, 1fr) minmax(160px, 220px) auto;
    margin-bottom: 20px;
    padding: 18px;
}

.bwlm-toolbar label {
    margin-bottom: 0;
}

.bwlm-toolbar label select {
    margin-top: 8px;
}

.bwlm-toolbar-submit {
    display: flex;
    flex-direction: column;
}

.bwlm-toolbar-submit span {
    color: transparent;
    display: block;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 8px;
    pointer-events: none;
    user-select: none;
}

.bwlm-toolbar .bwlm-button {
    line-height: 1.2;
    margin-top: 0;
    min-height: 44px;
}

.bwlm-community-actions .bwlm-button,
.bwlm-community-actions .bwlm-button-secondary {
    background: #1f5eff;
}

body.bwlm-community-open .bwlm-community-host {
    display: block !important;
    width: 100% !important;
}

body.bwlm-community-open #bwlm-community-panel {
    background: #eef2f6;
    box-sizing: border-box;
    bottom: 0;
    left: var(--bwlm-community-left-offset, 300px);
    max-width: none;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 24px 24px 24px 0;
    position: fixed;
    right: 0;
    top: var(--bwlm-community-top-offset, 60px);
    width: auto;
    z-index: 99999;
}

@media (max-width: 900px) {
    body.bwlm-community-open #bwlm-community-panel {
        left: var(--bwlm-community-left-offset, 0);
        top: var(--bwlm-community-top-offset, 0);
    }
}

body.bwlm-community-open #bwlm-community-panel .bwlm-community-shell {
    box-sizing: border-box;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
    width: 100%;
}

body.bwlm-community-open #bwlm-community-panel .bwlm-community-bar {
    align-items: center;
    background: #fff;
    border: 1px solid #dfe7f1;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(24, 38, 56, 0.06);
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 24px;
}

body.bwlm-community-open #bwlm-community-panel .bwlm-community-title {
    color: #17243a;
    font-size: 32px;
    line-height: 1.2;
    margin: 0;
}

body.bwlm-community-open #bwlm-community-panel .bwlm-community-close {
    background: #eef3f9;
    border: 0;
    border-radius: 6px;
    color: #24324a;
    cursor: pointer;
    font-weight: 800;
    min-height: 44px;
    padding: 10px 18px;
}

body.bwlm-community-open #bwlm-community-panel .bwlm-community-body,
body.bwlm-community-open #bwlm-community-panel .bwlm-portal {
    box-sizing: border-box;
    max-width: 100%;
    overflow-x: hidden;
    width: 100%;
}

body.bwlm-community-open #bwlm-community-panel .bwlm-form,
body.bwlm-community-open #bwlm-community-panel .bwlm-report-panel,
body.bwlm-community-open #bwlm-community-panel .bwlm-referral-panel,
body.bwlm-community-open #bwlm-community-panel .bwlm-closed-business-panel {
    box-sizing: border-box;
    max-width: none;
    width: 100%;
}

.bwlm-stats {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 24px;
}

.bwlm-dashboard {
    display: block;
}

.bwlm-stat {
    padding: 18px;
}

.bwlm-stat strong {
    color: #182638;
    display: block;
    font-size: 34px;
    line-height: 1;
}

.bwlm-stat span {
    color: #52627a;
    display: block;
    margin-top: 8px;
}

.bwlm-table {
    border-collapse: collapse;
    width: 100%;
}

.bwlm-table th,
.bwlm-table td {
    border-bottom: 1px solid #e5ebf2;
    padding: 12px 10px;
    text-align: left;
    vertical-align: top;
}

.bwlm-table th {
    color: #52627a;
    font-size: 13px;
    text-transform: uppercase;
}

.bwlm-referral-inbox,
.bwlm-referral-worklist {
    display: grid;
    gap: 16px;
}

.bwlm-referral-status-section {
    border: 1px solid #e5ebf2;
    border-radius: 8px;
    padding: 14px;
}

.bwlm-referral-status-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.bwlm-referral-status-heading h4 {
    margin: 0;
}

.bwlm-referral-status-heading span {
    background: #eef3f9;
    border-radius: 999px;
    color: #24324a;
    font-weight: 800;
    padding: 4px 10px;
}

.bwlm-referral-work-item {
    border: 1px solid #dfe7f1;
    border-radius: 8px;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
    padding: 18px;
}

.bwlm-referral-work-item h4 {
    color: #182638;
    font-size: 18px;
    margin: 0 0 6px;
}

.bwlm-referral-work-item p {
    margin: 0 0 8px;
}

.bwlm-referral-updates {
    border-left: 3px solid #dfe7f1;
    margin-top: 12px;
    padding-left: 12px;
}

.bwlm-referral-details {
    margin-top: 10px;
}

.bwlm-referral-details summary {
    color: #1f5eff;
    cursor: pointer;
    font-weight: 800;
}

.bwlm-referral-contact {
    background: #f8fafc;
    border: 1px solid #e5ebf2;
    border-radius: 8px;
    margin-top: 10px;
    padding: 12px;
}

.bwlm-referral-contact p:last-child {
    margin-bottom: 0;
}

.bwlm-referral-actions {
    display: grid;
    gap: 12px;
}

.bwlm-referral-status-form {
    display: grid;
    gap: 10px;
}

.bwlm-referral-status-form label {
    color: #24324a;
    display: block;
    font-weight: 700;
}

.bwlm-referral-status-form select,
.bwlm-referral-status-form textarea {
    border: 1px solid #cfd8e3;
    border-radius: 6px;
    box-sizing: border-box;
    color: #24324a;
    font-size: 15px;
    margin-top: 6px;
    padding: 10px 12px;
    width: 100%;
}

.bwlm-member-profile-card h4 {
    color: #24324a;
    font-size: 15px;
    margin: 0 0 12px;
}

.bwlm-profile-grid {
    display: grid;
    gap: 22px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bwlm-mini-bars {
    display: grid;
    gap: 10px;
}

.bwlm-mini-bar-row {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(140px, 1.2fr) minmax(100px, 2fr) 28px;
}

.bwlm-mini-bar-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bwlm-mini-bar-track {
    background: #edf2f7;
    border-radius: 999px;
    height: 9px;
    overflow: hidden;
}

.bwlm-mini-bar-track span {
    background: #1f5eff;
    border-radius: inherit;
    display: block;
    height: 100%;
}

.bwlm-personal-trends {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    min-height: 180px;
}

.bwlm-personal-trend-month {
    display: grid;
    gap: 8px;
    text-align: center;
}

.bwlm-personal-trend-bars {
    align-items: end;
    background: #f8fafc;
    border: 1px solid #e5ebf2;
    border-radius: 8px;
    display: flex;
    gap: 5px;
    height: 140px;
    justify-content: center;
    padding: 10px 8px;
}

.bwlm-personal-trend-bars span {
    border-radius: 999px 999px 0 0;
    display: block;
    min-height: 3px;
    width: 12px;
}

.bwlm-personal-trend-bars .is-one,
.bwlm-trend-legend .is-one::before {
    background: #1f5eff;
}

.bwlm-personal-trend-bars .is-given,
.bwlm-trend-legend .is-given::before {
    background: #0f766e;
}

.bwlm-personal-trend-bars .is-received,
.bwlm-trend-legend .is-received::before {
    background: #f59e0b;
}

.bwlm-trend-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 10px;
}

.bwlm-trend-legend span {
    align-items: center;
    color: #52627a;
    display: inline-flex;
    gap: 6px;
}

.bwlm-trend-legend span::before {
    border-radius: 999px;
    content: "";
    display: inline-block;
    height: 10px;
    width: 10px;
}

.bwlm-admin-filters {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
}

.bwlm-admin-filters label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bwlm-admin-page {
    color: #1f2937;
}

.bwlm-admin-hero,
.bwlm-admin-card,
.bwlm-admin-stat {
    background: #fff;
    border: 1px solid #d8dee7;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.bwlm-admin-hero {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin: 18px 0;
    padding: 20px 22px;
}

.bwlm-admin-actions {
    display: flex;
    gap: 10px;
}

.bwlm-admin-hero h1 {
    margin: 0 0 6px;
}

.bwlm-admin-hero p {
    margin: 0;
}

.bwlm-admin-stats {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 16px;
}

.bwlm-goal-stats .bwlm-admin-stat strong {
    color: #1d4ed8;
}

.bwlm-goal-card h3,
.bwlm-goal-card p {
    margin-top: 0;
}

.bwlm-goal-progress {
    background: #edf2f7;
    border-radius: 999px;
    height: 12px;
    margin: 12px 0;
    overflow: hidden;
}

.bwlm-goal-progress span {
    background: #1f5eff;
    border-radius: inherit;
    display: block;
    height: 100%;
}

.bwlm-goal-note {
    color: #52627a;
    margin-bottom: 0;
}

.bwlm-admin-stat {
    padding: 18px;
}

.bwlm-admin-stat strong {
    display: block;
    font-size: 30px;
    line-height: 1;
}

.bwlm-admin-stat span {
    color: #64748b;
    display: block;
    margin-top: 8px;
}

.bwlm-admin-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 16px;
}

.bwlm-admin-card {
    padding: 18px;
}

.bwlm-admin-card h2 {
    font-size: 16px;
    margin: 0 0 14px;
}

.bwlm-admin-section-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.bwlm-admin-section-header h2 {
    margin: 0;
}

.bwlm-admin-section-header span {
    color: #64748b;
}

.bwlm-leaderboard-snapshot {
    margin-bottom: 16px;
}

.bwlm-top-members {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.bwlm-top-member-card {
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    padding: 18px;
}

.bwlm-top-member-card.is-highlighted {
    border-color: #b9c9ff;
}

.bwlm-rank-badge {
    align-items: center;
    background: #111827;
    border-radius: 999px;
    color: #fff;
    display: flex;
    font-weight: 800;
    height: 44px;
    justify-content: center;
    margin-bottom: 16px;
    width: 44px;
}

.bwlm-top-member-card h3 {
    font-size: 18px;
    line-height: 1.2;
    margin: 0;
}

.bwlm-top-member-card p {
    color: #64748b;
    margin: 6px 0 14px;
    overflow-wrap: anywhere;
}

.bwlm-top-member-stats {
    color: #475569;
    display: grid;
    gap: 6px;
}

.bwlm-top-member-stats strong {
    color: #1d4ed8;
}

.bwlm-admin-bars {
    display: grid;
    gap: 12px;
}

.bwlm-trend-chart {
    align-items: end;
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    min-height: 230px;
}

.bwlm-trend-column {
    display: grid;
    gap: 8px;
    min-width: 0;
    text-align: center;
}

.bwlm-trend-column-bars {
    align-items: end;
    background: #f8fafc;
    border: 1px solid #e5ebf2;
    border-radius: 8px;
    display: flex;
    gap: 7px;
    height: 150px;
    justify-content: center;
    padding: 10px 8px;
}

.bwlm-trend-column strong {
    color: #475569;
}

.bwlm-trend-column small {
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bwlm-trend-bar {
    border-radius: 999px 999px 0 0;
    display: block;
    min-height: 3px;
    width: 18px;
}

.bwlm-trend-bar.is-one,
.bwlm-trend-legend .is-one::before {
    background: #1f5eff;
}

.bwlm-trend-bar.is-referral,
.bwlm-trend-legend .is-given::before {
    background: #0f766e;
}

.bwlm-trend-bar.is-closed,
.bwlm-trend-legend .is-closed::before {
    background: #f59e0b;
}

.bwlm-funnel {
    display: grid;
    gap: 12px;
}

.bwlm-funnel-step {
    display: grid;
    gap: 8px;
}

.bwlm-funnel-label {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.bwlm-funnel-label span {
    color: #64748b;
    font-weight: 700;
}

.bwlm-funnel-track {
    background: #edf2f7;
    border-radius: 999px;
    height: 14px;
    overflow: hidden;
}

.bwlm-funnel-track span {
    background: #1f5eff;
    border-radius: inherit;
    display: block;
    height: 100%;
}

.bwlm-admin-bar-row {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(130px, 1fr) minmax(120px, 2fr) 42px;
}

.bwlm-admin-bar-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bwlm-admin-bar-track {
    background: #edf2f7;
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}

.bwlm-admin-bar-track span {
    background: #2271b1;
    border-radius: inherit;
    display: block;
    height: 100%;
}

.bwlm-admin-bar-value {
    color: #475569;
    font-weight: 700;
    text-align: right;
}

.bwlm-admin-table {
    border: 0;
}

.bwlm-admin-section-heading {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.bwlm-admin-section-heading h2 {
    margin: 0;
}

.bwlm-admin-section-heading span {
    color: #64748b;
    font-weight: 700;
}

.bwlm-pagination {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 14px;
}

.bwlm-pagination span {
    color: #64748b;
    margin-right: auto;
}

.bwlm-report-detail td {
    background: #f8fafc;
    border-top: 0;
}

.bwlm-report-detail-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr);
    padding: 8px 4px;
}

.bwlm-report-detail-grid p {
    margin: 6px 0 0;
}

.bwlm-report-detail-summary {
    grid-column: 1 / -1;
}

.bwlm-report-detail-summary p {
    white-space: pre-wrap;
}

.bwlm-member-profile {
    margin-bottom: 16px;
}

.bwlm-member-profile h3 {
    margin: 8px 0 14px;
}

.bwlm-member-stats {
    margin-top: 16px;
}

.bwlm-top-member-card h3 a,
.bwlm-admin-table a {
    text-decoration: none;
}

@media (max-width: 1000px) {
    .bwlm-admin-stats,
    .bwlm-admin-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bwlm-top-members {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .bwlm-admin-hero,
    .bwlm-admin-section-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .bwlm-admin-stats,
    .bwlm-admin-grid {
        grid-template-columns: 1fr;
    }

    .bwlm-admin-bar-row {
        grid-template-columns: 1fr;
    }

    .bwlm-top-members {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .bwlm-toolbar,
    .bwlm-stats,
    .bwlm-profile-grid,
    .bwlm-field-grid {
        grid-template-columns: 1fr;
    }

    .bwlm-referral-work-item {
        grid-template-columns: 1fr;
    }

    .bwlm-personal-trends {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .bwlm-trend-chart {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bwlm-toolbar .bwlm-button {
        margin-top: 0;
        width: 100%;
    }

    .bwlm-toolbar-submit span {
        display: none;
    }

    .bwlm-mini-bar-row {
        grid-template-columns: 1fr;
    }
}
