/*
 * Compatibility helpers for the Bootstrap 3-era Blade markup.
 * Keep this deliberately small so pages can be migrated to native Bootstrap 5
 * classes incrementally without changing their behaviour in one large rewrite.
 */

body {
    font-family: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.42857143;
    color: #373737;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: 400;
    line-height: 1.1;
    color: inherit;
}

h1, h2, h3,
.h1, .h2, .h3 {
    margin-top: 21px;
    margin-bottom: 10.5px;
}

h4, h5, h6,
.h4, .h5, .h6 {
    margin-top: 10.5px;
    margin-bottom: 10.5px;
}

h1, .h1 { font-size: 39px; }
h2, .h2 { font-size: 32px; }
h3, .h3 { font-size: 26px; }
h4, .h4 { font-size: 19px; }
h5, .h5 { font-size: 15px; }
h6, .h6 { font-size: 13px; }

p {
    margin: 0 0 10.5px;
}

.row {
    --bs-gutter-x: 30px;
}

/* Bootstrap 3 did not treat arbitrary row children as grid columns. */
.main > .row > :not([class^="col-"]):not([class*=" col-"]) {
    padding-right: 0;
    padding-left: 0;
}

/* Bootstrap 3 rows allowed ordinary block children without adding gutters. */
.home-dashboard {
    display: block;
}

.home-dashboard > :not([class^="col-"]):not([class*=" col-"]) {
    padding-right: 0;
    padding-left: 0;
}

.btn {
    --bs-btn-padding-y: 10px;
    --bs-btn-padding-x: 15px;
    --bs-btn-font-size: 15px;
    --bs-btn-line-height: 1.42857143;
    --bs-btn-border-radius: 4px;
    font-weight: 400;
}

.btn-lg,
.btn-group-lg > .btn {
    --bs-btn-padding-y: 18px;
    --bs-btn-padding-x: 27px;
    --bs-btn-font-size: 19px;
    --bs-btn-line-height: 1.33;
    --bs-btn-border-radius: 6px;
}

.btn-sm,
.btn-group-sm > .btn {
    --bs-btn-padding-y: 6px;
    --bs-btn-padding-x: 9px;
    --bs-btn-font-size: 13px;
    --bs-btn-line-height: 1.5;
    --bs-btn-border-radius: 3px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.btn-default {
    --bs-btn-color: #fff;
    --bs-btn-bg: #95a5a6;
    --bs-btn-border-color: #95a5a6;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #798d8f;
    --bs-btn-hover-border-color: #74898a;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #798d8f;
    --bs-btn-active-border-color: #74898a;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-xs {
    --bs-btn-padding-y: 1px;
    --bs-btn-padding-x: 5px;
    --bs-btn-font-size: 13px;
    --bs-btn-line-height: 1.5;
    --bs-btn-border-radius: 3px;
}

.panel {
    margin-bottom: 1.25rem;
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
}

/* Keep Bootstrap 5 row gutters outside legacy panels instead of inside them. */
.row > .panel {
    width: calc(100% - var(--bs-gutter-x));
    margin-right: calc(var(--bs-gutter-x) * .5);
    margin-left: calc(var(--bs-gutter-x) * .5);
    padding-right: 0;
    padding-left: 0;
}

.panel-heading {
    padding: .75rem 1rem;
    border-bottom: 1px solid transparent;
    border-radius: calc(var(--bs-border-radius) - 1px) calc(var(--bs-border-radius) - 1px) 0 0;
}

.panel-title {
    margin: 0;
    font-size: 1.1rem;
}

.panel-body {
    padding: 1rem;
}

.panel-footer {
    padding: .75rem 1rem;
    background-color: var(--bs-tertiary-bg);
    border-top: 1px solid var(--bs-border-color);
}

.panel-primary {
    border-color: #373737;
}

.panel-primary > .panel-heading {
    color: #fff;
    background-color: #373737;
    border-color: #373737;
}

.well {
    min-height: 20px;
    padding: 19px;
    margin-bottom: 20px;
    background-color: #ecf0f1;
    border: 1px solid transparent;
    border-radius: 4px;
}

.form-control {
    height: 43px;
    padding: 10px 15px;
    font-size: 15px;
    line-height: 1.42857143;
    border-radius: 4px;
}

textarea.form-control {
    height: auto;
}

.form-control-static {
    padding-top: 11px;
    padding-bottom: 11px;
    margin-bottom: 0;
}

.form-group {
    margin-bottom: 1rem;
}

.form-horizontal .form-group {
    display: flex;
    flex-wrap: wrap;
    margin-right: calc(-.5 * var(--bs-gutter-x));
    margin-left: calc(-.5 * var(--bs-gutter-x));
}

.form-horizontal .form-group > [class^="col-"],
.form-horizontal .form-group > [class*=" col-"] {
    padding-right: 15px;
    padding-left: 15px;
}

.form-horizontal .checkbox {
    position: relative;
    display: block;
    min-height: 32px;
    padding-top: 11px;
    margin-top: 0;
    margin-bottom: 0;
}

.form-horizontal .checkbox label {
    min-height: 21px;
    margin-bottom: 0;
    font-weight: 400;
    cursor: pointer;
}

.form-horizontal .checkbox input[type="checkbox"] {
    position: absolute;
    margin-left: -20px;
}

@media (min-width: 768px) {
    .form-inline .form-group {
        display: inline-block;
        margin-bottom: 0;
        vertical-align: middle;
    }

    .form-inline .form-control {
        display: inline-block;
        width: auto;
        vertical-align: middle;
    }

    .form-inline .form-control-static {
        display: inline-block;
    }
}

.control-label {
    padding-top: calc(.375rem + var(--bs-border-width));
    margin-bottom: .5rem;
    font-weight: 600;
}

.has-error .form-control,
.has-error .chosen-container .chosen-single,
.has-error .chosen-container .chosen-choices {
    border-color: var(--bs-danger);
}

.has-error .control-label,
.has-error .help-block {
    color: var(--bs-danger);
}

.close {
    float: right;
    padding: 0;
    color: inherit;
    background: transparent;
    border: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    opacity: .5;
}

.close:hover,
.close:focus {
    opacity: .75;
}

.modal {
    --bs-modal-width: 600px;
}

.modal-header {
    padding: 15px;
}

.modal-title {
    margin: 0;
    line-height: 1.42857143;
}

.modal-body,
.modal-footer {
    padding: 20px;
}

.modal .well.bg-info {
    background-color: #ecf0f1 !important;
    color: #373737;
}

.modal-header .close {
    margin-top: -2px;
    margin-left: auto;
    order: 2;
}

.modal-header .modal-title {
    order: 1;
}

.pull-left {
    float: left !important;
}

.pull-right {
    float: right !important;
}

@media (min-width: 576px) {
    .col-sm-offset-2 { margin-left: 16.66666667%; }
    .col-sm-offset-3 { margin-left: 25%; }
    .col-sm-offset-5 { margin-left: 41.66666667%; }

    .form-horizontal .control-label {
        text-align: right;
    }
}

@media (min-width: 768px) {
    .col-md-offset-2 { margin-left: 16.66666667%; }
}

/* Preserve the original Bootstrap 3 layout breakpoints around the sidebar. */
@media (min-width: 576px) and (max-width: 767.98px) {
    [class*="col-sm-"] {
        width: 100%;
        margin-left: 0;
    }

    .main.col-sm-9 {
        width: 100%;
        margin-left: 0;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .sidebar.col-sm-3.col-md-2 { width: 25%; }
    .main.col-sm-9.col-md-10 {
        width: 75%;
        margin-left: 25%;
    }
}

@media (min-width: 992px) {
    .sidebar.col-sm-3.col-md-2 { width: 16.66666667%; }
    .main.col-sm-9.col-md-10 {
        width: 83.33333333%;
        margin-left: 16.66666667%;
    }
}
