/*!
 * Bee UI - Estilos base de los componentes reemplazados de Bootstrap.
 * Reemplaza el CSS de Bootstrap para modales, collapse, dropdowns, tooltips
 * y conserva un puñado de utilidades que el JavaScript existente alterna
 * (d-none, badge-*, alert-*, text-muted, form-check).
 */

/* ============ MODALES (.bee-modal) ============ */
.bee-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1055;
  overflow-y: auto;
  outline: none;
}
.bee-modal.show {
  display: block;
}

body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1050;
  background-color: rgba(0, 0, 0, 0.5);
}

/* ============ ESTRUCTURA DEL MODAL (.bee-modal) ============ */
.bee-modal-dialog {
  position: relative;
  width: auto;
  margin: 1.75rem auto;
  max-width: 500px;
  pointer-events: none;
}
.bee-modal-sm {
  max-width: 300px;
}
.bee-modal-lg {
  max-width: 800px;
}
.bee-modal-xl {
  max-width: 1140px;
}
@media (max-width: 575.98px) {
  .bee-modal-dialog {
    margin: 0.5rem;
  }
}
.bee-modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.6rem;
  outline: 0;
  pointer-events: auto;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}
.bee-modal-header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  border-top-left-radius: 0.6rem;
  border-top-right-radius: 0.6rem;
}
.bee-modal-title {
  margin-bottom: 0;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.5;
}
.bee-modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: 1.25rem;
}
.bee-modal-footer {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  padding: 0.9rem 1.25rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  border-bottom-right-radius: 0.6rem;
  border-bottom-left-radius: 0.6rem;
  gap: 0.5rem;
}
.bee-modal-footer > * {
  margin: 0;
}
.bee-modal-close {
  float: right;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: #000;
  text-shadow: 0 1px 0 #fff;
  opacity: 0.5;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.bee-modal-close:hover {
  opacity: 0.75;
}
.bee-modal-header .bee-modal-close {
  padding: 0.5rem;
  margin: -0.5rem -0.5rem -0.5rem auto;
}

/* ============ COLLAPSE ============ */
.collapse:not(.show) {
  display: none;
}
.collapse.show {
  display: block;
}

/* ============ TOOLTIPS ============ */
.bee-tooltip {
  position: fixed;
  z-index: 2000;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.4;
  color: #fff;
  background-color: #2c3e50;
  border-radius: 6px;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* ============ UTILIDADES usadas por JS existente ============ */
.d-none {
  display: none !important;
}
.d-block {
  display: block !important;
}
.d-flex {
  display: flex !important;
}
.d-inline-block {
  display: inline-block !important;
}
.text-muted {
  color: #6c757d !important;
}

/* ============ BADGES ============ */
.badge {
  display: inline-block;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.375rem;
}
.badge-success {
  color: #fff;
  background-color: #18bc9c;
}
.badge-danger {
  color: #fff;
  background-color: #e74c3c;
}
.badge-warning {
  color: #fff;
  background-color: #f39c12;
}
.badge-info {
  color: #fff;
  background-color: #3498db;
}
.badge-secondary {
  color: #fff;
  background-color: #95a5a6;
}
.badge-primary {
  color: #fff;
  background-color: #2c3e50;
}
.badge-light {
  color: #212529;
  background-color: #ecf0f1;
}
.badge-dark {
  color: #fff;
  background-color: #343a40;
}

/* ============ ALERTAS (usadas por JS existente) ============ */
.alert {
  position: relative;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
}
.alert-success {
  color: #0f5132;
  background-color: #d1e7dd;
  border-color: #badbcc;
}
.alert-danger {
  color: #842029;
  background-color: #f8d7da;
  border-color: #f5c2c7;
}
.alert-warning {
  color: #664d03;
  background-color: #fff3cd;
  border-color: #ffecb5;
}
.alert-info {
  color: #055160;
  background-color: #cff4fc;
  border-color: #b6effb;
}
.alert-primary {
  color: #084298;
  background-color: #cfe2ff;
  border-color: #b6d4fe;
}

/* ============ FORM CHECK (usado por JS existente) ============ */
.form-check {
  display: flex;
  align-items: center;
}
.form-check-input {
  width: 1em;
  height: 1em;
  margin-right: 0.5rem;
  accent-color: #18bc9c;
}
.form-check-input:checked {
  accent-color: #18bc9c;
}

/* ============ BOTONES (puente para JS y vistas no migradas) ============ */
.btn {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  border-radius: 0.4rem;
  transition:
    color 0.15s ease-in-out,
    background-color 0.15s ease-in-out,
    border-color 0.15s ease-in-out,
    box-shadow 0.15s ease-in-out;
}
.btn:hover {
  text-decoration: none;
}
.btn:focus {
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(44, 62, 80, 0.25);
}
.btn:disabled {
  opacity: 0.6;
  pointer-events: none;
}
.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.765rem;
  border-radius: 0.3rem;
}
.btn-lg {
  padding: 0.75rem 1.1rem;
  font-size: 1rem;
  border-radius: 0.5rem;
}
.btn-block {
  display: block;
  width: 100%;
}

.btn-action-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  line-height: 1;
}
.btn-action-circle i,
.btn-action-circle .bx {
  font-size: 16px;
  line-height: 1;
}
.btn-action-circle:hover {
  text-decoration: none;
}

.btn-primary {
  color: #fff;
  background-color: #2c3e50;
  border-color: #2c3e50;
}
.btn-primary:hover {
  color: #fff;
  background-color: #222f3b;
  border-color: #1e2a35;
}
.btn-secondary {
  color: #fff;
  background-color: #95a5a6;
  border-color: #95a5a6;
}
.btn-secondary:hover {
  color: #fff;
  background-color: #809090;
  border-color: #7a8a8a;
}
.btn-success {
  color: #fff;
  background-color: #18bc9c;
  border-color: #18bc9c;
}
.btn-success:hover {
  color: #fff;
  background-color: #149c83;
  border-color: #128f78;
}
.btn-danger {
  color: #fff;
  background-color: #e74c3c;
  border-color: #e74c3c;
}
.btn-danger:hover {
  color: #fff;
  background-color: #df2e1b;
  border-color: #d62c1a;
}
.btn-warning {
  color: #fff;
  background-color: #f39c12;
  border-color: #f39c12;
}
.btn-warning:hover {
  color: #fff;
  background-color: #da8b0a;
  border-color: #cf8409;
}
.btn-info {
  color: #fff;
  background-color: #3498db;
  border-color: #3498db;
}
.btn-info:hover {
  color: #fff;
  background-color: #258cd1;
  border-color: #2384c6;
}
.btn-light {
  color: #212529;
  background-color: #ecf0f1;
  border-color: #ecf0f1;
}
.btn-light:hover {
  color: #212529;
  background-color: #dde4e6;
  border-color: #d6dfe1;
}
.btn-dark {
  color: #fff;
  background-color: #343a40;
  border-color: #343a40;
}
.btn-dark:hover {
  color: #fff;
  background-color: #23272b;
  border-color: #1d2124;
}
.btn-link {
  color: #2c3e50;
  font-weight: 500;
  background-color: transparent;
  border: 0;
  text-decoration: none;
}
.btn-link:hover {
  color: #1a242c;
  text-decoration: underline;
}

.btn-outline-primary {
  color: #2c3e50;
  border-color: #2c3e50;
  background-color: transparent;
}
.btn-outline-primary:hover {
  color: #fff;
  background-color: #2c3e50;
}
.btn-outline-secondary {
  color: #95a5a6;
  border-color: #95a5a6;
  background-color: transparent;
}
.btn-outline-secondary:hover {
  color: #fff;
  background-color: #95a5a6;
}
.btn-outline-success {
  color: #18bc9c;
  border-color: #18bc9c;
  background-color: transparent;
}
.btn-outline-success:hover {
  color: #fff;
  background-color: #18bc9c;
}
.btn-outline-danger {
  color: #e74c3c;
  border-color: #e74c3c;
  background-color: transparent;
}
.btn-outline-danger:hover {
  color: #fff;
  background-color: #e74c3c;
}
.btn-outline-warning {
  color: #f39c12;
  border-color: #f39c12;
  background-color: transparent;
}
.btn-outline-warning:hover {
  color: #fff;
  background-color: #f39c12;
}
.btn-outline-info {
  color: #3498db;
  border-color: #3498db;
  background-color: transparent;
}
.btn-outline-info:hover {
  color: #fff;
  background-color: #3498db;
}
.btn-outline-light {
  color: #ecf0f1;
  border-color: #ecf0f1;
  background-color: transparent;
}
.btn-outline-light:hover {
  color: #212529;
  background-color: #ecf0f1;
}

.btn-group {
  display: inline-flex;
  vertical-align: middle;
}
.btn-group > .btn:not(:first-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  margin-left: -1px;
}
.btn-group > .btn:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.btn-group-sm > .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.765rem;
  border-radius: 0.3rem;
}

/* ============ DROPDOWNS (usados por bee-ui.js) ============ */
.dropdown {
  position: relative;
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1050;
  min-width: 10rem;
  margin: 0.125rem 0 0;
  padding: 0.4rem 0;
  list-style: none;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.4rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  text-align: left;
}
.dropdown-menu-end {
  right: auto;
  left: 0;
}
.dropdown-menu-right {
  left: auto;
  right: 0;
}
.dropdown-menu.show {
  display: block;
}
.dropdown-item {
  display: block;
  width: 100%;
  padding: 0.375rem 1rem;
  clear: both;
  font-weight: 400;
  color: #212529;
  text-align: inherit;
  text-decoration: none;
  white-space: nowrap;
  background-color: transparent;
  border: 0;
}
.dropdown-item:hover,
.dropdown-item:focus {
  color: #16181b;
  background-color: #eef2f4;
  text-decoration: none;
}
.dropdown-divider {
  height: 0;
  margin: 0.4rem 0;
  overflow: hidden;
  border-top: 1px solid #e9ecef;
}
.dropdown-header {
  display: block;
  padding: 0.375rem 1rem;
  font-size: 0.765rem;
  font-weight: 700;
  color: #6c757d;
  text-transform: uppercase;
}
.dropdown-toggle::after {
  display: inline-block;
  margin-left: 0.4em;
  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;
}
.dropdown-toggle:focus {
  outline: 0;
}

/* ============ CARD ============ */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;
  background-color: #fff;
  background-clip: border-box;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.6rem;
}
.card-header {
  padding: 0.75rem 1rem;
  margin-bottom: 0;
  background-color: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.card-body {
  flex: 1 1 auto;
  padding: 1rem;
}
.card-footer {
  padding: 0.75rem 1rem;
  background-color: rgba(0, 0, 0, 0.03);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}
.card-title {
  margin-bottom: 0.75rem;
}

/* ============ FORM CONTROLS (puente para JS) ============ */
.form-control {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  color: #495057;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ced4da;
  border-radius: 0.4rem;
  transition:
    border-color 0.15s ease-in-out,
    box-shadow 0.15s ease-in-out;
}
.form-control:focus {
  color: #495057;
  background-color: #fff;
  border-color: #18bc9c;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(24, 188, 156, 0.25);
}
.form-control-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.765rem;
  border-radius: 0.3rem;
}
.form-label {
  display: inline-block;
  margin-bottom: 0.4rem;
  font-weight: 500;
}
.form-select {
  display: block;
  width: 100%;
  padding: 0.375rem 2.25rem 0.375rem 0.75rem;
  font-size: 0.875rem;
  color: #495057;
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: 0.4rem;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  appearance: none;
}

/* ============ SPINNER ============ */
.spinner-border {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  vertical-align: -0.125em;
  border: 0.2em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: bee-spin 0.75s linear infinite;
}
.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.2em;
}
@keyframes bee-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============ UTILIDADES AUXILIARES ============ */
.rounded-circle {
  border-radius: 50% !important;
}
.float-end {
  float: right !important;
}
.float-start {
  float: left !important;
}
.text-white {
  color: #fff !important;
}
.text-center {
  text-align: center !important;
}
.text-start {
  text-align: left !important;
}
.text-end {
  text-align: right !important;
}
.text-decoration-none {
  text-decoration: none !important;
}
.small {
  font-size: 0.875em;
}

/* ============ TABLAS (usadas por vistas) ============ */
.table {
  width: 100%;
  margin-bottom: 1rem;
  color: #212529;
  border-collapse: collapse;
}
.table th,
.table td {
  padding: 0.75rem;
  vertical-align: middle;
  border-top: 1px solid #dee2e6;
}
.table thead th {
  vertical-align: bottom;
  border-bottom: 2px solid #dee2e6;
}
.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.03);
}
.table-hover tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.06);
}
.table-bordered th,
.table-bordered td {
  border: 1px solid #dee2e6;
}
.table-sm th,
.table-sm td {
  padding: 0.3rem;
}
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table .thead-dark th {
  color: #fff;
  background-color: #343a40;
  border-color: #454d55;
}
.table .thead-light th {
  color: #495057;
  background-color: #e9ecef;
  border-color: #dee2e6;
}

/* ============ PAGINACIÓN ============ */
.pagination {
  display: flex;
  list-style: none;
  padding-left: 0;
  gap: 0.25rem;
}
.page-item .page-link {
  display: block;
  padding: 0.4rem 0.75rem;
  color: #2c3e50;
  background-color: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  text-decoration: none;
}
.page-item .page-link:hover {
  color: #fff;
  background-color: #2c3e50;
  border-color: #2c3e50;
}
.page-item.active .page-link {
  color: #fff;
  background-color: #2c3e50;
  border-color: #2c3e50;
}
.page-item.disabled .page-link {
  color: #6c757d;
  pointer-events: none;
  background-color: #fff;
  border-color: #dee2e6;
}

/* ============ FORMS (helpers) ============ */
.form-group {
  margin-bottom: 1rem;
}
.form-text {
  margin-top: 0.25rem;
  font-size: 0.875em;
  color: #6c757d;
  display: block;
}

/* ============ BREADCRUMB ============ */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
  list-style: none;
  background-color: #e9ecef;
  border-radius: 0.375rem;
}
.breadcrumb-item + .breadcrumb-item {
  padding-left: 0.5rem;
}
.breadcrumb-item + .breadcrumb-item::before {
  float: left;
  padding-right: 0.5rem;
  color: #6c757d;
  content: "/";
}
.breadcrumb-item a {
  color: #2c3e50;
  text-decoration: none;
}
.breadcrumb-item a:hover {
  text-decoration: underline;
}
.breadcrumb-item.active {
  color: #6c757d;
}

/* ============ LIST GROUP ============ */
.list-group {
  display: flex;
  flex-direction: column;
  padding-left: 0;
  margin-bottom: 0;
  border-radius: 0.375rem;
  list-style: none;
}
.list-group-item {
  position: relative;
  display: block;
  padding: 0.75rem 1.25rem;
  color: #212529;
  background-color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.125);
  text-decoration: none;
}
.list-group-item + .list-group-item {
  border-top-width: 0;
}
.list-group-item:first-child {
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}
.list-group-item:last-child {
  border-bottom-right-radius: inherit;
  border-bottom-left-radius: inherit;
}
.list-group-item-action:hover,
.list-group-item-action:focus {
  color: #495057;
  background-color: #f8f9fa;
}

/* ============ INPUT GROUP (append/prepend) ============ */
.input-group-append,
.input-group-prepend {
  display: flex;
}

/* ============ CUSTOM FILE ============ */
.custom-file {
  position: relative;
  display: inline-block;
  width: 100%;
  height: calc(1.5em + 0.75rem + 2px);
  margin-bottom: 0;
}
.custom-file-input {
  position: relative;
  z-index: 2;
  width: 100%;
  height: calc(1.5em + 0.75rem + 2px);
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.custom-file-input:focus ~ .custom-file-label {
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}
.custom-file-label {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1;
  height: calc(1.5em + 0.75rem + 2px);
  padding: 0.375rem 0.75rem;
  color: #495057;
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.custom-file-label::after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: block;
  height: calc(1.5em + 0.75rem);
  padding: 0.375rem 0.75rem;
  line-height: 1.5;
  color: #495057;
  content: "Examinar";
  background-color: #e9ecef;
  border-left: inherit;
  border-radius: 0 0.375rem 0.375rem 0;
}

/* ============ CUSTOM CONTROL (checkbox/switch) ============ */
.custom-control {
  position: relative;
  z-index: 1;
  display: block;
  min-height: 1.5rem;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.custom-control-input {
  position: absolute;
  z-index: -1;
  width: 1rem;
  height: 1.25rem;
  opacity: 0;
}
.custom-control-label {
  position: relative;
  margin-bottom: 0;
  vertical-align: top;
  cursor: pointer;
}
.custom-control-label::before {
  position: absolute;
  top: 0.25rem;
  left: -1.5rem;
  display: block;
  width: 1rem;
  height: 1rem;
  pointer-events: none;
  content: "";
  background-color: #fff;
  border: #adb5bd solid 1px;
}
.custom-control-label::after {
  position: absolute;
  top: 0.25rem;
  left: -1.5rem;
  display: block;
  width: 1rem;
  height: 1rem;
  content: "";
  background: no-repeat 50% / 50% 50%;
}
.custom-control-input:checked ~ .custom-control-label::before {
  color: #fff;
  border-color: #007bff;
  background-color: #007bff;
}
.custom-control-input:focus ~ .custom-control-label::before {
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}
.custom-control-input:disabled ~ .custom-control-label {
  color: #6c757d;
  cursor: default;
}
.custom-switch {
  padding-left: 2.25rem;
}
.custom-switch .custom-control-label::before {
  left: -2.25rem;
  width: 1.75rem;
  pointer-events: all;
  border-radius: 0.5rem;
}
.custom-switch .custom-control-label::after {
  top: calc(0.25rem + 2px);
  left: calc(-2.25rem + 2px);
  width: calc(1rem - 4px);
  height: calc(1rem - 4px);
  background-color: #adb5bd;
  border-radius: 0.5rem;
  transition:
    transform 0.15s ease-in-out,
    background-color 0.15s ease-in-out;
}
.custom-switch .custom-control-input:checked ~ .custom-control-label::after {
  background-color: #fff;
  transform: translateX(0.75rem);
}
.custom-switch .custom-control-input:checked ~ .custom-control-label::before {
  border-color: #007bff;
  background-color: #007bff;
}
.custom-checkbox .custom-control-label::before {
  border-radius: 0.25rem;
}
.custom-checkbox .custom-control-input:checked ~ .custom-control-label::after {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/%3e%3c/svg%3e");
}
