/* Custom overrides */

/* iOS Safari auto-zooms inputs smaller than 16px. Keep them readable to prevent stuck zoom. */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 768px) {
        input[type="text"],
        input[type="search"],
        input[type="number"],
        input[type="tel"],
        input[type="email"],
        input[type="url"],
        input[type="password"],
        select,
        textarea,
        .form-control,
        .form-select,
        .select2-container .select2-selection,
        .select2-container--default .select2-selection--single,
        .select2-container--default .select2-selection--multiple,
        .select2-container .select2-selection__rendered,
        .select2-search__field {
            font-size: 16px !important;
        }
    }
}

/* Mobile sidebar scroll fix (iOS/Android) */
@media (max-width: 1024px) {
    .dash-sidebar .navbar-wrapper {
        height: 100dvh;
        height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .dash-sidebar .navbar-content {
        flex: 1 1 auto;
        height: calc(100dvh - 70px);
        height: calc(100vh - 70px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .dash-sidebar .navbar-content .simplebar-content-wrapper {
        height: 100% !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }
}

/* Roles permissions table */
table.datatable td.Permission {
    white-space: normal;
}

table.datatable td.Permission .permission-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    align-items: flex-start;
    max-width: 100%;
}

table.datatable td.Permission .permission-inner .badge {
    white-space: normal;
    word-break: break-word;
    line-height: 1.2;
}
