/* Post-Annahmestelle page (mw-pa-*) — one full-width MwDataGrid with the grid-swap
   feature: deliveries register as the primary grid, the desk's inbox (its own
   independent Email grid with detail-row previews) slides in under the same toolbar. */

.mw-pa-layout {
    display: flex;
    gap: 12px;
    padding: 12px;
    box-sizing: border-box;
    /* NOTE: Same dense-appbar height math as the Inventory page (mw-im-layout) — the app uses a
       DENSE MudAppBar, so MudMainContent's padding-top is appbar*0.75; subtract that instead of
       the full appbar to fill exactly to the viewport bottom. */
    height: calc(100vh - var(--mud-appbar-height) + var(--mud-appbar-height) / 4);
}

/* Swap-pane empty state — shown when no Post-Annahmestelle inbound address is configured */
.mw-pa-mail-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    text-align: center;
    color: var(--mud-palette-text-secondary);
}

/* Right panel — the deliveries grid */
.mw-pa-grid {
    flex: 1;
    min-width: 0;
}

/* Date cells — keep the popover picker's input chromeless and row-height friendly.
   No calendar adornment; the date text itself is the click target (pointer cursor). */
.mw-pa-date-cell {
    margin: 0;
}

.mw-pa-date-cell .mud-input {
    font-size: 0.875rem;
}

.mw-pa-date-cell input {
    cursor: pointer;
}

.mw-pa-date-cell .mud-input.mud-input-underline:before,
.mw-pa-date-cell .mud-input.mud-input-underline:after {
    border-bottom: none;
}

/* Status banners (account page + My Teams frames) — the whole alert is the click target */
.mw-pa-banner {
    cursor: pointer;
    margin-bottom: 8px;
}

/* The clear (X) button stays subtle until the cell is hovered */
.mw-pa-date-cell .mud-input-clear-button {
    opacity: 0;
    transition: opacity 120ms ease;
}

.mw-pa-date-cell:hover .mud-input-clear-button {
    opacity: 1;
}

/* Narrow viewports: fixed grid height instead of viewport-filling flex */
@media (max-width: 960px) {
    .mw-pa-layout {
        height: auto;
    }

    .mw-pa-grid {
        height: 600px;
    }
}

/* Inbox grid — unread row emphasis + the dot cell */
.mw-pa-mail-row--unread .mw-dg-cell {
    font-weight: 600;
}

.mw-pa-unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mud-palette-primary);
    display: inline-block;
}

/* Detail-row mail preview — the mail keeps its own (usually light) styling, so it
   renders on a white sheet inside the dark detail row */
.mw-pa-mail-preview-wrap {
    padding: 10px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mw-pa-mail-preview {
    background: #ffffff;
    color: #222222;
    border-radius: 8px;
    padding: 16px 20px;
    max-height: 420px;
    overflow: auto;
    line-height: 1.55;
}

.mw-pa-mail-preview img {
    max-width: 100%;
    height: auto;
}

.mw-pa-mail-preview pre {
    white-space: pre-wrap;
    font-family: inherit;
    margin: 0;
}
