/* Tooltips globales (data-app-tip): fondo oscuro, alto contraste */
.jph-app-tooltip {
  position: fixed;
  z-index: 100050;
  left: 0;
  top: 0;
  max-width: min(22rem, calc(100vw - 1.25rem));
  padding: 0.65rem 0.9rem;
  border-radius: 0.65rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #fafafa;
  background: linear-gradient(155deg, #2d2d32 0%, #141416 48%, #0a0a0c 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.07) inset,
    0 14px 44px rgba(0, 0, 0, 0.55),
    0 4px 14px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px) scale(0.97);
  transition: opacity 0.16s ease-out, transform 0.16s ease-out;
  text-align: left;
  hyphens: auto;
  overflow-wrap: break-word;
}

.jph-app-tooltip.jph-app-tooltip--show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.jph-app-tooltip[data-place='bottom'] {
  transform: translateY(-6px) scale(0.97);
}

.jph-app-tooltip[data-place='bottom'].jph-app-tooltip--show {
  transform: translateY(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .jph-app-tooltip {
    transition: none;
  }
}

/* Toasts SweetAlert2 más legibles */
.swal2-toast.swal2-toast-jph,
.swal2-container .swal2-toast.swal2-toast-jph {
  border: 1px solid #e7e5e4;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/*
 * Estética unificada de modales (SweetAlert2 `.swal2-jph`).
 * Se aplica a todos los modales no-toast vía `installJphSwalDefaults()`.
 * No toca los toasts (`.swal2-toast-jph`).
 */
.swal2-container .swal2-popup.swal2-jph {
  border-radius: 1.1rem;
  border: 1px solid rgba(253, 186, 116, 0.55);
  box-shadow: 0 20px 50px rgba(28, 25, 23, 0.18), 0 6px 14px rgba(28, 25, 23, 0.08);
  padding: 1.75rem 1.75rem 1.4rem;
  background: linear-gradient(180deg, #ffffff 0%, #fffaf4 100%);
  color: #292524;
  font-family: inherit;
  overflow: hidden;
}

/* Tabla inyectada en Swal (detalle llamados / apercibimientos): anchos explícitos, scroll horizontal */
.aperc-detail-scroll {
  max-height: 55vh;
  overflow: auto;
  border-radius: 0.75rem;
  border: 1px solid #e7e5e4;
  -webkit-overflow-scrolling: touch;
}
.aperc-detail-table {
  width: max-content;
  min-width: 52rem;
  border-collapse: collapse;
  font-size: 0.8125rem;
  line-height: 1.35;
  text-align: left;
}
.aperc-detail-table thead th {
  background: #f5f5f4;
  color: #44403c;
  font-weight: 700;
  padding: 0.5rem 0.65rem;
  white-space: nowrap;
  vertical-align: bottom;
}
.aperc-detail-table tbody td {
  padding: 0.5rem 0.65rem;
  vertical-align: top;
  border-bottom: 1px solid #fafaf9;
  color: #44403c;
}
.aperc-detail-table tbody tr:last-child td {
  border-bottom: none;
}
.aperc-detail-table td.aperc-detail-col--date,
.aperc-detail-table td.aperc-detail-col--when {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.aperc-detail-table td.aperc-detail-col--tipo {
  min-width: 9.5rem;
  white-space: normal;
}
.aperc-detail-table td.aperc-detail-col--person {
  min-width: 10.5rem;
  max-width: 14rem;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.aperc-detail-table td.aperc-detail-col--title {
  min-width: 7rem;
  max-width: 12rem;
  font-weight: 600;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.aperc-detail-table td.aperc-detail-col--body {
  min-width: 12rem;
  max-width: 22rem;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.aperc-detail-table td.aperc-detail-col--by {
  min-width: 9rem;
  max-width: 14rem;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Tabla "Regla de advertencias" (apercibimientos + modal): misma altura de línea y alineación superior en todas las celdas */
.warning-rules-table th,
.warning-rules-table td {
  vertical-align: top;
}

.swal2-container .swal2-popup.swal2-jph .swal2-title {
  color: #1c1917;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 0 2.2rem 0.35rem 0;
  line-height: 1.35;
}

.swal2-container .swal2-popup.swal2-jph .swal2-html-container,
.swal2-container .swal2-popup.swal2-jph .swal2-content {
  color: #44403c;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-top: 0.35rem;
}

.swal2-container .swal2-popup.swal2-jph .swal2-actions {
  margin-top: 1.1rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.swal2-container .swal2-popup.swal2-jph .swal2-styled {
  border-radius: 0.7rem;
  font-weight: 700;
  padding: 0.55rem 1.1rem;
  font-size: 0.875rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.swal2-container .swal2-popup.swal2-jph .swal2-styled:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.swal2-container .swal2-popup.swal2-jph .swal2-styled.swal2-confirm {
  background: #e85d04 !important;
}

.swal2-container .swal2-popup.swal2-jph .swal2-styled.swal2-cancel {
  background: #78716c !important;
}

.swal2-container .swal2-popup.swal2-jph .swal2-styled.swal2-deny {
  background: #b91c1c !important;
}

.swal2-container .swal2-popup.swal2-jph .swal2-input,
.swal2-container .swal2-popup.swal2-jph .swal2-select,
.swal2-container .swal2-popup.swal2-jph .swal2-textarea {
  border-radius: 0.7rem;
  border: 1px solid #e7e5e4;
  box-shadow: none;
  font-size: 0.9rem;
}

.swal2-container .swal2-popup.swal2-jph .swal2-input:focus,
.swal2-container .swal2-popup.swal2-jph .swal2-select:focus,
.swal2-container .swal2-popup.swal2-jph .swal2-textarea:focus {
  border-color: #ea580c;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.18);
}

.swal2-container .swal2-popup.swal2-jph .swal2-validation-message {
  border-radius: 0.7rem;
  background: #fff1f2;
  color: #9f1239;
}

.swal2-container .swal2-popup.swal2-jph > .swal2-close.swal2-jph-close {
  position: absolute;
  top: 0.6rem;
  right: 0.7rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
  border-radius: 9999px;
  border: 1px solid transparent;
  background: transparent;
  color: #78716c;
  box-shadow: none;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.swal2-container .swal2-popup.swal2-jph > .swal2-close.swal2-jph-close:hover {
  background: #fff1e6;
  color: #c2410c;
  border-color: rgba(253, 186, 116, 0.7);
}

.swal2-container .swal2-popup.swal2-jph > .swal2-close.swal2-jph-close:focus,
.swal2-container .swal2-popup.swal2-jph > .swal2-close.swal2-jph-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.3);
}

.swal2-container .swal2-popup.swal2-jph .swal2-icon {
  margin: 0.25rem auto 0.85rem;
}

.swal2-container.swal2-backdrop-show {
  background: rgba(28, 25, 23, 0.48);
}

/* Combo con filtro (select[data-filterable]): botón visible + panel desplegable */
.combo-filter-btn:focus {
  outline: none;
}
.combo-filter-btn:focus-visible {
  box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.35);
}

/* display solo si no está .hidden (Tailwind); si no, este archivo gana a styles.css y el ítem sigue visible. */
.rrhh-check-item {
  align-items: center;
  gap: 0.45rem;
  margin-right: 0.7rem;
  margin-bottom: 0.35rem;
  padding: 0.2rem 0.45rem;
  border-radius: 0.6rem;
  border: 1px solid #e7e5e4;
  background: #fafaf9;
  font-size: 0.75rem;
  line-height: 1rem;
  color: #44403c;
  user-select: none;
}

.rrhh-check-item:not(.hidden) {
  display: inline-flex;
}

/* Sin display:flex en el bloque base: si no, en cascada pisa la utilidad `.hidden` de Tailwind y los filtros RRHH no ocultan filas. */
.rrhh-check-item-block {
  margin-right: 0;
}

/* Mayor especificidad que .rrhh-check-item:not(.hidden) para filas bloque en supervisores. */
.rrhh-check-item.rrhh-check-item-block:not(.hidden) {
  display: flex;
}

.rrhh-checkbox {
  width: 1rem;
  height: 1rem;
  accent-color: #ea580c;
  cursor: pointer;
}

.rrhh-check-item:has(.rrhh-checkbox:checked) {
  background: #fff7ed;
  border-color: #fdba74;
}

/*
 * Matriz de evaluación · foto en cabecera: el scroll + overflow del layout y el motor de
 * tablas pueden recortar o inflar la imagen; reglas fijas en px y position contenida.
 */
#matrixTable.matrix-eval-grid thead tr:nth-child(2) th.matrix-eval-emp-h {
  overflow: visible;
  min-width: 0;
  vertical-align: top;
}

#matrixTable.matrix-eval-grid .matrix-eval-avatar-wrap {
  display: flex;
  width: 100%;
  max-width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  margin-left: auto;
  margin-right: auto;
}

#matrixTable.matrix-eval-grid .matrix-eval-avatar {
  box-sizing: border-box;
  position: relative;
  width: clamp(42px, 5vw, 64px);
  height: clamp(42px, 5vw, 64px);
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 9999px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
}

@media (min-width: 640px) {
  #matrixTable.matrix-eval-grid .matrix-eval-avatar {
    width: clamp(46px, 4.5vw, 68px);
    height: clamp(46px, 4.5vw, 68px);
  }
}

#matrixTable.matrix-eval-grid .matrix-eval-avatar-initials {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

@media (min-width: 640px) {
  #matrixTable.matrix-eval-grid .matrix-eval-avatar-initials {
    font-size: 1.4rem;
  }
}

#matrixTable.matrix-eval-grid .matrix-eval-avatar img {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 8%;
  max-width: 100%;
  max-height: 100%;
  transform: translateZ(0);
  filter: brightness(1.12) contrast(1.08);
}

#matrixTable.matrix-eval-grid .matrix-eval-emp-name {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.05;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.35rem;
  border-radius: 1rem;
  border: 1px solid rgba(253, 186, 116, 0.7);
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  width: 100%;
}

@media (max-width: 639px) {
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    justify-content: flex-start;
    gap: 0.35rem;
    padding-bottom: 0.45rem;
  }
}

.tab {
  appearance: none;
  border: 1px solid #e7e5e4;
  background: #ffffff;
  color: #292524;
  border-radius: 0.9rem;
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.1rem;
  flex: 1 1 0;
  min-width: 0;
  /* Centrado fiable del label (text-align solo falla en varios UAs con <button>) */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  box-sizing: border-box;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease,
    border-color 0.16s ease;
}

.tab::-moz-focus-inner {
  border: 0;
  padding: 0;
}

@media (max-width: 639px) {
  .tab {
    flex: 0 0 auto;
    padding: 0.5rem 0.75rem;
    font-size: 0.78rem;
  }
}

.tab.hidden {
  display: none;
}

.tab:hover {
  background: #fafaf9;
}

.tab--active {
  border-color: #e85d04;
  background: #e85d04;
  color: #ffffff;
}

.loader-spinner {
  width: 1rem;
  height: 1rem;
  border-radius: 9999px;
  border: 2px solid #fed7aa;
  border-top-color: #ea580c;
  animation: spin 0.8s linear infinite;
}

.btn-loading {
  opacity: 0.75;
  cursor: wait;
}

.canje-grid-busy {
  pointer-events: none;
  opacity: 0.92;
}

.canje-grid-busy .canje-open-redeem-modal {
  cursor: wait;
}

button,
[role='button'],
.tab,
.combo-filter-btn {
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    opacity 0.16s ease,
    background-color 0.16s ease;
}

button:hover,
[role='button']:hover,
.tab:hover,
.combo-filter-btn:hover {
  transform: translateY(-1px);
}

button:active,
[role='button']:active,
.tab:active,
.combo-filter-btn:active {
  transform: translateY(0) scale(0.985);
}

.ui-fade-in {
  animation: uiFadeIn 220ms ease-out;
}

.ui-action-pop {
  animation: uiActionPop 180ms ease-out;
}

.ui-field-flash {
  animation: uiFieldFlash 260ms ease-out;
}

@keyframes uiFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes uiActionPop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.97);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes uiFieldFlash {
  0% {
    box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.28);
  }
  100% {
    box-shadow: 0 0 0 6px rgba(234, 88, 12, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Tabla RRHH · Usuarios y roles */
.rrhh-users-wrap {
  border-radius: 0.75rem;
  border: 1px solid #e7e5e4;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  max-height: min(70vh, 720px);
  scrollbar-gutter: stable;
  /* Debe permitir scroll vertical; overflow:hidden anulaba overflow-auto de Tailwind y recortaba todas las filas. */
  overflow: auto;
}

.rrhh-users-table {
  border-collapse: separate;
  border-spacing: 0;
}

.rrhh-users-table thead th.rrhh-users-th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.65rem 0.75rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #57534e;
  background: linear-gradient(to bottom, rgba(250, 250, 249, 0.98), rgba(245, 245, 244, 0.96));
  border-bottom: 1px solid #e7e5e4;
  white-space: nowrap;
}

.rrhh-users-table tbody td.rrhh-users-td {
  padding: 0.75rem 0.75rem;
  vertical-align: middle;
  border-bottom: 1px solid #f5f5f4;
}

.rrhh-users-table tbody tr.rrhh-users-tr:last-child td {
  border-bottom: none;
}

.rrhh-users-table tbody tr.rrhh-users-tr:hover td {
  background: rgba(255, 247, 237, 0.55);
}

.rrhh-role-pill {
  display: inline-flex;
  cursor: pointer;
  align-items: center;
  border-radius: 9999px;
  border-width: 1px;
  padding: 0.2rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    box-shadow 0.12s ease;
  user-select: none;
}

.rrhh-role-pill:hover {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.rrhh-role-pill:has(input:checked) {
  box-shadow: 0 0 0 1px rgba(234, 88, 12, 0.35);
}

.rrhh-role-pill__face {
  pointer-events: none;
}

/* ============================================================
   Modal "Tabla de evaluación por criterio"
   ============================================================ */
.criteria-rules-modal .swal2-html-container {
  padding-inline: 0.5rem;
}
.criteria-rules-wrap {
  text-align: left;
  color: #1c1917;
}
.criteria-rules-summary {
  border: 1px solid #e0f2fe;
  background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
  border-radius: 1rem;
  padding: 0.75rem;
  box-shadow: inset 0 1px 2px rgba(14, 165, 233, 0.06);
}
.criteria-rules-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.criteria-rules-summary-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #0c4a6e;
  margin: 0;
}
.criteria-rules-summary-sub {
  margin: 0.15rem 0 0 0;
  font-size: 0.72rem;
  color: #57534e;
}
.criteria-rules-total-chip {
  flex-shrink: 0;
  background: #e0f2fe;
  color: #075985;
  border: 1px solid #bae6fd;
  border-radius: 9999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.criteria-rules-weight-bar {
  margin-top: 0.6rem;
  display: flex;
  height: 1.75rem;
  width: 100%;
  overflow: hidden;
  border-radius: 0.6rem;
  box-shadow: 0 0 0 1px #e7e5e4 inset;
}
.criteria-rules-weight-seg {
  position: relative;
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: filter 0.12s ease;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
  min-width: 0;
  padding-inline: 0.35rem;
}
.criteria-rules-weight-seg:hover {
  filter: brightness(1.07);
}
.criteria-rules-weight-seg-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.criteria-rules-weight-seg-pct {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 0.35rem;
  padding: 0.05rem 0.3rem;
  font-size: 0.62rem;
}
@media (max-width: 640px) {
  .criteria-rules-weight-seg-label {
    display: none;
  }
}
.criteria-rules-legend {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.criteria-rules-legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid #e7e5e4;
  background: #ffffff;
  border-radius: 9999px;
  padding: 0.22rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: #44403c;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}
.criteria-rules-legend-dot {
  display: inline-block;
  height: 0.6rem;
  width: 0.6rem;
  border-radius: 9999px;
}
.criteria-rules-scale {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid #e7e5e4;
  background: #fafaf9;
  border-radius: 0.75rem;
  padding: 0.45rem 0.75rem;
}
.criteria-rules-scale-dots {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  color: #44403c;
  font-size: 0.72rem;
}
.criteria-rules-scale-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.1rem;
  width: 1.1rem;
  border-radius: 9999px;
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 800;
  box-shadow: 0 0 0 2px #ffffff;
}
.criteria-rules-scale-caption {
  margin-left: 0.35rem;
  font-weight: 600;
}
.criteria-rules-scale-count {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #78716c;
}
.criteria-rules-grid {
  margin-top: 0.8rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
  max-height: 62vh;
  overflow: auto;
  padding-right: 0.25rem;
}
@media (min-width: 840px) {
  .criteria-rules-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.criteria-rules-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid #e7e5e4;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.02);
}
.criteria-rules-card-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.8rem;
  color: #ffffff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.22);
}
.criteria-rules-card-icon {
  display: inline-flex;
  height: 2rem;
  width: 2rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
  color: #ffffff;
}
.criteria-rules-card-icon svg {
  height: 1rem;
  width: 1rem;
}
.criteria-rules-card-title {
  margin: 0;
  flex: 1 1 auto;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #ffffff;
}
.criteria-rules-card-weight {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-radius: 9999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}
.criteria-rules-levels {
  list-style: none;
  margin: 0;
  padding: 0;
}
.criteria-rules-level {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.55rem 0.8rem;
  border-top: 1px solid #f5f5f4;
}
.criteria-rules-level:first-child {
  border-top: 0;
}
.criteria-rules-level-chip {
  margin-top: 0.1rem;
  display: inline-flex;
  height: 1.6rem;
  width: 1.6rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 0 0 2px #ffffff, 0 1px 2px rgba(0, 0, 0, 0.12);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}
.criteria-rules-level-text {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #1c1917;
}

/* ============================================================
   Vista móvil (≤639px): coherente con desktop, sin desbordes
   ============================================================ */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (max-width: 639px) {
  .session-user-menu-panel {
    left: 0;
    right: 0;
    min-width: unset;
    width: 100%;
    max-width: min(100vw - 1rem, 22rem);
    margin-left: auto;
    margin-right: auto;
  }

  /* Filtros: inputs/selects con min-width fijo no rompen el ancho */
  #app input[class*='min-w-'],
  #app select[class*='min-w-'] {
    min-width: 0 !important;
    max-width: 100%;
  }

  #app div.flex.flex-col[class*='min-w-'] {
    min-width: 0 !important;
    max-width: 100%;
    width: 100%;
  }

  .rrhh-users-wrap {
    max-height: min(65vh, 560px);
  }

  .swal2-container .swal2-popup.swal2-jph {
    width: min(100vw - 1.25rem, 26rem) !important;
    padding: 1.25rem 1.1rem 1rem;
  }

  /* Modales con tablas anchas (p. ej. detalle disciplina): no limitar a 26rem */
  .swal2-container .swal2-popup.swal2-jph.swal2-jph--wide-table {
    width: min(100vw - 1rem, 64rem) !important;
    max-width: min(100vw - 1rem, 64rem);
    overflow-x: auto;
  }

  .swal2-container .swal2-popup.swal2-jph.swal2-jph--wide-table .swal2-html-container {
    overflow-x: visible;
  }

  #tour-matrix-grid-wrap {
    border-radius: 1rem;
  }

  /* Matriz: una sola columna de persona → nombre más legible */
  #matrixTable.matrix-eval-grid .matrix-eval-emp-name {
    font-size: 0.7rem;
    line-height: 1.15;
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }

  .matrix-carousel-nav {
    width: 100%;
  }
}

@media (min-width: 640px) {
  .matrix-carousel-nav {
    width: auto;
  }
}
