/* FakturaVorratTile — Embedded-Accordion (flach, eine Zeile pro Schein). */

.pd-faktura-schein-row__reviewed {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    border: 1.5px solid var(--l-success);
    background: color-mix(in srgb, var(--l-success-bg) 55%, var(--l-bg-elevated));
    color: var(--l-success);
    flex-shrink: 0;
}

.pd-faktura-schein-row__reviewed--export-ready {
    border-color: var(--l-success);
    background: var(--l-success);
    color: var(--l-text-on-primary);
}

/* Seitenabstand der Karte enger als Standard-Fill-Tiles (Liste braucht die Breite). */
[data-testid="pd-faktura-vorrat-tile"] .pd-tile-card.pd-tile-card--fill .e-card-content {
    padding: 0.25rem 0.35rem !important;
}

[data-testid="pd-faktura-vorrat-tile"] .pd-tile-card .e-card-header {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

.faktura-vorrat-tile-body {
    container-type: inline-size;
    container-name: faktura-vorrat-tile;
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
    height: 100%;
    overflow: hidden;
}

.faktura-vorrat-tile-body .faktura-export--embedded {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    flex: 1 1 auto;
    min-height: 0;
}

.faktura-vorrat-tile-body .faktura-export--embedded .faktura-export__list {
    padding-right: 0.2rem;
}

.faktura-vorrat-tile-body .faktura-export--embedded .faktura-export-card__header {
    padding-left: 0.1rem;
    padding-right: 0.1rem;
}

.faktura-vorrat-tile-body .faktura-export--embedded .faktura-export-card__header.is-collapsible:hover {
    background: var(--l-bg-hover);
}

.faktura-vorrat-tile-body .faktura-export--embedded .faktura-export-card__amount {
    font-size: var(--l-text-sm);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.015em;
}

/* Icons + Titel in einer Zeile; Umbruch nur in der Titelspalte. */
.faktura-vorrat-tile-body .faktura-export--embedded .patient-name-row--embedded {
    flex-wrap: nowrap;
    align-items: flex-start;
}

.faktura-vorrat-tile-body .faktura-export--embedded .patient-name-row--embedded .faktura-export-card__toggle,
.faktura-vorrat-tile-body .faktura-export--embedded .patient-name-row--embedded .faktura-export-card__avatar {
    margin-top: 0.15rem;
}

/* Rezepte in einer Zeile, solange Platz; sonst Segment für Segment umbrechen. */
.faktura-vorrat-tile-body .faktura-export--embedded .faktura-export-card__title-row {
    display: flex;
    flex-flow: row wrap;
    align-items: baseline;
    column-gap: 0.35rem;
    row-gap: 0.12rem;
    flex: 1 1 auto;
    min-width: 0;
}

.faktura-vorrat-tile-body .faktura-export--embedded .faktura-export-card__recipe-segment {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 0.3rem;
    flex: 0 0 auto; /* nicht quetschen — lieber ganz in die nächste Zeile */
    max-width: 100%;
}

/* „|“ gehört zum Folgesegment — bei Zeilenwechsel mitnehmen, nicht am Ende hängen. */
.faktura-vorrat-tile-body .faktura-export--embedded .faktura-export-card__recipe-sep {
    flex-shrink: 0;
}

.faktura-vorrat-tile-body .faktura-export--embedded .faktura-export-card__title {
    white-space: normal;
    overflow-wrap: break-word;
    line-height: 1.35;
}

/* Breite 1 / schmale Spalte: Titel + Geprüft weiter in einer Zeile; Aktionen/Termine umbrechen. */
@container faktura-vorrat-tile (max-width: 24rem) {
    .faktura-vorrat-tile-body .faktura-export--embedded .faktura-export-card__header {
        flex-direction: row;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .faktura-vorrat-tile-body .faktura-export--embedded .faktura-export-card__info {
        flex: 1 1 auto;
        min-width: 0;
    }

    .faktura-vorrat-tile-body .faktura-export--embedded .selection-summary {
        width: auto;
        max-width: 55%;
        margin-left: auto;
        flex-shrink: 0;
        flex-wrap: wrap;
        justify-content: flex-end;
        align-items: center;
        row-gap: 0.15rem;
        column-gap: 0.35rem;
    }

    .faktura-vorrat-tile-body .faktura-export--embedded .amount-review-date--full {
        display: none;
    }

    .faktura-vorrat-tile-body .faktura-export--embedded .amount-review-date--short {
        display: inline;
        max-width: none;
        flex: 0 1 auto;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: right;
        line-height: 1.3;
    }

    .faktura-vorrat-tile-body .faktura-export--embedded .appointment-groups {
        padding-left: 0.35rem;
    }

    .faktura-vorrat-tile-body .faktura-export--embedded .group-header--embedded-actions {
        flex-wrap: wrap;
        align-items: center;
        gap: 0.25rem 0.5rem;
    }

    .faktura-vorrat-tile-body .faktura-export--embedded .group-actions {
        flex-wrap: wrap;
        align-items: center;
        width: 100%;
        gap: 0.35rem 0.5rem;
    }

    .faktura-vorrat-tile-body .faktura-export--embedded .group-actions__selection {
        border-right: none;
        padding-right: 0;
        flex-wrap: wrap;
    }

    .faktura-vorrat-tile-body .faktura-export--embedded .group-actions__recalculate.l-btn {
        margin-left: 0;
    }

    .faktura-vorrat-tile-body .faktura-export--embedded .appointment-info {
        gap: 4px 6px;
    }

    .faktura-vorrat-tile-body .faktura-export--embedded .appointment-row {
        align-items: flex-start;
    }

    .faktura-vorrat-tile-body .faktura-export--embedded .schein-secondary-meta {
        flex-wrap: wrap;
        gap: 0.15rem 0.35rem;
    }
}
