/*
 * Phone-friendly admin (owner request 2026-08-11). Filament is roughly
 * responsive already; these rules fix what actually hurts on a phone:
 * cramped padding, tiny tap targets, modals bigger than the screen, and
 * iOS zooming into every input. Tables additionally hide their secondary
 * columns below md via visibleFrom() in each resource.
 */
/* ALL widths: when a table is wider than the window, its row actions
   (Revert, Looks fine, Refund…) stay pinned at the right edge instead of
   scrolling out of reach (owner report 2026-08-11, Profile changes). */
.fi-ta-table tr:has(.fi-ta-actions) > td:last-child,
.fi-ta-table tr:has(.fi-ta-actions) > th:last-child {
    position: sticky;
    right: 0;
    background-color: rgb(255 255 255 / 0.97);
}
.dark .fi-ta-table tr:has(.fi-ta-actions) > td:last-child,
.dark .fi-ta-table tr:has(.fi-ta-actions) > th:last-child {
    background-color: rgb(24 24 27 / 0.97);
}

@media (max-width: 767px) {

    /* Reclaim screen space: the desktop padding wastes a third of a phone. */
    .fi-main {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    .fi-page > section,
    .fi-section-content-ctn {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Page header: title on one line, actions wrapping below it with
       finger-sized targets. */
    .fi-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.625rem;
    }
    .fi-header-heading {
        font-size: 1.25rem !important;
        line-height: 1.3;
    }
    .fi-header .fi-ac {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .fi-btn {
        min-height: 2.75rem; /* 44px Apple/Google touch minimum */
    }

    /* Tables: momentum scrolling instead of a stuck two-finger fight. */
    .fi-ta-content {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .fi-ta-cell {
        padding-top: 0.625rem;
        padding-bottom: 0.625rem;
    }

    /* Modals own the whole screen — a half-height dialog with its own inner
       scrollbar is unusable with a keyboard open. */
    .fi-modal-window {
        max-width: 100vw !important;
        width: 100vw !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    /* 16px inputs stop iOS Safari from zooming the page on focus. */
    .fi-input,
    .fi-select-input,
    .fi-fo-field-wrp input,
    .fi-fo-field-wrp select,
    .fi-fo-field-wrp textarea {
        font-size: 16px !important;
    }

    /* Dashboard/stat widgets stack instead of squeezing. */
    .fi-wi-stats-overview-stats-ctn {
        grid-template-columns: 1fr !important;
    }
}
