/* ==========================================================================
   Dashboard Sponsor Redesign V2
   ========================================================================== */

:root {
    --dash-bg: #eff6f0;
    --dash-card-bg: #f8faf9;
    --dash-white: #ffffff;
    --dash-primary: #12A24A;
    --dash-text-main: #333;
    --dash-text-muted: #64748b;
    --dash-accent-yellow: #facc15;
    --pa-primary: #049551;
}

.dash-page {
    background-color: var(--dash-bg);
    min-height: 100vh;
    padding-bottom: 6rem;
    font-family: 'Inter', sans-serif;
}

.dash-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 40px;
}

/* --- Header --- */
.dash-header {
    text-align: center;
    padding: 8rem 0 10rem;
}

.dash-header__title {
    font-family: var(--pa-font-headline);
    font-size: clamp(32px, 5vw, 40px);
    color: var(--dash-text-main);
    margin: 0;
}

/* --- Profile Card --- */
.dash-profile {
    background: var(--dash-white);
    border-radius: 48px;
    padding: 4rem;
    margin-bottom: 4rem;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.dash-profile__avatar-wrapper {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
}

.dash-profile__avatar {
    width: 148px;
    height: 148px;
    border-radius: 50%;
    border: 4px solid var(--dash-white);
    object-fit: cover;
    object-position: center 20%;
}

.dash-profile__badge-c {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 40px;
    height: 40px;
    background: var(--dash-accent-yellow);
    border: 3px solid var(--dash-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #000;
    font-size: 18px;
}

.dash-profile__info {
    margin-top: 5rem;
}

.dash-profile__name {
    font-size: 24px;
    font-weight: 700;
    color: var(--dash-text-main);
    margin-bottom: 2.4rem;
}

.dash-profile__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    color: var(--dash-text-muted);
    font-size: 16px;
}

.dash-profile__meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dash-profile__meta-item svg {
    width: 20px;
    height: 20px;
    color: var(--dash-primary);
}

.dash-profile__edit-btn {
    position: absolute;
    top: 2rem;
    right: 4rem;
    background: transparent;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: var(--dash-text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.dash-profile__edit-btn:hover {
    background: #f1f5f9;
}

/* --- Tabs --- */
.dash-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    justify-content: center;
}

.dash-tab {
    background: var(--dash-white);
    border: none;
    border-radius: 30px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    color: var(--dash-text-muted);
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.dash-tab--active {
    background: var(--dash-primary);
    color: var(--dash-white);
}

/* --- Toolbar (count + sort) --- */
.dash-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.dash-toolbar__count {
    margin: 0;
    color: #333;
    font-size: 16px;
}

.dash-toolbar__count strong {
    color: var(--dash-text-main);
    font-weight: 700;
}

.dash-toolbar__sort {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dash-toolbar__sort-label {
    color: #333;
    font-size: 16px;
    font-weight: 500;
}

.dash-toolbar__sort-select {
    background: var(--dash-white);
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 16px 40px 16px 24px;
    font-size: 15px;
    font-weight: 600;
    color: var(--dash-text-main);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.dash-toolbar__sort-select:focus {
    outline: none;
    border-color: var(--dash-primary);
}

/* --- Card Grid --- */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(410px, 1fr));
    column-gap: 2rem;
    row-gap: 5.5rem;
}

.dash-card--hidden {
    display: none;
}

/* --- Load More --- */
.dash-load-more {
    display: flex;
    justify-content: center;
    margin-top: 2.5rem;
}

.dash-load-more__btn {
    background-color: white !important;
    border: 1.5px solid var(--pa-primary);
    color: var(--pa-primary);
    border-radius: 999px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dash-load-more__btn:hover,
.dash-load-more__btn:focus {
    background: var(--pa-primary) !important;
    color: white;
}

/* --- Child Card (mirrors home-child-card visual) --- */
.dash-card {
    position: relative;
    width: 100%;
    margin-top: 70px;
    transition: transform 0.3s ease;
}

.dash-card__avatar-wrapper {
    position: absolute;
    top: -70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
}

.dash-card__avatar-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 2px solid var(--pa-primary, #049551);
    background-color: #e9f5ec;
    overflow: hidden;
    transition: transform 0.4s ease;
}

.dash-card__avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: none;
    display: block;
}

.dash-card__body {
    background: linear-gradient(180deg, #55B78A 0%, #029551 49.93%);
    border-radius: 40px;
    padding: 9rem 1.75rem 1.75rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.4rem;
}

.dash-card__name {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 0;
}

.dash-card__sponsored-by {
    color: rgba(255, 255, 255, 0.92);
    font-size: 15px;
    margin-bottom: 0;
}

.dash-card__sponsored-by a {
    color: #fff;
    font-weight: 700;
}

.dash-card__link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 0;
    text-decoration: none;
}

.dash-card__link svg,
.dash-card__link i {
    width: 14px;
    height: 14px;
}

/* --- Save for College (white inset on green) --- */
.dash-card__college {
    width: 100%;
    background: #EDF6EE;
    border-radius: 18px;
    padding: 2rem;
    text-align: left;
}

.dash-card__college-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    color: var(--dash-text-main);
    font-size: 14px;
    margin-bottom: 1rem;
}

.dash-card__college-header i {
    cursor: pointer;
    color: #94a3b8;
    display: inline-flex;
}

.dash-card__college-header i svg {
    width: 14px;
    height: 14px;
}

.dash-card__college-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.dash-card__college-field {
    display: flex;
    background: #f8fafc;
    border-radius: 999px;
    padding: 1.2rem 2.4rem;
    border: 1px solid #e2e8f0;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.dash-card__currency {
    color: var(--dash-text-muted);
    padding-right: 0.35rem;
    font-size: 16px;
    font-weight: 400;
}

.dash-card__input {
    border: none;
    background: transparent;
    width: 100%;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    outline: none;
    color: var(--dash-text-main);
}

.dash-card__input::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

.dash-card__save-btn {
    white-space: nowrap;
    background: #fff;
    border: 1.5px solid var(--pa-primary);
    color: var(--pa-primary);
    border-radius: 999px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.dash-card__save-btn:hover {
    background: var(--pa-primary);
    color: #fff;
}

/* --- Child Updates Button (white pill on green) --- */
.dash-card__update-btn {
    background: #fff;
    color: #333;
    border: none;
    border-radius: 999px;
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 800;
    transition: all 0.2s ease;
    cursor: pointer;
    display: block;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
}

.dash-card__update-btn:hover,
.dash-card__update-btn:focus {
    background: #f0faf4;
    color: var(--pa-primary);
    text-decoration: none;
}

/* Empty state for the sponsor list */
.dash-grid__empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #333;
    font-size: 16px;
    padding: 2rem 1rem;
    margin: 0;
}

/* Empty state for transaction tables (AJAX-loaded) */
.dash-table__empty {
    text-align: center;
    color: #333;
    font-size: 16px;
    padding: 3rem 1rem;
    margin: 0;
    background: white;
}

@media (max-width: 1230px) {

    /* Page */
    .dash-page {
        padding-bottom: 4rem;
    }

    .dash-container {
        padding: 0 16px;
    }

    /* Header */
    .dash-header {
        padding: 1.5rem 0 7rem;
    }

    .dash-header__title {
        font-size: 22px;
    }

    /* Profile card */
    .dash-profile {
        border-radius: 28px;
        padding: 6rem 1.25rem 1.5rem;
        margin-bottom: 1.5rem;
        flex-direction: column;
        align-items: center;
        gap: 0;
    }

    .dash-profile__avatar {
        width: 100px;
        height: 100px;
    }

    .dash-profile__avatar-wrapper {
        top: -50px;
    }

    .dash-profile__info {
        margin-top: 0;
    }

    .dash-profile__name {
        font-size: 18px;
        margin-bottom: 0.75rem;
    }

    .dash-profile__meta {
        font-size: 13px;
        gap: 0.75rem;
        flex-direction: column;
        align-items: center;
    }

    .dash-profile__edit-btn {
        position: static;
        margin-top: 1.25rem;
        font-size: 13px;
        padding: 8px 16px;
    }

    /* Tabs */
    .dash-tabs {
        justify-content: flex-start;
        gap: 0.5rem;
        margin-bottom: 1.25rem;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .dash-tab {
        font-size: 13px;
        padding: 10px 16px;
        border-radius: 24px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Card grid — single column on mobile */
    .dash-grid {
        column-gap: 1rem;
        row-gap: 4.5rem;
    }

    /* Child card */
    .dash-card {
        margin-top: 60px;
    }

    .dash-card__avatar-wrapper {
        top: -60px;
    }

    .dash-card__avatar-circle {
        width: 120px;
        height: 120px;
    }

    .dash-card__body {
        border-radius: 32px;
        padding: 4.5rem 1.25rem 1.25rem;
    }

    .dash-card__name {
        font-size: 18px;
    }

    .dash-card__sponsored-by {
        font-size: 13px;
    }

    .dash-card__link {
        font-size: 13px;
        margin-bottom: 1rem;
    }

    /* Save for College */
    .dash-card__college {
        padding: 0.85rem 1rem;
        margin-bottom: 0.85rem;
    }

    .dash-card__college-header {
        font-size: 13px;
        margin-bottom: 0.5rem;
    }

    .dash-card__college-input-group {
        gap: 0.4rem;
    }

    .dash-card__currency {
        font-size: 13px;
    }

    .dash-card__input {
        font-size: 13px;
    }

    .dash-card__save-btn {
        font-size: 12px;
        padding: 7px 12px;
    }

    /* Update button */
    .dash-card__update-btn {
        font-size: 14px;
        padding: 12px 18px;
    }
}

.dash-page {
    background-color: var(--dash-bg, #eff6f0);
    min-height: 100vh;
    padding-bottom: 80px;
}

.dash-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

@media (min-width: 1230px) {
    .dash-container {
        padding: 0 40px;
    }
}


body:has(.dash-page) .hv2-header__menu-pill,
body:has(.dcp-page) .hv2-header__menu-pill {
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.65),
        0 10px 26px rgba(0, 0, 0, 0.28);
}

.hv2-header__user .hv2-header__user-dropdown {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

@media (max-width: 1230px) {

    body:has(.dash-page) .hv2-header,
    body:has(.dash-page) .hv2-header--overlay {
        background: #32BF7E;
    }
}

.dash-hero {
    position: relative;
    background: linear-gradient(180deg, #02723f 0%, #038248 18%, #049551 38%, #0bb265 100%);
    min-height: 640px;
    padding: 56px 0 40px;
    display: flex;
    align-items: center;
}

.dash-hero::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 180px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.28) 0%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
    z-index: 0;
}

@media (max-width: 1230px) {
    .dash-hero::before {
        background: none;
    }
}

.dash-hero>.dash-container {
    position: relative;
    z-index: 1;
    width: 100%;
}

.dash-hero__breadcrumb {
    display: inline-flex;
    margin: 0 0 20px;
}

.dash-hero__row {
    display: grid;
    grid-template-columns: minmax(0, 516px) minmax(0, 1fr);
    gap: 24px;
}

@media (max-width: 1230px) {
    .dash-hero__breadcrumb {
        margin: 0 0 14px;
    }
}

@media (max-width: 1230px) {
    .dash-hero {
        min-height: 0;
        padding: 40px 0 24px;
        background: transparent;
    }

    .dash-hero::before {
        display: none;
    }

    .dash-hero__row {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

    .dash-hero .dash-profile-card {
        position: relative;
    }

    .dash-hero .dash-profile-card::before {
        content: "";
        position: absolute;
        top: -80px;
        bottom: -120px;
        left: 50%;
        transform: translateX(-50%);
        width: 100vw;
        background: #32BF7E;
        z-index: -1;
    }

    .dash-impact-card {
        position: relative;
        z-index: 2;
    }
}

/* ---- LEFT: Profile card ---- */
.dash-profile-card {
    background: #fff;
    border-radius: 24px;
    padding: 48px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 376px;
    min-width: 0;
}

@media (max-width: 1230px) {
    .dash-profile-card {
        height: auto;
    }
}

.dash-profile-card__top {
    display: flex;
    align-items: center;
    gap: 16px;
}

.dash-profile-card__avatar {
    position: relative;
    width: 124px;
    height: 124px;
    background: transparent;
    flex-shrink: 0;
}

.dash-profile-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 16px;
    background: #f3f4f6;
}

.dash-profile-card__verified {
    position: absolute;
    right: -10px;
    bottom: -10px;
    width: 28px;
    height: 28px;
    background: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    color: var(--pa-primary, #049551);
}

.dash-profile-card__verified svg {
    width: 20px;
    height: 20px;
}

.dash-profile-card__head {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dash-page .dash-profile-card__name {
    font-family: var(--pa-font-default, 'Inter', sans-serif) !important;
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin: 0;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dash-profile-card__edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    transition: color 0.15s;
    line-height: 0;
}

.dash-profile-card__edit svg {
    width: 20px;
    height: 20px;
}

.dash-profile-card__edit:hover {
    color: var(--pa-primary, #049551);
}

.dash-profile-card__edit:focus:not(:hover) {
    color: #94a3b8;
    text-decoration: none;
}

.dash-profile-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #EDF6EE;
    color: var(--pa-primary, #049551);
    border-radius: 999px;
    font-size: 16px;
    font-weight: 500;
    align-self: flex-start;
}

.dash-profile-card__badge-icon {
    width: 20px;
    height: 20px;
}

@media (max-width: 1230px) {
    .dash-profile-card__badge-icon {
        width: 18px;
        height: 18px;
    }
}

.dash-profile-card__contact {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dash-profile-card__contact li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #333;
    font-size: 16px;
    min-width: 0;
}

.dash-profile-card__contact li span {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-profile-card__contact li svg {
    width: 36px;
    height: 36px;
    color: var(--pa-primary, #049551);
    flex-shrink: 0;
    background: #ECFDF3;
    padding: 5px;
    border-radius: 6px;
}

.dash-profile-card__logout-mobile {
    display: none;
}

@media (max-width: 1230px) {
    .dash-profile-card__logout-mobile {
        margin-top: 18px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
        padding: 12px 20px;
        background: white;
        color: var(--pa-primary);
        border: 1.5px solid var(--pa-primary, #049551);
        border-radius: 999px;
        font-size: 16px;
        font-weight: 600;
        text-decoration: none;
        transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.1s ease;
    }

    .dash-profile-card__logout-mobile svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
        color: currentColor;
    }

    .dash-profile-card__logout-mobile:hover,
    .dash-profile-card__logout-mobile:focus-visible {
        background: var(--pa-primary);
        border-color: var(--pa-primary);
        color: #fff;
        text-decoration: none;
    }

    .dash-profile-card__logout-mobile:active {
        transform: translateY(1px);
    }
}

/* ---- RIGHT: Impact card ---- */
.dash-impact-card {
    background: #fff;
    border-radius: 24px;
    padding: 48px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.dash-page .dash-impact-card__title {
    font-family: var(--pa-font-default, 'Inter', sans-serif) !important;
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin: 0;
    line-height: 1.2;
}

@media (min-width: 1230px) {
    .dash-page .dash-impact-card__title svg {
        display: none;
    }
}

@media (max-width: 1230px) {
    .dash-page .dash-impact-card__title {
        font-size: 18px;
    }
}

.dash-impact-card__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.dash-stat {
    background: #F5F8F6;
    border-radius: 24px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.dash-stat__label {
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

@media (max-width: 1230px) {
    .dash-stat__label {
        font-size: 14px;
    }
}

.dash-stat__value {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    white-space: nowrap;
}

.dash-impact-card__footer {
    border-top: 1px solid #E5EAE7;
    padding-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.dash-impact-card__next {
    margin: 0;
    color: #333;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dash-impact-card__next strong {
    color: #333;
    font-weight: 700;
}

.dash-impact-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    background: var(--pa-primary, #049551);
    color: #fff;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    transition: filter 0.15s, transform 0.15s;
}

.dash-impact-card__cta:hover {
    color: #fff;
    text-decoration: underline;
}

.dash-impact-card__cta:focus:not(:hover) {
    color: #fff;
    text-decoration: none;
}

.dash-impact-card__cta svg {
    width: 18px;
    height: 18px;
    color: #fff;
}

@media (max-width: 1230px) {
    .dash-profile-card {
        padding: 20px;
        gap: 18px;
    }

    .dash-profile-card__top {
        gap: 14px;
        align-items: flex-start;
    }

    .dash-profile-card__avatar {
        width: 100px;
        height: 100px;
    }

    .dash-profile-card__avatar img {
        border-radius: 14px;
    }

    .dash-page .dash-profile-card__name {
        font-size: 20px;
    }

    .dash-profile-card__badge {
        font-size: 12px;
        padding: 8px 20px;
        line-height: 1.3;
        white-space: normal;
    }

    .dash-profile-card__contact li {
        gap: 14px;
    }

    .dash-profile-card__contact li svg {
        width: 20px;
        height: 20px;
        padding: 6px;
        background: #EDF6EE;
        border-radius: 8px;
        box-sizing: content-box;
        border-radius: 6px;
    }

    .dash-impact-card {
        padding: 22px 20px 20px;
    }

    .dash-page .dash-impact-card__title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
    }

    .dash-impact-card__title-chev {
        width: 18px;
        height: 18px;
        color: #64748b;
        transition: transform 0.2s ease;
        flex-shrink: 0;
    }

    .dash-impact-card.is-collapsed .dash-impact-card__title-chev {
        transform: rotate(-180deg);
    }

    .dash-impact-card.is-collapsed .dash-impact-card__stats,
    .dash-impact-card.is-collapsed .dash-impact-card__footer {
        display: none;
    }

    .dash-impact-card__stats {
        grid-template-columns: 1fr;
    }

    .dash-impact-card__footer {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .dash-impact-card__next {
        justify-content: space-between;
    }

    .dash-impact-card__cta {
        justify-content: center;
        width: 100%;
        padding: 12px 20px;
    }

    .dash-stat__value {
        font-size: 20px;
    }
}

/* ---- BODY: tabs + filter + grid wrapper ---- */
.dash-body {
    position: relative;
    z-index: 1;
}

.dash-tabs-wrap {
    display: flex;
    justify-content: stretch;
}

.dash-page .dash-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    background: #fff;
    border-radius: 999px;
    padding: 8px;
    width: 100%;
    margin-top: -3%;
}

.dash-page .dash-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    border-radius: 999px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

@media (max-width: 1230px) {
    .dash-page .dash-tab {
        padding: 12px 16px;
        font-size: 16px;
    }
}

@media (max-width: 400px) {
    .dash-page .dash-tab {
        font-size: 12px;
    }
}

.dash-page .dash-tab:hover {
    color: var(--pa-primary, #049551);
    text-decoration: none;
}

.dash-page .dash-tab--active {
    background: #EDF6EE;
    color: var(--pa-primary, #049551);
    font-weight: 700;
}

.dash-tab__icon {
    width: 18px;
    height: 18px;
}

/* ---- Filter bar (count + search + sort) ---- */
.dash-filter {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 1fr) auto;
    gap: 16px;
    align-items: center;
    margin: 0 0 24px;
}

.dash-filter__count {
    margin: 0;
    color: #333;
    font-size: 16px;
}

.dash-filter__count strong {
    color: #333;
    font-weight: 700;
}

.dash-filter__search {
    position: relative;
    display: flex;
    align-items: center;
}

.dash-filter__search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #333;
    pointer-events: none;
    line-height: 0;
}

.dash-filter__search-icon svg {
    width: 18px;
    height: 18px;
}

.dash-filter__search-input {
    width: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 16px 24px 16px 44px;
    font-size: 14px;
    color: #333;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.dash-filter__search-input:focus {
    border-color: var(--pa-primary, #049551);
}

.dash-sort-by {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.dash-sort-by__pill {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border-radius: 999px;
    padding: 4px 14px 4px 20px;
    gap: 4px;
    transition: box-shadow 0.2s;
    border: 1px solid #e5e7eb;
}

.dash-sort-by__pill:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.dash-sort-by__label {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
}

.dash-sort-by__select-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

/* Hidden native select — kept so the existing GET form still posts a `sort` value */
.dash-sort-by__sr,
.dash-sort-by__select--sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    pointer-events: none;
}

.dash-sort-by__trigger {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    padding: 12px 4px;
    font-size: 14px;
    font-family: inherit;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    outline: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    white-space: nowrap;
}

.dash-sort-by__chevron {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
    color: #64748b;
    flex-shrink: 0;
}

.dash-sort-by.is-open .dash-sort-by__chevron,
.dash-sort-by__trigger[aria-expanded="true"] .dash-sort-by__chevron {
    transform: rotate(180deg);
    color: var(--pa-primary, #049551);
}

.dash-sort-by__menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(15, 42, 73, 0.14), 0 0 0 1px rgba(15, 42, 73, 0.04);
    padding: 6px;
    margin: 0;
    list-style: none;
    z-index: 60;
    animation: dash-sort-menu-in 0.16s ease-out;
}

.dash-sort-by__menu[hidden] {
    display: none;
}

@keyframes dash-sort-menu-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dash-sort-by__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    border-radius: 10px;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    user-select: none;
}

.dash-sort-by__option:hover {
    background: #f4faf6;
    color: var(--pa-primary, #049551);
}

.dash-sort-by__option.is-active {
    background: rgba(14, 138, 63, 0.08);
    color: var(--pa-primary, #049551);
    font-weight: 600;
}

.dash-sort-by__option-check {
    width: 16px;
    height: 16px;
    color: var(--pa-primary, #049551);
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s;
}

.dash-sort-by__option.is-active .dash-sort-by__option-check {
    opacity: 1;
}

@media (max-width: 1230px) {
    .dash-filter {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "search search"
            "count  sort";
        gap: 12px;
        align-items: center;
    }

    .dash-filter__search {
        grid-area: search;
    }

    .dash-filter__count {
        grid-area: count;
        margin: 0;
        align-self: center;
        font-size: 14px;
    }

    .dash-filter__count-prefix {
        display: none;
    }

    .dash-sort-by {
        grid-area: sort;
        justify-self: end;
    }

    /* Sort pill compact on mobile so it doesn't stretch. */
    .dash-sort-by__pill {
        padding: 0 12px 0 16px;
    }
}

.dash-page .dash-card__photo {
    position: absolute;
    top: -65px;
    left: 50%;
    transform: translateX(-50%);
    width: 148px;
    height: 148px;
    border-radius: 24px;
    background-color: #e9f5ec;
    overflow: hidden;
    z-index: 20;
    transition: transform 0.4s ease;
    border: 2px solid #049551;
}

@media (max-width: 1230px) {
    .dash-page .dash-card__photo {
        width: 100px;
        height: 100px;
        border-radius: 12px;
    }
}

.dash-page .dash-card__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.dash-page .dash-card__body {
    background: #32BF7E;
    border-radius: 48px;
    padding: 96px 24px 24px;
    text-align: center;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
}

@media (max-width: 1230px) {
    .dash-page .dash-card__body {
        padding: 55px 16px 16px;
    }
}

.dash-page .dash-card__name {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    margin: 0;
    text-align: center;
}

@media (max-width: 1230px) {
    .dash-page .dash-card__name {
        font-size: 20px;
    }

    .dash-page .dash-card__sponsored-by {
        font-size: 14px;
    }
}

.dash-page .dash-card__sponsored-by {
    margin: 0;
    color: rgba(255, 255, 255, 0.92);
    font-size: 16px;
    text-align: center;
}

.dash-page .dash-card__sponsored-by a {
    color: #fff;
    font-weight: 700;
}

.dash-page .dash-card__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    color: white;
    border: 1px solid white;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, transform 0.15s;
}

@media (max-width: 1230px) {
    .dash-page .dash-card__action {
        font-size: 16px;
    }
}

.dash-page .dash-card__action:hover,
.dash-page .dash-card__action:focus-visible {
    color: #fff;
    text-decoration: underline;
}

.dash-page .dash-card__action svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: currentColor;
}

/* Gift variant — solid white pill with green text + icon. */
.dash-page .dash-card__action--gift {
    background: #fff;
    color: var(--pa-primary, #049551);
}

.dash-page .dash-card__action--gift:hover,
.dash-page .dash-card__action--gift:focus-visible {
    color: var(--pa-primary);
    text-decoration: underline;
}

.dash-page .dash-card__view-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    margin: 2px 0;
}

.dash-page .dash-card__view-link:hover,
.dash-page .dash-card__view-link:focus-visible {
    color: #fff;
    text-decoration: underline;
}

.dash-card__view-link-arrow {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
}

@media (max-width: 1230px) {
    .dash-card__view-link-arrow {
        width: 24px;
        height: 24px;
    }
}

.dash-card__view-link-arrow path {
    stroke: currentColor;
    fill: none;
}

.dash-page .dash-card__college {
    background: #EDF6EE;
    border-radius: 16px;
    padding: 16px 18px;
    color: #333;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}

.dash-card__college-head {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dash-card__college-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

@media (max-width: 1230px) {
    .dash-card__college-title {
        font-size: 14px;
    }

    .dash-card__college-label {
        font-size: 12px;
    }

    .dash-card__college-collected {
        font-size: 16px;
    }
}

/* A <button> since it opens the Save for College sheet — the reset keeps it
   looking exactly like the plain icon it replaced. */
.dash-card__college-tip {
    display: inline-flex;
    color: #94a3b8;
    line-height: 0;
    cursor: pointer;
    padding: 0;
    border: 0;
    background: none;
    transition: color 0.18s ease;
}

.dash-card__college-tip:hover,
.dash-card__college-tip:focus-visible {
    color: var(--pa-primary);
}

.dash-card__college-tip svg {
    width: 16px;
    height: 16px;
}

.dash-card__college-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dash-card__college-meta-right {
    text-align: right;
}

.dash-card__college-meta>div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dash-card__college-label {
    font-size: 16px;
    color: #64748b;
    font-weight: 500;
}

.dash-card__college-collected {
    color: var(--pa-primary, #049551);
    font-size: 20px;
    font-weight: 700;
}

.dash-card__college-target {
    color: #333;
    font-size: 20px;
    font-weight: 700;
}

.dash-card__college-bar {
    position: relative;
    width: 100%;
    height: 12px;
    background: #E5EAE7;
    border-radius: 3px;
    overflow: hidden;
}

.dash-card__college-bar-fill {
    position: absolute;
    inset: 0 auto 0 0;
    height: 100%;
    background: linear-gradient(270deg, #14A24A 0%, #18D660 100%);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.dash-page .dash-card__college-field {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 6px 16px;
    background: #fff;
}

.dash-page .dash-card__currency {
    color: #333;
    font-size: 16px;
    font-weight: 600;
    margin-right: 6px;
    flex-shrink: 0;
}

.dash-page .dash-card__input {
    flex: 0 1 auto;
    width: auto;
    min-width: 1ch;
    max-width: 100%;
    border: 0;
    background: transparent;
    padding: 8px 0;
    font-size: 16px;
    color: #333;
    outline: none;
    text-align: left;
    field-sizing: content;
}

.dash-page .dash-card__input::placeholder {
    color: #94a3b8;
}

.dash-page .dash-card__donate-btn {
    appearance: none;
    -webkit-appearance: none;
    background: #fff;
    color: var(--pa-primary, #049551);
    border: 1.5px solid var(--pa-primary, #049551);
    border-radius: 999px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, transform 0.15s;
}

@media (max-width: 1230px) {
    .dash-page .dash-card__donate-btn {
        padding: 12px 20px;
    }
}

.dash-page .dash-card__donate-btn:hover,
.dash-page .dash-card__donate-btn:focus-visible {
    color: var(--pa-primary);
    text-decoration: underline;
}

.dash-page .dash-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 24px;
    row-gap: 80px;
}

@media (max-width: 1230px) {
    .dash-page .dash-grid {
        grid-template-columns: 1fr;
        row-gap: 4.5rem;
    }

    .dash-page .dash-card {
        margin-top: 80px;
    }
}

.dash-page .dash-card {
    margin-top: 56px;
}

/* ==========================================================================
   CHILD UPDATE CARD (dchild-update) — child-profile dashboard
   ========================================================================== */
.child-updates__child-name {
    font-family: var(--pa-font-headline, inherit);
    color: var(--dash-text-main);
    font-size: 20px;
    font-weight: 700;
    margin: 24px 0 16px;
}

.dchild-update {
    display: flex;
    gap: 24px;
    background: var(--dash-white);
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.dchild-update__media {
    position: relative;
    flex: 0 0 400px;
    aspect-ratio: 1.65 / 1;
    border-radius: 16px;
    overflow: hidden;
    display: block;
    background: var(--dash-card-bg);
    text-decoration: none;
}

.dchild-update__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dchild-update__media-dl {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.dchild-update__media:hover .dchild-update__media-dl {
    background: rgba(0, 0, 0, 0.8);
}

.dchild-update__body {
    flex: 1 1 auto;
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 16px;
    row-gap: 6px;
    grid-template-areas:
        "title   report"
        "date    date"
        "content content";
    align-items: start;
}

.dchild-update__title {
    grid-area: title;
}

.dchild-update__report {
    grid-area: report;
    align-self: start;
}

.dchild-update__date {
    grid-area: date;
}

.dchild-update__content {
    grid-area: content;
}

.dchild-update__title {
    margin: 0;
    color: var(--dash-text-main);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
    font-family: var(--pa-font-default, inherit);
}

.dchild-update__report {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--dash-primary);
    color: #ffffff !important;
    font-size: 16px;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 999px;
    text-decoration: none;
    flex-shrink: 0;
    transition: filter 0.15s ease;
    white-space: nowrap;
}

.dchild-update__report:hover {
    filter: brightness(0.95);
    color: #fff !important;
    text-decoration: none;
}

.dchild-update__report svg {
    flex-shrink: 0;
}

.dchild-update__date {
    color: #333;
    font-size: 16px;
    font-weight: 400;
    margin: 0 0 10px;
    line-height: 1.4;
}

@media (max-width: 1230px) {
    .dchild-update__report {
        font-size: 14px;
    }
}

.dchild-update__content {
    color: #2F3037;
    font-size: 16px;
    line-height: 1.6;
}

.dchild-update__content p {
    margin: 0 0 8px;
    color: #333;
}

.dchild-update__content p:last-child {
    margin-bottom: 0;
}

@media (max-width: 1230px) {
    .dchild-update {
        flex-direction: column;
        gap: 16px;
        padding: 18px;
        border-radius: 16px;
    }

    .dchild-update__media {
        flex: 0 0 auto;
        width: 100%;
        aspect-ratio: 16 / 10;
    }

    .dchild-update__body {
        display: block;
    }

    .dchild-update__title {
        font-size: 18px;
        margin-bottom: 6px;
    }

    .dchild-update__date {
        margin-bottom: 10px;
    }

    .dchild-update__report {
        display: inline-flex;
        margin-top: 20px;
        width: 100%;
        justify-content: center;
    }
}

/* ── Load-more button below update list ── */
.dchild-load-more {
    display: flex;
    justify-content: center;
    margin-top: 28px;
}

.dchild-load-more__btn {
    background: white;
    border: 1.5px solid var(--pa-primary);
    color: var(--pa-primary);
    border-radius: 999px;
    padding: 14px 32px;
    font-family: inherit;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}

.dchild-load-more__btn:hover,
.dchild-load-more__btn:focus-visible {
    background: var(--pa-primary);
    color: white;
    outline: none;
}

.dchild-load-more__btn:disabled {
    opacity: 0.6;
    cursor: progress;
}

/* ==========================================================================
   CHILD PROFILE PAGE V2 (dcp) — uses dashboard tokens for consistency
   with .dash-page / .dash-profile / .dash-card visual language.
   ========================================================================== */
.dcp-page {
    background-color: var(--dash-bg);
    min-height: 100vh;
    padding-bottom: 6rem;
    font-family: 'Inter', sans-serif;
}

.dcp-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.dcp-hero {
    position: relative;
    background-color: var(--dash-bg);
    background-image: linear-gradient(180deg, #02723f 0%, #038248 18%, #049551 38%, #0bb265 100%);
    background-size: 100% 640px;
    background-repeat: no-repeat;
    padding: 118px 0 0px;
}

.dcp-hero::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 180px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.28) 0%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
    z-index: 0;
}

.dcp-hero>.dcp-container {
    position: relative;
    z-index: 1;
}

.dcp-hero__breadcrumb {
    display: inline-flex;
    margin: 0 0 20px;
}

@media (max-width: 1230px) {
    .dcp-hero__breadcrumb {
        margin: 0 0 14px;
    }
}

.dcp-card {
    position: relative;
    z-index: 1;
    background: var(--dash-white);
    border-radius: 40px;
    padding: 48px;
    margin-top: 0;
    display: grid;
    grid-template-columns: 160px 1fr auto;
    column-gap: 24px;
    align-items: start;
    grid-template-areas:
        "photo   info    send"
        "photo   info    present"
        "fund    fund    fund"
        "about   about   about";
}

.dcp-card__photo {
    grid-area: photo;
}

.dcp-card__info {
    grid-area: info;
}

.dcp-card__send {
    grid-area: send;
}

.dcp-card__present {
    grid-area: present;
}

.dcp-fund {
    grid-area: fund;
}

.dcp-about {
    grid-area: about;
}

.dcp-card__photo {
    width: 148px;
    height: 148px;
    border-radius: 20px;
    overflow: hidden;
    background: var(--dash-card-bg);
    border: 2px solid #049551
}

.dcp-card__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    object-position: center 10%;
}

.dcp-card__info {
    min-width: 0;
    padding-top: 4px;
}

.dcp-card__name {
    margin: 0 0 14px;
    color: var(--dash-text-main);
    font-size: 30px;
    font-weight: 700;
    line-height: 1.15;
    font-family: var(--pa-font-headline, inherit);
}

.dcp-card__meta {
    margin: 0 0 6px;
    color: var(--dash-text-main);
    font-size: 16px;
    line-height: 1.5;
}

.dcp-card__meta strong {
    font-weight: 700;
    color: var(--dash-text-main);
}

.dcp-card__meta span {
    margin-left: 8px;
    color: #333;
    font-weight: 400;
}

.dcp-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.dcp-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    background: #E6F4EA;
    color: var(--pa-primary, #049551);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}

.dcp-badge__icon {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.dcp-badge__icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.dcp-card__send,
.dcp-card__present {
    align-self: start;
    width: 324px;
}

.dcp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    transition: filter 0.15s ease, background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
    min-width: 200px;
}

.dcp-btn svg {
    flex-shrink: 0;
}

.dcp-btn--outline {
    background: var(--dash-white);
    color: var(--pa-primary) !important;
    border: 1.5px solid var(--pa-primary);
}

.dcp-btn--outline:hover {
    text-decoration: underline;
}

.dcp-btn--solid {
    background: var(--pa-primary);
    color: #ffffff !important;
}

.dcp-btn--solid:hover {
    color: #fff !important;
    text-decoration: underline;
}

/* ── Save for College fund ── */
.dcp-fund {
    padding: 24px 0;
    border-bottom: 1px solid #f1f5f9;
}

/* Header row. The accordion trigger is .dcp-fund__toggle laid over it rather
   than wrapping it, so the help control inside the title can be a real
   <button> — a button nested in a button is dropped by the HTML parser. */
.dcp-fund__head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin: 0 0 16px;
    color: inherit;
    font-family: inherit;
    text-align: left;
}

/* Covers the whole row so the tap target stays as large as it was when the
   header itself was the button. */
.dcp-fund__toggle {
    position: absolute;
    inset: 0;
    width: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    cursor: default;
}

.dcp-fund__title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--dash-text-main);
    font-size: 20px;
    font-weight: 700;
    font-family: var(--pa-font-default, inherit);
    line-height: 1.2;
}

/* Chevron hidden on desktop; revealed on mobile/tablet as accordion indicator. */
.dcp-fund__chevron {
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--dash-text-muted);
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.dcp-fund__chevron svg {
    display: block;
}

.dcp-fund--open .dcp-fund__chevron {
    transform: rotate(0);
}

.dcp-fund:not(.dcp-fund--open) .dcp-fund__chevron {
    transform: rotate(180deg);
}

/* Opens the Save for College sheet. Sits above .dcp-fund__toggle so the click
   reaches it instead of collapsing the accordion. */
.dcp-fund__help {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: 0;
    background: none;
    line-height: 0;
    cursor: pointer;
    transition: opacity 0.18s ease;
}

.dcp-fund__help:hover,
.dcp-fund__help:focus-visible {
    opacity: 0.7;
}

.dcp-fund__help svg {
    display: block;
}

.dcp-fund__panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    background: #EDF6EE;
    border-radius: 18px;
    padding: 24px;
}

.dcp-fund__progress {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dcp-fund__row,
.dcp-fund__amounts {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.dcp-fund__lbl {
    color: #333;
    font-size: 16px;
    font-weight: 500;
}

@media (max-width: 1230px) {
    .dcp-fund__lbl {
        font-size: 14px;
    }

    .dcp-fund__raised {
        font-size: 18px;
    }

    .dcp-fund__target {
        font-size: 18px;
    }

    .dcp-fund__donate-lbl {
        display: none;
    }
}

.dcp-fund__amounts {
    margin: 2px 0 8px;
}

.dcp-fund__raised {
    color: var(--pa-primary);
    font-size: 20px;
    font-weight: 800;
}

.dcp-fund__target {
    color: var(--dash-text-main);
    font-size: 20px;
    font-weight: 800;
}

.dcp-fund__track {
    height: 12px;
    border-radius: 999px;
    background: rgba(18, 162, 74, 0.18);
    overflow: hidden;
}

.dcp-fund__fill {
    height: 100%;
    background: var(--pa-primary);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.dcp-fund__donate {
    border-left: 1px solid rgba(18, 162, 74, 0.18);
    padding-left: 22px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dcp-fund__donate-lbl {
    color: #333;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 6px;
}

.dcp-fund__donate-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.dcp-fund__input-wrap {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
}

.dcp-fund__currency {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dash-text-muted);
    font-size: 14px;
    pointer-events: none;
}

.dcp-fund__input {
    width: 100%;
    padding: 12px 24px 12px calc(22px + var(--dcp-cur-w, 2ch));
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: var(--dash-white);
    font-size: 16px;
    color: var(--dash-text-main);
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}

.dcp-fund__input:focus {
    border-color: var(--pa-primary);
}

.dcp-fund__donate-btn {
    flex: 0 0 auto;
    min-width: 0;
    padding: 11px 22px;
    font-size: 16px;
}

@media (max-width: 1230px) {
    .dcp-fund__input-wrap {
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #e5e7eb;
        border-radius: 999px;
        padding: 6px 16px;
        background: #fff;
    }

    .dcp-fund__input-wrap:focus-within {
        border-color: var(--pa-primary);
    }

    .dcp-fund__currency {
        position: static;
        left: auto;
        top: auto;
        transform: none;
        color: #333;
        font-size: 14px;
        font-weight: 600;
        margin-right: 6px;
        flex-shrink: 0;
    }

    .dcp-fund__input {
        flex: 0 1 auto;
        width: auto;
        min-width: 1ch;
        max-width: 100%;
        border: 0;
        background: transparent;
        padding: 8px 0;
        border-radius: 0;
        font-size: 14px;
        color: #333;
        outline: none;
        text-align: left;
        field-sizing: content;
    }
}

/* ── Tentang ── */
.dcp-about {
    padding: 24px 0 8px;
    text-align: center;
}

.dcp-about__title {
    text-align: left;
    margin: 0 0 12px;
    color: var(--dash-text-main);
    font-size: 20px;
    font-weight: 700;
}

.child-updates-list .text-center {
    font-size: 20px;
}

@media (max-width: 1230px) {
    .dcp-about__title {
        font-size: 18px;
    }
}

.dcp-about__excerpt {
    text-align: left;
    color: var(--dash-text-muted);
    font-size: 14px;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
}

.dcp-about__excerpt p {
    margin: 0;
    color: #333;
}

.dcp-about--open .dcp-about__excerpt {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    overflow: visible;
}

.dcp-about--open .dcp-about__excerpt p {
    margin: 0 0 10px;
}

.dcp-about--open .dcp-about__excerpt p:last-child {
    margin-bottom: 0;
}

.dcp-about__more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding: 6px 9px;
    background: transparent;
    border: 0;
    color: var(--pa-primary);
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
}

.dcp-about__more-icon {
    transition: transform 0.2s ease;
}

.dcp-about--open .dcp-about__more-icon {
    transform: rotate(180deg);
}

/* ── Updates section ── */
.dcp-updates {
    padding: 24px 0 80px;
}

.dcp-updates__title {
    margin: 16px 0 32px;
    color: var(--dash-text-main);
    font-size: 20px;
    font-weight: 700;
}

.dcp-back {
    margin-top: 32px;
}

.dcp-back__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--pa-primary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.dcp-back__link:hover {
    text-decoration: underline;
}

/* ── Unauthorized state ── */
.dcp-unauthorized {
    padding: 80px 0;
    text-align: center;
}

.dcp-unauthorized h2 {
    margin: 0 0 12px;
    color: var(--dash-text-main);
    font-size: 22px;
    font-weight: 700;
}

.dcp-unauthorized p {
    color: var(--dash-text-muted);
    margin: 0 0 24px;
}

/* ── Responsive ── tablet + mobile: stack everything, photo + name centered,
   accordion mode for Save for College, Donate-for-Present at bottom. */
@media (max-width: 1230px) {
    .dcp-card {
        padding: 28px 24px;
        grid-template-columns: 1fr;
        grid-template-areas:
            "photo"
            "info"
            "send"
            "fund"
            "present"
            "about";
        row-gap: 18px;
    }

    /* Photo + name + meta centered & full-width */
    .dcp-card__photo {
        width: 160px;
        height: 160px;
        margin: 0 auto;
        border-radius: 20px;
    }

    .dcp-card__info {
        text-align: center;
        padding-top: 0;
    }

    .dcp-card__name {
        font-size: 26px;
        margin-bottom: 18px;
        text-align: center;
    }

    .dcp-card__meta {
        text-align: left;
        margin-bottom: 14px;
    }

    .dcp-card__meta strong {
        display: block;
        margin-bottom: 2px;
    }

    .dcp-card__meta span {
        display: block;
        margin-left: 0;
    }

    /* Action buttons full-width */
    .dcp-card__send,
    .dcp-card__present {
        width: 100%;
        align-self: stretch;
    }

    /* Save for College accordion mode */
    .dcp-fund {
        padding: 18px 22px;
        background: #EDF6EE;
        border-radius: 18px;
        border-bottom: 0;
    }

    .dcp-fund__head {
        margin-bottom: 0;
    }

    .dcp-fund__toggle {
        cursor: pointer;
    }

    .dcp-fund__title {
        font-size: 14px;
    }

    .dcp-fund__chevron {
        display: inline-flex;
    }

    /* Panel becomes the collapsible body */
    .dcp-fund__panel {
        display: none;
        background: transparent;
        border-radius: 0;
        padding: 16px 0 0;
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .dcp-fund--open .dcp-fund__panel {
        display: grid;
    }

    .dcp-fund__donate {
        border-left: 0;
        border-top: 1px solid rgba(18, 162, 74, 0.18);
        padding-left: 0;
        padding-top: 16px;
    }

    .dcp-fund__donate-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .dcp-fund__donate-btn {
        width: 100%;
        padding: 14px 22px;
        font-size: 15px;
    }
}

@media (max-width: 1230px) {
    .dcp-hero {
        padding: 40px 0 0px;
    }

    .dcp-hero::before {
        display: none;
    }

    .dcp-card {
        padding: 22px 18px;
        border-radius: 24px;
    }

    .dcp-card__photo {
        width: 100px;
        height: 100px;
        border-radius: 16px;
    }

    .dcp-card__name {
        font-size: 24px;
    }

    .dcp-card__meta {
        font-size: 16px;
    }

    .dcp-btn {
        font-size: 16px;
        padding: 12px 20px;
    }

    .dcp-card__send svg {
        width: 18px;
        height: 18px;
    }

    .dcp-btn--solid svg {
        width: 18px;
        height: 18px;
    }
}

.dash-filter--tx {
    grid-template-columns:
        minmax(0, 1fr) minmax(240px, 1.6fr) auto auto auto;
}

.dash-subtabs--hidden {
    display: none !important;
}

@media (max-width: 1230px) {
    .dash-filter--tx {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "search search"
            "count  count"
            "type   year"
            "sort   sort";
        gap: 12px;
    }

    .dash-filter--tx .dash-filter__search {
        grid-area: search;
    }

    .dash-filter--tx .dash-filter__count {
        grid-area: count;
    }

    .dash-filter--tx [data-tx-filter="type"] {
        grid-area: type;
    }

    .dash-filter--tx [data-tx-filter="year"] {
        grid-area: year;
    }

    .dash-filter--tx [data-tx-filter="sort"] {
        grid-area: sort;
    }

    .dash-filter--tx .dash-filter__dd {
        min-width: 0;
    }
}

/* ==========================================================================
   TRANSACTIONS TABLE CELLS — donor avatar, type/status pills, PDF button
   ========================================================================== */
.dash-table__donor {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.dash-table__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.dash-table__donor-name {
    color: var(--dash-text-main);
    font-weight: 500;
    font-size: 14px;
}

.dash-table__donor-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.dash-table__donor-link:hover .dash-table__donor-name {
    text-decoration: underline;
}

.dash-table__donor-name--truncate {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 320px;
    word-break: break-word;
}

.dash-table__date,
.dash-table__amount {
    color: var(--dash-text-main);
    font-size: 14px;
}

.dash-table__amount-check {
    display: none;
    vertical-align: middle;
}

/* Colored pill badge — base */
.dash-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 20px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.dash-pill svg {
    flex-shrink: 0;
}

/* Donation Type variants */
.dash-pill--sponsor {
    background: #d1f4e0;
    color: #0e8a4a;
}

.dash-pill--general {
    background: #e4d8fb;
    color: #6941C6;
}

.dash-pill--campaign {
    background: #fde6c2;
    color: #B54708;
}

.dash-pill--savings {
    background: #cfe3ff;
    color: #4c94f3;
}

.dash-pill--gifts {
    background: #cfe3ff;
    color: #4c94f3;
}

/* Status variants */
.dash-pill--completed {
    background: #d1f4e0;
    color: #0e8a4a;
}

.dash-pill--scheduled {
    background: #e4d8fb;
    color: #6738d7;
}

.dash-pill--failed {
    background: #fdd1cf;
    color: #c0322f;
}

.dash-pill--active {
    background: #d1f4e0;
    color: #0e8a4a;
}

.dash-pill--cancelled {
    background: #fdd1cf;
    color: #c0322f;
}

/* PDF / Pay button */
.dash-invoice-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 999px;
    background: var(--pa-primary);
    color: #ffffff !important;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    transition: filter 0.15s ease;
}

.dash-invoice-btn:hover {
    filter: brightness(0.95);
    color: #fff !important;
    text-decoration: none;
}

.dash-invoice-btn svg {
    flex-shrink: 0;
}

.dash-table thead tr {
    background: #f7faf8;
    border-bottom: 1px solid #e2e8f0;
}

.dash-table thead th {
    padding: 16px 18px;
    color: #333;
    font-weight: 700;
    font-size: 16px;
}

.dash-table tbody td {
    padding: 16px 18px;
    font-size: 16px;
    color: #333;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

@media (max-width: 1230px) {
    .dash-table tbody td {
        font-size: 14px;
    }
}

.dash-table tbody tr:last-child td {
    border-bottom: 0;
}

.dash-table tbody tr:hover {
    background: #fafdfb;
}

/* Donor cell: avatar + name flex layout */
.dash-table__donation {
    padding-left: 18px;
}

.dash-table__donor {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.dash-table__avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--dash-card-bg);
    flex-shrink: 0;
    object-position: center 20%;
}

.dash-table__donor-name {
    color: var(--dash-text-main);
    font-weight: 600;
    font-size: 16px;
    line-height: 1.2;
}

.dash-table__date,
.dash-table__amount {
    color: var(--dash-text-main);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

/* Load-more button override — smaller, dashboard-pattern outlined pill */
.dash-load-more {
    margin-top: 28px;
}

/* ==========================================================================
   TX FILTER — mobile/tablet "Filter" button + bottom-sheet wrapper
   ========================================================================== */

/* Filter button: hidden on desktop; the 3 dropdowns sit inline there. */
.dash-filter__open-btn {
    display: none;
    align-items: center;
    gap: 8px;
    background: var(--dash-white);
    color: var(--dash-text-main);
    border: 1.5px solid #e2e8f0;
    border-radius: 999px;
    padding: 10px 18px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.dash-filter__open-btn:hover {
    border-color: var(--pa-primary);
    color: var(--pa-primary);
}

.dash-filter__open-btn svg {
    flex-shrink: 0;
    color: var(--dash-text-muted);
}


.dash-filter__sheet,
.dash-filter__sheet-body {
    display: contents;
}

.dash-filter__sheet-head,
.dash-filter__sheet-close,
.dash-filter__scrim {
    display: none;
}

@media (max-width: 1230px) {

    .dash-filter--tx {
        grid-template-areas:
            "search search"
            "count  filter";
        grid-template-columns: 1fr auto;
    }

    .dash-filter--tx .dash-filter__open-btn {
        display: inline-flex;
        grid-area: filter;
        justify-self: end;
    }

    /* Hide the inline dropdown wrappers — they live inside the sheet now */
    .dash-filter--tx [data-tx-filter="type"],
    .dash-filter--tx [data-tx-filter="year"],
    .dash-filter--tx [data-tx-filter="sort"] {
        display: none;
    }

    .dash-filter__sheet {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        background: var(--dash-white);
        border-radius: 24px 24px 0 0;
        padding: 18px 22px 28px;
        transform: translateY(110%);
        transition: transform 0.28s ease;
        max-height: 80vh;
        overflow-y: auto;
    }

    .dash-filter__sheet-body {
        display: block;
    }

    .dash-filter--tx.is-open .dash-filter__sheet {
        transform: translateY(0);
    }

    .dash-filter__sheet-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin: 0 0 16px;
    }

    .dash-filter__sheet-title {
        font-size: 16px;
        font-weight: 700;
        color: var(--dash-text-main);
    }

    .dash-filter__sheet-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: 0;
        padding: 4px;
        cursor: pointer;
        color: var(--dash-text-muted);
    }

    /* Reveal the dropdowns INSIDE the sheet (they were hidden inline above) */
    .dash-filter__sheet [data-tx-filter] {
        display: block !important;
        margin-bottom: 12px;
    }

    .dash-filter__sheet [data-tx-filter]:last-child {
        margin-bottom: 0;
    }

    /* Each dropdown becomes a full-width pill row inside the sheet */
    .dash-filter__sheet .dash-sort-by__pill {
        width: 100%;
        padding: 0 12px 0 16px;
    }

    .dash-filter__sheet .dash-sort-by__trigger {
        width: 100%;
        justify-content: space-between;
    }

    /* Scrim — dim background behind the sheet */
    .dash-filter__scrim {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 9998;
        opacity: 0;
        transition: opacity 0.2s ease;
    }

    .dash-filter--tx.is-open .dash-filter__scrim {
        display: block;
        opacity: 1;
    }
}

/* ==========================================================================
   MY-SPONSORING MOBILE FILTER — bottom-sheet modal with pill-style options
   (mirrors .sfc-filter-modal pattern from sponsor-full-child)
   ========================================================================== */

/* Filter trigger button — hidden on desktop, shown on mobile */
.dash-fm-btn {
    display: none;
}

@media (max-width: 1230px) {

    /* Hide the desktop sort dropdown — modal handles sort on mobile */
    .dash-page .dash-filter .dash-sort-by {
        display: none !important;
    }

    .dash-fm-btn {
        all: unset;
        box-sizing: border-box;
        display: inline-flex;
        align-items: center;
        gap: 0.6rem;
        padding: 10px 18px;
        background: #fff;
        border: 1.5px solid #e2e8f0;
        border-radius: 999px;
        font-size: 14px;
        font-weight: 600;
        color: var(--pa-text-primary, #333);
        cursor: pointer;
        white-space: nowrap;
        transition: box-shadow 0.2s, transform 0.15s, border-color 0.15s, color 0.15s;
        grid-area: sort;
        justify-self: end;
    }

    .dash-fm-btn:hover,
    .dash-fm-btn:focus-visible {
        border-color: var(--pa-primary);
        color: var(--pa-primary);
    }

    .dash-fm-btn:active {
        transform: translateY(1px);
    }
}

/* Bottom-sheet modal */
.dash-fm-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
}

.dash-fm-modal[hidden] {
    display: none;
}

.dash-fm-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 42, 73, 0.45);
    opacity: 0;
    transition: opacity 0.22s ease;
    pointer-events: auto;
}

.dash-fm-modal.is-open .dash-fm-modal__backdrop {
    opacity: 1;
}

.dash-fm-modal__panel {
    position: relative;
    z-index: 1;
    background: linear-gradient(180deg, #FFFFFF 0%, #E4FFEE 100%);
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.dash-fm-modal.is-open .dash-fm-modal__panel {
    transform: translateY(0);
}

.dash-fm-modal__header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 18px 18px 10px;
    position: relative;
}

.dash-fm-modal__title {
    grid-column: 2;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--pa-text-primary, #333);
    margin: 0;
    font-family: var(--pa-font-headline, inherit);
}

.dash-fm-modal__close {
    all: unset;
    grid-column: 3;
    justify-self: end;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(15, 42, 73, 0.08);
    color: var(--pa-text-primary, #333);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
}

.dash-fm-modal__close:hover,
.dash-fm-modal__close:focus-visible {
    background: rgba(15, 42, 73, 0.14);
}

.dash-fm-modal__close svg {
    width: 14px;
    height: 14px;
}

.dash-fm-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 20px 20px;
}

.dash-fm-group+.dash-fm-group {
    margin-top: 24px;
}

.dash-fm-group__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--pa-text-primary, #333);
    margin: 0 0 10px;
}

.dash-fm-group__options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dash-fm-pill {
    all: unset;
    box-sizing: border-box;
    padding: 12px 20px;
    border-radius: 999px;
    border: 1px solid #E2E8F0;
    background: #fff;
    color: var(--pa-text-primary, #333);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    white-space: nowrap;
}

.dash-fm-pill:hover,
.dash-fm-pill:focus-visible {
    border-color: var(--pa-primary);
    color: var(--pa-primary);
}

.dash-fm-pill.is-active {
    border-color: var(--pa-primary);
    color: var(--pa-primary);
    font-weight: 700;
}

.dash-fm-modal__footer {
    padding: 14px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dash-fm-modal__btn {
    all: unset;
    box-sizing: border-box;
    display: block;
    width: 100%;
    text-align: center;
    padding: 16px 20px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.15s, background 0.15s, color 0.15s;
}

.dash-fm-modal__btn--primary {
    background: var(--pa-primary);
    color: #fff;
}

.dash-fm-modal__btn--primary:hover {
    filter: brightness(1.05);
}

.dash-fm-modal__btn--ghost {
    background: #fff;
    color: var(--pa-primary);
    border: 1.5px solid var(--pa-primary);
}

.dash-fm-modal__btn--ghost:hover {
    background: rgba(14, 138, 63, 0.06);
}

/* ==========================================================================
   MOBILE TRANSACTIONS — table rows become tappable cards, modal for PDF
   ========================================================================== */

/* ── Modal: hidden by default; revealed by JS adding .is-open ── */
.dash-tx-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
}

.dash-tx-modal.is-open {
    display: block;
}

.dash-tx-modal__scrim {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.dash-tx-modal__sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, #FFFFFF 0%, #E4FFEE 100%);
    border-radius: 24px 24px 0 0;
    padding: 20px 22px 28px;
    transform: translateY(0);
    animation: dashTxSlideUp 0.28s ease;
}

@keyframes dashTxSlideUp {
    from {
        transform: translateY(20%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.dash-tx-modal__head {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 0 0 18px;
}

.dash-tx-modal__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--dash-text-main);
}

.dash-tx-modal__close {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: #f1f5f9;
    border: 0;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--dash-text-main);
    cursor: pointer;
}

.dash-tx-modal__card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
        "avatar name name"
        "type   type amount"
        "date   date .";
    column-gap: 12px;
    row-gap: 10px;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 20px 20px 20px;
    margin-bottom: 18px;
}

.dash-tx-modal__avatar {
    grid-area: avatar;
    align-self: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    object-fit: cover;
    object-position: center 20%;
}

/* Non-sponsor donation (no photo): name/type/date span to the left edge so the
   collapsed avatar column leaves no gap. */
.dash-tx-modal__card.is-no-avatar {
    grid-template-areas:
        "name name name"
        "type type amount"
        "date date .";
}

.dash-tx-modal__name {
    grid-area: name;
    min-width: 0;
}

.dash-tx-modal__type {
    grid-area: type;
}

.dash-tx-modal__date {
    grid-area: date;
}

.dash-tx-modal__name {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--dash-text-main);
    line-height: 1.2;
}

.dash-tx-modal__type {
    margin: 4px 0 2px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    /* Color inherits via .dash-pill--* classes mirrored from row */
}

/* The mirrored .dash-pill--* classes also carry a pill background; in the modal
   the type is plain coloured text, so strip the badge styling. */
.dash-tx-modal__type[class*="dash-pill--"] {
    background: transparent;
    padding: 0;
    border-radius: 0;
}

.dash-tx-modal__type.dash-pill--sponsor {
    color: #0e8a4a;
}

.dash-tx-modal__type.dash-pill--general {
    color: #6738d7;
}

.dash-tx-modal__type.dash-pill--campaign {
    color: #b96b08;
}

.dash-tx-modal__type.dash-pill--savings {
    color: #1e57c6;
}

.dash-tx-modal__type.dash-pill--gifts {
    color: #c0322f;
}

.dash-tx-modal__date {
    margin: 0;
    font-size: 12px;
    color: #333;
    line-height: 1.2;
}

.dash-tx-modal__amount-wrap {
    grid-area: amount;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dash-tx-modal__amount {
    font-size: 14px;
    font-weight: 700;
    color: var(--dash-text-main);
    white-space: nowrap;
}

.dash-tx-modal__check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    color: #fff;
    flex-shrink: 0;
}

.dash-tx-modal__pdf {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--pa-primary);
    color: #fff !important;
    font-size: 15px;
    font-weight: 700;
    padding: 14px 22px;
    border-radius: 999px;
    text-decoration: none;
    transition: filter 0.15s ease;
}

.dash-tx-modal__pdf:hover {
    filter: brightness(0.95);
    color: #fff !important;
}

/* ── Mobile/tablet: convert table rows into tappable cards ── */
@media (max-width: 1230px) {
    .dash-table thead {
        display: none;
    }

    .dash-table tbody {
        display: block;
    }

    .dash-table tbody tr {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "name  amount"
            "date  type";
        row-gap: 6px;
        align-items: center;

        background: var(--dash-white);
        border: 1px solid #e9f5ec;
        border-radius: 24px;
        padding: 14px 5px;
        margin-bottom: 10px;
        cursor: pointer;
        transition: box-shadow 0.15s ease, transform 0.15s ease;
    }

    .dash-table tbody tr:hover,
    .dash-table tbody tr:active {
        background: var(--dash-white);
    }

    .dash-table tbody td {
        padding: 0;
        border-bottom: 0;
        vertical-align: middle;
    }

    /* td positional mapping (matches the markup order) */
    .dash-table tbody td:nth-child(1) {
        grid-area: name;
    }

    /* type ("Sponsor Anak") — bottom right */
    .dash-table tbody td:nth-child(2) {
        grid-area: type;
        justify-self: end;
    }

    /* date — bottom left */
    .dash-table tbody td:nth-child(3) {
        grid-area: date;
    }

    /* date */
    .dash-table tbody td:nth-child(4) {
        display: none;
    }

    /* amount — spans the three left rows, vertically centered on the right */
    .dash-table tbody td:nth-child(5) {
        grid-area: amount;
        justify-self: end;
        align-self: center;
        text-align: right;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-weight: 700;
    }

    /* Mobile: show the real check-circle SVG next to the amount (on desktop the
       check lives in the status pill, which is hidden on these cards). */
    .dash-table__amount-check {
        display: inline-flex;
        flex-shrink: 0;
    }

    .dash-table tbody td:nth-child(6) {
        display: none;
    }

    /* invoice button - hide */

    /* Donor avatar smaller on mobile */
    .dash-table__avatar {
        width: 32px;
        height: 32px;
    }

    .dash-table__donor-name {
        font-size: 13px;
        font-weight: 700;
    }

    .dash-table tbody td:nth-child(2) .dash-pill {
        background: transparent;
        padding: 0;
        border-radius: 0;
        font-size: 13px;
        font-weight: 600;
        line-height: 1.2;
    }

    .dash-table tbody td:nth-child(2) .dash-pill--sponsor {
        color: #049551;
    }

    .dash-table tbody td:nth-child(2) .dash-pill--general {
        color: #6941C6;
    }

    .dash-table tbody td:nth-child(2) .dash-pill--campaign {
        color: #B54708;
    }

    .dash-table tbody td:nth-child(2) .dash-pill--savings {
        color: #1e57c6;
    }

    .dash-table tbody td:nth-child(2) .dash-pill--gifts {
        color: #c0322f;
    }

    .dash-table__date {
        font-size: 12px;
        color: var(--dash-text-muted);
        font-weight: 500;
    }

    .dash-table__amount {
        font-size: 14px;
        font-weight: 700;
        color: var(--dash-text-main);
    }

    /* Hide the table wrapper's overflow scroll — cards stack naturally */
    .dash-table-wrapper {
        overflow: visible;
        margin-bottom: 0;
    }

    .dash-table.sponsortable {
        background: transparent;
        border: none;
    }

    .dash-table,
    .dash-table.sponsortable {
        min-width: 0;
        width: 100%;
    }
}

/* ==========================================================================
   SEND MESSAGE MODAL (dcp-msg-modal) — child-profile "Send a Message" CTA
   ========================================================================== */
.dcp-msg-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
}

.dcp-msg-modal.is-open {
    display: block;
}

.dcp-msg-modal__scrim {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.dcp-msg-modal__sheet {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 32px);
    max-width: 520px;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    background: var(--dash-white);
    border-radius: 22px;
    padding: 140px 28px 28px;
    animation: dcpMsgIn 0.22s ease;
}

@keyframes dcpMsgIn {
    from {
        opacity: 0;
        transform: translate(-50%, -46%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.dcp-msg-modal__head {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    display: flex;
    justify-content: flex-end;
}

.dcp-msg-modal__icon-btn {
    background: #0000000A;
    border: 0;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--dash-text-main);
    cursor: pointer;
    transition: background 0.15s ease;
}

.dcp-msg-modal__icon-btn:hover {
    background: #f1f5f9;
}

/* Avatar floats over the modal top edge */
.dcp-msg-modal__avatar {
    width: 72px;
    height: 72px;
    border-radius: 24px;
    overflow: hidden;
    border: 2px solid #049551;
    margin: -100px auto 16px;
    background: var(--dash-card-bg);
    position: relative;
    z-index: 1;
}

.dcp-msg-modal__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 10%;
    display: block;
}

.dcp-msg-modal__title {
    margin: 0 0 24px;
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    color: var(--dash-text-main);
    line-height: 1.25;
    font-family: var(--pa-font-headline, inherit);
}

.dcp-msg-modal__form {
    display: block;
}

.dcp-msg-modal__label {
    display: block;
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--dash-text-main);
}

.dcp-msg-modal__textarea {
    display: block;
    width: 100%;
    min-height: 130px;
    padding: 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 24px;
    background: var(--dash-white);
    color: var(--dash-text-main);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.55;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}

.dcp-msg-modal__textarea:focus {
    outline: none;
    border-color: var(--pa-primary);
}

.dcp-msg-modal__status {
    margin: 8px 2px 0;
    min-height: 18px;
    font-size: 13px;
    color: var(--dash-text-muted);
    text-align: center;
}

.dcp-msg-modal__submit {
    display: block;
    width: 100%;
    margin-top: 18px;
    padding: 16px 24px;
    background: var(--pa-primary);
    color: #fff;
    font-family: inherit;
    font-size: 20px;
    font-weight: 700;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    transition: filter 0.15s ease;
}

.dcp-msg-modal__submit:hover {
    filter: brightness(0.95);
}

.dcp-msg-modal__submit:disabled {
    opacity: 0.6;
    cursor: progress;
}

/* ── Tablet + mobile (≤1230px): modal becomes a full-screen page so the
   send-message flow feels native. Avatar sits INSIDE the modal (not
   floating over the top edge anymore) and a thin divider sits below the
   title to match the design. ── */
@media (max-width: 1230px) {
    .dcp-msg-modal__sheet {
        position: fixed;
        inset: 0;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: none;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        transform: none;
        padding: 70px 22px 28px;
        box-shadow: none;
        animation: dcpMsgFadeIn 0.2s ease;
        overflow-y: auto;
        background: var(--dash-white);
    }

    @keyframes dcpMsgFadeIn {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }

    .dcp-msg-modal__scrim {
        display: none;
        /* sheet is opaque + fullscreen, no scrim needed */
    }

    .dcp-msg-modal__head {
        top: 18px;
        left: 16px;
        right: 16px;
    }

    /* Avatar sits inline (not floating over an edge) */
    .dcp-msg-modal__avatar {
        width: 80px;
        height: 80px;
        margin: 0 auto 18px;
        border-radius: 18px;
        border: 2px solid var(--pa-primary);
    }

    .dcp-msg-modal__title {
        margin: 0 0 18px;
        padding-bottom: 18px;
        border-bottom: 1px solid #e2e8f0;
        font-size: 18px;
    }

    .dcp-msg-modal__textarea {
        min-height: 150px;
    }
}

@media (max-width: 480px) {
    .dcp-msg-modal__sheet {
        padding: 64px 18px 24px;
    }

    .dcp-msg-modal__avatar {
        width: 72px;
        height: 72px;
    }

    .dcp-msg-modal__title {
        font-size: 17px;
    }
}