.referral-layout {
    display: grid;
    gap: 14px;
}

.referral-top-grid {
    display: grid;
    grid-template-columns: minmax(280px, 1.1fr) minmax(300px, 1fr);
    gap: 14px;
}

.referral-summary-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 0;
}

.referral-cards {
    display: grid;
    gap: 12px;
}

.referral-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 16px;
    background: rgba(8, 12, 22, 0.55);
}

.referral-card.is-claimable {
    border-color: rgba(34, 197, 94, 0.26);
    background:
        linear-gradient(180deg, rgba(34, 197, 94, 0.10), rgba(8, 12, 22, 0.52)),
        rgba(8, 12, 22, 0.55);
}

.referral-card.is-muted {
    border-color: rgba(148, 163, 184, 0.14);
    background: rgba(8, 12, 22, 0.42);
}

.referral-card-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.referral-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.referral-list-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.referral-list-indicator.is-claimable {
    background: rgba(34, 197, 94, 0.18);
    color: #86efac;
}

.referral-list-indicator.is-muted {
    background: rgba(148, 163, 184, 0.14);
    color: #cbd5e1;
}

.referral-catalog-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.referral-catalog-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.referral-catalog-main {
    display: grid;
    gap: 2px;
}

.referral-catalog-main strong {
    font-size: 14px;
    font-weight: 700;
}

.referral-catalog-reward {
    display: flex;
    justify-content: flex-end;
}

.referral-catalog-reward .referral-reward-items {
    margin-top: 0;
    gap: 6px;
}

.referral-catalog-reward .referral-item-slot {
    width: 40px;
    height: 40px;
    border-radius: 6px;
}

.referral-catalog-reward .referral-item-slot img {
    max-width: 22px;
    max-height: 22px;
}

.referral-catalog-reward .referral-item-qty {
    right: 3px;
    bottom: 2px;
    min-width: 16px;
    padding: 0 3px;
    font-size: 9px;
}

.referral-catalog-note {
    margin-top: 6px;
    font-size: 12px;
    opacity: 0.78;
}

.referral-task-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.referral-task-row {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) auto minmax(220px, auto);
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
}

.referral-task-row.is-done {
    background: rgba(34, 197, 94, 0.12);
}

.referral-task-row.is-pending {
    background: rgba(249, 115, 22, 0.10);
}

.referral-task-main {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.referral-task-value {
    font-size: 12px;
    opacity: 0.82;
}

.referral-task-reward {
    display: flex;
    justify-content: flex-end;
}

.referral-task-reward .referral-reward-items {
    margin-top: 0;
}

.referral-task-side {
    display: grid;
    gap: 8px;
    justify-items: end;
    min-width: 220px;
}

.referral-task-side.is-disabled .btn {
    opacity: 0.5;
    filter: saturate(0.15);
}

.referral-task-side .input-group {
    width: 100%;
    margin: 0;
}

.referral-task-side .btn {
    min-width: 132px;
}

.referral-reward-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.referral-item-slot {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.18);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
        linear-gradient(135deg, rgba(251, 191, 36, 0.14), rgba(30, 41, 59, 0.18));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22);
}

.referral-item-slot img {
    max-width: 28px;
    max-height: 28px;
    image-rendering: pixelated;
}

.referral-item-qty {
    position: absolute;
    right: 6px;
    bottom: 4px;
    min-width: 20px;
    padding: 1px 4px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.92);
    color: #f8fafc;
    font-size: 11px;
    line-height: 1.2;
    text-align: center;
}

.referral-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.referral-status-pill.is-ok {
    background: rgba(34, 197, 94, 0.16);
    color: #86efac;
}

.referral-status-pill.is-pending {
    background: rgba(251, 191, 36, 0.16);
    color: #fde68a;
}

.referral-status-pill.is-review {
    background: rgba(249, 115, 22, 0.16);
    color: #fdba74;
}

.referral-status-pill.is-blocked {
    background: rgba(239, 68, 68, 0.16);
    color: #fca5a5;
}

.referral-modal {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.referral-modal.hidden {
    display: none;
}

.referral-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(8px);
}

.referral-modal-card {
    position: relative;
    width: min(1040px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.96)),
        rgba(2, 6, 23, 0.96);
    padding: 18px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.referral-modal-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.referral-modal-actions {
    display: grid;
    gap: 10px;
    justify-items: end;
}

.referral-modal-close {
    min-width: 110px;
}

.referral-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(8, 12, 22, 0.45);
}

.referral-pagination-meta {
    font-size: 12px;
    color: #cbd5e1;
}

.referral-pagination-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.referral-page-btn {
    min-width: 34px;
    height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(15, 23, 42, 0.84);
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.referral-page-btn:hover:not(:disabled) {
    border-color: rgba(34, 197, 94, 0.35);
}

.referral-page-btn.is-active {
    background: rgba(34, 197, 94, 0.18);
    border-color: rgba(34, 197, 94, 0.35);
    color: #86efac;
}

.referral-page-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.referral-page-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    color: #94a3b8;
    font-size: 12px;
}

@media (max-width: 900px) {
    .referral-top-grid {
        grid-template-columns: 1fr;
    }

    .referral-card-head,
    .referral-card-footer,
    .referral-modal-header {
        flex-direction: column;
    }

    .referral-catalog-row,
    .referral-task-row {
        grid-template-columns: 1fr;
        display: grid;
    }

    .referral-catalog-reward,
    .referral-task-reward,
    .referral-task-side,
    .referral-modal-actions {
        justify-content: flex-start;
        justify-items: start;
        min-width: 0;
    }

    .referral-modal {
        padding: 12px;
    }

    .referral-modal-card {
        max-height: calc(100vh - 24px);
        padding: 16px;
    }

    .referral-pagination {
        flex-direction: column;
        align-items: stretch;
    }

    .referral-pagination-controls {
        justify-content: flex-start;
    }
}

/* AGENT UI NEW REFERRAL PASS */
.referral-layout {
    color: #d9c8ad;
}

.referral-card,
.referral-modal-card,
.referral-pagination,
.referral-task-row,
.referral-item-slot,
.referral-catalog-row {
    border-color: rgba(73, 51, 31, 0.92);
    background:
        linear-gradient(180deg, rgba(13, 15, 21, 0.97), rgba(8, 9, 13, 0.98));
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.3);
}

.referral-card,
.referral-modal-card,
.referral-pagination,
.referral-task-row,
.referral-item-slot {
    border-radius: 8px;
}

.referral-card.is-claimable,
.referral-card.is-muted,
.referral-task-row.is-done,
.referral-task-row.is-pending {
    border-color: rgba(240, 177, 59, 0.42);
    background:
        linear-gradient(180deg, rgba(33, 23, 13, 0.7), rgba(13, 15, 21, 0.97));
}

.referral-card-head,
.referral-card-footer,
.referral-modal-header,
.referral-pagination {
    border-color: rgba(73, 51, 31, 0.92);
}

.referral-catalog-main strong,
.referral-task-main strong,
.referral-modal-header h3,
.referral-card h3,
.referral-card h4 {
    color: #fff1c8;
}

.referral-catalog-note,
.referral-task-value,
.referral-pagination-meta,
.referral-page-dots {
    color: #c8bda8;
}

.referral-list-indicator,
.referral-status-pill,
.referral-page-btn,
.referral-item-qty {
    border-radius: 6px;
    border: 1px solid rgba(94, 87, 78, 0.86);
    background: #17191f;
    color: #d9c8ad;
}

.referral-list-indicator.is-claimable,
.referral-list-indicator.is-muted,
.referral-status-pill.is-ok,
.referral-status-pill.is-pending,
.referral-status-pill.is-review,
.referral-status-pill.is-blocked,
.referral-page-btn.is-active {
    border-color: #f0b13b;
    background: #8a4d13;
    color: #fff2cf;
}

.referral-page-btn:hover:not(:disabled) {
    border-color: #ffd36c;
    background: #22252c;
    color: #ffffff;
}

.referral-page-btn:disabled {
    border-color: #2d2c2a;
    background: #111217;
    color: #756b5f;
}

.referral-modal-backdrop {
    background: rgba(0, 0, 0, 0.78);
}

.referral-task-side.is-disabled .btn {
    filter: none;
}
