/* =========================================================
   Compatibilidad Bootstrap 3 → 4 / AdminLTE 2 → 3
   Permite que los módulos legacy sigan funcionando.
   ========================================================= */

/* ---- Utilidades BS3 ---- */
.pull-left { float: left !important; }
.pull-right { float: right !important; }

@media (max-width: 767.98px) {
  .hidden-xs { display: none !important; }
}
@media (min-width: 768px) {
  .hidden-sm { display: none !important; }
}
@media (min-width: 992px) {
  .hidden-md { display: none !important; }
}
@media (min-width: 1200px) {
  .hidden-lg { display: none !important; }
}

.visible-xs { display: none !important; }
@media (max-width: 767.98px) {
  .visible-xs { display: block !important; }
}

.col-xs-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
.col-xs-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-xs-3 { flex: 0 0 25%; max-width: 25%; }
.col-xs-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-xs-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
.col-xs-6 { flex: 0 0 50%; max-width: 50%; }
.col-xs-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
.col-xs-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-xs-9 { flex: 0 0 75%; max-width: 75%; }
.col-xs-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
.col-xs-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
.col-xs-12 { flex: 0 0 100%; max-width: 100%; }

.img-responsive {
  display: block;
  max-width: 100%;
  height: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ---- Botones / labels BS3 ---- */
.btn-default {
  color: #334155;
  background-color: #f8fafc;
  border-color: #cbd5e1;
}
.btn-default:hover,
.btn-default:focus {
  color: #0f172a;
  background-color: #e2e8f0;
  border-color: #94a3b8;
}

.label {
  display: inline-block;
  padding: 0.25em 0.5em;
  font-size: 75%;
  font-weight: 600;
  line-height: 1;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
}
.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; }

/* ---- Input group BS3 ---- */
.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;
}
.input-group .input-group-addon:first-child {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: 0;
}
.input-group .form-control:not(:first-child):not(:last-child) {
  border-radius: 0;
}
.input-group .input-group-addon + .form-control {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* ---- AdminLTE 2 boxes → cards ---- */
.box {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.35rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  margin-bottom: 1rem;
}
.box.box-solid {
  border-top-width: 3px;
}
.box-primary { border-top: 3px solid #007bff; }
.box-success { border-top: 3px solid #28a745; }
.box-info { border-top: 3px solid #17a2b8; }
.box-warning { border-top: 3px solid #ffc107; }
.box-danger { border-top: 3px solid #dc3545; }
.box-default { border-top: 3px solid #6c757d; }

.box-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: transparent;
}
.box-header.with-border {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.box-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  color: #0f172a;
}
.box-tools {
  margin-left: auto;
}
.box-body {
  flex: 1 1 auto;
  padding: 1rem;
}
.box-footer {
  padding: 0.75rem 1rem;
  background-color: #f8fafc;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 0 0 0.35rem 0.35rem;
}

/* ---- Panels BS3 ---- */
.panel {
  margin-bottom: 1rem;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.35rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.panel-heading {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 0.35rem 0.35rem 0 0;
}
.panel-body { padding: 1rem; }
.panel-footer {
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* ---- Content header ALTE2 spacing ---- */
.content-header > h1 {
  margin: 0;
  font-size: 1.5rem;
}
.content-header .breadcrumb {
  background: transparent;
  margin-bottom: 0;
  padding: 0.5rem 0;
}

/* ---- Nav tabs BS3 (fichas / pestañas) ---- */
.nav-tabs {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
  border-bottom: 1px solid #dee2e6;
}

.nav-tabs > li {
  float: none;
  margin-bottom: -1px;
  display: list-item;
}

.nav-tabs > li > a {
  display: block;
  padding: 0.55rem 1rem;
  margin-right: 2px;
  line-height: 1.4;
  border: 1px solid transparent;
  border-top-left-radius: 0.35rem;
  border-top-right-radius: 0.35rem;
  color: #64748b;
  text-decoration: none;
  background: transparent;
  white-space: nowrap;
}

.nav-tabs > li > a:hover,
.nav-tabs > li > a:focus {
  border-color: #e2e8f0 #e2e8f0 #dee2e6;
  color: #0f172a;
  text-decoration: none;
  background: #f8fafc;
}

.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus,
.nav-tabs > li > a.active,
.nav-tabs .nav-link.active {
  color: #0f172a;
  background-color: #fff;
  border-color: #dee2e6 #dee2e6 #fff;
  font-weight: 600;
}

.nav-tabs .nav-item {
  margin-bottom: -1px;
}

.nav-tabs .nav-link {
  border: 1px solid transparent;
  border-top-left-radius: 0.35rem;
  border-top-right-radius: 0.35rem;
}

/* Breadcrumb BS3 */
.breadcrumb > li {
  display: inline-block;
}
.breadcrumb > li + li:before {
  content: "/\00a0";
  padding: 0 0.4rem;
  color: #94a3b8;
}

/* Modal close BS3 */
.modal-header .close {
  order: 2;
  margin: -0.5rem -0.5rem -0.5rem auto;
  padding: 0.5rem;
  background: transparent;
  border: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header .modal-title {
  margin: 0;
  flex: 1;
}

/* ---- Small-box (info boxes dashboard) ---- */
.small-box {
  border-radius: 0.35rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* ---- Utilidades BS4 → BS5 ---- */
.ml-auto { margin-left: auto !important; }
.mr-auto { margin-right: auto !important; }
.ml-1 { margin-left: 0.25rem !important; }
.ml-2 { margin-left: 0.5rem !important; }
.ml-3 { margin-left: 1rem !important; }
.mr-1 { margin-right: 0.25rem !important; }
.mr-2 { margin-right: 0.5rem !important; }
.mr-3 { margin-right: 1rem !important; }
.pr-1 { padding-right: 0.25rem !important; }
.pr-2 { padding-right: 0.5rem !important; }
.pl-1 { padding-left: 0.25rem !important; }
.pl-2 { padding-left: 0.5rem !important; }
.float-left { float: left !important; }
.float-right { float: right !important; }
.float-sm-right { float: right !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }
.font-weight-bold { font-weight: 700 !important; }
.font-weight-light { font-weight: 300 !important; }
.font-weight-normal { font-weight: 400 !important; }
.font-italic { font-style: italic !important; }
.badge-primary { background-color: #0d6efd; color: #fff; }
.badge-success { background-color: #198754; color: #fff; }
.badge-danger { background-color: #dc3545; color: #fff; }
.badge-warning { background-color: #ffc107; color: #212529; }
.badge-info { background-color: #0dcaf0; color: #000; }
.badge-secondary { background-color: #6c757d; color: #fff; }
.badge-light { background-color: #f8f9fa; color: #000; }
.badge-dark { background-color: #212529; color: #fff; }
.btn-block { display: block; width: 100%; }
.form-group { margin-bottom: 1rem; }
.custom-select,
select.form-control {
  display: block;
  width: 100%;
  padding: 0.375rem 2.25rem 0.375rem 0.75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #212529;
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  appearance: auto;
}
.input-group-prepend,
.input-group-append {
  display: flex;
}
.input-group > .input-group-prepend > .input-group-text,
.input-group > .input-group-append > .input-group-text {
  border-radius: 0.375rem;
}
.input-group > .input-group-prepend > .input-group-text {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.input-group > .input-group-prepend + .form-control {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.img-circle { border-radius: 50% !important; }
.close {
  background: transparent;
  border: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0.6;
  cursor: pointer;
}
.modal-header .close,
.modal-header .btn-close {
  margin-left: auto;
}
/* content-header ALTE */
.content-header {
  display: block;
}
.content-wrapper > .content {
  padding: 0.75rem 1rem 1.5rem;
}

/* ---- Extras BS3/ALTE críticos post-migración ---- */
.hide { display: none !important; }
.show { display: block !important; }
.invisible { visibility: hidden !important; }

.form-row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -0.5rem;
  margin-left: -0.5rem;
}
.form-row > [class*="col-"] {
  padding-right: 0.5rem;
  padding-left: 0.5rem;
}

.modal-dialog.lg,
.modal-dialog.modal-lg {
  max-width: 800px;
}

.modal-header {
  height: auto !important;
  min-height: 52px;
  gap: 0.5rem;
  flex-wrap: nowrap;
}
.modal-header .modal-title {
  font-size: 1.1rem;
  line-height: 1.3;
  color: inherit;
}
.modal-header .btn-close,
.modal-header .close {
  order: 2;
  margin-left: auto !important;
  flex-shrink: 0;
  box-shadow: none;
}

/* input-group-btn BS3 */
.input-group-btn {
  display: flex;
  align-items: stretch;
}
.input-group-btn > .btn {
  position: relative;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.input-group > .form-control + .input-group-btn > .btn,
.input-group > .form-control + .input-group-btn {
  margin-left: -1px;
}
.input-group .ajaxgif {
  margin-left: 8px;
  align-self: center;
  max-height: 28px;
}

/* Colores AdminLTE */
.bg-blue, .bg-primary { background-color: #0d6efd !important; color: #fff !important; }
.bg-red, .bg-danger { background-color: #dc3545 !important; color: #fff !important; }
.bg-green, .bg-success { background-color: #198754 !important; color: #fff !important; }
.bg-yellow, .bg-warning { background-color: #ffc107 !important; color: #212529 !important; }
.bg-aqua, .bg-info { background-color: #0dcaf0 !important; color: #000 !important; }
.bg-navy { background-color: #001f3f !important; color: #fff !important; }
.bg-teal { background-color: #20c997 !important; color: #000 !important; }
.bg-olive { background-color: #3d9970 !important; color: #fff !important; }
.bg-lime { background-color: #01ff70 !important; color: #000 !important; }
.bg-orange { background-color: #fd7e14 !important; color: #000 !important; }
.bg-fuchsia { background-color: #f012be !important; color: #fff !important; }
.bg-purple { background-color: #6f42c1 !important; color: #fff !important; }
.bg-maroon { background-color: #d81b60 !important; color: #fff !important; }
.bg-black { background-color: #111 !important; color: #fff !important; }
.bg-gray { background-color: #6c757d !important; color: #fff !important; }

.text-blue { color: #0d6efd !important; }
.text-red { color: #dc3545 !important; }
.text-green { color: #198754 !important; }
.text-yellow { color: #ffc107 !important; }
.text-aqua { color: #0dcaf0 !important; }

.badge.bg-blue { background-color: #0d6efd !important; }
.badge.bg-red { background-color: #dc3545 !important; }
.badge.bg-green { background-color: #198754 !important; }

/* info-box AdminLTE (dashboard técnico) */
.info-box {
  display: flex;
  align-items: stretch;
  min-height: 90px;
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  margin-bottom: 1rem;
  overflow: hidden;
}
.info-box-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  font-size: 2rem;
  color: #fff;
  flex-shrink: 0;
}
.info-box-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.75rem 1rem;
  flex: 1;
  line-height: 1.3;
}
.info-box-text {
  display: block;
  font-size: 0.85rem;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 600;
}
.info-box-number {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
}

/* small-box AdminLTE */
.small-box {
  position: relative;
  display: block;
  margin-bottom: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
  overflow: hidden;
}
.small-box > .inner { padding: 12px 14px; }
.small-box h3 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 6px;
  white-space: nowrap;
  padding: 0;
  color: inherit;
}
.small-box p { margin: 0; font-size: 0.9rem; color: inherit; opacity: 0.9; }
.small-box .icon {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 2.5rem;
  opacity: 0.25;
}
.small-box > .small-box-footer {
  display: block;
  padding: 6px 0;
  text-align: center;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
  text-decoration: none;
  font-size: 0.8rem;
}

.btn-xs {
  padding: 0.15rem 0.4rem;
  font-size: 0.75rem;
  border-radius: 0.25rem;
}
.btn-app {
  display: inline-block;
  margin: 0 0 8px 8px;
  padding: 12px 8px;
  min-width: 80px;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #fff;
  text-align: center;
  color: #334155;
  text-decoration: none;
}
.btn-app > .fa, .btn-app > .bi { display: block; font-size: 1.4rem; margin-bottom: 4px; }

/* Breadcrumb BS4 float */
.breadcrumb-item + .breadcrumb-item::before {
  float: none;
}

/* Directivas visibles ALTE */
.visible-lg-block { display: none !important; }
@media (min-width: 1200px) {
  .visible-lg-block { display: block !important; }
}

/* DataTables BS5 spacing */
div.dataTables_wrapper div.dataTables_length select {
  width: auto;
  display: inline-block;
}
div.dataTables_wrapper div.dataTables_filter input {
  width: auto;
  display: inline-block;
  margin-left: 0.5rem;
}
