.crudPartLabel {
  padding: 2px;
  position: absolute;
  font-size: 0.8em;
  margin: -18px -6px;
  color: gray;
}

.crudHeader .loading {
  width: 16px;
  margin-left: -30px;
  vertical-align: middle;
  position: absolute;
  margin-top: 7px;
  display: none;
}

.crudHeader .loading.run {
  position: absolute;
  display: inline-block;
}

.crudAccionesListado * {
  vertical-align: middle;
}
/* ===== Toolbar de búsqueda y acciones ===== */
.crud-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 4px;
  flex-wrap: wrap;
}

.crud-toolbar__search {
  flex: 1;
  min-width: 180px;
}

.crud-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.crud-search-box__icon {
  position: absolute;
  left: 12px;
  color: #9aa0a6;
  font-size: .8rem;
  pointer-events: none;
}

.crud-search-box__input {
  width: 100%;
  padding: 8px 14px 8px 34px;
  border: 1px solid #dadce0;
  border-radius: 22px;
  background: #f8f9fa;
  font-size: .85rem;
  color: #202124;
  outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}

.crud-search-box__input:focus {
  background: #fff;
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, .12);
}

.crud-search-box__input::placeholder { color: #9aa0a6; }

.crud-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Botón base */
.crud-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid transparent;
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
  transition: background .15s, border-color .15s, box-shadow .15s;
}

/* Ghost — Filtrar */
.crud-btn--ghost {
  background: #fff;
  border-color: #dadce0;
  color: #3c4043;
}
.crud-btn--ghost:hover {
  background: #f1f3f4;
  border-color: #bdc1c6;
}

/* Icon-only — Imprimir */
.crud-btn--icon {
  background: transparent;
  border-color: transparent;
  color: #5f6368;
  padding: 7px 10px;
  border-radius: 50%;
}
.crud-btn--icon:hover {
  background: #f1f3f4;
  color: #3c4043;
}

/* Primary — Nuevo */
.crud-btn--primary {
  background: #00769d;
  border-color: #00769d;
  color: #fff;
}
.crud-btn--primary:hover {
  background: #005f80;
  border-color: #005f80;
  box-shadow: 0 2px 6px rgba(0, 118, 157, .35);
}
/* ===== Fin Toolbar ===== */

/* ── Listado / Tabla ─────────────────────────────────────── */
.crudBody {
  margin: 0;
  text-align: left;
}
.crudList {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  color: #1e293b;
}
.crudList thead tr {
  border-bottom: 2px solid #e2e8f0;
}
.crudList th {
  background: #f8fafc;
  border: none;
  padding: 10px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  vertical-align: middle;
  width: auto;
}
.th-accion {
  width: 44px !important;
  text-align: center;
}
.crudList td {
  border: none;
  border-bottom: 1px solid #f1f5f9;
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
  word-wrap: break-word;
  word-break: keep-all;
}
.crudList td p {
  margin: 0;
  padding: 0;
}
.crudList tbody tr {
  transition: background 0.12s;
}
.crudList tbody tr:hover {
  background: #f8fafc;
}
.crudList th a {
  color: #475569;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.crudList th a:hover {
  color: #1e293b;
}

/* Botones de acción inline (Editar / Eliminar) */
.btn-crud-edit,
.btn-crud-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-size: 0.8rem;
  padding: 0;
  line-height: 1;
}
.btn-crud-edit {
  color: #2563eb;
  border-color: #bfdbfe;
}
.btn-crud-edit:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}
.btn-crud-del {
  color: #dc2626;
  border-color: #fecaca;
}
.btn-crud-del:hover {
  background: #fef2f2;
  border-color: #f87171;
}
.td-accion {
  text-align: center;
  width: 44px;
}
.crudHeaderResult {
  display: block;
}
.crudHeaderResult .crud2-local-sum,
.crudHeaderResult .crud2-server-sum {
  padding: 5px;
  text-align: right;
  display: block;
}
.crudHeaderResult .crud2-local-sum {
  color: gray;
}
.crudHeaderResult i {
  display: inline-block;
  padding: 5px;
  float: right;
}
/* ── Panel de edición ───────────────────────────────────── */
.crudEdit {
  margin: 20px auto 8px;
  display: block;
  width: 100%;
  max-width: 680px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

/* Header */
.crudEditHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  min-height: 0;
  height: auto;
}
.crudEditHeaderLeft {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.crudEditTitle {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.crudEditBadge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #dbeafe;
  color: #1d4ed8;
  white-space: nowrap;
  flex-shrink: 0;
}
.crudEditBadge--new  { background: #dcfce7; color: #15803d; }
.crudEditBadge--edit { background: #ffedd5; color: #c2410c; }
.crudEditBadge--del  { background: #fee2e2; color: #b91c1c; }
.crudEditBtnIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 6px;
  color: #64748b;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.crudEditBtnIcon:hover {
  background: #e2e8f0;
  color: #1e293b;
}

/* Error */
.crudEditError {
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
}
.crudEditError:not(:empty) {
  padding: 10px 18px;
  background: #fef2f2;
  color: #b91c1c;
  border-bottom: 1px solid #fecaca;
}

/* Campos */
.crudEditCampos {
  padding: 18px 20px 8px;
  text-align: left;
}
.crudEditCampos > .crud2-item > input,
.crudEditCampos > .crud2-item > textarea,
.crudEditCampos > .crud2-item > select {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.9rem;
  padding: 8px 10px;
  width: 100%;
  display: block;
  background: #fff;
  color: #1e293b;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.crudEditCampos > .crud2-item > select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}
.crudEditCampos > .crud2-item > input:focus,
.crudEditCampos > .crud2-item > textarea:focus,
.crudEditCampos > .crud2-item > select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  outline: none;
}
.crudEditCampos > .crud2-item > span {
  font-size: 0.9rem;
  display: block;
  width: 100%;
  color: #1e293b;
  padding: 4px 0;
}

/* ── jQuery UI Combobox ───────────────────────────────────────────────────
   sitio.css no se carga en este contexto, por lo que los estilos del widget
   deben definirse aquí. Sin position:relative en .ui-combobox el botón ▼
   (position:absolute) escala al primer ancestro posicionado (el nav).
   ──────────────────────────────────────────────────────────────────────── */
.ui-combobox {
  position: relative;
  display: block;
  width: 100%;
}
.ui-combobox-input {
  width: calc(100% - 38px);
  border: 1px solid #cbd5e1;
  border-right: none;
  border-radius: 6px 0 0 6px;
  font-size: 0.9rem;
  padding: 7px 10px;
  height: 38px;
  box-sizing: border-box;
  background: #fff;
  color: #1e293b;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ui-combobox-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.ui-combobox-toggle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 0 6px 6px 0;
  background: #f8fafc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #64748b;
  transition: background 0.15s;
}
.ui-combobox-toggle:hover {
  background: #e9ecef;
}
/* Dropdown lista del autocomplete (appendTo:body → necesita z-index alto) */
.ui-autocomplete {
  z-index: 9999 !important;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.10);
  max-height: 220px;
  overflow-y: auto;
  font-size: 0.9rem;
}
.ui-autocomplete .ui-menu-item-wrapper {
  padding: 7px 12px;
  cursor: pointer;
}
.ui-autocomplete .ui-menu-item-wrapper.ui-state-active,
.ui-autocomplete .ui-menu-item-wrapper:hover {
  background: #f0f7ff;
  color: #1e40af;
  border: none;
  margin: 0;
}
.crudEditCampos > .crud2-item > input[readonly],
.crudEditCampos > .crud2-item > textarea[readonly],
.crudEditCampos > .crud2-item > select[readonly] {
  background: #f8fafc;
  color: #64748b;
  cursor: not-allowed;
}

/* Acciones / Footer */
.crudEditAcciones {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  position: static;
  margin-top: 0;
}
.crudEditCampos .crud-map {
  display: inline-block;
  background: #efefef;
  border: lightgray 1px solid;
  border-radius: 4px;
  padding: 4px;
  margin: 20px;
}
.crudEditCampos .map-layer {
  width: 500px;
  height: 500px;
}
.crudEditCampos .crud-map .map-search {
  width: 300px;
}
.crudEliminando {
  color: #fefefe;
  background: darkred;
  transition: all 1s ease-out;
  box-shadow: 0px 0px 10px red;
}
.crudEliminando .btn btn-primary {
  border: none;
  background: none;
  padding: 0;
  margin-bottom: 8px;
}

.crudEliminando .btn btn-primary.crudEliminarConfirm {
  display: inline-block;
}

.crudEliminando .btn btn-primary.crudEliminarCancelar {
  display: inline-block;
}

.crud2-item {
  display: block;
  text-align: left;
  margin: 0 0 16px 0;
}
.crud2-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 5px;
}
.crud2-required {
  color: #ef4444;
  margin-left: 2px;
}

#error-enItem {
  position: absolute;
  transition: all 200ms;
  opacity: 0;
  margin-top: 30px;
}
*:focus + #error-enItem {
  transition: all 200ms;
  opacity: 1;
}
.img-zoom {
  background: url("../../../../images/loading.gif") no-repeat no-repeat 50%;
  width: 100%;
  min-height: 32px;
}
.crudFilterColumn {
  display: block;
  padding: 2px 2px 10px 2px;
  width: 150px;
  margin: auto;
}
.crudFilterColumn.closed {
  width: auto;
  display: inline-block;
  margin-left: 10px;
  color: #b5b5b5;
}
.crudFilterColumn.closed:hover {
  color: #000000;
}
.crudFilterColumn.closed > i.fa-filter {
  margin: 0;
  padding: 0;
}
.crudFilterColumn > i.fa-filter {
  display: none;
}
.crudFilterColumn.closed > i.fa-filter {
  display: inline-block;
}

.crudFilterColumn.closed > i.fa-remove-circle {
  display: none;
}
.crudFilterColumn.closed > input {
  display: none;
}
.crudFilterColumn > input {
  width: 100px;
}
.crudFilterColumn > input.changed + span {
  display: inline-block;
  position: absolute;
  font-size: 9px;
  font-style: italic;
  width: 200px;
  margin-left: -100%;
  margin-top: 22px;
  color: gray;
}
.crudFilterColumn > input + span {
  display: none;
}


/* ── Formulario multi-columna ────────────────────────────── */
.crudEditCampos--cols-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 16px;
}
.crudEditCampos--cols-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 16px;
}
/* Campos que ocupan todo el ancho (map, password, columnaCompleta) */
.crudEditCampos--cols-2 .crud2-item--full,
.crudEditCampos--cols-3 .crud2-item--full {
  grid-column: 1 / -1;
}
/* En pantallas chicas, colapsar a 1 columna */
@media (max-width: 540px) {
  .crudEditCampos--cols-2,
  .crudEditCampos--cols-3 {
    grid-template-columns: 1fr;
  }
}

/* ===== Paginación "Cargar más" moderna ===== */
.crudList tr.load-indicador td {
  text-align: center;
  border-bottom: none;
}
.crud-load-more {
  padding: 14px 16px 10px;
  max-width: 480px;
  margin: 0 auto;
}
.crud-load-more__bar {
  height: 3px;
  background: #e8eaed;
  border-radius: 2px;
  margin-bottom: 10px;
  overflow: hidden;
}
.crud-load-more__fill {
  height: 100%;
  background: #1a73e8;
  border-radius: 2px;
  transition: width .4s ease;
}
.crud-load-more__info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.crud-load-more__label {
  font-size: .78rem;
  color: #80868b;
}
.crud-load-more__label strong {
  color: #3c4043;
  font-weight: 600;
}
.crud-load-more__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 18px;
  border: 1px solid #dadce0;
  border-radius: 20px;
  background: #fff;
  color: #3c4043;
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
}
.crud-load-more__btn:hover {
  background: #f1f3f4;
  border-color: #bdc1c6;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}
.crud-load-more__btn i {
  font-size: .72rem;
}
/* ===== Fin Paginación ===== */
