.gtc-ml-root {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.gtc-ml-cabecera {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.gtc-ml-titulo {
  font-size: 2rem;
  font-weight: 700;
  color: #1c2646;
  margin: 0;
}

.gtc-ml-busqueda {
  width: min(560px, 100%);
}

.gtc-ml-busqueda > div {
  position: relative;
  width: 100%;
}

.gtc-ml-input-busqueda {
  width: 100%;
  height: 3rem;
  border: 2px solid #181f3a;
  border-radius: 0.8rem;
  background: #ffffff;
  color: #1f2937;
  padding: 0 2.8rem 0 0.9rem;
  font-size: 1rem;
  font-weight: 500;
}

.gtc-ml-icono-busqueda {
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  margin: 0;
  pointer-events: none;
}

.gtc-ml-wrapper-tabla {
  width: 100%;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e4e8f2;
  border-radius: 0.7rem;
  box-shadow: 0 3px 10px rgba(16, 24, 40, 0.06);
}

.gtc-ml-tabla-wrapper {
  width: 100%;
  height: 100%;
}

.gtc-ml-tabla-wrapper > div {
  height: 100%;
}

.gtc-ml-tabla {
  min-width: 2300px;
  table-layout: fixed;
}

.gtc-ml-tabla th,
.gtc-ml-tabla td {
  font-size: 0.9rem;
  color: #2f3a4f;
  vertical-align: middle;
  padding: 0.75rem 0.75rem;
}

.gtc-ml-tabla th {
  background: #f1f5ff;
  font-weight: 700;
  white-space: nowrap;
}

.gtc-ml-fila:hover {
  background: #f9fbff;
}

.gtc-ml-celda {
  white-space: normal;
  word-break: break-word;
  line-height: 1.25rem;
}

.gtc-ml-tabla th:nth-child(1),
.gtc-ml-tabla td:nth-child(1) {
  width: 56px;
  min-width: 56px;
}

.gtc-ml-tabla th:nth-child(2),
.gtc-ml-tabla td:nth-child(2) {
  width: 95px;
  min-width: 95px;
}

.gtc-ml-tabla th:nth-child(3),
.gtc-ml-tabla td:nth-child(3) {
  width: 150px;
  min-width: 150px;
}

.gtc-ml-tabla th:nth-child(4),
.gtc-ml-tabla td:nth-child(4) {
  width: 110px;
  min-width: 110px;
}

.gtc-ml-tabla th:nth-child(5),
.gtc-ml-tabla td:nth-child(5) {
  width: 165px;
  min-width: 165px;
}

.gtc-ml-tabla th:nth-child(6),
.gtc-ml-tabla td:nth-child(6) {
  width: 72px;
  min-width: 72px;
}

.gtc-ml-tabla th:nth-child(7),
.gtc-ml-tabla td:nth-child(7) {
  width: 170px;
  min-width: 170px;
}

.gtc-ml-tabla th:nth-child(8),
.gtc-ml-tabla td:nth-child(8) {
  width: 220px;
  min-width: 220px;
}

.gtc-ml-tabla th:nth-child(9),
.gtc-ml-tabla td:nth-child(9) {
  width: 220px;
  min-width: 220px;
}

.gtc-ml-tabla th:nth-child(10),
.gtc-ml-tabla td:nth-child(10) {
  width: 160px;
  min-width: 160px;
}

.gtc-ml-tabla th:nth-child(11),
.gtc-ml-tabla td:nth-child(11) {
  width: 170px;
  min-width: 170px;
}

.gtc-ml-tabla th:nth-child(12),
.gtc-ml-tabla td:nth-child(12) {
  width: 150px;
  min-width: 150px;
}

.gtc-ml-tabla th:nth-child(13),
.gtc-ml-tabla td:nth-child(13) {
  width: 110px;
  min-width: 110px;
}

.gtc-ml-tabla th:nth-child(14),
.gtc-ml-tabla td:nth-child(14) {
  width: 165px;
  min-width: 165px;
}

.gtc-ml-tabla th:nth-child(15),
.gtc-ml-tabla td:nth-child(15) {
  width: 70px;
  min-width: 70px;
  text-align: center;
}

.gtc-ml-celda-calificacion {
  width: 100%;
}

.gtc-ml-celda-acciones {
  text-align: center;
}

.gtc-ml-select {
  width: 100%;
  height: 2rem;
  border: 1px solid #c7cfdf;
  border-radius: 0.35rem;
  background: #ffffff;
  color: #1f2937;
  padding: 0 0.35rem;
  font-size: 0.85rem;
}

.gtc-ml-celda-vacia {
  color: #6b7280;
  font-weight: 600;
  white-space: nowrap;
}

.gtc-ml-versiones-panel {
  position: fixed;
  top: 74px;
  right: 18px;
  width: min(360px, calc(100vw - 24px));
  max-height: calc(100vh - 96px);
  background: #ffffff;
  border: 1px solid #d8e1f2;
  border-radius: 0.65rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
  z-index: 1400;
  padding: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.gtc-ml-versiones-head > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.gtc-ml-versiones-titulo {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  color: #1c2646;
}

.gtc-ml-versiones-cerrar {
  width: 30px;
  height: 30px;
  border: 1px solid #d1d9e8;
  border-radius: 0.4rem;
  background: #ffffff;
  color: #4b5563;
  cursor: pointer;
}

.gtc-ml-versiones-cerrar:hover {
  background: #f3f6ff;
}

.gtc-ml-versiones-filtro {
  width: 100%;
}

.gtc-ml-versiones-filtro .mb-2 {
  margin-bottom: 0;
}

.gtc-ml-versiones-filtro .w-\[240px\] {
  width: 100%;
  max-width: 100%;
}

.gtc-ml-versiones-lista {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
  max-height: calc(100vh - 220px);
  padding-right: 0.12rem;
}

.gtc-ml-version-item {
  border: 1px solid #e1e7f5;
  border-radius: 0.55rem;
  background: #f8faff;
  padding: 0.55rem;
}

.gtc-ml-version-item-title {
  margin: 0 0 0.24rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1c2646;
}

.gtc-ml-version-item-text {
  margin: 0.08rem 0;
  font-size: 0.76rem;
  color: #334155;
  line-height: 1.18rem;
}

.gtc-ml-version-item-btn {
  margin-top: 0.35rem;
  width: auto;
  min-height: 28px;
  border: 1px solid #1c2646;
  border-radius: 0.35rem;
  background: #ffffff;
  color: #1c2646;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
}

.gtc-ml-version-item-btn:hover {
  background: #eef2ff;
}

.gtc-ml-versiones-vacio {
  border: 1px dashed #cdd7ee;
  border-radius: 0.5rem;
  padding: 0.6rem;
  text-align: center;
  font-size: 0.8rem;
  color: #64748b;
  background: #f8fafc;
}

.gtc-ml-botones {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.9rem;
  flex-wrap: nowrap;
}

/* Fallback de separación visible entre botones aun sin soporte de gap */
.gtc-ml-botones .gtc-ml-btn + .gtc-ml-btn {
  margin-left: 0.9rem;
}

.gtc-ml-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.35rem;
  min-width: 170px;
  height: 44px;
  padding: 0 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.gtc-ml-btn p {
  margin: 0;
  text-align: center;
}

.gtc-ml-btn-primario {
  background: #1c2646;
  border: 1px solid #1c2646;
  color: #ffffff;
}

.gtc-ml-btn-primario:hover {
  background: #27335e;
}

.gtc-ml-btn-secundario {
  background: #ffffff;
  border: 2px solid #1c2646;
  color: #1c2646;
}

.gtc-ml-btn-secundario:hover {
  background: #f4f7ff;
}

.gtc-ml-btn-salir {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  color: #6b7280;
}

.gtc-ml-btn-salir:hover {
  background: #e5e7eb;
}

.gtc-ml-card-grafica {
  width: min(760px, 100%);
  border: 1px solid #e4e8f2;
  border-radius: 0.8rem;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(16, 24, 40, 0.08);
  padding: 0.8rem;
}

.gtc-ml-card-titulo {
  margin: 0 0 0.6rem;
  color: #1c2646;
  font-size: 1.9rem;
  font-weight: 700;
}

.gtc-ml-card-contenido {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.gtc-ml-donut-wrap {
  width: 230px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gtc-ml-canvas-donut {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  background: transparent;
  border-radius: 999px;
  display: block;
}

.gtc-ml-donut-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
}

.gtc-ml-leyenda {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  width: 100%;
  max-width: 360px;
}

.gtc-ml-leyenda-fila {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) 46px;
  gap: 0.5rem;
  align-items: center;
}

.gtc-ml-leyenda-punto {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.gtc-ml-leyenda-texto,
.gtc-ml-leyenda-valor {
  margin: 0;
  font-size: 0.9rem;
  color: #374151;
  line-height: 1.05rem;
}

.gtc-ml-leyenda-texto {
  white-space: nowrap;
}

.gtc-ml-leyenda-valor {
  font-weight: 700;
  white-space: nowrap;
  text-align: right;
}

body.modo-oscuro .gtc-ml-titulo,
body.modo-oscuro .gtc-ml-card-titulo {
  color: var(--texto-principal);
}

body.modo-oscuro .gtc-ml-wrapper-tabla,
body.modo-oscuro .gtc-ml-card-grafica,
body.modo-oscuro .gtc-ml-tabla,
body.modo-oscuro .gtc-ml-tabla th,
body.modo-oscuro .gtc-ml-tabla td {
  background: var(--fondo-card) !important;
  color: var(--texto-principal) !important;
  border-color: var(--borde-principal) !important;
}

body.modo-oscuro .gtc-ml-tabla th {
  background: #232839 !important;
}

body.modo-oscuro .gtc-ml-input-busqueda,
body.modo-oscuro .gtc-ml-select {
  background: var(--fondo-input) !important;
  color: var(--texto-principal) !important;
  border-color: #ffffff !important;
}

body.modo-oscuro .gtc-ml-icono-busqueda,
body.modo-oscuro .gtc-ml-leyenda-texto,
body.modo-oscuro .gtc-ml-celda-vacia {
  color: var(--texto-secundario) !important;
}

body.modo-oscuro .gtc-ml-btn-secundario {
  background: transparent;
  border-color: #ffffff;
  color: #ffffff;
}

body.modo-oscuro .gtc-ml-btn-secundario:hover {
  background: rgba(255,255,255,0.08);
}

body.modo-oscuro .gtc-ml-btn-salir {
  background: #2c3348;
  border-color: #3e4966;
  color: #d1d5db;
}

body.modo-oscuro .gtc-ml-tabla-wrapper .bg-white,
body.modo-oscuro .gtc-ml-tabla-wrapper .bg-gray-50 {
  background: var(--fondo-card) !important;
}

body.modo-oscuro .gtc-ml-tabla-wrapper .text-gray-700,
body.modo-oscuro .gtc-ml-tabla-wrapper .text-gray-400 {
  color: var(--texto-secundario) !important;
}

body.modo-oscuro .gtc-ml-tabla-wrapper .border-gray-200,
body.modo-oscuro .gtc-ml-tabla-wrapper .border-gray-300,
body.modo-oscuro .gtc-ml-tabla-wrapper .border-gray-400 {
  border-color: var(--borde-principal) !important;
}

body.modo-oscuro .gtc-ml-versiones-panel {
  background: var(--fondo-card) !important;
  border-color: var(--borde-principal) !important;
}

body.modo-oscuro .gtc-ml-versiones-titulo,
body.modo-oscuro .gtc-ml-versiones-label,
body.modo-oscuro .gtc-ml-version-item-title,
body.modo-oscuro .gtc-ml-version-item-text {
  color: var(--texto-principal) !important;
}

body.modo-oscuro .gtc-ml-versiones-input {
  background: var(--fondo-input) !important;
  color: var(--texto-principal) !important;
  border-color: #ffffff !important;
}

body.modo-oscuro .gtc-ml-versiones-filtro .bg-white,
body.modo-oscuro .gtc-ml-versiones-filtro .text-\[\#181f3a\],
body.modo-oscuro .gtc-ml-versiones-filtro .text-gray-400 {
  background: var(--fondo-input) !important;
  color: var(--texto-principal) !important;
}

body.modo-oscuro .gtc-ml-versiones-filtro .border-\[\#181f3a\] {
  border-color: var(--borde-principal) !important;
}

body.modo-oscuro .gtc-ml-version-item {
  background: rgba(255,255,255,0.03);
  border-color: var(--borde-principal) !important;
}

body.modo-oscuro .gtc-ml-version-item-btn {
  background: transparent;
  border-color: #ffffff;
  color: #ffffff;
}

body.modo-oscuro .gtc-ml-version-item-btn:hover {
  background: rgba(255,255,255,0.08);
}

@media (max-width: 1100px) {
  .gtc-ml-card-contenido {
    grid-template-columns: 1fr;
  }

  .gtc-ml-donut-wrap {
    width: 210px;
    margin: 0 auto;
  }

  .gtc-ml-botones {
    flex-wrap: wrap;
  }

  .gtc-ml-botones .gtc-ml-btn + .gtc-ml-btn {
    margin-left: 0;
  }

  .gtc-ml-btn {
    min-width: 150px;
  }
}

.gtc-ml-dialog-panel {
  width: 100%;
  background: #ffffff;
  border-radius: 0.65rem;
  padding: 0.75rem 0.75rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.gtc-ml-dialog-title {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 1.85rem;
  font-weight: 700;
  color: #1c2646;
  margin: 0.2rem 0 0.35rem;
}

.gtc-ml-dialog-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.gtc-ml-dialog-grid-3 {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 0.55rem;
}

.gtc-ml-dialog-field {
  width: 100%;
}

.gtc-ml-dialog-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #394768;
  margin-bottom: 0.2rem;
}

.gtc-ml-dialog-input {
  width: 100%;
  height: 1.9rem;
  border: 1px solid #cfd6e5;
  border-radius: 0.24rem;
  background: #ffffff;
  color: #1f2937;
  padding: 0 0.55rem;
  font-size: 0.88rem;
}

.gtc-ml-dialog-textarea {
  width: 100%;
  border: 1px solid #cfd6e5;
  border-radius: 0.24rem;
  background: #ffffff;
  color: #1f2937;
  padding: 0.45rem 0.55rem;
  font-size: 0.88rem;
  line-height: 1.2rem;
  resize: vertical;
}

.gtc-ml-dialog-file-choices {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}

.gtc-ml-dialog-radio {
  width: 0.85rem;
  height: 0.85rem;
  accent-color: #1c2646;
}

.gtc-ml-dialog-radio-label {
  font-size: 0.85rem;
  color: #4b5563;
  margin-right: 0.7rem;
}

.gtc-ml-dialog-file-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) 2.1rem;
  gap: 0.45rem;
  width: min(620px,100%);
}

.gtc-ml-dialog-file-btn {
  width: 2.1rem;
  height: 1.9rem;
  border: 1px solid #cfd6e5;
  border-radius: 0.24rem;
  background: #ffffff;
  color: #1c2646;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.gtc-ml-dialog-file-btn:hover {
  background: #f8fafc;
  border-color: #1c2646;
}

.gtc-ml-dialog-actions {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 0.25rem;
}

.gtc-ml-dialog-actions .gtc-ml-dialog-btn + .gtc-ml-dialog-btn {
  margin-left: 0.4rem;
}

.gtc-ml-dialog-btn {
  min-width: 7.2rem;
  height: 2.1rem;
  border-radius: 0.24rem;
  font-size: 0.86rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gtc-ml-dialog-btn p {
  margin: 0;
}

.gtc-ml-dialog-btn-primary {
  background: #2563eb;
  border: 1px solid #2563eb;
  color: #ffffff;
}

.gtc-ml-dialog-btn-primary:hover {
  background: #1d4ed8;
}

.gtc-ml-dialog-btn-secondary {
  background: #ffffff;
  border: 1px solid #9ca3af;
  color: #4b5563;
}

.gtc-ml-dialog-btn-secondary:hover {
  background: #f3f4f6;
}

body.modo-oscuro .gtc-ml-dialog-panel {
  background: var(--fondo-card);
}

body.modo-oscuro .gtc-ml-dialog-title,
body.modo-oscuro .gtc-ml-dialog-label {
  color: var(--texto-principal);
}

body.modo-oscuro .gtc-ml-dialog-input,
body.modo-oscuro .gtc-ml-dialog-textarea {
  background: var(--fondo-input);
  color: var(--texto-principal);
  border-color: var(--borde-principal);
}

body.modo-oscuro .gtc-ml-dialog-radio-label {
  color: var(--texto-secundario);
}

body.modo-oscuro .gtc-ml-dialog-file-btn {
  background: #ffffff;
  color: #1c2646;
  border-color: #cfd6e5;
}

body.modo-oscuro .gtc-ml-dialog-btn-secondary {
  background: #2c3348;
  border-color: #4b5563;
  color: #d1d5db;
}

@media (max-width: 1024px) {
  .gtc-ml-dialog-grid-3 {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}

@media (max-width: 700px) {
  .gtc-ml-dialog-grid-3 {
    grid-template-columns: 1fr;
  }
}

.gtc-ml-import-panel {
  width: 100%;
  background: #ffffff;
  border-radius: 0.65rem;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.gtc-ml-import-title {
  display: block;
  text-align: center;
  font-size: 1.9rem;
  font-weight: 700;
  color: #1c2646;
  margin: 0.2rem 0;
}

.gtc-ml-import-file-row > div {
  display: grid;
  grid-template-columns: minmax(0,1fr) 180px;
  gap: 0.55rem;
  align-items: center;
}

.gtc-ml-import-file-input {
  width: 100%;
  height: 2.4rem;
  border: 1px solid #cfd6e5;
  border-radius: 0.28rem;
  background: #f8fafc;
  color: #334155;
  padding: 0 0.65rem;
  font-size: 0.9rem;
}

.gtc-ml-import-btn-file {
  height: 2.4rem;
  border: 1px solid #cfd6e5;
  border-radius: 0.28rem;
  background: #ffffff;
  color: #1c2646;
  font-size: 0.9rem;
  font-weight: 700;
}

.gtc-ml-import-btn-file p {
  margin: 0;
}

.gtc-ml-import-btn-file:hover {
  background: #f8fafc;
  border-color: #1c2646;
}

.gtc-ml-import-map-head > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.gtc-ml-import-head {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #293658;
}

.gtc-ml-import-map-grid {
  max-height: min(54vh, 500px);
  overflow: auto;
  padding-right: 0.2rem;
}

.gtc-ml-import-map-grid > div {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.gtc-ml-import-map-row > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  align-items: center;
}

.gtc-ml-import-label {
  margin: 0;
  color: #334155;
  font-size: 0.93rem;
  font-weight: 600;
}

.gtc-ml-import-select {
  width: 100%;
  height: 2.4rem;
  border: 1px solid #cfd6e5;
  border-radius: 0.28rem;
  background: #ffffff;
  color: #0f172a;
  padding: 0 0.6rem;
  font-size: 0.92rem;
}

.gtc-ml-import-actions {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 0.15rem;
}

.gtc-ml-import-actions > div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gtc-ml-import-btn {
  min-width: 140px;
  height: 2.3rem;
  border-radius: 0.28rem;
  font-size: 0.95rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gtc-ml-import-btn p {
  margin: 0;
}

.gtc-ml-import-btn-primary {
  background: #2563eb;
  border: 1px solid #2563eb;
  color: #ffffff;
}

.gtc-ml-import-btn-primary:hover {
  background: #1d4ed8;
}

.gtc-ml-import-btn-secondary {
  background: #ffffff;
  border: 1px solid #9ca3af;
  color: #4b5563;
}

.gtc-ml-import-btn-secondary:hover {
  background: #f3f4f6;
}

body.modo-oscuro .gtc-ml-import-panel {
  background: var(--fondo-card);
}

body.modo-oscuro .gtc-ml-import-title,
body.modo-oscuro .gtc-ml-import-head,
body.modo-oscuro .gtc-ml-import-label {
  color: var(--texto-principal);
}

body.modo-oscuro .gtc-ml-import-file-input,
body.modo-oscuro .gtc-ml-import-select {
  background: var(--fondo-input);
  color: var(--texto-principal);
  border-color: var(--borde-principal);
}

body.modo-oscuro .gtc-ml-import-btn-file {
  background: #ffffff;
  color: #1c2646;
  border-color: #cfd6e5;
}

body.modo-oscuro .gtc-ml-import-btn-secondary {
  background: #2c3348;
  border-color: #4b5563;
  color: #d1d5db;
}

@media (max-width: 880px) {
  .gtc-ml-import-file-row > div,
  .gtc-ml-import-map-head > div,
  .gtc-ml-import-map-row > div {
    grid-template-columns: 1fr;
  }

  .gtc-ml-import-head {
    font-size: 0.95rem;
  }
}
