/* A Select2 that is started twice copies the "hidden accessible" class onto its visible box, which makes it absolutely positioned
   and wider than its column, so the page scrolled sideways on forms with several drop-downs. The visible box is always in the flow. */
.select2-container.select2-hidden-accessible {
    position: relative !important; clip: auto !important; height: auto !important; margin: 0 !important;
    overflow: visible !important; padding: 0 !important; border: 0 !important; max-width: 100% !important;
}

/* Containment rules added during the ASP.NET Core port. The original Admin theme let a few widgets exceed the
   viewport on phones (Select2 fixed pixel widths, .row margins outside a .container, a long header nav).
   Nothing here changes desktop layout. */
@media (max-width: 767.98px) {
    html, body { max-width: 100%; overflow-x: hidden; }
    .select2-container { max-width: 100% !important; }
    .select2-container .select2-selection--single,
    .select2-container .select2-selection--multiple { max-width: 100%; }
    .main-wrapper, .main-content, .content-wrapper { max-width: 100%; overflow-x: clip; }
    /* wide data tables scroll inside their card instead of widening the page */
    .card-body > table, .card-body .dataTables_wrapper { display: block; max-width: 100%; overflow-x: auto; }
    img, video, canvas { max-width: 100%; height: auto; }
}

/* Charts drawn on a canvas never exceed the card they sit in. */
canvas { max-width: 100%; }

/* A .row directly inside a tab pane has no padded parent to absorb its negative margins, which made the profile tabs 15px wider than the screen. */
.tab-content > .tab-pane > .row { margin-left: 0; margin-right: 0; }
