/* ==========================================================================
   Add an expense from a receipt
   ========================================================================== */

.receipt-upload__form {
    display: grid;
    gap: 1rem;
}

.receipt-upload__drop {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: 2rem 1rem;
    background: var(--edit-soft);
    border: 2px dashed var(--edit-line);
    border-radius: .5rem;
    color: var(--edit-muted);
    text-align: center;
    cursor: pointer;
}

.receipt-upload__drop:hover,
.receipt-upload__drop:focus-within {
    border-color: #0078e7;
}

/* The whole box is the click target; the input itself is visually hidden */
.receipt-upload__drop input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.receipt-upload__file {
    color: var(--edit-ink);
    font-weight: 600;
    word-break: break-all;
}

.receipt-upload__preview {
    max-width: 100%;
    max-height: 24rem;
    border-radius: .25rem;
}

.receipt-upload__status {
    align-self: center;
    color: var(--edit-muted);
}

/* ==========================================================================
   Emailed receipts inbox
   ========================================================================== */

/* Full width like the bank import page, so flipping between the inbox's two pages doesn't shift the layout */
.expense-edit-page.email-receipts {
    max-width: none;
}

.email-receipts .expense-edit-page__header p {
    max-width: 48rem;
}

.email-receipts__address {
    font-weight: 600;
    word-break: break-all;
}

.email-receipts__hint,
.email-receipts__empty,
.email-receipts__source {
    color: var(--edit-muted);
}

.email-receipts__list {
    display: grid;
    gap: .75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.email-receipts__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .75rem 1rem;
    background: var(--edit-soft);
    border: 1px solid var(--edit-line);
    border-radius: .5rem;
}

.email-receipts__item--failed {
    border-left: 4px solid #ca3c3c;
}

.email-receipts__details {
    display: grid;
    gap: .25rem;
    min-width: 0;
}

.email-receipts__actions {
    display: flex;
    gap: .5rem;
}

.email-receipts__actions form {
    margin: 0;
}

/* ==========================================================================
   Possible duplicates, on the create form and the emailed-receipts inbox
   ========================================================================== */

/* Inline in the form, not an .alert: those are flash toasts that float and fade */
.expense-duplicates {
    display: flex;
    gap: .6rem;
    align-items: baseline;
    margin: 1.25rem 0 0;
    padding: .6rem .85rem;
    border-left: 3px solid #e0a100;
    border-radius: .25rem;
    background: #fffaeb;
    color: #6b5200;
    font-size: .875rem;
}

.expense-duplicates__icon {
    color: #e0a100;
}

.expense-duplicates__list {
    margin: .25rem 0 0;
    padding: 0;
    list-style: none;
}

.expense-duplicates__list a {
    font-weight: 600;
}

.email-receipts__dupe {
    color: #8a6d3b;
}
