.rpg-agencies,
.rpg-people-directory {
    background: #fff;
}

.rpg-agency-heading {
    max-width: 680px;
    margin-inline: auto;
}

.rpg-agency-heading h1 {
    margin: 8px 0;
    font-size: 34px;
    line-height: 42px;
}

.rpg-agency-heading p {
    color: #64748b;
    font-size: 15px;
    line-height: 24px;
}

.rpg-agency-filter {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 12px;
    padding: 18px;
    border-radius: 14px;
    background: #f8fafc;
}

.rpg-agency-filter input,
.rpg-agency-filter select {
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid #dbe2ea;
    border-radius: 9px;
    background: #fff;
}

.rpg-agency-filter button {
    min-height: 48px;
    padding: 10px 18px;
    border: 0;
    border-radius: 9px;
    background: var(--primary-color, #db1d23);
    color: #fff;
    font-weight: 700;
}

.rpg-agency-grid > [class*="col-"] {
    display: flex;
}

.rpg-agency-card {
    display: flex;
    width: 100%;
    min-width: 0;
    gap: 17px;
    padding: 20px;
    border: 1px solid #e3e8ed;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 6px 25px rgba(15, 23, 42, .06);
    transition: transform .2s ease, box-shadow .2s ease;
}

.rpg-agency-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 13px 32px rgba(15, 23, 42, .11);
}

.rpg-agency-logo {
    display: grid;
    width: 82px;
    height: 82px;
    flex: 0 0 82px;
    place-items: center;
    overflow: hidden;
    border-radius: 14px;
    background: #f1f5f9;
    color: var(--primary-color, #db1d23);
    font-size: 32px;
    font-weight: 800;
}

.rpg-agency-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rpg-directory-entry__content {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

.rpg-role-badge {
    display: inline-flex;
    width: max-content;
    max-width: 100%;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(219, 29, 35, .08);
    color: var(--primary-color, #db1d23);
    font-size: 10px;
    font-weight: 800;
    line-height: 14px;
    text-transform: uppercase;
}

.rpg-directory-entry h3 {
    margin: 7px 0 5px;
    font-size: 19px;
    line-height: 25px;
}

.rpg-directory-entry h3 a {
    display: inline;
    color: #172033;
}

.rpg-directory-entry__agency {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 6px;
    color: var(--primary-color, #db1d23);
    font-size: 12px;
    font-weight: 700;
}

.rpg-directory-entry__agency svg,
.rpg-directory-entry__meta svg {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
}

.rpg-directory-entry__meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
    color: #64748b;
    font-size: 12px;
    line-height: 18px;
}

.rpg-directory-entry__meta span {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 6px;
}

.rpg-directory-entry__description {
    display: -webkit-box;
    overflow: hidden;
    margin-bottom: 9px;
    color: #64748b;
    font-size: 12px;
    line-height: 18px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.rpg-directory-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: auto;
    padding-top: 5px;
}

.rpg-directory-action {
    display: flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #fff !important;
    font-size: 11px;
    font-weight: 800;
    line-height: 15px;
    text-align: center;
}

.rpg-directory-action svg {
    width: 15px;
    height: 15px;
}

.rpg-directory-action--call {
    background: var(--primary-color, #db1d23);
}

.rpg-directory-action--whatsapp {
    background: #16a34a;
}

.rpg-directory-action--profile {
    grid-column: 1 / -1;
    border-color: #d9e0e6;
    background: #fff;
    color: #263442 !important;
}

.rpg-agency-hero {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 30px;
    border-radius: 18px;
    background: linear-gradient(135deg, #fff4f4, #f8fafc);
}

.rpg-agency-logo-lg {
    width: 130px;
    height: 130px;
    flex-basis: 130px;
}

.rpg-agency-hero h1 {
    font-size: 38px;
    line-height: 46px;
}

.rpg-agency-hero .rpg-directory-actions,
.agent-header .rpg-directory-actions {
    width: min(100%, 420px);
    margin-top: 16px;
}

.rpg-agency-website {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 11px;
    color: #475569;
    font-weight: 700;
}

.rpg-agency-section {
    margin-top: 40px;
}

.rpg-agency-section h2 {
    margin-bottom: 20px;
    font-size: 28px;
    line-height: 36px;
}

.rpg-team-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.rpg-team-card img {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
}

.rpg-team-card small {
    display: block;
    color: #64748b;
}

.agent-detail-section {
    max-width: 1320px;
    margin-inline: auto;
    padding: 50px 15px;
}

.agent-header {
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(15, 23, 42, .07);
}

.agent-avatar {
    overflow: hidden;
    border-radius: 14px;
}

.agent-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.agent-contact-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
}

.agent-info-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.rpg-profile-role {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    margin: 8px 0 14px;
}

.rpg-profile-role a {
    color: #475569;
    font-weight: 700;
}

.agent-about-section,
.agent-properties-section {
    margin-top: 34px;
    padding: 25px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
}

@media (max-width: 991px) {
    .rpg-agency-heading h1 {
        font-size: 30px;
        line-height: 38px;
    }

    .rpg-agency-card {
        padding: 17px;
    }
}

@media (max-width: 767px) {
    .rpg-agency-filter {
        grid-template-columns: 1fr;
    }

    .rpg-agency-heading h1 {
        font-size: 27px;
        line-height: 34px;
    }

    .rpg-agency-card {
        gap: 13px;
        border-radius: 14px;
    }

    .rpg-agency-logo {
        width: 70px;
        height: 70px;
        flex-basis: 70px;
    }

    .rpg-directory-entry h3 {
        font-size: 18px;
        line-height: 23px;
    }

    .rpg-agency-hero {
        align-items: flex-start;
        flex-direction: column;
        padding: 22px;
    }

    .rpg-agency-logo-lg {
        width: 100px;
        height: 100px;
        flex-basis: 100px;
    }

    .rpg-agency-hero h1 {
        font-size: 29px;
        line-height: 36px;
    }
}

@media (max-width: 430px) {
    .rpg-agency-card {
        flex-direction: column;
    }

    .rpg-agency-logo {
        width: 76px;
        height: 76px;
    }
}
