/* Repository-wide responsive safeguards for legacy Blade UI. */
html {
    max-width: 100%;
}

body {
    min-width: 0;
}

img,
svg,
canvas,
video,
iframe {
    max-width: 100%;
}

img,
video {
    height: auto;
}

.content-wrapper,
.content,
.panel,
.panel-body,
.panel-heading,
.card,
.modal-content,
.luma-card,
.luma-widget,
.luma-page-shell,
.luma-page,
.serene-shell,
.serene-main {
    min-width: 0;
    max-width: 100%;
}

.panel-heading,
.panel-body,
.luma-card__header,
.luma-card__footer,
.luma-page-hero,
.luma-page-toolbar,
.luma-actions,
.icons-list,
.btn-toolbar,
.form-actions,
.luma-form-actions,
.luma-filter-actions,
.luma-table-toolbar,
.serene-header,
.serene-header__start,
.serene-header__end,
.serene-header__actions {
    min-width: 0;
}

.table-responsive,
.luma-table-wrap,
.pg-table-wrap,
.pm-table-wrap,
.banks-table-wrap,
.invoice-table-wrap,
.luma-api-client-keys-table,
.luma-api-keys-table-responsive {
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.table,
.luma-table,
.pg-table {
    overflow-wrap: normal;
}

.dropdown-menu,
.select2-container,
.select2-dropdown {
    max-width: min(92vw, 420px);
}

.dropdown-menu {
    max-height: min(60vh, 420px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    z-index: 1050;
}

.dropdown-menu > li > a,
.dropdown-menu > li > button,
.dropdown-menu > li > label,
.select2-results__option {
    overflow-wrap: anywhere;
    white-space: normal;
}

.select2-results__options {
    max-height: min(60vh, 420px) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

body.serene-provider .select2-results__options {
    max-height: 240px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

body.serene-provider .serene-dropdown__panel {
    max-width: calc(100vw - 32px);
    max-height: calc(100dvh - 88px);
    z-index: 1050;
}

body.serene-provider .serene-dropdown__list {
    max-height: min(60vh, 420px);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

body.serene-provider:not(.serene-sidebar-open) {
    overflow-x: hidden;
    overflow-y: auto;
}

body.serene-provider .serene-app,
body.serene-provider .serene-shell {
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
}

body.serene-provider .serene-shell,
body.serene-provider .serene-main {
    min-width: 0;
}

body.serene-provider .serene-main {
    flex: 1 0 auto;
    overflow: visible;
}

.form-control,
.input-group,
.select2-container,
.bootstrap-select,
.tokenfield,
.tagsinput,
textarea,
select {
    max-width: 100%;
}

.btn,
.luma-btn,
.pg-btn,
.invoice-btn {
    max-width: 100%;
    white-space: normal;
}

.btn-group,
.input-group,
.luma-actions,
.pg-actions,
.users-status-tabs,
.luma-order-tabs {
    min-width: 0;
}

.modal-dialog {
    max-width: calc(100vw - 24px);
}

.modal-content {
    max-height: calc(100vh - 24px);
    display: flex;
    flex-direction: column;
}

.modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-wrap: anywhere;
}

@media (min-width: 769px) {
    body.luma-admin-dashboard .page-content {
        display: flex;
        align-items: stretch;
        min-width: 0;
    }

    body.luma-admin-dashboard .content-wrapper {
        flex: 1 1 auto;
    }
}

@media (max-width: 1024px) {
    body.serene-provider .select2-results__options {
        max-height: 200px !important;
    }

    body.luma-admin-dashboard .content,
    body.luma-admin-dashboard .content-wrapper > .content,
    body.luma-admin-dashboard .luma-page-shell,
    body.luma-admin-dashboard .pg-artists,
    body.serene-provider .serene-main {
        padding: 20px;
    }

    body.luma-admin-dashboard .luma-page-hero,
    body.luma-admin-dashboard .panel-heading,
    body.luma-admin-dashboard .luma-card__header,
    body.serene-provider .luma-page__head {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 12px;
    }

    body.luma-admin-dashboard .luma-page-toolbar,
    body.luma-admin-dashboard .pg-artists__hero-actions,
    body.serene-provider .luma-page__actions {
        justify-content: flex-start;
    }

    body.luma-admin-dashboard .luma-filter-grid,
    body.luma-admin-dashboard .pg-filter-grid,
    body.serene-provider .luma-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    body.luma-admin-dashboard .navbar-header {
        flex-wrap: wrap;
        width: 100%;
        gap: 8px;
        padding-inline: 12px;
    }

    body.luma-admin-dashboard .navbar-brand {
        min-width: 0;
        max-width: calc(100vw - 140px);
        margin-block: 6px;
    }

    body.luma-admin-dashboard .navbar-brand > img {
        max-width: 100%;
    }

    body.luma-admin-dashboard .navbar-header > ul:not(.nav) {
        margin: 0;
        padding: 0;
    }

    body.luma-admin-dashboard #mySelect {
        max-width: 116px;
    }

    body.luma-admin-dashboard .content,
    body.luma-admin-dashboard .content-wrapper > .content,
    body.luma-admin-dashboard .luma-page-shell,
    body.luma-admin-dashboard .pg-artists,
    body.serene-provider .serene-main {
        padding: 16px;
    }

    body.serene-provider .serene-shell {
        width: 100%;
    }

    body.serene-provider .serene-sidebar {
        max-height: 100vh;
        max-height: 100dvh;
        overflow: hidden;
    }

    body.serene-provider .serene-nav {
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    body.luma-admin-dashboard .panel,
    body.luma-admin-dashboard .luma-card,
    body.serene-provider .luma-widget {
        border-radius: 12px;
    }

    body.luma-admin-dashboard .panel-heading,
    body.luma-admin-dashboard .panel-body,
    body.luma-admin-dashboard .luma-card__header,
    body.luma-admin-dashboard .luma-card__body,
    body.luma-admin-dashboard .luma-card__footer,
    body.serene-provider .luma-widget {
        padding: 14px;
    }

    body.luma-admin-dashboard .row,
    body.serene-provider .row {
        margin-inline: -8px;
    }

    body.luma-admin-dashboard [class*="col-"],
    body.serene-provider [class*="col-"] {
        padding-inline: 8px;
        min-width: 0;
    }

    body.luma-admin-dashboard .form-horizontal .control-label {
        padding-top: 0;
        margin-bottom: 6px;
        text-align: start;
    }

    body.luma-admin-dashboard .form-group,
    body.serene-provider .form-group {
        margin-bottom: 14px;
    }

    body.luma-admin-dashboard .form-actions,
    body.luma-admin-dashboard .luma-form-actions,
    body.luma-admin-dashboard .luma-filter-actions,
    body.serene-provider .luma-form-actions,
    body.serene-provider .luma-filter-actions {
        align-items: stretch;
        flex-direction: column;
        justify-content: stretch;
    }

    body.luma-admin-dashboard .form-actions .btn,
    body.luma-admin-dashboard .luma-form-actions .btn,
    body.luma-admin-dashboard .luma-form-actions .luma-btn,
    body.luma-admin-dashboard .luma-filter-actions .luma-btn,
    body.serene-provider .luma-form-actions .luma-btn,
    body.serene-provider .luma-filter-actions .luma-btn {
        width: 100%;
    }

    body.luma-admin-dashboard .btn-toolbar,
    body.luma-admin-dashboard .luma-actions,
    body.luma-admin-dashboard .pg-actions,
    body.serene-provider .luma-actions,
    body.serene-provider .pg-actions {
        flex-wrap: wrap;
    }

    body.luma-admin-dashboard .table-responsive,
    body.luma-admin-dashboard .luma-table-wrap,
    body.luma-admin-dashboard .pg-table-wrap,
    body.luma-admin-dashboard .pm-table-wrap,
    body.luma-admin-dashboard .banks-table-wrap,
    body.serene-provider .table-responsive,
    body.serene-provider .luma-table-wrap,
    body.serene-provider .pg-table-wrap {
        overflow-x: auto;
        overflow-y: visible;
    }

    body.luma-admin-dashboard .table:not(.table-condensed),
    body.luma-admin-dashboard .luma-table,
    body.serene-provider .table,
    body.serene-provider .luma-table {
        min-width: 680px;
    }

    body.luma-admin-dashboard .table th,
    body.luma-admin-dashboard .table td,
    body.luma-admin-dashboard .luma-table th,
    body.luma-admin-dashboard .luma-table td,
    body.serene-provider .table th,
    body.serene-provider .table td,
    body.serene-provider .luma-table th,
    body.serene-provider .luma-table td {
        max-width: 420px;
        padding: 10px 12px;
        font-size: 12px;
    }

    body.luma-admin-dashboard .table td,
    body.luma-admin-dashboard .luma-table td,
    body.serene-provider .table td,
    body.serene-provider .luma-table td {
        overflow-wrap: anywhere;
    }

    body.luma-admin-dashboard .pagination,
    body.serene-provider .pagination {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    body.luma-admin-dashboard .pagination > li > a,
    body.luma-admin-dashboard .pagination > li > span,
    body.serene-provider .pagination > li > a,
    body.serene-provider .pagination > li > span {
        margin: 0;
        min-width: 36px;
        text-align: center;
    }

    body.luma-admin-dashboard .dropdown-menu,
    body.serene-provider .dropdown-menu {
        max-width: calc(100vw - 32px);
        white-space: normal;
    }

    body.luma-admin-dashboard .modal-dialog,
    body.serene-provider .modal-dialog {
        width: auto;
        margin: 10px;
    }
}

@media (max-width: 520px) {
    body.luma-admin-dashboard .content,
    body.luma-admin-dashboard .content-wrapper > .content,
    body.luma-admin-dashboard .luma-page-shell,
    body.luma-admin-dashboard .pg-artists,
    body.serene-provider .serene-main {
        padding: 12px;
    }

    body.serene-provider .serene-main {
        min-height: calc(100vh - 64px);
        min-height: calc(100dvh - 64px);
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    body.luma-admin-dashboard .luma-page-title,
    body.luma-admin-dashboard .pg-artists__hero-title,
    body.serene-provider .luma-page__title {
        font-size: 20px;
        line-height: 1.35;
    }

    body.luma-admin-dashboard .luma-page-toolbar,
    body.luma-admin-dashboard .pg-artists__hero-actions,
    body.luma-admin-dashboard .users-status-tabs,
    body.serene-provider .luma-page__actions {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    body.luma-admin-dashboard .luma-page-toolbar .btn,
    body.luma-admin-dashboard .luma-page-toolbar .luma-btn,
    body.luma-admin-dashboard .pg-artists__hero-actions .pg-btn,
    body.luma-admin-dashboard .users-status-tabs .luma-btn,
    body.serene-provider .luma-page__actions .luma-btn {
        width: 100%;
    }

    body.luma-admin-dashboard .luma-filter-grid,
    body.luma-admin-dashboard .pg-filter-grid,
    body.serene-provider .luma-filter-grid {
        grid-template-columns: 1fr;
    }

    body.luma-admin-dashboard .modal-footer,
    body.serene-provider .modal-footer {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    body.luma-admin-dashboard .modal-footer .btn,
    body.serene-provider .modal-footer .btn {
        width: 100%;
        margin: 0;
    }
}

@media (max-width: 430px) {
    body.serene-provider .select2-results__options {
        max-height: 170px !important;
    }

    body.luma-admin-dashboard .table:not(.table-condensed),
    body.luma-admin-dashboard .luma-table,
    body.serene-provider .table,
    body.serene-provider .luma-table {
        min-width: 620px;
    }

    body.luma-admin-dashboard .btn,
    body.luma-admin-dashboard .luma-btn,
    body.luma-admin-dashboard .pg-btn,
    body.serene-provider .btn,
    body.serene-provider .luma-btn {
        min-height: 40px;
        padding-inline: 11px;
    }
}

@media print {
    .table,
    .luma-table,
    .pg-table {
        min-width: 0;
    }
}
