
/* Base */
body, .client-main {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #f8f9fb;
  color: #1f2937;
  line-height: 1.5;
}

/* Layout general */
.client-main {
  display: flex;
  flex-direction: row;
  padding: 20x;
}

.container-client {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-areas:
    "client-info status-info"
    "main-info status-info"
    "history-info status-info"
    "addAction-container current-promise-container"
    "address-info current-promise-container";
  gap: 20px;
  width: 100%;
}

/* Cards generales */
.client-info,
.main-info,
.history-info,
.addAction-container,
.status-info,
.current-promise-container,
.address-info {
  background-color: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* Cabecera Cliente */
.client-info {
  grid-area: client-info;
  display: flex;
  align-items: center;
  gap: 16px;
}
.client-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  background-color: #e5e7eb;
}
.client-data-a {
  font-size: 20px;
  font-weight: 600;
}
.client-data-b {
  font-size: 14px;
  color: #6b7280;
}

/* Contacto */
.contact-info p {
  font-size: 14px;
  color: #374151;
  margin-bottom: 4px;
}

/* Estado deuda / DPD */
.dpd-container {
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  color: #fff;
}
.green  { background-color: #22c55e; }
.yellow { background-color: #facc15; color: #1f2937; }
.orange { background-color: #fb923c; }
.red    { background-color: #ef4444; }

/* Tabla Productos e Historial */
.table {
  width: 100%;
  border-collapse: collapse;
}
.table-th {
  text-align: left;
  padding: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  background-color: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}
.table-td {
  padding: 10px;
  font-size: 14px;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
}
.table tbody tr:hover {
  background-color: #f9fafb;
}

.btn-more-info{
  background-color: #3b82f6;
  color: white;
  border: none;
  width: 80px;
  border-radius: 5px;
  padding: 5px 10px;}

.text-notes{
  font-size: 14px;
  color: #374151;
  resize: none;
  height: 80px;
  width: 80%;
  padding: 10px;
}

.phones-form{
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.phones-form-row{
  display: flex;
  flex-direction: row;
  gap: 200px;
}

.others-phones-group{
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.phones-others-label{
  font-size: 14px;
  color: #374151;
}

.phones-others-input{
  padding: 5px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
}

.btn-phone-client{
  background-color: #3b82f6;
  color: white;
  border: none;
  width: 150px;
  border-radius: 5px;
  padding: 10px 20px;
  margin: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
/* Form Nueva Gestión */
.addAction-container {
  grid-area: addAction-container;
}
.action-form {
  display: flex;
  flex-direction: column;
  gap: 12px;

}

.text-coments{
  font-size: 14px;
  color: #374151;
  resize: none;
    height: 38px;
}

.form-group-add-action {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group-add-action label {
  font-size: 14px;
  color: #374151;
}
.form-group-add-action input,
.form-group-add-action select,
.form-group-add-action textarea {
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
}
.form-group-add-action input:focus,
.form-group-add-action select:focus,
.form-group-add-action textarea:focus {
  border-color: #3b82f6;
  outline: none;
}

/* Botones */
.btn-client,
.addAction-container .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background-color: #2563eb;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .2s;
}
.btn-client:hover,
.addAction-container .btn:hover {
  background-color: #1d4ed8;
}

/* Status, Promesas, Dirección */
.status-info p,
.current-promise-container p,
.address-info p {
  font-size: 14px;
  color: #374151;
}

/* Responsivo */
@media (max-width: 1024px) {
  .container-client {
    grid-template-columns: 1fr;
    grid-template-areas:
      "client-info"
      "status-info"
      "main-info"
      "history-info"
      "addAction-container"
      "current-promise-container"
      "address-info";
  }
}

/* Fondo del modal */
.modal {
  position: fixed;
  inset: 0;
  display: none;                 
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 9999;
}

/* Contenido del modal */
.modal-content {
  position: relative;             /* 👈 clave: referencia para la X */
  background: #ffffff;
  color: #333;
  width: 100%;
  max-width: 480px;
  border-radius: 16px;
  padding: 24px 28px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  animation: fadeInUp 0.3s ease;
  font-family: 'Inter', system-ui, sans-serif;
}

/* Animación de entrada */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Botón de cierre */
.modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 22px;
  font-weight: bold;
  color: #777;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
  user-select: none;
}

.modal-close:hover {
  color: #000;
  transform: scale(1.1);
}

/* Título */
.modal-content h4 {
  margin-top: 0;
  margin-bottom: 18px;
  font-size: 1.2rem;
  font-weight: 600;
  color: #222;
  text-align: center;
}

/* Cuerpo */
#producto-info-body {
  font-size: 0.95rem;
  line-height: 1.5;
}

#producto-info-body strong {
  color: #555;
  font-weight: 500;
}

/* Grid de datos */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px 14px;
}

/* Responsivo */
@media (max-width: 500px) {
  .modal-content {
    max-width: 90%;
    padding: 20px;
  }
}

.gestiones-grid {
    display: flex; /* Cambiado de grid a flex */
    flex-direction: column; /* Apila los elementos verticalmente */
    gap: 20px;
}

.timeline-wrapper, .promises-wrapper {
    height: 130px; 
    overflow-y: auto; 
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
}

.promises-wrapper .table thead {
    position: sticky;
    top: -16px; 
    background-color: #ffffff;
    z-index: 1;
}

.status-pending { color: #f59e0b; font-weight: bold; }
.status-fulfilled { color: #10b981; font-weight: bold; }
.status-broken { color: #ef4444; font-weight: bold; }
.status-partial { color: #3b82f6; font-weight: bold; }
.status-renegotiated { color: #8b5cf6; font-weight: bold; }
.status-semi_fulfilled { color: #22c55e; font-weight: bold; }


/* === MODAL RENEGOCIAR PROMESA === */
#renegotiate-modal .modal-content {
  max-width: 440px;
  background: #ffffff;
  border-radius: 16px;
  padding: 28px 32px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  animation: fadeInUp 0.3s ease;
}

#renegotiate-modal h4 {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 20px;
}

#renegotiate-modal .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

#renegotiate-modal label {
  font-size: 14px;
  color: #374151;
  font-weight: 500;
}

#renegotiate-modal input,
#renegotiate-modal textarea {
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  color: #1f2937;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#renegotiate-modal input:focus,
#renegotiate-modal textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
  outline: none;
}

#renegotiate-modal textarea {
  resize: none;
  min-height: 70px;
}

/* Botones del modal */
#renegotiate-modal .btn-action-primary {
  flex: 1;
  background-color: #3b82f6;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.25s ease;
}

#renegotiate-modal .btn-action-primary:hover {
  background-color: #2563eb;
}

#renegotiate-modal .btn-action-secondary {
  flex: 1;
  background-color: #e5e7eb;
  color: #374151;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.25s ease;
}

#renegotiate-modal .btn-action-secondary:hover {
  background-color: #d1d5db;
}
