﻿/* =========================================================
   Resident Expenses
   Glassmorphism / RTL / Responsive
   ========================================================= */

.resident-expenses-page {
    min-height: calc(100vh - 70px);
    position: relative;
    overflow: hidden;
    background: radial-gradient( circle at 8% 12%, rgba(16, 185, 129, .12), transparent 25% ), radial-gradient( circle at 92% 18%, rgba(59, 130, 246, .10), transparent 25% ), radial-gradient( circle at 55% 95%, rgba(20, 184, 166, .08), transparent 28% ), #f5f7fb;
    color: #172033;
    isolation: isolate;
}

.resident-expenses-container {
    position: relative;
    z-index: 2;
    max-width: 1500px;
    margin: 0 auto;
    padding: 30px 28px 45px;
}


/* =========================================================
   Shared Glass
   ========================================================= */

.resident-expenses-page .glass-panel,
.resident-expenses-page .glass-card {
    background: rgba(255, 255, 255, .58);
    border: 1px solid rgba(255, 255, 255, .78);
    box-shadow: 0 18px 45px rgba(31, 41, 55, .07), inset 0 1px 0 rgba(255, 255, 255, .85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}


/* =========================================================
   Hero
   ========================================================= */

.expenses-hero {
    min-height: 175px;
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 32px 38px;
    margin-bottom: 28px;
}

    .expenses-hero::before {
        content: "";
        position: absolute;
        width: 230px;
        height: 230px;
        top: -120px;
        right: -70px;
        border-radius: 50%;
        background: rgba(16, 185, 129, .14);
        filter: blur(25px);
        pointer-events: none;
    }

    .expenses-hero::after {
        content: "";
        position: absolute;
        width: 180px;
        height: 180px;
        bottom: -110px;
        left: 18%;
        border-radius: 50%;
        background: rgba(59, 130, 246, .08);
        filter: blur(28px);
        pointer-events: none;
    }

.expenses-hero-icon {
    position: relative;
    z-index: 2;
    width: 76px;
    height: 76px;
    flex: 0 0 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 23px;
    color: #fff;
    font-size: 1.7rem;
    background: linear-gradient(135deg, #10b981, #06b6d4);
    box-shadow: 0 16px 32px rgba(16, 185, 129, .25), inset 0 1px 0 rgba(255,255,255,.35);
}

.expenses-hero-content {
    position: relative;
    z-index: 2;
}

.expenses-eyebrow {
    display: block;
    margin-bottom: 6px;
    color: #94a3b8;
    font-size: .73rem;
    font-weight: 600;
}

.expenses-hero h1 {
    margin: 0 0 7px;
    font-size: clamp(1.45rem, 2.3vw, 2rem);
    font-weight: 750;
    letter-spacing: -.025em;
}

.expenses-hero p {
    margin: 0;
    color: #718096;
    font-size: .82rem;
    line-height: 1.8;
}


/* =========================================================
   Section Heading
   ========================================================= */

.expenses-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

    .expenses-section-heading > div:first-child {
        display: flex;
        flex-direction: column;
        gap: 3px;
    }

    .expenses-section-heading span {
        color: #94a3b8;
        font-size: .68rem;
        font-weight: 600;
    }

    .expenses-section-heading h2 {
        margin: 0;
        font-size: 1.18rem;
        font-weight: 700;
    }

.expenses-count {
    padding: 7px 13px;
    border-radius: 999px;
    background: rgba(16, 185, 129, .08);
    border: 1px solid rgba(16, 185, 129, .12);
    color: #059669;
    font-size: .68rem;
    white-space: nowrap;
}


/* =========================================================
   Expense Grid
   ========================================================= */

.expenses-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.expense-card-link {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.expense-card {
    position: relative;
    height: 100%;
    min-height: 220px;
    overflow: hidden;
    border-radius: 25px;
    padding: 23px;
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}

    .expense-card::before {
        content: "";
        position: absolute;
        width: 125px;
        height: 125px;
        top: -55px;
        right: -48px;
        border-radius: 50%;
        background: #10b981;
        opacity: .10;
        filter: blur(5px);
    }

    .expense-card::after {
        content: "";
        position: absolute;
        width: 150px;
        height: 150px;
        right: -75px;
        bottom: -95px;
        border-radius: 50%;
        background: #10b981;
        opacity: .16;
        filter: blur(30px);
        transition: opacity .3s ease;
    }

.expense-card-top,
.expense-card-content,
.expense-card-bottom {
    position: relative;
    z-index: 2;
}


/* =========================================================
   Expense Icon
   ========================================================= */

.expense-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.expense-icon {
    width: 53px;
    height: 53px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 17px;
    color: #059669;
    font-size: 1.1rem;
    background: rgba(16, 185, 129, .11);
    border: 1px solid rgba(255,255,255,.72);
    box-shadow: 0 9px 22px rgba(31,41,55,.07), inset 0 1px 0 rgba(255,255,255,.75);
}

.expense-date {
    color: #94a3b8;
    font-size: .65rem;
    direction: rtl;
}


/* =========================================================
   Content
   ========================================================= */

.expense-card-content {
    margin-top: 24px;
}

    .expense-card-content h3 {
        margin: 0 0 7px;
        font-size: 1rem;
        font-weight: 700;
    }

    .expense-card-content p {
        max-width: 270px;
        min-height: 39px;
        margin: 0;
        color: #718096;
        font-size: .72rem;
        line-height: 1.85;
    }


/* =========================================================
   Bottom
   ========================================================= */

.expense-card-bottom {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
}

.expense-category {
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(148,163,184,.08);
    color: #64748b;
    font-size: .6rem;
    white-space: nowrap;
}

.expense-amount {
    display: flex;
    align-items: baseline;
    gap: 5px;
    color: #059669;
    font-size: 1rem;
    font-weight: 750;
    white-space: nowrap;
}

    .expense-amount small {
        color: #94a3b8;
        font-size: .58rem;
        font-weight: 500;
    }


/* =========================================================
   Hover
   ========================================================= */

.expense-card-link:hover .expense-card {
    transform: translateY(-6px);
    border-color: rgba(255,255,255,.95);
    box-shadow: 0 25px 55px rgba(31,41,55,.11), inset 0 1px 0 rgba(255,255,255,.95);
}

    .expense-card-link:hover .expense-card::after {
        opacity: .28;
    }

.expense-card-link:hover .expense-icon {
    transform: translateY(-2px);
}

.expense-icon {
    transition: transform .3s ease;
}


/* =========================================================
   Empty State
   ========================================================= */

.expenses-empty {
    min-height: 270px;
    border-radius: 26px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
}

.expenses-empty-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    border-radius: 20px;
    color: #94a3b8;
    font-size: 1.4rem;
    background: rgba(148,163,184,.08);
    border: 1px solid rgba(148,163,184,.10);
}

.expenses-empty h3 {
    margin: 0 0 7px;
    font-size: .98rem;
}

.expenses-empty p {
    margin: 0;
    color: #94a3b8;
    font-size: .7rem;
}


/* =========================================================
   Tablet
   ========================================================= */

@media (max-width: 991.98px) {

    .resident-expenses-container {
        padding: 25px 20px 38px;
    }

    .expenses-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .expenses-hero {
        padding: 30px;
    }
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 767.98px) {

    .resident-expenses-page {
        min-height: 100dvh;
    }

    .resident-expenses-container {
        padding: 18px 14px 30px;
    }

    .expenses-hero {
        min-height: 0;
        padding: 22px 20px;
        border-radius: 23px;
        gap: 15px;
        margin-bottom: 22px;
    }

    .expenses-hero-icon {
        width: 55px;
        height: 55px;
        flex-basis: 55px;
        border-radius: 17px;
        font-size: 1.15rem;
    }

    .expenses-eyebrow {
        font-size: .61rem;
    }

    .expenses-hero h1 {
        font-size: 1.25rem;
        margin-bottom: 4px;
    }

    .expenses-hero p {
        font-size: .66rem;
        line-height: 1.7;
    }

    .expenses-section-heading {
        margin-bottom: 13px;
    }

        .expenses-section-heading span {
            font-size: .6rem;
        }

        .expenses-section-heading h2 {
            font-size: .98rem;
        }

    .expenses-count {
        padding: 6px 9px;
        font-size: .57rem;
    }

    .expenses-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .expense-card {
        min-height: 165px;
        border-radius: 20px;
        padding: 17px;
    }

    .expense-icon {
        width: 45px;
        height: 45px;
        border-radius: 14px;
        font-size: .95rem;
    }

    .expense-date {
        font-size: .58rem;
    }

    .expense-card-content {
        margin-top: 15px;
    }

        .expense-card-content h3 {
            font-size: .85rem;
            margin-bottom: 4px;
        }

        .expense-card-content p {
            min-height: 0;
            max-width: 230px;
            font-size: .63rem;
            line-height: 1.7;
        }

    .expense-card-bottom {
        margin-top: 15px;
    }

    .expense-category {
        padding: 4px 7px;
        font-size: .55rem;
    }

    .expense-amount {
        font-size: .85rem;
    }

        .expense-amount small {
            font-size: .53rem;
        }

    .expenses-empty {
        min-height: 220px;
        border-radius: 21px;
    }
}


/* =========================================================
   Very Small Phones
   ========================================================= */

@media (max-width: 380px) {

    .resident-expenses-container {
        padding-inline: 11px;
    }

    .expenses-hero {
        padding: 19px 16px;
    }

    .expenses-hero-icon {
        width: 49px;
        height: 49px;
        flex-basis: 49px;
    }

    .expenses-hero h1 {
        font-size: 1.12rem;
    }

    .expenses-hero p {
        font-size: .61rem;
    }

    .expense-card {
        padding: 15px;
    }
}


/* =========================================================
   Reduced Motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .expense-card,
    .expense-icon,
    .expense-card::after {
        transition: none;
    }
}


/* =========================================================
   Expense Details
   ========================================================= */

.expense-details-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.expense-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 8px 13px;
    border-radius: 999px;
    color: #64748b;
    background: rgba(255,255,255,.58);
    border: 1px solid rgba(255,255,255,.78);
    box-shadow: 0 8px 20px rgba(31,41,55,.05);
    font-size: .68rem;
    text-decoration: none;
    transition: all .25s ease;
}

    .expense-back-link:hover {
        color: #059669;
        transform: translateX(3px);
    }

.expense-details-card {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    padding: 34px;
}

    .expense-details-card::before {
        content: "";
        position: absolute;
        width: 300px;
        height: 300px;
        top: -170px;
        right: -120px;
        border-radius: 50%;
        background: rgba(16,185,129,.12);
        filter: blur(25px);
        pointer-events: none;
    }

.expense-details-header,
.expense-details-divider,
.expense-details-amount,
.expense-details-description,
.expense-details-meta {
    position: relative;
    z-index: 2;
}

.expense-details-header {
    display: flex;
    align-items: center;
    gap: 22px;
}

.expense-details-icon {
    width: 78px;
    height: 78px;
    flex: 0 0 78px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    color: #fff;
    font-size: 1.65rem;
    background: linear-gradient(135deg, #10b981, #06b6d4);
    box-shadow: 0 16px 32px rgba(16,185,129,.24), inset 0 1px 0 rgba(255,255,255,.4);
}

.expense-details-title {
    min-width: 0;
}

.expense-details-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: #059669;
    font-size: .68rem;
    font-weight: 650;
}

.expense-details-title h1 {
    margin: 0 0 8px;
    font-size: clamp(1.35rem, 2.5vw, 1.8rem);
    font-weight: 750;
    letter-spacing: -.025em;
}

.expense-details-date {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #94a3b8;
    font-size: .67rem;
}

.expense-details-divider {
    height: 1px;
    margin: 30px 0;
    background: linear-gradient( to left, transparent, rgba(148,163,184,.18), transparent );
}

.expense-details-amount {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 21px 23px;
    border-radius: 21px;
    background: rgba(16,185,129,.055);
    border: 1px solid rgba(16,185,129,.09);
}

    .expense-details-amount > span {
        color: #64748b;
        font-size: .72rem;
    }

    .expense-details-amount strong {
        display: flex;
        align-items: baseline;
        gap: 6px;
        color: #059669;
        font-size: 1.35rem;
    }

    .expense-details-amount small {
        color: #64748b;
        font-size: .65rem;
        font-weight: 500;
    }

.expense-details-description {
    margin-top: 25px;
}

.expense-details-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #334155;
    font-size: .75rem;
    font-weight: 700;
}

    .expense-details-section-title i {
        color: #10b981;
    }

.expense-details-description p {
    margin: 0;
    padding: 17px 18px;
    border-radius: 17px;
    background: rgba(248,250,252,.72);
    border: 1px solid rgba(226,232,240,.7);
    color: #64748b;
    font-size: .72rem;
    line-height: 2;
    white-space: pre-line;
}

.expense-details-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 25px;
}

.expense-meta-item {
    padding: 16px 18px;
    border-radius: 17px;
    background: rgba(255,255,255,.48);
    border: 1px solid rgba(226,232,240,.55);
}

    .expense-meta-item span {
        display: block;
        margin-bottom: 6px;
        color: #94a3b8;
        font-size: .61rem;
    }

    .expense-meta-item strong {
        color: #334155;
        font-size: .7rem;
    }


/* =========================================================
   Details - Mobile
   ========================================================= */

@media (max-width: 767.98px) {

    .expense-details-wrapper {
        width: 100%;
    }

    .expense-back-link {
        margin-bottom: 13px;
        padding: 7px 11px;
        font-size: .59rem;
    }

    .expense-details-card {
        border-radius: 23px;
        padding: 21px 17px;
    }

    .expense-details-header {
        gap: 14px;
    }

    .expense-details-icon {
        width: 56px;
        height: 56px;
        flex-basis: 56px;
        border-radius: 17px;
        font-size: 1.15rem;
    }

    .expense-details-eyebrow {
        font-size: .59rem;
    }

    .expense-details-title h1 {
        margin-bottom: 5px;
        font-size: 1.08rem;
    }

    .expense-details-date {
        font-size: .57rem;
    }

    .expense-details-divider {
        margin: 22px 0;
    }

    .expense-details-amount {
        padding: 17px;
        border-radius: 17px;
    }

        .expense-details-amount > span {
            font-size: .62rem;
        }

        .expense-details-amount strong {
            font-size: 1rem;
        }

        .expense-details-amount small {
            font-size: .54rem;
        }

    .expense-details-description {
        margin-top: 19px;
    }

    .expense-details-section-title {
        font-size: .66rem;
    }

    .expense-details-description p {
        padding: 13px 14px;
        border-radius: 14px;
        font-size: .63rem;
        line-height: 1.9;
    }

    .expense-details-meta {
        gap: 9px;
        margin-top: 18px;
    }

    .expense-meta-item {
        padding: 13px;
        border-radius: 14px;
    }

        .expense-meta-item span {
            font-size: .54rem;
        }

        .expense-meta-item strong {
            font-size: .61rem;
        }
}