/* Shared layout rules for the administration screens. */
:root {
    --admin-content-width: 1580px;
    --admin-gutter: clamp(12px, 2.4vw, 32px);
}

html {
    min-width: 320px;
}

body {
    overflow-x: hidden;
}

/* Keep the dashboard, lists, settings and forms aligned on the same canvas. */
body>.container-fluid,
body>main.page-wrap,
body>.page-wrap,
body>.container.py-4,
body>main .container-fluid {
    width: min(calc(100% - 2 * var(--admin-gutter)), var(--admin-content-width)) !important;
    max-width: var(--admin-content-width) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

body>main.page-wrap,
body>.page-wrap {
    padding-left: 0;
    padding-right: 0;
}

/* Authentication cards use the same centered column on desktop. */
.login-wrapper,
.register-wrapper {
    width: min(100% - 2 * var(--admin-gutter), 1000px) !important;
    max-width: 1000px !important;
    margin-left: auto;
    margin-right: auto;
}

/* Tables stay readable on narrow screens without widening the page itself. */
.table-responsive,
.table-container {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    max-width: 100%;
}

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

input,
select,
textarea,
button {
    max-width: 100%;
}

input[type="email"],
input[type="url"],
input[type="text"],
input[type="tel"] {
    min-width: 0;
}

@media (max-width: 767.98px) {
    :root {
        --admin-gutter: 12px;
    }

    body>.container-fluid,
    body>main.page-wrap,
    body>.page-wrap,
    body>.container.py-4,
    body>main .container-fluid {
        width: calc(100% - 24px) !important;
    }

    .modal-dialog {
        margin: .75rem;
    }

    .modal-dialog-centered {
        min-height: calc(100% - 1.5rem);
    }

    .btn {
        white-space: normal;
    }
}

@media (max-width: 420px) {

    .table th,
    .table td {
        padding: .55rem .45rem;
    }
}