/* ==========================================================================
   SLP One - expenses
   The claim is a form and a table, so most of this is small: receipt
   thumbnails, the states a line can be in, and the split editor.
   ========================================================================== */

.slp-expense-table td,
.slp-expense-table th {
    vertical-align: middle;
}

/* A line that is not yet good enough to submit. Marked rather than hidden, so
   somebody can see at a glance which row still needs work. */
.slp-line-problem {
    box-shadow: inset 3px 0 0 var(--bs-warning);
}

/* The mileage line is posted by the system and cannot be edited. */
.slp-line-mileage {
    background-color: rgb(var(--bs-primary-rgb) / 4%);
}

.slp-line-mileage td {
    font-style: italic;
}

/* --- Receipt thumbnails --------------------------------------------------- */

.slp-receipt-thumb {
    display: block;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: .5rem;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-tertiary-bg, #f4f1ec);
    transition: transform .12s ease, box-shadow .12s ease;
}

.slp-receipt-thumb:hover {
    transform: scale(1.06);
    box-shadow: var(--slp-shadow-sm);
}

.slp-receipt-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.slp-receipt-missing {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: .5rem;
    border: 1px dashed var(--bs-border-color);
    color: var(--bs-secondary-color, #6c757d);
    font-size: 1.1rem;
}

/* --- The capture panel in the editor -------------------------------------- */

.slp-receipt-panel {
    border: 1px solid var(--bs-border-color);
    border-radius: var(--slp-radius);
    background: var(--bs-tertiary-bg, #f4f1ec);
    padding: 1rem;
}

.slp-receipt-preview {
    display: block;
    width: 6rem;
    height: 7.5rem;
    flex: 0 0 auto;
    border-radius: .5rem;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
}

.slp-receipt-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- Receipt inbox -------------------------------------------------------- */

.slp-drop-zone {
    border: 2px dashed var(--bs-border-color);
    border-radius: var(--slp-radius);
    background: var(--bs-tertiary-bg, #f4f1ec);
    padding: 1.5rem 1rem;
    text-align: center;
    transition: border-color .12s ease, background-color .12s ease;
}

.slp-drop-zone.is-dragging {
    border-color: var(--bs-primary);
    background: rgb(var(--bs-primary-rgb) / 8%);
}

.slp-inbox-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.slp-inbox-item .slp-receipt-preview {
    width: 4.5rem;
    height: 5.5rem;
}

/* --- Split editor --------------------------------------------------------- */

.slp-split-list {
    max-height: 16rem;
    overflow-y: auto;
    border: 1px solid var(--bs-border-color);
    border-radius: .5rem;
    padding: .5rem .75rem;
}

/* --- Dark mode ------------------------------------------------------------ */

[data-bs-theme="dark"] .slp-receipt-panel,
[data-bs-theme="dark"] .slp-drop-zone {
    background: rgb(255 255 255 / 3%);
}

[data-bs-theme="dark"] .slp-line-mileage {
    background-color: rgb(var(--bs-primary-rgb) / 10%);
}

@media (prefers-reduced-motion: reduce) {
    .slp-receipt-thumb {
        transition: none;
    }

    .slp-receipt-thumb:hover {
        transform: none;
    }
}
