/**
 * Compatibilidad visual con clases tipo Bootstrap usadas en vistas PHP
 * (sin cargar Bootstrap ni jQuery).
 */

/* --- Contenedores --- */
.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 15px;
}

.container-fluid {
  width: 100%;
  padding: 0 15px;
}

.full {
  width: 100%;
}

/* --- Flex / alineación --- */
.d-flex {
  display: flex !important;
}

.d-none {
  display: none !important;
}

.flex-wrap {
  flex-wrap: wrap !important;
}

.flex-column {
  flex-direction: column !important;
}

.align-items-start {
  align-items: flex-start !important;
}

.align-items-center {
  align-items: center !important;
}

.align-items-end {
  align-items: flex-end !important;
}

.justify-content-start {
  justify-content: flex-start !important;
}

.justify-content-end {
  justify-content: flex-end !important;
}

.justify-content-center {
  justify-content: center !important;
}

.justify-content-between {
  justify-content: space-between !important;
}

.mr-auto {
  margin-right: auto !important;
}

.ml-auto {
  margin-left: auto !important;
}

.my-2 {
  margin-top: 0.5rem !important;
  margin-bottom: 0.5rem !important;
}

.my-lg-0 {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

@media (min-width: 992px) {
  .my-lg-0 {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }
}

/* --- Rejilla extra --- */
.col-sm-6 {
  flex: 0 0 50%;
  max-width: 50%;
}

.col-md-6,
.col-lg-6 {
  flex: 0 0 50%;
  max-width: 50%;
}

@media (max-width: 768px) {
  .col-sm-6,
  .col-md-6,
  .col-lg-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* --- Tipografía / util --- */
.lead {
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.5;
}

.text-white {
  color: #fff !important;
}

.text-primary {
  color: #0d6efd !important;
}

.text-default {
  color: inherit;
}

.small {
  font-size: 0.875rem;
}

.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;
}

.hidden-xs {
  display: block !important;
}

.visible-xs {
  display: none !important;
}

@media (max-width: 575.98px) {
  .hidden-xs {
    display: none !important;
  }

  .visible-xs {
    display: block !important;
  }
}

.page-section {
  margin: 1rem 0;
}

/* --- Botones legacy .btn --- */
.btn {
  display: inline-block;
  font-weight: 600;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.45rem 0.85rem;
  font-size: 1rem;
  line-height: 1.4;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  color: #fff;
  background: var(--save-color-primary, #4582ec);
  border-color: var(--save-color-primary, #4582ec);
}

.btn-primary:hover {
  background: var(--save-color-primary-dark, #3a6fd4);
  border-color: var(--save-color-primary-dark, #3a6fd4);
  color: #fff;
}

.btn-info {
  color: #fff;
  background: var(--save-color-info, #009efa);
  border-color: var(--save-color-info, #009efa);
}

.btn-info:hover {
  background: var(--save-color-info-dark, #007ed6);
  border-color: var(--save-color-info-dark, #007ed6);
  color: #fff;
}

.btn-success {
  color: #fff;
  background: var(--save-color-success, #06b875);
  border-color: var(--save-color-success, #06b875);
}

.btn-success:hover {
  background: var(--save-color-success-dark, #05a366);
  color: #fff;
}

.btn-secondary {
  color: #fff;
  background: #6c757d;
  border-color: #6c757d;
}

.btn-secondary:hover {
  background: #5c636a;
  color: #fff;
}

.btn-light {
  color: #212529;
  background: #f8f9fa;
  border-color: #dee2e6;
}

.btn-lg {
  padding: 0.55rem 1.1rem;
  font-size: 1.15rem;
}

.btn-block {
  display: block;
  width: 100%;
}

/* --- Alertas --- */
.alert {
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 6px;
}

.alert-success {
  color: #0a3622;
  background: #d1e7dd;
  border-color: #a3cfbb;
}

.alert-danger {
  color: #58151c;
  background: #f8d7da;
  border-color: #f1aeb5;
}

.alert-warning {
  color: #664d03;
  background: #fff3cd;
  border-color: #ffe69c;
}

/* --- Panel --- */
.panel {
  margin-bottom: 1rem;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.panel-body {
  padding: 0;
}

/* --- Tarjetas --- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.card-header {
  padding: 0.65rem 1rem;
  margin-bottom: 0;
  background: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  font-weight: 600;
}

.card-body {
  flex: 1 1 auto;
  padding: 1rem;
}

.card-footer {
  padding: 0.65rem 1rem;
  background: rgba(0, 0, 0, 0.03);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.card-title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.card-text:last-child {
  margin-bottom: 0;
}

.card.text-white.bg-info,
.bg-info {
  background-color: var(--save-color-info, #009efa) !important;
}

.card.text-white.bg-info .card-header,
.card.text-white.bg-info .card-body {
  color: #052c65;
}

/* --- Badges --- */
.badge {
  display: inline-block;
  padding: 0.25em 0.5em;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 4px;
}

.badge-success {
  color: #fff;
  background: var(--save-color-success, #06b875);
}

.badge-danger {
  color: #fff;
  background: #dc3545;
}

.badge-info {
  color: #052c65;
  background: #cff4fc;
}

.badge-light {
  color: #212529;
  background: #f8f9fa;
}

.badge-pill {
  border-radius: 10rem;
  padding-left: 0.65em;
  padding-right: 0.65em;
}

/* --- Tablas --- */
.table-bordered th,
.table-bordered td {
  border: 1px solid #dee2e6;
}

.table-striped tbody tr:nth-of-type(odd) {
  background: rgba(0, 0, 0, 0.03);
}

.table-hover tbody tr:hover {
  background: rgba(13, 110, 253, 0.06);
}

.table-sm th,
.table-sm td {
  padding: 0.35rem 0.5rem;
}

.table-condensed th,
.table-condensed td {
  padding: 0.3rem 0.45rem;
}

.table-responsive {
  display: block;
  width: 100%;
  overflow-x: auto;
}

thead.bg-info th,
thead.bg-info td {
  background: var(--save-color-info, #009efa) !important;
  color: #fff !important;
}

/* --- Formularios --- */
.form-horizontal .form-group {
  margin-left: 0;
  margin-right: 0;
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.form-inline .form-control {
  width: auto;
  display: inline-block;
}

/* --- Navbar (vanilla + dom-helpers) --- */
.navbar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  margin-right: 1rem;
  font-size: 1.1rem;
  text-decoration: none;
  white-space: nowrap;
}

.navbar-toggler {
  padding: 0.35rem 0.6rem;
  font-size: 1rem;
  line-height: 1;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.95);
  cursor: pointer;
}

.navbar-toggler:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

.navbar-toggler-icon {
  display: inline-block;
  width: 1.35em;
  height: 1em;
  vertical-align: middle;
  background: linear-gradient(#fff, #fff) 0 0 / 100% 2px no-repeat,
    linear-gradient(#fff, #fff) 0 50% / 100% 2px no-repeat,
    linear-gradient(#fff, #fff) 0 100% / 100% 2px no-repeat;
}

.navbar-nav {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.15rem;
}

.navbar-expand-lg .navbar-nav .nav-link {
  padding-right: 0.65rem;
  padding-left: 0.65rem;
}

.nav-item.active .nav-link {
  font-weight: 700;
}

.nav-link {
  display: block;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
}

.navbar-dark .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.88);
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
  color: #fff;
}

.dropdown-toggle::after {
  display: inline-block;
  margin-left: 0.35em;
  vertical-align: 0.15em;
  content: "";
  border-top: 0.3em solid;
  border-right: 0.3em solid transparent;
  border-bottom: 0;
  border-left: 0.3em solid transparent;
}

.nav-item.dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  min-width: 10rem;
  padding: 0.4rem 0;
  margin: 0.15rem 0 0;
  font-size: 0.95rem;
  color: #212529;
  text-align: left;
  list-style: none;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  box-shadow: 0 0.35rem 0.85rem rgba(0, 0, 0, 0.15);
}

.dropdown-menu-right {
  right: 0;
  left: auto;
}

.nav-item.dropdown.show > .dropdown-menu,
.dropdown.show > .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 0.45rem 1rem;
  clear: both;
  font-weight: 400;
  color: #212529;
  text-align: inherit;
  text-decoration: none;
  white-space: nowrap;
  background: none;
  border: 0;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: #f8f9fa;
  color: #000;
}

.dropdown-divider {
  height: 0;
  margin: 0.35rem 0;
  overflow: hidden;
  border-top: 1px solid #e9ecef;
}

.navbar-collapse {
  flex-basis: 100%;
  flex-grow: 1;
  align-items: center;
}

@media (max-width: 991.98px) {
  .navbar-expand-lg .navbar-collapse:not(.show) {
    display: none;
  }

  .navbar-expand-lg .navbar-collapse.show {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    padding-top: 0.5rem;
  }

  .navbar-expand-lg .navbar-collapse.show .navbar-nav {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .navbar-expand-lg .navbar-collapse.show .dropdown-menu {
    position: static;
    float: none;
    width: 100%;
    margin-top: 0;
    border: none;
    box-shadow: none;
  }

  .navbar-expand-lg .navbar-toggler {
    display: block;
  }
}

@media (min-width: 992px) {
  .navbar-expand-lg .navbar-toggler {
    display: none;
  }

  .navbar-expand-lg .navbar-collapse {
    display: flex !important;
    flex-basis: auto;
    flex-grow: 1;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
  }

  .navbar-expand-lg .navbar-nav {
    flex-direction: row;
  }
}

/* --- Utilidades BK (legacy) --- */
.bk-margin-bottom-20 {
  margin-bottom: 20px !important;
}

.bk-margin-top-20 {
  margin-top: 20px !important;
}

.bk-margin-bottom-10 {
  margin-bottom: 10px !important;
}

.bk-padding-left-20 {
  padding-left: 20px !important;
}

.bk-padding-right-20 {
  padding-right: 20px !important;
}

.bk-radius {
  border-radius: 5px;
}

/* --- Encabezado sección menú --- */
.encabezado.no-padding-bottom {
  padding-bottom: 0;
}

.encabezado.no-padding-top {
  padding-top: 0;
}
