/* Bootstrap 2/3 compatibility layer for Bootstrap 4.6.x */
.control-group {
  margin-bottom: 1rem;
}

.control-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.controls {
  display: block;
  width: 100%;
}

.controls input,
.controls select,
.controls textarea {
  width: 100%;
}

.help-inline,
.help-block {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875em;
  color: #6c757d;
}

.has-error .control-label,
.has-error .help-block,
.has-error .help-inline,
.has-error .form-control,
.has-error input,
.has-error select,
.has-error textarea {
  color: #dc3545;
  border-color: #dc3545;
}

.has-success .control-label,
.has-success .help-block,
.has-success .help-inline,
.has-success .form-control,
.has-success input,
.has-success select,
.has-success textarea {
  color: #28a745;
  border-color: #28a745;
}

.input-group-addon {
  display: flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  margin-bottom: 0;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #495057;
  text-align: center;
  white-space: nowrap;
  background-color: #e9ecef;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
}

.btn-default {
  color: #fff;
  background-color: #6c757d;
  border-color: #6c757d;
}

.btn-default:hover,
.btn-default:focus {
  color: #fff;
  background-color: #5a6268;
  border-color: #545b62;
}

.label {
  display: inline-block;
  padding: 0.25em 0.4em;
  font-size: 75%;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
  background-color: #6c757d;
}

.badge {
  vertical-align: baseline;
}

.panel {
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  margin-bottom: 1rem;
  background-color: #fff;
}

.panel-heading {
  padding: 0.75rem 1.25rem;
  margin-bottom: 0;
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
}

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

.panel-body {
  padding: 1.25rem;
}

.panel-footer {
  padding: 0.75rem 1.25rem;
  background-color: #f8f9fa;
  border-top: 1px solid #dee2e6;
}

.well {
  min-height: 20px;
  padding: 1rem;
  margin-bottom: 1rem;
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 0.25rem;
}

.form-actions {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e9ecef;
}

/* Bootstrap 2/3 horizontal form compatibility */
.form-horizontal .form-group {
  display: flex !important;
  flex-direction: row;
  flex-wrap: wrap;
  margin-right: -15px;
  margin-left: -15px;
  align-items: flex-start;
}

.form-horizontal .control-label {
  text-align: right;
  margin-bottom: 0;
  padding-top: calc(0.375rem + 1px);
  font-size: 15px;
}

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

/* Force side-by-side layout when horizontal forms are used */
.form-horizontal .form-group > .control-label {
  flex: 0 0 25%;
  max-width: 25%;
}

.form-horizontal .form-group > .col-sm-9 {
  flex: 0 0 50%;
  max-width: 50%;
}

/* Ensure fieldset inside a row doesn't shrink columns like .span5 */
.row > fieldset {
  display: block;
  width: 100%;
  min-width: 0;
}

/* Bootstrap 3 .in compatibility for fades */
.fade.in {
  opacity: 1;
}

/* Bootstrap 3 pagination markup -> Bootstrap 4 look */
.pagination {
  display: flex;
  padding-left: 0;
  list-style: none;
  border-radius: 0.25rem;
  margin-bottom: 1rem;
}

.pagination > li > a,
.pagination > li > span {
  position: relative;
  display: block;
  padding: 0.375rem 0.75rem;
  margin-left: -1px;
  line-height: 1.5;
  color: #007bff;
  background-color: #fff;
  border: 1px solid #dee2e6;
  text-decoration: none;
}

.pagination > li:first-child > a,
.pagination > li:first-child > span {
  margin-left: 0;
  border-top-left-radius: 0.25rem;
  border-bottom-left-radius: 0.25rem;
}

.pagination > li:last-child > a,
.pagination > li:last-child > span {
  border-top-right-radius: 0.25rem;
  border-bottom-right-radius: 0.25rem;
}

.pagination > li > a:hover,
.pagination > li > span:hover {
  color: #0056b3;
  background-color: #e9ecef;
  border-color: #dee2e6;
}

.pagination > li.active > a,
.pagination > li.active > span {
  z-index: 3;
  color: #fff;
  background-color: #007bff;
  border-color: #007bff;
}

.pagination > li.disabled > a,
.pagination > li.disabled > span {
  color: #6c757d;
  pointer-events: none;
  background-color: #fff;
  border-color: #dee2e6;
}

/* Bootstrap 3 breadcrumbs -> Bootstrap 4 look */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  list-style: none;
  background-color: #e9ecef;
  border-radius: 0.25rem;
}

.breadcrumb > li {
  display: inline-flex;
  align-items: center;
}

.breadcrumb > li + li::before {
  display: inline-block;
  padding-right: 0.5rem;
  padding-left: 0.5rem;
  color: #6c757d;
  content: "/";
}

.breadcrumb > li > a {
  color: #007bff;
  text-decoration: none;
}

.breadcrumb > li > a:hover {
  color: #0056b3;
  text-decoration: underline;
}

.breadcrumb > .active {
  color: #6c757d;
}

/* Bootstrap 3 caret for grid sort indicators */
.caret {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 0.255em;
  vertical-align: 0.255em;
  border-top: 0.3em solid currentColor;
  border-right: 0.3em solid transparent;
  border-left: 0.3em solid transparent;
}

.caret.up,
.caret.asc {
  border-top: 0;
  border-bottom: 0.3em solid currentColor;
}

/* Disable legacy grid sort sprite pseudo-elements */
.grid-view table.items th:hover a.asc::after,
.grid-view table.items th:hover a.desc::after,
.grid-view table.items th a.asc::after,
.grid-view table.items th a.desc::after {
  content: none !important;
}

/* Bootstrap 2/3 nav-pills stacked (TbMenu) -> Bootstrap 4 look */
.nav {
  display: flex;
  flex-wrap: wrap;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
}

.nav > li {
  display: block;
}

.nav > li > a {
  display: block;
  padding: 0.5rem 1rem;
  text-decoration: none;
}

.nav-stacked,
.nav.nav-stacked {
  flex-direction: column;
}

.nav-stacked > li + li,
.nav.nav-stacked > li + li {
  margin-top: 0.25rem;
  margin-left: 0;
}

.nav-pills > li > a {
  border-radius: 0.25rem;
}

.nav-pills > li.active > a,
.nav-pills > li.active > a:hover,
.nav-pills > li.active > a:focus {
  color: #fff;
  background-color: #007bff;
}

/* Ensure headings break in inline forms */
.form-inline h1,
.form-inline h2,
.form-inline h3,
.form-inline h4,
.form-inline h5,
.form-inline h6 {
  display: block;
  width: 100%;
  margin-bottom: 0.5rem;
}


.form-inline .btn + .btn {
  margin-top: 0.5rem;
  margin-left: 0;
}

/* Bootstrap collapse visibility helpers */
.collapse {
  display: none;
}

.collapse.in,
.collapse.show {
  display: block;
}

.collapsing {
  height: 0;
  overflow: hidden;
  transition: height 0.35s ease;
}

/* Inline radio + input alignment */
label.radio {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

label.radio input[type="radio"] {
  margin: 0;
}

/* jQuery UI tabs: allow panels to grow */
.ui-tabs-panel {
  height: auto !important;
  overflow: visible;
}

/* jQuery UI tabs: keep tab list on one line */
.ui-tabs .ui-tabs-nav {
  display: flex;
  flex-wrap: wrap;
  overflow: visible;
  white-space: normal;
  gap: 0.25rem;
  justify-content: flex-start;
}

.ui-tabs .ui-tabs-nav li {
  float: none;
  margin: 0;
}

/* Bootstrap 2 navbar compatibility for Bootstrap 4 */
.navbar-fixed-top,
.navbar-fixed-bottom {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 1030;
}

.navbar-fixed-top {
  top: 0;
}

.navbar-fixed-bottom {
  bottom: 0;
}

.navbar .navbar-inner {
  flex: 1 1 auto;
  width: 100%;
}

#nav-container,
#nav-bar {
  width: 100%;
  box-sizing: border-box;
}
