/* ============================================================
   Tabla de escalas salariales UTHGRA — v3 (compacto, blindado)
   ============================================================ */

.escalas-wrapper {
  --esc-primary:      #163a6b;
  --esc-primary-2:    #24568f;
  --esc-primary-dark: #0f2a4f;
  --esc-soft:         #eaf1fa;
  --esc-ring:         rgba(22, 58, 107, .20);
  --esc-text:         #17212e;
  --esc-text-soft:    #64707e;
  --esc-border:       #e2e6eb;
  --esc-surface:      #ffffff;
  --esc-alt:          #f6f8fb;
  --esc-radius:       14px;
  --esc-radius-sm:    8px;

  max-width: 100%;
  margin: 0 auto;
  color: var(--esc-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
.escalas-wrapper *, .escalas-wrapper *::before, .escalas-wrapper *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ---------- Tarjeta ---------- */
.escalas-wrapper .escalas-card {
  background: var(--esc-surface);
  border: 1px solid var(--esc-border);
  border-radius: var(--esc-radius);
  box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 6px 16px rgba(0,0,0,.04);
  overflow: hidden;
}

/* ---------- Encabezado ---------- */
.escalas-wrapper .esc-head {
  padding: 20px 22px 0;
}
.escalas-wrapper .esc-head h2 {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  letter-spacing: -.01em;
  color: var(--esc-text) !important;
  line-height: 1.3 !important;
  border: none !important;
  text-transform: none !important;
}
.escalas-wrapper .esc-head p {
  margin: 3px 0 0 !important;
  padding: 0 !important;
  font-size: 13px !important;
  color: var(--esc-text-soft) !important;
  line-height: 1.4 !important;
}

/* ---------- Menú de convenios ---------- */
.escalas-wrapper .esc-menu {
  margin-top: 14px;
  padding: 0 22px;
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--esc-border);
}
.escalas-wrapper .esc-menu::-webkit-scrollbar { display: none; }

.escalas-wrapper .esc-tab {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 10px 12px 12px;
  font-family: inherit;
  font-size: 12.5px !important;
  font-weight: 600;
  color: var(--esc-text-soft);
  background: none !important;
  border: none !important;
  border-bottom: 2.5px solid transparent !important;
  border-radius: 0 !important;
  margin: 0 0 -1px 0;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.3;
  transition: color .12s;
  text-transform: none;
  letter-spacing: 0;
  outline: none;
  box-shadow: none !important;
}
.escalas-wrapper .esc-tab:hover { color: var(--esc-primary); background: none !important; }
.escalas-wrapper .esc-tab.is-active {
  color: var(--esc-primary) !important;
  border-bottom-color: var(--esc-primary) !important;
  background: none !important;
}

.escalas-wrapper .esc-tab__count {
  min-width: 18px;
  height: 17px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  color: var(--esc-text-soft);
  background: var(--esc-alt);
  border-radius: 999px;
  transition: color .12s, background .12s;
}
.escalas-wrapper .esc-tab.is-active .esc-tab__count {
  color: #fff;
  background: var(--esc-primary);
}

/* ---------- Sub-barra: clasificación + año ---------- */
.escalas-wrapper .esc-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 22px;
  background: var(--esc-alt);
  border-bottom: 1px solid var(--esc-border);
  flex-wrap: wrap;
}
.escalas-wrapper .esc-subbar[hidden] { display: none; }

/* Toggle group */
.escalas-wrapper .esc-toggle {
  display: inline-flex;
  background: var(--esc-surface);
  border: 1px solid var(--esc-border);
  border-radius: var(--esc-radius-sm);
  overflow: hidden;
}
.escalas-wrapper .esc-toggle__btn {
  padding: 7px 13px;
  font-family: inherit;
  font-size: 12px !important;
  font-weight: 600;
  color: var(--esc-text-soft);
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.3;
  transition: color .1s, background .1s;
  outline: none;
  box-shadow: none !important;
  text-transform: none;
  letter-spacing: 0;
}
.escalas-wrapper .esc-toggle__btn + .esc-toggle__btn { border-left: 1px solid var(--esc-border) !important; }
.escalas-wrapper .esc-toggle__btn:hover { color: var(--esc-primary); background: var(--esc-soft) !important; }
.escalas-wrapper .esc-toggle__btn.is-active {
  color: #fff !important;
  background: var(--esc-primary) !important;
}

/* Select de año */
.escalas-wrapper .esc-select-anio {
  display: flex;
  align-items: center;
  gap: 8px;
}
.escalas-wrapper .esc-select-anio label {
  font-size: 11px !important;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--esc-text-soft) !important;
  margin: 0 !important;
  padding: 0 !important;
}
.escalas-wrapper .esc-select-anio select {
  height: 36px;
  min-width: 150px;
  padding: 0 32px 0 12px;
  font-family: inherit;
  font-size: 13px !important;
  color: var(--esc-text);
  background-color: var(--esc-surface);
  border: 1px solid var(--esc-border) !important;
  border-radius: var(--esc-radius-sm) !important;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364707e' stroke-width='2.5' 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;
  transition: border-color .12s, box-shadow .12s;
}
.escalas-wrapper .esc-select-anio select:focus {
  border-color: var(--esc-primary) !important;
  box-shadow: 0 0 0 3px var(--esc-ring) !important;
}

/* ---------- Tabla ---------- */
.escalas-wrapper .esc-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.escalas-wrapper .esc-table-wrap[hidden] { display: none; }

.escalas-wrapper #t_escalas_e.dataTable {
  width: 100% !important;
  margin: 0 !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  font-size: 13px !important;
}
.escalas-wrapper #t_escalas_e thead th {
  padding: 10px 18px !important;
  text-align: left;
  font-size: 10.5px !important;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--esc-text-soft) !important;
  background: var(--esc-surface) !important;
  border-top: none !important;
  border-bottom: 1px solid var(--esc-border) !important;
  white-space: nowrap;
}
.escalas-wrapper #t_escalas_e tbody td {
  padding: 12px 18px !important;
  border-top: none !important;
  border-bottom: 1px solid var(--esc-border) !important;
  color: var(--esc-text);
  vertical-align: middle;
  background: var(--esc-surface);
  font-size: 13px !important;
}
.escalas-wrapper #t_escalas_e tbody tr:last-child td { border-bottom: none !important; }
.escalas-wrapper #t_escalas_e tbody tr { transition: background .1s; }
.escalas-wrapper #t_escalas_e tbody tr:hover td { background: var(--esc-soft) !important; }

/* Categoría */
.escalas-wrapper #t_escalas_e td.col-cat {
  font-weight: 600;
  color: var(--esc-text);
  max-width: 280px;
}

/* Tag de convenio */
.escalas-wrapper .esc-conv-tag {
  display: block;
  margin-top: 3px;
  font-size: 10.5px !important;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--esc-primary);
  opacity: .65;
}

/* Provincia */
.escalas-wrapper #t_escalas_e td.col-prov {
  color: var(--esc-text-soft);
  font-size: 12.5px !important;
}

/* Badge de año */
.escalas-wrapper .esc-badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 11.5px !important;
  font-weight: 700;
  color: var(--esc-primary);
  background: var(--esc-soft);
  border-radius: 999px;
  white-space: nowrap;
}

/* Botón descarga */
.escalas-wrapper #t_escalas_e td.col-desc { text-align: right; white-space: nowrap; }
.escalas-wrapper #t_escalas_e td.col-desc a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  color: #fff !important;
  background: var(--esc-primary) !important;
  border-radius: 999px !important;
  text-decoration: none !important;
  border: none !important;
  box-shadow: none !important;
  transition: background .12s, transform .05s;
  line-height: 1.3;
}
.escalas-wrapper #t_escalas_e td.col-desc a::before {
  content: "";
  width: 13px; height: 13px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E") center/contain no-repeat;
}
.escalas-wrapper #t_escalas_e td.col-desc a:hover { background: var(--esc-primary-dark) !important; }
.escalas-wrapper #t_escalas_e td.col-desc a:active { transform: translateY(1px); }

/* Orden DataTables */
.escalas-wrapper #t_escalas_e thead th.sorting,
.escalas-wrapper #t_escalas_e thead th.sorting_asc,
.escalas-wrapper #t_escalas_e thead th.sorting_desc { cursor: pointer; }

/* Estado vacío */
.escalas-wrapper #t_escalas_e td.dataTables_empty {
  padding: 36px 18px !important;
  text-align: center;
  color: var(--esc-text-soft);
  font-style: italic;
}

/* ---------- Pie (info + paginación) ---------- */
.escalas-wrapper .dataTables_wrapper .dataTables_info,
.escalas-wrapper .dataTables_wrapper .dataTables_paginate {
  padding: 12px 22px !important;
  font-size: 12px !important;
  color: var(--esc-text-soft);
}
.escalas-wrapper .dataTables_wrapper .dataTables_paginate .paginate_button {
  padding: 5px 10px !important;
  margin-left: 3px !important;
  border-radius: 6px !important;
  border: 1px solid transparent !important;
  color: var(--esc-text) !important;
  cursor: pointer;
  font-size: 12px !important;
  background: none !important;
  box-shadow: none !important;
}
.escalas-wrapper .dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--esc-primary) !important;
  border-color: var(--esc-primary) !important;
  color: #fff !important;
}
.escalas-wrapper .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--esc-soft) !important;
  border-color: var(--esc-border) !important;
  color: var(--esc-primary) !important;
}
.escalas-wrapper .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.escalas-wrapper .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
  background: transparent !important;
  color: #c2c9d2 !important;
  cursor: default;
}

/* ---------- Panel Tucumán ---------- */
.escalas-wrapper .esc-tucuman {
  padding: 40px 22px 48px;
  text-align: center;
}
.escalas-wrapper .esc-tucuman[hidden] { display: none; }
.escalas-wrapper .esc-tucuman__icon {
  max-width: 180px;
  margin: 0 auto 20px;
}
.escalas-wrapper .esc-tucuman__icon img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}
.escalas-wrapper .esc-tucuman h3 {
  margin: 0 0 6px !important;
  padding: 0 !important;
  font-size: 17px !important;
  font-weight: 800 !important;
  color: var(--esc-text) !important;
  border: none !important;
}
.escalas-wrapper .esc-tucuman p {
  margin: 0 auto 20px !important;
  padding: 0 !important;
  max-width: 400px;
  font-size: 13px !important;
  color: var(--esc-text-soft) !important;
}
.escalas-wrapper .esc-site-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px !important;
  font-weight: 700 !important;
  font-size: 13.5px !important;
  color: #fff !important;
  background: var(--esc-primary) !important;
  border-radius: 999px !important;
  text-decoration: none !important;
  border: none !important;
  box-shadow: none !important;
  transition: background .12s, transform .05s;
}
.escalas-wrapper .esc-site-btn svg { width: 16px; height: 16px; }
.escalas-wrapper .esc-site-btn:hover { background: var(--esc-primary-dark) !important; color: #fff !important; }
.escalas-wrapper .esc-site-btn:active { transform: translateY(1px); }

/* Ocultar tabla/filtro en Tucumán */
.escalas-wrapper .esc-table-wrap[hidden],
.escalas-wrapper .esc-subbar[hidden] { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .escalas-wrapper .esc-subbar { flex-direction: column; align-items: stretch; }
  .escalas-wrapper .esc-toggle { width: 100%; }
  .escalas-wrapper .esc-toggle__btn { flex: 1; text-align: center; padding: 7px 6px; font-size: 11px !important; }
  .escalas-wrapper .esc-select-anio { justify-content: space-between; }
  .escalas-wrapper .esc-select-anio select { flex: 1; min-width: 0; }
}
@media (max-width: 580px) {
  .escalas-wrapper .esc-head { padding: 16px 16px 0; }
  .escalas-wrapper .esc-head h2 { font-size: 16px !important; }
  .escalas-wrapper .esc-menu { padding: 0 16px; }
  .escalas-wrapper .esc-tab { padding: 8px 8px 10px; font-size: 11.5px !important; }
  .escalas-wrapper .esc-subbar { padding: 10px 16px; }
  .escalas-wrapper #t_escalas_e thead { display: none; }
  .escalas-wrapper #t_escalas_e,
  .escalas-wrapper #t_escalas_e tbody,
  .escalas-wrapper #t_escalas_e tr,
  .escalas-wrapper #t_escalas_e td { display: block; width: 100%; }
  .escalas-wrapper #t_escalas_e tbody tr {
    padding: 14px 16px;
    border-bottom: 6px solid var(--esc-alt) !important;
  }
  .escalas-wrapper #t_escalas_e tbody td { padding: 2px 0 !important; border: none !important; }
  .escalas-wrapper #t_escalas_e td.col-desc { text-align: left; margin-top: 8px; }
  .escalas-wrapper .esc-tucuman__icon { max-width: 140px; }
}