/* =========================================
   ESTILOS GLOBALES SIG ISTRED (ANT DESIGN)
   ========================================= */

/* --- CONTENEDORES FLUIDOS --- */
.full-width-container {
  padding-left: 20px !important;
  padding-right: 20px !important;
  width: 100% !important;
  margin-top: 20px;
}

.panel-ant-flat {
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  background: #fff;
  margin-bottom: 20px;
}

.panel-heading-ant {
  background-color: #21376d !important;
  color: white !important;
  padding: 12px 20px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-heading-ant h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* --- BOTONES INSTITUCIONALES --- */

/* Botón Primario Global */
.btn-ant-primary {
  background: #21376d !important;
  border: 1px solid #21376d !important;
  color: #fff !important;
  padding: 5px 16px !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.3s !important;
}
.btn-ant-primary:hover {
  background: #005ca3 !important;
  color: white !important;
  border-color: #005ca3 !important;
}

.btn-ant-header {
  background-color: rgba(255, 255, 255, 0.15) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  color: #ffffff !important;
  padding: 4px 15px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  cursor: pointer;
}
.btn-ant-header:hover {
  background-color: rgba(255, 255, 255, 0.25) !important;
  color: white !important;
  border-color: white !important;
}

/* --- TABLAS ANT DESIGN --- */
.sig-table-ant {
  width: 100% !important;
  border-collapse: collapse !important;
  background-color: #fff;
}

.sig-table-ant thead th {
  background-color: #fafafa !important;
  color: rgba(0, 0, 0, 0.85) !important;
  font-weight: 600 !important;
  font-size: 12px !important;
  padding: 16px 12px !important;
  border-bottom: 1px solid #f0f0f0 !important;
  text-transform: uppercase;
}

.sig-table-ant tbody td {
  padding: 12px !important;
  border-bottom: 1px solid #f0f0f0 !important;
  font-size: 13px !important;
  color: rgba(0, 0, 0, 0.75);
  vertical-align: middle !important;
}

/* --- COMPLEMENTO PARA RESPONSIVIDAD --- */
.table-responsive-ant {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  margin-bottom: 16px;
}

.sig-table-ant thead th {
  white-space: nowrap !important;
}

.sig-table-ant {
  min-width: 900px;
  width: 100% !important;
  margin: 0 !important;
  border-collapse: collapse !important;
}

/* --- AYUDANTES DE TEXTO --- */
.txt-bold-dark {
  font-weight: 700;
  color: #262626;
  font-size: 13px;
}
.txt-grey-sm {
  font-size: 11px;
  color: #8c8c8c;
  margin-top: 2px;
}
.txt-grey-sm-no-margin {
  font-size: 11px;
  color: #8c8c8c;
  line-height: 1.3;
}

.module-info-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.module-icon-box {
  width: 32px;
  height: 32px;
  background: #f0f5ff;
  color: #155aa5;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 16px;
  border: 1px solid #adc6ff;
}

/* --- BADGES Y ESTADOS --- */
.ant-badge {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  display: inline-block;
}
.ant-badge-success {
  background-color: #f6ffed !important;
  color: #52c41a !important;
  border: 1px solid #b7eb8f !important;
}
.ant-badge-warning {
  background-color: #fffbe6 !important;
  color: #faad14 !important;
  border: 1px solid #ffe58f !important;
}

.badge-estado {
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  display: inline-block;
}
.badge-activo {
  background: #f6ffed;
  border: 1px solid #b7eb8f;
  color: #52c41a;
}
.badge-inactivo {
  background: #fff7e6;
  border: 1px solid #ffd591;
  color: #fa8c16;
}
.badge-titulado {
  background: #e6f7ff;
  border: 1px solid #91d5ff;
  color: #1890ff;
}
.badge-retirado {
  background: #fff1f0;
  border: 1px solid #ffa39e;
  color: #f5222d;
}
.badge-estudiando {
  background: #fafafa;
  border: 1px solid #d9d9d9;
  color: #8c8c8c;
}
.badge-pendiente {
  background: #fffbe6;
  border: 1px solid #ffe58f;
  color: #d48806;
}

/* --- BOTONES ACCIÓN --- */
.btn-action-sig {
  width: 32px;
  height: 32px;
  background: white;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  color: #555;
  margin: 0 2px;
  cursor: pointer;
}
.btn-action-sig:hover {
  border-color: #155aa5;
  color: #155aa5;
  background: #f0f7ff;
}

/* --- FIX DEFINITIVO DE PAGINACIÓN --- */
.dataTables_wrapper .dataTables_paginate {
  float: right !important;
  padding-top: 15px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
}

.dataTables_wrapper .dataTables_paginate span {
  display: inline-flex !important;
  align-items: center !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 32px !important;
  height: 32px !important;
  padding: 0 8px !important;
  margin: 0 2px !important;
  border: 1px solid #d9d9d9 !important;
  border-radius: 4px !important;
  background: #ffffff !important;
  color: rgba(0, 0, 0, 0.88) !important;
  font-size: 14px !important;
  cursor: pointer !important;
  transition: all 0.3s !important;
  text-decoration: none !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background-color: #21376d !important;
  color: #fff !important;
  border-color: #21376d !important;
}

.dataTables_info {
  float: left !important;
  padding-top: 25px !important;
  font-size: 13px !important;
  color: #8c8c8c !important;
}

/* --- LOADER --- */
#sig-loader-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.85);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}
.ant-spin-dot {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 40px;
  transform: rotate(45deg);
  animation: antRotate 1.2s infinite linear;
}
.ant-spin-dot i {
  position: absolute;
  display: block;
  width: 18px;
  height: 18px;
  background-color: #003399;
  border-radius: 100%;
  opacity: 0.3;
  animation: antSpinMove 1s infinite linear alternate;
}
.ant-spin-dot i:nth-child(1) {
  top: 0;
  left: 0;
}
.ant-spin-dot i:nth-child(2) {
  top: 0;
  right: 0;
  animation-delay: 0.4s;
}
.ant-spin-dot i:nth-child(3) {
  bottom: 0;
  right: 0;
  animation-delay: 0.8s;
}
.ant-spin-dot i:nth-child(4) {
  bottom: 0;
  left: 0;
  animation-delay: 1.2s;
}
@keyframes antRotate {
  to {
    transform: rotate(405deg);
  }
}
@keyframes antSpinMove {
  to {
    opacity: 1;
  }
}

/* --- MODALES --- */
.modal-ant .modal-content {
  border-radius: 8px;
  border: none;
  box-shadow: 0 9px 28px 8px rgba(0, 0, 0, 0.05);
}
.modal-ant .modal-header {
  padding: 16px 24px;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
  border-radius: 8px 8px 0 0;
}

.btn-ant-modal-primary,
.modal-ant .btn-ant-modal-primary {
  background: #21376d !important;
  border: 1px solid #21376d !important;
  color: #fff !important;
  padding: 5px 16px !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.3s !important;
}
.btn-ant-modal-primary:hover,
.modal-ant .btn-ant-modal-primary:hover {
  background: #005ca3 !important;
  color: white !important;
  border-color: #005ca3 !important;
}

.btn-ant-modal-default,
.modal-ant .btn-ant-modal-default {
  background: #fff !important;
  border: 1px solid #d9d9d9 !important;
  padding: 5px 16px !important;
  border-radius: 4px !important;
  color: rgba(0, 0, 0, 0.88) !important;
  transition: all 0.3s !important;
  font-size: 14px !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 32px !important;
  text-decoration: none !important;
}

.btn-ant-modal-default:hover,
.modal-ant .btn-ant-modal-default:hover {
  color: #40a9ff !important;
  border-color: #40a9ff !important;
  background: #fff !important;
}

/* --- ESTILOS ESPECÍFICOS PARA PERMISOS --- */
.role-button {
  width: 100%;
  text-align: left;
  margin-bottom: 8px;
  padding: 10px 15px;
  border-radius: 4px;
  border: 1px solid #d9d9d9;
  background: #fff;
  color: rgba(0, 0, 0, 0.85);
  transition: all 0.3s;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.role-button:hover {
  border-color: #21376d;
  color: #21376d;
  background: #f0f5ff;
}
.role-button i {
  font-size: 12px;
  opacity: 0.5;
}

.scroll-panel {
  max-height: 600px;
  overflow-y: auto;
  padding-right: 5px;
}
.scroll-panel::-webkit-scrollbar {
  width: 5px;
}
.scroll-panel::-webkit-scrollbar-track {
  background: #f1f1f1;
}
.scroll-panel::-webkit-scrollbar-thumb {
  background: #d9d9d9;
  border-radius: 10px;
}

.panel-title-sub {
  font-size: 13px;
  font-weight: 700;
  color: #21376d;
  margin-bottom: 15px;
  text-transform: uppercase;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 8px;
}

/* --- LAYOUT MAESTRO-DETALLE (SIDER + CONTENT) --- */
.sig-layout-container {
  display: flex;
  gap: 20px;
  margin-top: 10px;
  align-items: flex-start;
}

.sig-sider {
  width: 320px;
  flex-shrink: 0;
}

.sig-content {
  flex-grow: 1;
  min-width: 0;
}

/* Items de Navegación Lateral (Carreras) */
.carrera-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #f0f0f0;
  margin-bottom: 2px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 12px;
  color: #595959;
  font-weight: 600;
  text-transform: uppercase;
}

.carrera-item:first-child {
  border-radius: 4px 4px 0 0;
}
.carrera-item:last-child {
  border-radius: 0 0 4px 4px;
}

.carrera-item:hover {
  background-color: #fafafa;
  color: #21376d;
  border-left: 3px solid #adc6ff;
}

.carrera-item.active {
  background: #e6f7ff;
  border-color: #91d5ff;
  color: #1890ff;
  border-left: 4px solid #1890ff;
}

.carrera-item.has-match {
  background: #e6f7ff;
  color: #1890ff;
  border: 1px solid #91d5ff;
}

.badge-count {
  background: #f5f5f5;
  color: #bfbfbf;
  padding: 0 8px;
  border-radius: 10px;
  font-size: 11px;
  min-width: 30px;
  text-align: center;
  border: 1px solid #d9d9d9;
}

.active .badge-count {
  background: #1890ff;
  color: #fff;
  border-color: #1890ff;
}

/* Input group estilo Ant */
.sig-input-group-search {
  height: 40px;
}
.sig-input-group-search .input-group-addon {
  background-color: #fafafa;
  color: #8c8c8c;
  border: 1px solid #d9d9d9;
}
.sig-input-group-search .form-control {
  border: 1px solid #d9d9d9;
  height: 40px;
  box-shadow: none;
  font-size: 14px;
}
.sig-input-group-search .form-control:focus {
  border-color: #40a9ff;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.swal2-container {
  z-index: 99999 !important;
}

/* Forzar que el modal y su fondo oscuro estén por encima de todo el sistema */
.modal-ant {
  z-index: 999999 !important;
}
.modal-backdrop {
  z-index: 999998 !important;
}

/* =========================================
   COMPLEMENTOS PARA FORMULARIOS Y TABS EN MODALES
   ========================================= */

.modal-ant label {
  font-weight: 600 !important;
  color: rgba(0, 0, 0, 0.85) !important;
  font-size: 13px !important;
  margin-bottom: 8px !important;
  display: block;
}

.modal-ant .form-control {
  height: 32px !important;
  border-radius: 4px !important;
  border: 1px solid #d9d9d9 !important;
  font-size: 13px !important;
  transition: all 0.3s !important;
  box-shadow: none !important;
}

.modal-ant .form-control:focus {
  border-color: #40a9ff !important;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2) !important;
  outline: 0 !important;
}

.modal-ant .nav-tabs {
  border-bottom: 1px solid #f0f0f0 !important;
  margin-bottom: 20px !important;
}

.modal-ant .nav-tabs > li > a {
  border: none !important;
  color: rgba(0, 0, 0, 0.45) !important;
  padding: 12px 20px !important;
  background: transparent !important;
  transition: all 0.3s !important;
}

.modal-ant .nav-tabs > li.active > a,
.modal-ant .nav-tabs > li.active > a:hover,
.modal-ant .nav-tabs > li.active > a:focus {
  color: #1890ff !important;
  border-bottom: 2px solid #1890ff !important;
  background: transparent !important;
  font-weight: 600 !important;
}

.fileinput-preview.thumbnail {
  border: 1px dashed #d9d9d9 !important;
  background: #fafafa !important;
  border-radius: 4px !important;
}

.modal-ant .close {
  font-weight: 300;
  font-size: 24px;
  opacity: 0.4;
  transition: all 0.3s;
}

.modal-ant .close:hover {
  opacity: 1;
  transform: rotate(90deg);
}

.fileinput-preview {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  background: #fafafa !important;
  border: 1px dashed #d9d9d9 !important;
  padding: 0 !important;
}

.fileinput-preview img {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}

.cell-break {
  max-width: 300px !important;
}

.cell-break code {
  white-space: normal !important;
  word-break: break-all !important;
  display: block !important;
  line-height: 1.5 !important;
  text-align: left !important;
}

/* =========================================
   OPTIMIZACIÓN FINAL DE SCROLL Y CONSISTENCIA
   ========================================= */

.table-responsive-ant::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}

.table-responsive-ant::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.table-responsive-ant::-webkit-scrollbar-thumb {
  background: #d9d9d9;
  border-radius: 10px;
  transition: all 0.3s;
}

.table-responsive-ant::-webkit-scrollbar-thumb:hover {
  background: #21376d;
}

.table-responsive-ant {
  overflow-y: hidden !important;
}

.modal-ant textarea.form-control {
  height: auto !important;
  min-height: 60px;
  resize: vertical;
}

.modal-ant select.form-control {
  padding-top: 4px !important;
  padding-bottom: 4px !important;
}

/* --- FIX PARA JQUERY UI AUTOCOMPLETE (SOBRE MODALES) --- */
.ui-autocomplete {
  z-index: 1000001 !important; /* Superior al modal-ant que es 999999 */
  position: absolute;
  box-shadow:
    0 3px 6px -4px rgba(0, 0, 0, 0.12),
    0 6px 16px 0 rgba(0, 0, 0, 0.08),
    0 9px 28px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid #f0f0f0 !important;
  background: #fff !important;
  border-radius: 2px !important;
  max-height: 300px;
  overflow-y: auto;
}

.ui-front {
  z-index: 1000001 !important;
}

.ui-menu-item .ui-menu-item-wrapper {
  padding: 8px 12px !important;
  font-size: 13px !important;
  color: rgba(0, 0, 0, 0.85) !important;
  transition: all 0.3s;
  border: none !important;
}

.ui-menu-item .ui-menu-item-wrapper.ui-state-active {
  background-color: #e6f7ff !important;
  color: #1890ff !important;
  margin: 0 !important;
}

/* FICHA BECAS (fb-) — Estilos 100 % autónomos. */
