/* License Plate Log mobile enhancements - Revision 1.2.32 */
.log-table th,
.log-table td {
    padding: .45rem .55rem;
    vertical-align: middle;
}

.log-table .col-select {
    min-width: 7rem;
}

.log-table .col-plate {
    min-width: 7rem;
    position: sticky;
    left: 0;
    z-index: 3;
    background: #f3f5f8;
}

.log-table tbody .entry-plate {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    font-weight: 700;
    white-space: nowrap;
}

.compact-action-cell {
    min-width: 10.5rem !important;
    white-space: nowrap !important;
    padding: .35rem .45rem !important;
}

/* The legacy stylesheet makes .inline-actions vertical. Override that exact rule. */
.compact-action-cell > .inline-actions,
.compact-action-cell .inline-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    gap: .3rem !important;
    width: max-content !important;
    margin: 0 !important;
}

.compact-action-cell .inline-actions > button,
.compact-action-cell .inline-actions > a,
.compact-row-action {
    display: inline-flex !important;
    flex: 0 0 2.25rem !important;
    align-items: center !important;
    justify-content: center !important;
    width: 2.25rem !important;
    height: 2.25rem !important;
    min-width: 2.25rem !important;
    max-width: 2.25rem !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: .45rem !important;
    font-size: 1rem !important;
    line-height: 1 !important;
}

.duplicate-cleanup-button,
.success {
    background: #18864b !important;
    border-color: #18864b !important;
    color: #fff !important;
}

.duplicate-cleanup-button:hover {
    background: #126d3c !important;
}

.bulk-actions {
    align-items: center;
}

.entry-plate a,
.entry-plate {
    color: #174ea6;
}

/* Make details/edit/delete dialogs use a fixed-height flex shell with a scrollable body. */
#entryDetailsOverlay,
#entryEditorOverlay,
#deleteEntryOverlay {
    overscroll-behavior: contain;
}

#entryDetailsOverlay .photo-overlay-panel,
#entryEditorOverlay .photo-overlay-panel,
#deleteEntryOverlay .photo-overlay-panel {
    display: flex !important;
    flex-direction: column !important;
    max-height: calc(100dvh - 2rem) !important;
    overflow: hidden !important;
}

#entryDetailsOverlay .photo-overlay-header,
#entryEditorOverlay .photo-overlay-header,
#deleteEntryOverlay .photo-overlay-header {
    flex: 0 0 auto;
    position: sticky;
    top: 0;
    z-index: 2;
}

#entryDetailsOverlay .entry-editor-body,
#entryEditorOverlay .entry-editor-body,
#deleteEntryOverlay .entry-editor-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

#entryEditorOverlay form,
#deleteEntryOverlay form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: calc(100dvh - 2rem);
}

#entryEditorOverlay .entry-editor-actions,
#deleteEntryOverlay .entry-editor-actions {
    flex: 0 0 auto;
}

@media (max-width: 760px) {
    .log-table th,
    .log-table td {
        padding: .32rem .4rem;
    }

    .row-select-option span {
        display: none;
    }

    .log-table .col-select {
        min-width: 3.2rem;
    }

    .compact-action-cell {
        min-width: 9.7rem !important;
    }

    .compact-action-cell .inline-actions > button,
    .compact-action-cell .inline-actions > a,
    .compact-row-action {
        flex-basis: 2rem !important;
        width: 2rem !important;
        height: 2rem !important;
        min-width: 2rem !important;
        max-width: 2rem !important;
        font-size: .9rem !important;
    }

    .bulk-actions button {
        padding: .65rem .8rem;
        font-size: .95rem;
    }

    .log-table tbody tr {
        height: auto !important;
    }

    .log-table .col-plate,
    .log-table tbody .entry-plate {
        left: 0;
        box-shadow: 2px 0 3px rgba(0, 0, 0, .08);
    }

    .photo-overlay {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    #entryDetailsOverlay .photo-overlay-panel,
    #entryEditorOverlay .photo-overlay-panel,
    #deleteEntryOverlay .photo-overlay-panel {
        width: 100vw !important;
        max-width: 100vw !important;
        max-height: 88dvh !important;
        border-radius: 16px 16px 0 0 !important;
        border-bottom: 0 !important;
    }

    #entryDetailsOverlay .entry-details-grid {
        grid-template-columns: minmax(7.5rem, 42%) minmax(0, 1fr) !important;
        gap: .65rem .8rem !important;
    }

    #entryDetailsOverlay .entry-details-grid > * {
        min-width: 0;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 760px) and (orientation: landscape) {
    #entryDetailsOverlay .photo-overlay-panel,
    #entryEditorOverlay .photo-overlay-panel,
    #deleteEntryOverlay .photo-overlay-panel {
        max-height: 82dvh !important;
        width: min(92vw, 760px) !important;
        border-radius: 14px 14px 0 0 !important;
    }
}
