/*:root {
  --primary: #4F6D09;
  --primary2: #bdc0b8;
  --text: #333;
  --background: #e8e8e8;
  --white: #ffffff;
  --border: #bdc0b8;
  --secondary-color: #ffffff;
  --gradient-light: linear-gradient(135deg, #007bff, #00c6ff);
  --gradient-dark: linear-gradient(to right, #246ab4, #1d4e89);
  --text-color: #333;
  --highlight: #fff3cd;
}*/
#mi-portlet {
  font-family: sans-serif;
  padding: 40px;
  color: var(--text);
}

#mi-portlet #formContainer {
  max-width: 1200px;
  background-color: #e8e8e8;
  border: 2px solid #bdc0b8;
  border-radius: 8px;
  padding-top: 1em;
  margin-top: 25px;
}

#mi-portlet .col-criterio {
  background-color: #ffe082;
  font-weight: 600;
}

#mi-portlet .tooltipo {
  cursor: pointer;
}

#mi-portlet #tablaAdjudicatarios {
  padding-top: 1em;
  display: none;
  margin-top: 25px;
}

/* Primera columna ajustada al contenido */
.tabla3 th:first-child,
.tabla3 td:first-child {
  white-space: nowrap; /* Evita que el contenido se rompa en varias líneas */
}

/*max-width: 600px;
margin: 50px auto 50px auto;*/
#mi-portlet .btn-limpiar {
  margin-right: 2em;
  color: #ffffff;
  background-color: #5d5d5d;
  border-color: #5d5d5d;
  text-shadow: none;
  font-weight: bold;
  font-size: 0.85em;
  padding: 0.29em 0.85em;
  background-image: none;
  border-radius: 4px;
}

#mi-portlet .btn-enviar {
  color: #ffffff;
  background-color: #4F6D09;
  border-color: #4F6D09;
  text-shadow: none;
  font-weight: bold;
  font-size: 0.85em;
  padding: 0.29em 0.85em;
  background-image: none;
  border-radius: 4px;
}

#mi-portlet #contenidoFormulario {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
}

#mi-portlet #sublotePrincipal {
  display: none;
}

#mi-portlet select {
  font-size: 14px;
  border: 1px solid #aaa;
  padding: 4px 6px;
  word-wrap: normal;
  max-width: 50%;
}

#mi-portlet .titulo {
  max-width: 1200px;
  margin: 20px 0 20px 0;
  padding: 20px;
  background-color: #fff;
  border: 1px solid #ddd;
}

#mi-portlet .header {
  background: var(--gradient-dark);
  color: var(--secondary-color);
  padding: 2rem 1rem;
  text-align: center;
  border-radius: 10px;
}

#mi-portlet .header {
  font-size: 24px;
  margin: 0;
}

#mi-portlet .content {
  margin-top: 30px;
  font-size: 16px;
  line-height: 1.5;
}

#mi-portlet .content p {
  margin-bottom: 10px;
}

#mi-portlet .content ul {
  list-style-type: disc;
  margin-left: 20px;
}

#mi-portlet .content strong {
  color: #000;
}

#mi-portlet .footer {
  text-align: center;
  padding: 10px;
  border-radius: 5px;
  margin-top: 30px;
}

#mi-portlet .footer p {
  margin: 0;
}

/* Contenedor checkbox + label + input */
#mi-portlet .checkbox-option {
  display: flex;
  align-items: center;
  cursor: pointer;
  background: #e8e8e8;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  flex-wrap: nowrap;
}

#mi-portlet .checkbox-option input[type=checkbox] {
  width: 22px;
  height: 22px;
  accent-color: #4F6D09;
  cursor: pointer;
  margin-bottom: 0;
}

#mi-portlet .checkbox-option:hover {
  background: #f0fdfa;
  border-color: #4F6D09;
}

#mi-portlet .checkbox-option:has(input:checked) {
  background: linear-gradient(135deg, #f1f5e6 0%, #e0ebc8 100%);
  border-color: #4F6D09;
}

#mi-portlet .checkbox-option label {
  font-size: 14px;
  font-weight: bold;
  color: #334155;
  cursor: pointer;
  margin-top: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

#mi-portlet .checkbox-option label .emoji {
  font-size: 1.5em;
  line-height: 1;
  margin-right: 8px;
}

#mi-portlet .so-qty {
  min-width: 100px;
  max-width: 200px;
  height: 32px;
  padding: 4px 6px;
  font-size: 14px;
  border: 1px solid #aaa;
  border-radius: 0px;
  box-sizing: border-box;
  display: none;
  margin-right: 0px;
  font-family: inherit;
}

#mi-portlet .so-icon {
  width: 30px;
  height: 30px;
  margin-right: 6px;
  vertical-align: middle;
}

#mi-portlet .container-so-qty {
  display: none;
}

#mi-portlet .qty {
  min-width: 100px;
  max-width: 200px;
  padding: 4px 6px;
  margin-top: 5px;
  border: 1px solid #aaa;
  border-radius: 0px;
  font-size: 14px;
  /*background-color: #aaa;*/
  box-sizing: border-box;
  display: flex;
  overflow: visible;
  font-family: inherit;
}

#mi-portlet .custom-warning {
  font-size: 13px;
  margin-top: 4px;
  margin-bottom: 2px;
  width: 90%;
}

#mi-portlet .so-qty,
#mi-portlet .container-so-qty {
  display: none;
}

@media (max-width: 480px) {
  #mi-portlet .so-qty {
    max-width: 200px;
    font-size: 14px;
    height: 28px;
  }
  #mi-portlet .checkbox-option label {
    font-size: 1em;
  }
}
#mi-portlet .error-msg {
  color: red;
  font-size: 12px;
  display: block;
  margin-top: 5px;
  text-align: left;
}

#mi-portlet .control-label {
  font-weight: 600;
}

#mi-portlet .controls input,
#mi-portlet .controls select {
  font-size: 14px;
  border: 1px solid #aaa;
  padding: 4px 6px;
}

#mi-portlet .input-error {
  border: 2px solid red;
}

#mi-portlet .toggle-sub {
  border-radius: 50rem !important;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

#mi-portlet .btn-outline-info {
  border-color: #4F6D09;
  color: #4F6D09;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

#mi-portlet .btn-outline-info:hover {
  border-color: #4F6D09 !important;
  background-color: #4F6D09 !important;
  color: #FFF !important;
}

#mi-portlet .btn.rounded-pill {
  border-radius: 50rem !important;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

#mi-portlet .tabla3 td:first-child {
  text-align: center;
  vertical-align: middle;
}

#mi-portlet tr.oculto {
  display: none;
  transition: all 0.3s ease-in-out;
}

#mi-portlet.detalle,
#mi-portlet .detalle-sub {
  display: table-row;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.4s ease;
}

#mi-portlet .detalle.show,
#mi-portlet .detalle-sub.show {
  max-height: 500px;
  opacity: 1;
}

#mi-portlet .table-container {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 20px;
}

#mi-portlet table {
  border-collapse: collapse;
  width: 100%;
  min-width: 600px;
}

#mi-portlet .tabla3 {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 14px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  box-sizing: border-box;
  margin-left: 0px;
  margin-right: 0px;
  justify-content: center;
  border-width: 1px;
  border-color: rgb(189, 192, 184);
  border-spacing: 0px;
  color: rgb(33, 37, 41);
  border-style: solid;
}

#mi-portlet .tabla3 th,
#mi-portlet .tabla3 td {
  border-width: 1px;
  border-color: rgb(189, 192, 184) rgb(222, 226, 230) rgb(222, 226, 230) rgb(189, 192, 184);
  border-style: solid;
  padding: 0.4rem;
  text-align: left;
  position: relative;
  box-sizing: border-box;
  vertical-align: middle;
  background-clip: padding-box;
  /* NUEVO: Ajuste de texto */
  white-space: normal; /* Permite saltos de línea */
  word-wrap: break-word; /* Rompe palabras largas si es necesario */
  overflow-wrap: break-word; /* Compatibilidad adicional */
}

#mi-portlet .tabla3 th {
  border-width: 1px 1px 2px;
  height: 36px;
  background-color: rgb(79, 109, 9);
  padding: 0.4rem 0.4rem 0px;
  color: #ffffff;
  text-align: center;
  font-weight: bold;
}

#mi-portlet .tabla-sublotes {
  width: 70%;
  table-layout: auto;
  border-collapse: collapse;
  font-size: 14px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  box-sizing: border-box;
  margin-left: 0px;
  margin-right: 0px;
  justify-content: center;
  border-width: 1px;
  border-color: rgb(189, 192, 184);
  border-spacing: 0px;
  color: rgb(33, 37, 41);
  border-style: solid;
}

#mi-portlet .tabla-sublotes th,
#mi-portlet .tabla-sublotes td {
  border-width: 1px;
  border-color: rgb(189, 192, 184) rgb(222, 226, 230) rgb(222, 226, 230) rgb(189, 192, 184);
  border-style: solid;
  padding: 0.4rem;
  text-align: left;
  position: relative;
  box-sizing: border-box;
  vertical-align: middle;
  background-clip: padding-box;
  /* NUEVO: Ajuste de texto */
  white-space: normal; /* Permite saltos de línea */
  word-wrap: break-word; /* Rompe palabras largas si es necesario */
  overflow-wrap: break-word; /* Compatibilidad adicional */
}

/* Segunda columna más grande */
#mi-portlet .tabla-sublotes th:nth-child(1),
#mi-portlet .tabla-sublotes td:nth-child(1) {
  width: 20% !important;
}

#mi-portlet .tabla-sublotes th:nth-child(2),
#mi-portlet .tabla-sublotes td:nth-child(2) {
  width: 20% !important;
}

/* Tercera columna y cuarta se ajustan automáticamente */
#mi-portlet .tabla-sublotes th:nth-child(3),
#mi-portlet .tabla-sublotes td:nth-child(3) {
  width: 40% !important;
}

#mi-portlet .tabla-sublotes th:nth-child(4),
#mi-portlet .tabla-sublotes td:nth-child(4) {
  width: 20% !important;
}

#mi-portlet .tabla-articulos {
  width: 80%;
}

#mi-portlet .tabla-articulos th:nth-child(1),
#mi-portlet .tabla-articulos td:nth-child(1) {
  width: 20% !important;
}

#mi-portlet .tabla-articulos th:nth-child(2),
#mi-portlet .tabla-articulos td:nth-child(2) {
  width: 40% !important;
}

#mi-portlet .tabla-articulos th:nth-child(3),
#mi-portlet .tabla-articulos td:nth-child(3) {
  width: 10% !important;
}

#mi-portlet .tabla-articulos th:nth-child(4),
#mi-portlet .tabla-articulos td:nth-child(4) {
  width: 10% !important;
}

#mi-portlet .tabla-articulos th:nth-child(5),
#mi-portlet .tabla-articulos td:nth-child(5) {
  width: 20% !important;
}

#mi-portlet .tabla-empresa tr:hover {
  background-color: #f1f1f1;
}

#mi-portlet .euro {
  text-align: right;
  font-weight: bold;
}

#mi-portlet th,
#mi-portlet td {
  border: 1px solid #ddd;
  padding: 8px;
  white-space: nowrap;
}

#mi-portlet th {
  background-color: #f2f2f2;
  position: sticky;
  top: 0;
  z-index: 2;
}

#mi-portlet .tabla-empresa th:nth-child(1),
#mi-portlet .tabla-empresa td:nth-child(1) {
  width: 150px;
  /*max-width: 20% !important;*/
}

#mi-portlet .tabla-empresa th:nth-child(2),
#mi-portlet .tabla-empresa td:nth-child(2) {
  width: 50px;
}

#mi-portlet .tabla-empresa th,
#mi-portlet .tabla-empresa td {
  width: 100px; /* si son 5 columnas */
}

#mi-portlet .boton-estilizado {
  margin-top: 20px;
  background: linear-gradient(135deg, #4A90E2, #357ABD);
  color: white;
  border: none;
  border-radius: 25px;
  padding: 12px 25px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  text-align: center;
}

#mi-portlet .boton-estilizado:hover {
  background: linear-gradient(135deg, #5AA0F2, #468CD1);
  transform: scale(1.05);
}

#mi-portlet .boton-estilizado:active {
  transform: scale(0.98);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#mi-portlet .boton-estilizado:focus {
  outline: none;
  box-shadow: 0 0 4px 2px rgba(72, 131, 255, 0.6);
}

#mi-portlet .rotated {
  transform: rotate(90deg);
}

#mi-portlet #spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

#mi-portlet .spinner {
  border: 6px solid #f3f3f3;
  border-top: 6px solid #3498db;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
#mi-portlet .toast-container {
  position: fixed;
  top: 25px;
  right: 30px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 9999;
}

#mi-portlet .toast {
  border-radius: 12px;
  background: #fff;
  padding: 20px 35px 20px 25px;
  box-shadow: 0 6px 20px -5px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transform: translateX(calc(100% + 30px));
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.35), opacity 0.4s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  min-width: 300px;
}

#mi-portlet .toast.active {
  transform: translateX(0%);
  opacity: 1;
}

#mi-portlet .toast.hide {
  transform: translateX(120%);
  opacity: 0;
}

#mi-portlet .toast .toast-content {
  display: flex;
  align-items: center;
}

#mi-portlet .toast-content .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 35px;
  min-width: 35px;
  color: #fff;
  font-size: 20px;
  border-radius: 50%;
}

#mi-portlet .toast-content .message {
  display: flex;
  flex-direction: column;
  margin: 0 20px;
}

#mi-portlet .message .text {
  font-size: 16px;
  color: #666666;
}

#mi-portlet .message .text.text-1 {
  font-weight: 600;
  color: #333;
}

#mi-portlet .toast .close {
  position: absolute;
  top: 10px;
  right: 15px;
  padding: 5px;
  cursor: pointer;
  opacity: 0.7;
}

#mi-portlet .toast .close:hover {
  opacity: 1;
}

#mi-portlet .toast .progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
}
#mi-portlet .toast .progress:before {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  height: 100%;
  width: 100%;
}

#mi-portlet .progress.active:before {
  animation: progress 5s linear forwards;
}

@keyframes progress {
  100% {
    right: 100%;
  }
}
#mi-portlet .success .icon, #mi-portlet .success .progress:before {
  background-color: #28a745;
}

#mi-portlet .warning .icon, #mi-portlet .warning .progress:before {
  background-color: #ffc107;
}

#mi-portlet .error .icon, #mi-portlet .error .progress:before {
  background-color: #dc3545;
}

#mi-portlet .info .icon, #mi-portlet .info .progress:before {
  background-color: #007bff;
}

/* === CARD PARA JUSTIFICACIÓN === */
#mi-portlet .card {
  background: var(--white);
  padding: 30px;
  border-radius: 10px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.08);
  border: 1px solid #e4e6e8;
  box-sizing: border-box;
  margin: 0 auto; /* centrado horizontal */
  display: none;
}

#mi-portlet .card h2 {
  margin-top: 0;
  font-size: 20px;
  font-weight: 600;
  color: #2d3e50;
  margin-bottom: 20px;
}

#mi-portlet .card label {
  font-size: 14px;
  font-weight: 600;
  color: #2d3e50;
}

#mi-portlet .card textarea {
  width: 100%;
  height: 160px;
  margin-top: 8px;
  padding: 14px;
  border-radius: 6px;
  border: 1px solid #bfc5ca;
  font-size: 14px;
  resize: vertical;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background: #fdfdfd;
  box-sizing: border-box;
}

#mi-portlet .card textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 6px rgba(0, 119, 204, 0.3);
}

#mi-portlet .card .btn {
  margin-top: 20px;
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s ease;
}

#mi-portlet .card .btn:hover {
  background: #005ea3; /* un poco más oscuro */
}

/* 🔥 RESPONSIVE PARA TODAS LAS PANTALLAS */
@media (max-width: 480px) {
  #mi-portlet .card {
    padding: 20px;
  }
  #mi-portlet .card h2 {
    font-size: 18px;
  }
  #mi-portlet .card textarea {
    height: 140px;
    font-size: 13px;
  }
  #mi-portlet .card .btn {
    font-size: 14px;
    padding: 10px;
  }
}
@media (max-width: 350px) {
  #mi-portlet {
    padding: 10px;
  }
  #mi-portlet .card {
    padding: 16px;
  }
  #mi-portlet .card h2 {
    font-size: 16px;
  }
  #mi-portlet .card textarea {
    height: 120px;
    padding: 10px;
    font-size: 12px;
  }
  #mi-portlet .card .btn {
    padding: 9px;
    font-size: 13px;
  }
}
@media (max-width: 300px) {
  #mi-portlet .card {
    padding: 12px;
  }
  #mi-portlet .card h2 {
    font-size: 15px;
  }
  #mi-portlet .card label {
    font-size: 12px;
  }
  #mi-portlet .card textarea {
    height: 100px;
    padding: 8px;
    font-size: 11px;
  }
  #mi-portlet .card .btn {
    padding: 8px;
    font-size: 12px;
  }
}
/* Fondo del modal */
#mi-portlet .modal1 {
  display: none; /* oculto por defecto */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* Contenido del modal */
#mi-portlet .modal-content {
  position: relative;
  background: #fff;
  padding: 20px 30px 30px 30px;
  border-radius: 8px;
  max-width: 40%;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  /* Transición estilo dialogo */
  transform: scale(0.8);
  opacity: 0;
  transition: all 0.25s ease;
}

#mi-portlet .modal1.active .modal-content {
  transform: scale(1);
  opacity: 1;
}

/* Animación del modal */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* Botón de cerrar (X) más visible */
#mi-portlet .modal-close-btn {
  position: absolute;
  top: 7px;
  right: 12px;
  background: #ff4d4d; /* fondo rojo intenso */
  border: none;
  font-size: 28px; /* más grande */
  font-weight: bold;
  cursor: pointer;
  color: white; /* texto blanco */
  width: 38px;
  height: 38px;
  border-radius: 50%; /* círculo */
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: background 0.3s;
  line-height: 1;
}

#mi-portlet .modal-close-btn:hover {
  background: #cc0000; /* rojo más oscuro al hover */
  color: #fff;
}

/* Textarea */
#mi-portlet .modal-content textarea {
  width: 100%;
  padding: 8px;
  border-radius: 5px;
  border: 1px solid #ccc;
  resize: vertical;
  font-size: 14px;
  box-sizing: border-box;
}

/* Botón Descargar PDF */
#mi-portlet .modal-content button#confirmDownload {
  margin-top: 20px;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  width: 100%;
}

#mi-portlet .modal-instructions {
  font-size: 14px;
  color: #333;
  margin-bottom: 15px;
  line-height: 1.5;
  background: #fff3cd; /* fondo suave para destacar */
  padding: 10px;
  border-left: 4px solid #007BFF; /* barra azul al inicio */
  border-radius: 4px;
}

#mi-portlet .modal-content button#confirmDownload:hover {
  background-color: #0056b3;
}

/*PARA LOS DISTINTOS TIPOS DE DIALOG*/
/* Overlay */
/*.overlay {
  display: none; 
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}*/
/* Dialog */
#mi-portlet .dialog {
  background: white;
  padding: 15px;
  border-radius: 12px;
  width: 430px;
  text-align: center;
  transform: scale(0.8);
  opacity: 0;
  transition: all 0.25s ease;
}

#mi-portlet .dialog #titulo {
  font-size: 1.8em;
  color: #4F6D09;
  margin: 0 0 0 0.2em;
  text-align: center;
  display: inline-block;
  width: 100%;
  font-weight: bold;
}

#mi-portlet .modal1.active .dialog {
  transform: scale(1);
  opacity: 1;
}

#mi-portlet .modal1.active {
  display: flex; /* aquí sí se muestra */
}

/* Iconos */
#mi-portlet .icon {
  font-size: 50px;
  margin-bottom: 10px;
}

#mi-portlet .success {
  color: #28a745;
}

#mi-portlet .error {
  color: #dc3545;
}

#mi-portlet .warning {
  color: #ffc107;
}

#mi-portlet .info {
  color: #17a2b8;
}

/* Botones */
#mi-portlet .buttons {
  margin-top: 20px;
}

#mi-portlet button {
  padding: 10px 18px;
  margin: 5px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

#mi-portlet .btn-ok {
  background: #007BFF;
  color: white;
}

#mi-portlet .btn-cancel {
  background: #ccc;
}

@media (max-width: 600px) {
  #mi-portlet {
    padding: 20px;
  }
}