/* Shared adjustments on top of stock Bootstrap 5.3, loaded by every layout
   after bootstrap.min.css and before the host theme's theme.css. */

:root {
    /* The site was designed around Bootstrap 3's 14px body text. */
    --bs-body-font-size: 0.875rem;
}

/* Bootstrap 3 only underlined links on hover. */
a {
    text-decoration: none;
}

    a:hover {
        text-decoration: underline;
    }

    a.btn:hover,
    a.nav-link:hover,
    a.dropdown-item:hover,
    a.card:hover {
        text-decoration: none;
    }

label,
.form-label {
    font-weight: 600;
}

.form-check-label {
    font-weight: 400;
}

/* Server-side validation: the has-error class is added to the field wrapper
   by the bs3-validation-for tag helper. */
.has-error .form-label,
.has-error .form-check-label {
    color: var(--bs-danger);
}

.has-error .form-control,
.has-error .form-select {
    border-color: var(--bs-danger);
}

.input-validation-error {
    border-color: var(--bs-danger);
}

.validation-summary-valid {
    display: none;
}

.validation-summary-errors ul {
    margin-bottom: 1rem;
}

.avatar-32 {
    width: 32px;
    height: 32px;
}

/* Icon buttons that used to rely on icon-font spacing. */
.btn > .bi + span,
.btn > .bi:not(:only-child) {
    margin-right: 0.25rem;
}

/* Bootstrap 3 heading scale and spacing, which the page designs assume. */
h1, .h1 { font-size: 2.25rem; }
h2, .h2 { font-size: 1.875rem; }
h3, .h3 { font-size: 1.5rem; }
h4, .h4 { font-size: 1.125rem; }
h5, .h5 { font-size: 0.875rem; }
h6, .h6 { font-size: 0.75rem; }

h1, h2, h3 {
    margin-top: 1.25rem;
    margin-bottom: 0.625rem;
}

h4, h5, h6 {
    margin-top: 0.625rem;
    margin-bottom: 0.625rem;
}

/* Card headings (formerly panel titles) sit flush inside their header. */
.card-header > h1, .card-header > h2, .card-header > h3,
.card-header > h4, .card-header > h5, .card-header > h6,
.card-title {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 1rem;
}

.page-heading {
    margin-top: 0;
}

/* Label-wrapped checkboxes: "ckbox" labels and Bootstrap 3 ".checkbox" blocks. */
.ckbox,
.checkbox label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400;
}

.checkbox {
    margin-bottom: 0.625rem;
}

/* ----- Page chrome shared by every signed-in layout -----
   A dark sidebar that is always visible from the lg breakpoint up and slides in
   (Bootstrap offcanvas) below it, plus a header bar with the menu button. */

.app-main {
    min-width: 0; /* let wide tables scroll instead of stretching the page */
}

/* Sidebar */
.app-sidebar {
    --app-sidebar-width: 250px;
    --bs-offcanvas-width: var(--app-sidebar-width);
    --bs-offcanvas-bg: #2b3035;
    background-color: #2b3035;
}

@media (min-width: 992px) {
    .app-sidebar {
        position: sticky;
        top: 0;
        flex: 0 0 var(--app-sidebar-width);
        width: var(--app-sidebar-width);
        height: 100vh;
        overflow-y: auto;
        /* .offcanvas-lg makes the background transparent from lg up */
        background-color: #2b3035 !important;
    }
}

.app-sidebar .sidebar-brand {
    min-height: 56px;
    padding: 0.75rem 1rem;
    background-color: #fff;
}

.app-sidebar .nav {
    flex-wrap: nowrap;
}

.app-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 1rem;
    color: rgba(255, 255, 255, 0.75);
}

    .app-sidebar .nav-link:hover,
    .app-sidebar .nav-link:focus-visible {
        color: #fff;
        background-color: rgba(255, 255, 255, 0.08);
    }

    .app-sidebar .nav-link.active {
        color: #fff;
        background-color: rgba(255, 255, 255, 0.14);
    }

    .app-sidebar .nav-link .bi-chevron-down {
        font-size: 0.75em;
        transition: transform 0.15s ease-in-out;
    }

    .app-sidebar .nav-link[aria-expanded="true"] .bi-chevron-down {
        transform: rotate(180deg);
    }

.app-sidebar .sub {
    background-color: rgba(0, 0, 0, 0.15);
}

    .app-sidebar .sub .nav-link {
        padding-left: 2.75rem;
    }

/* Header */
.app-header {
    min-height: 56px;
}

.app-sidebar .sidebar-brand img {
    max-width: 100%;
    max-height: 40px;
}

.app-header .header-logo img {
    max-height: 32px;
}

/* ----- Columns used without a .row -----
   Many pages place col-* elements directly inside a container, card or another
   column. Bootstrap 3 columns floated, so those sat side by side; Bootstrap 5
   columns only line up inside a (flex) .row and otherwise stack. Give columns
   outside a row their Bootstrap 3 behaviour. Columns inside a .row are flex
   items, where float has no effect, and are not matched by these rules. */

:not(.row) > [class^="col-"],
:not(.row) > [class*=" col-"] {
    position: relative;
    float: left;
    min-height: 1px;
    padding-right: 15px;
    padding-left: 15px;
}

/* A row that follows floated columns starts below them (a flex row would otherwise be
   squeezed into the space beside the float). */
.row {
    clear: both;
}

/* Contain the floats, as Bootstrap 3's clearfix on these elements did. */
.container::after,
.container-fluid::after,
.card-body::after,
.modal-footer::after {
    display: block;
    clear: both;
    content: "";
}
