/**
 * Bridge AdminLTE 2 / Bootstrap 3 markup used in admin blades to AdminLTE 3 / Bootstrap 4.
 */

/* Bootstrap 3 column aliases */
.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6,
.col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 {
  position: relative;
  width: 100%;
  padding-right: 7.5px;
  padding-left: 7.5px;
}
.col-xs-12 { flex: 0 0 100%; max-width: 100%; }
.col-xs-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
.col-xs-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
.col-xs-9 { flex: 0 0 75%; max-width: 75%; }
.col-xs-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-xs-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
.col-xs-6 { flex: 0 0 50%; max-width: 50%; }
.col-xs-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
.col-xs-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-xs-3 { flex: 0 0 25%; max-width: 25%; }
.col-xs-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-xs-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }

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

/* AdminLTE 2 boxes → card-like panels */
.box {
  position: relative;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .125);
  border-radius: .25rem;
  box-shadow: 0 0 1px rgba(0, 0, 0, .125), 0 1px 3px rgba(0, 0, 0, .2);
  margin-bottom: 1rem;
  width: 100%;
  display: block;
}
.box.box-primary { border-top: 3px solid #007bff; }
.box.box-success { border-top: 3px solid #28a745; }
.box.box-warning { border-top: 3px solid #ffc107; }
.box.box-danger { border-top: 3px solid #dc3545; }
.box.box-info { border-top: 3px solid #17a2b8; }
.box.box-solid { border-top-width: 0; }
.box-header {
  display: block;
  padding: .75rem 1.25rem;
  position: relative;
  border-bottom: 1px solid rgba(0, 0, 0, .125);
  color: inherit;
}
.box-header.with-border { border-bottom: 1px solid rgba(0, 0, 0, .125); }
.box-header > .box-title,
.box-title {
  display: inline-block;
  font-size: 1.1rem;
  margin: 0;
  line-height: 1.5;
  font-weight: 400;
}
.box-header > .box-tools {
  position: absolute;
  right: 1rem;
  top: .75rem;
}
.box-body {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: .25rem;
  border-bottom-left-radius: .25rem;
  padding: 1.25rem;
}
.box-footer {
  border-top: 1px solid rgba(0, 0, 0, .125);
  padding: .75rem 1.25rem;
  background-color: rgba(0, 0, 0, .03);
  border-bottom-right-radius: .25rem;
  border-bottom-left-radius: .25rem;
}
.box-tools .btn-box-tool {
  padding: .25rem .5rem;
  font-size: .875rem;
  background: transparent;
  color: #6c757d;
  border: 0;
}
.box-tools .btn-box-tool:hover {
  color: #343a40;
  text-decoration: none;
}

/* Bootstrap 3 labels → badges */
.label {
  display: inline-block;
  padding: .25em .4em;
  font-size: 75%;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: .25rem;
  color: #fff;
}
.label-default { background-color: #6c757d; }
.label-primary { background-color: #007bff; }
.label-success { background-color: #28a745; }
.label-info { background-color: #17a2b8; }
.label-warning { background-color: #ffc107; color: #212529; }
.label-danger { background-color: #dc3545; }

/* Content header (AL2 style inside AL3 content-header) */
.content-header h1 {
  margin: 0;
  font-size: 1.8rem;
}
.content-header h1 > small {
  font-size: 1rem;
  display: inline-block;
  padding-left: .5rem;
  font-weight: 300;
  color: #6c757d;
}
.admin-content-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1rem;
  width: 100%;
}
.admin-content-header-row > h1 {
  margin: 0;
}

/* DataTables layout helpers when Bootstrap4 integration CSS is present */
div.dataTables_wrapper div.dataTables_length label,
div.dataTables_wrapper div.dataTables_filter label {
  font-weight: normal;
  text-align: left;
  white-space: nowrap;
}
div.dataTables_wrapper div.dataTables_filter {
  text-align: right;
}
div.dataTables_wrapper div.dataTables_filter input {
  margin-left: .5em;
  display: inline-block;
  width: auto;
}
div.dataTables_wrapper div.dataTables_length select {
  width: auto;
  display: inline-block;
  margin: 0 .5em;
}
div.dataTables_wrapper div.dataTables_info {
  padding-top: .85em;
}
div.dataTables_wrapper div.dataTables_paginate {
  margin: 0;
  white-space: nowrap;
  text-align: right;
}
div.dataTables_wrapper div.dataTables_paginate ul.pagination {
  margin: 2px 0;
  white-space: nowrap;
  justify-content: flex-end;
}
table.dataTable {
  width: 100% !important;
  margin: 0 !important;
}
.cursor-pointer { cursor: pointer; }

/* Form groups that still use BS3 has-feedback spacing */
.form-group.has-feedback { position: relative; }
.form-control-feedback {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  display: block;
  width: 34px;
  height: 34px;
  line-height: 34px;
  text-align: center;
  pointer-events: none;
}

/* Bootstrap 3 form-horizontal → flex row layout (BS4 dropped form-horizontal) */
.form-horizontal .form-group {
  display: flex;
  flex-wrap: wrap;
  margin-right: -7.5px;
  margin-left: -7.5px;
  margin-bottom: 1rem;
}
.form-horizontal .form-group > [class*="col-"] {
  position: relative;
  padding-right: 7.5px;
  padding-left: 7.5px;
}
.form-horizontal .control-label {
  padding-top: calc(.375rem + 1px);
  margin-bottom: 0;
  font-weight: 700;
  text-align: right;
}
@media (max-width: 575.98px) {
  .form-horizontal .control-label {
    text-align: left;
  }
}
.help-block {
  display: block;
  margin-top: .25rem;
  color: #6c757d;
  font-size: .875rem;
}
.has-error .form-control,
.has-error .form-control:focus {
  border-color: #dc3545;
  box-shadow: 0 0 0 .2rem rgba(220, 53, 69, .25);
}
.has-error .control-label,
.has-error .help-block {
  color: #dc3545;
}

/* Bootstrap 3 buttons missing in BS4 */
.btn-default {
  color: #212529;
  background-color: #f8f9fa;
  border-color: #ddd;
}
.btn-default:hover,
.btn-default:focus {
  color: #212529;
  background-color: #e2e6ea;
  border-color: #dae0e5;
}
.btn-default:not(:disabled):not(.disabled):active,
.btn-default.active {
  color: #212529;
  background-color: #dae0e5;
  border-color: #d3d9df;
}
.btn-xs,
.btn-group-xs > .btn {
  padding: .125rem .35rem;
  font-size: .75rem;
  line-height: 1.5;
  border-radius: .2rem;
}
.btn-group-xs > .btn + .btn,
.btn-group-xs > .btn + .btn-group,
.btn-group-xs > .btn-group + .btn {
  margin-left: -1px;
}

/* Bootstrap 3 caret / close / input-group-addon */
.caret {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 2px;
  vertical-align: middle;
  border-top: 4px solid;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}
.input-group-addon,
.input-group-btn {
  display: flex;
  align-items: stretch;
}
.input-group-addon {
  padding: .375rem .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: .25rem;
}
/* BS3 input-group-btn → BS4 input-group-append */
.input-group > .input-group-btn {
  display: flex;
  margin-left: -1px;
}
.input-group > .input-group-btn > .btn {
  position: relative;
  z-index: 2;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.input-group > .input-group-btn > .btn:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  margin-right: -1px;
}
.input-group-sm > .input-group-btn > .btn,
.input-group-sm > .form-control {
  height: calc(1.5em + .5rem + 2px);
  padding: .25rem .5rem;
  font-size: .875rem;
  line-height: 1.5;
  border-radius: .2rem;
}
.input-group-sm > .input-group-btn > .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.input-group .input-group-addon:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: 0;
}
.input-group .input-group-addon:not(:first-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 0;
}
.btn-flat {
  box-shadow: none !important;
  border-width: 1px;
}
.btn-xs + .btn-xs,
td .btn-xs {
  margin-left: 2px;
}
.table-condensed th,
.table-condensed td {
  padding: .3rem;
}

/* Laravel Bootstrap-4 pagination inside AL2 box footers */
.box-footer .pagination {
  margin: 0;
  justify-content: flex-end;
}
.box-footer nav {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

/* Filters row sits above Per Page / search toolbar.
   Negative side margins cancel .box-header padding so the divider is full-bleed. */
.admin-list-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  width: auto;
  margin: 0 -1.25rem .75rem;
  padding: 0 1.25rem .75rem;
  border-bottom: 1px solid rgba(0, 0, 0, .125);
}
.admin-list-filters > .btn,
.admin-list-filters .admin-filter-btns > .btn {
  margin: 0;
}

/* Unified admin list toolbar (per-page buttons + users-style search) */
.admin-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
  margin-bottom: 0;
  gap: .5rem 1rem;
}
.admin-list-toolbar__left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}
.admin-list-toolbar__right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-left: auto;
}
.admin-list-toolbar__label {
  margin-right: .15rem;
  font-weight: 600;
}
.admin-list-search {
  width: 280px;
  max-width: 100%;
}
.admin-list-search .input-group {
  width: 100%;
}
/* Hide DataTables built-in length/filter when custom toolbar is used */
div.dataTables_wrapper div.dataTables_length,
div.dataTables_wrapper div.dataTables_filter {
  display: none !important;
}

/* DataTables processing overlay should never stick on top after load */
div.dataTables_wrapper div.dataTables_processing {
  z-index: 2;
}
div.dataTables_wrapper div.dataTables_processing[style*="display: none"],
div.dataTables_wrapper div.dataTables_processing[style*="display:none"] {
  visibility: hidden !important;
}

/* Bootstrap 3 nav-stacked / pills (vertical side menus) */
.nav-stacked {
  flex-direction: column !important;
}
.nav-stacked > li {
  float: none;
  width: 100%;
}
.nav-stacked > li + li {
  margin-top: 2px;
  margin-left: 0;
}
.nav-stacked > li > a {
  display: block;
  border-radius: .25rem;
  padding: .5rem 1rem;
}
.nav-pills.nav-stacked > li.active > a,
.nav-pills.nav-stacked > li.active > a:hover,
.nav-pills.nav-stacked > li.active > a:focus {
  background-color: #007bff;
  color: #fff;
}
.box-body.no-padding {
  padding: 0;
}
.box-body.no-padding .nav-stacked > li > a {
  border-radius: 0;
}

/* Bootstrap 3 dl-horizontal (removed in BS4) */
.dl-horizontal {
  margin-bottom: 0;
}
.dl-horizontal dt {
  float: left;
  width: 160px;
  clear: left;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
.dl-horizontal dd {
  margin-left: 180px;
  margin-bottom: .75rem;
  min-height: 1.25rem;
}
.dl-horizontal dd:before,
.dl-horizontal dd:after {
  display: table;
  content: " ";
}
.dl-horizontal dd:after {
  clear: both;
}
@media (max-width: 767.98px) {
  .dl-horizontal dt {
    float: none;
    width: auto;
    text-align: left;
  }
  .dl-horizontal dd {
    margin-left: 0;
  }
}

/* form-control-static removed in BS4 */
.form-control-static {
  display: block;
  width: 100%;
  padding-top: calc(.375rem + 1px);
  padding-bottom: calc(.375rem + 1px);
  margin-bottom: 0;
  line-height: 1.5;
  min-height: calc(1.5em + .75rem + 2px);
}

/* FA icon spacing next to labels/links */
.nav > li > a > .fa,
.nav > li > a > .fas,
.nav > li > a > .far,
.btn > .fa,
.btn > .fas,
a > .fa,
a > .fas {
  margin-right: .35rem;
}

/* BS3 checkbox / radio blocks */
.checkbox,
.radio {
  position: relative;
  display: block;
  margin-top: .5rem;
  margin-bottom: .5rem;
}
.checkbox label,
.radio label {
  min-height: 20px;
  padding-left: 1.25rem;
  margin-bottom: 0;
  font-weight: 400;
  cursor: pointer;
}
.checkbox input[type="checkbox"],
.radio input[type="radio"] {
  position: absolute;
  margin-left: -1.25rem;
  margin-top: .2rem;
}

/* dropdown-menu li > a (BS3) inside BS4 menus */
.dropdown-menu > li > a {
  display: block;
  width: 100%;
  padding: .25rem 1.5rem;
  clear: both;
  font-weight: 400;
  color: #212529;
  text-align: inherit;
  white-space: nowrap;
  background-color: transparent;
  border: 0;
  text-decoration: none;
}
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
  color: #16181b;
  text-decoration: none;
  background-color: #f8f9fa;
}
