.expenses-overview {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
    display: grid;
    gap: 16px;
}

.expenses-overview,
.expenses-overview * {
    box-sizing: border-box;
}

.expenses-overview .panel {
    width: 100%;
    padding: 16px;
}

.expenses-overview__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.expenses-overview__titleWrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.expenses-overview__scopeIndicator {
    font-size: .82rem;
    line-height: 1.2;
    font-weight: 500;
    color: rgba(15, 23, 42, .72);
}

.expenses-overview__state {
    margin: 10px 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(0,0,0,.04);
}

    .expenses-overview__state.is-error {
        background: rgba(255,0,0,.08);
        white-space: pre-line;
    }

.ov-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ov-row {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,.08);
    background: #fff;
    box-shadow: var(--rk-shadow-card);
}

.ov-row__main {
    width: 100%;
    display: grid;
    grid-template-columns: 1.6fr 0.8fr 0.7fr 0.8fr auto;
    gap: 10px;
    align-items: center;
    padding: 12px 12px;
    background: transparent;
    border: 0;
    cursor: pointer;
    text-align: left;
    color: inherit;
    -webkit-text-fill-color: currentColor;
}

.ov-row__col {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ov-row__total {
    font-weight: 600;
}

.ov-row__imgBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    text-decoration: none;
}

.ov-row__chev {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: transform 200ms ease;
}

.ov-row.is-open .ov-row__chev {
    transform: rotate(180deg);
}

/* Details slide animatie */
.ov-details {
    max-height: 0px;
    overflow: hidden;
    transition: max-height 260ms ease;
    border-top: 1px solid rgba(0,0,0,.06);
    background: rgba(0,0,0,.02);
}

.ov-details__inner {
    padding: 12px;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.ov-row.is-open .ov-details__inner {
    opacity: 1;
    transform: translateY(0);
}

.ov-details__actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 45px;
    padding: 4px 0 12px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(0,0,0,.08);
}

.ov-details__loading,
.ov-details__empty,
.ov-details__error {
    padding: 8px 2px;
    opacity: 0.9;
}

.expenses-overview .ov-lines {
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.expenses-overview .ov-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 70px) minmax(0, 120px);
    gap: 10px;
    padding: 10px 4px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    border-bottom: 1px solid rgba(0,0,0,.08);
    min-width: 0;
    align-items: center;
}

.expenses-overview .ov-line:last-child {
    border-bottom: 0;
}

.ov-line__desc,
.ov-line__qty,
.ov-line__total {
    min-width: 0;
}

.ov-line__desc {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.ov-line--disabled {
    opacity: .55;
}

.ov-line--disabled .ov-line__desc {
    text-decoration: line-through;
}

.ov-line--disabled .ov-line__desc .ov-pill {
    text-decoration: none;
}

.ov-line--disabled .ov-line__total {
    text-decoration: line-through;
}

.ov-pill {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .8rem;
    padding: .1rem .45rem;
    border-radius: 999px;
    border: 1px solid #ddd;
    background: #f4f4f4;
    color: #666;
    margin-left: .35rem;
    white-space: nowrap;
}

.ov-pill--disabled {
    border-color: #ddd;
    background: #f4f4f4;
    color: #666;
}

.ov-line__qty,
.ov-line__total {
    text-align: right;
    font-variant-numeric: tabular-nums;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Popup image */
.ov-imgPopup__wrap {
    width: 100%;
}

.ov-imgPopup__img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 14px;
}

.ov-imgPopup__pdf {
    width: 100%;
    height: 80vh;
    border: 0;
}

.ov-row__actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ov-row__iconBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 10px;
}

.ov-row__iconBtn--danger {
    opacity: .9;
}

.expenses-overview__headerActions {
    display: flex;
    gap: .5rem;
    align-items: center;
}

.ov-filter {
    position: relative;
}

.ov-filter__panel {
    position: absolute;
    right: 0;
    top: calc(100% + .5rem);
    min-width: 320px;
    background: #fff;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 12px;
    padding: .75rem;
    box-shadow: 0 10px 30px rgba(0,0,0,.12);
    z-index: 50;
}

.ov-filter__row {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin-bottom: .75rem;
}

.ov-filter__label {
    font-size: .9rem;
    opacity: .85;
}

.ov-filter__select,
.ov-filter__date {
    width: 100%;
    padding: .45rem .55rem;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,.15);
}

.ov-filter__dates {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.ov-filter__dateSep {
    opacity: .7;
    font-size: .9rem;
}

.ov-filter__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: .25rem;
}

.ov-filter__actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: .75rem;
}

.ov-filter__clear {
    font-size: .95rem;
    text-decoration: underline;
    cursor: pointer;
    opacity: .85;
    display: inline-flex;
    align-items: center;
    line-height: normal; /* important: don't force 1 */
    padding: .45rem 0;
    transform: translate(0, -7px);
}

#ovFilterApplyBtn {
    margin: 0;
}


.ov-filter__clear:hover {
    opacity: 1;
}

.ov-filter__close {
    display: flex;
    justify-content: center;
    margin-top: .25rem;
}

.ov-filter__closeBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 0;
    background: transparent;
    cursor: pointer;
    opacity: .7;
    margin: 0;
    padding: 0;
}

    .ov-filter__closeBtn:hover {
        opacity: 1;
        background: rgba(0,0,0,.05);
    }



@media (pointer: coarse) {
    .ov-filter__closeBtn {
        width: 24px;
        height: 24px; /* nicer tap target on mobile */
    }
}



@media (max-width: 768px) {
    .ov-row__main {
        grid-template-columns: 1fr auto auto; /* content + icon + chevron */
        grid-template-areas:
            "store img chev"
            "date  img chev"
            "total img chev";
        row-gap: 6px;
        column-gap: 10px;
        align-items: center;
    }

    .ov-row__store {
        grid-area: store;
    }

    .ov-row__date {
        grid-area: date;
        opacity: 0.85;
        font-size: 0.95em;
    }

    /* Items tellertje verbergen op mobiel (optioneel) */
    .ov-row__items {
        display: none;
    }

    .ov-row__total {
        grid-area: total;
        font-weight: 700;
    }

    .ov-row__imgBtn {
        grid-area: img;
        align-self: center; /* midden */
        justify-self: end; /* rechts */
        width: 40px;
        height: 40px;
    }

    .ov-row__chev {
        grid-area: chev;
        align-self: center; /* midden */
        justify-self: end; /* helemaal rechts */
        width: 40px;
        height: 40px;
    }

    /* Zorg dat lange winkelnaam netjes afkapt */
    .ov-row__store,
    .ov-row__date,
    .ov-row__total {
        min-width: 0;
    }
}

.expenses-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    border: 0;
    background: var(--color-primary, #1d4ed8);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(0,0,0,.25);
    z-index: 60;
}

.expenses-fab svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.4;
    color: white;
}

.expenses-fab:hover {
    filter: brightness(1.05);
}

@media (max-width: 600px) {
    .expenses-fab {
        right: 16px;
        bottom: 16px;
    }
}

/* Upload popup tweaks: avoid global button margin-top inside the popup */
.rk-expenseUpload .btn-primary,
.rk-expenseUpload .btn-secondary {
    margin-top: 0;
}

.rk-expenseUpload__giftLink {
    align-self: center;
    border: 0;
    background: transparent;
    color: var(--color-primary, #1d4ed8);
    text-decoration: underline;
    font-size: .92rem;
    padding: 4px 6px 0;
    cursor: pointer;
    opacity: .9;
    margin: 0;
}

.rk-expenseUpload__giftLink:hover {
    opacity: 1;
}

.rk-expenseUpload__giftLink:disabled {
    opacity: .45;
    cursor: not-allowed;
}


