/* Base Styles */
.mortgage-documents-container,
.mortgage-real-estate-container,
.mortgage-manager-container {
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Headers */
.real-estate-header,
.manager-header,
.user-header {
  margin-bottom: 30px;
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
}

.real-estate-header h2,
.manager-header h2,
.user-header h2 {
  color: #2c3338;
  font-size: 24px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f1;
}

/* Navigation Tabs */
.real-estate-tabs,
.manager-tabs {
  display: flex;
  gap: 10px;
  border-bottom: 2px solid #e5e5e5;
  margin-top: 20px;
}

.tab-button {
  padding: 10px 20px;
  border: none;
  background: none;
  color: #666;
  font-weight: 500;
  cursor: pointer;
  position: relative;
}

.tab-button.active {
  color: #2271b1;
}

.tab-button.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: #2271b1;
}

/* Tables */
/* Contenedor responsive para tablas con scroll horizontal */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}

.table-responsive .manager-table {
  width: 100%; /* Usa todo el ancho disponible */
  margin-bottom: 0;
}

/* Solo forzar ancho mínimo en pantallas medianas y pequeñas */
@media (max-width: 1400px) {
  .table-responsive .manager-table {
    min-width: 1200px; /* Aquí sí forzamos el scroll */
  }
}

@media (max-width: 768px) {
  .table-responsive .manager-table {
    min-width: 1000px; /* En mobile, ancho menor */
  }
}

.real-estate-table,
.manager-table,
.documents-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background: #fff;
}

.real-estate-table th,
.manager-table th,
.documents-table th,
.real-estate-table td,
.manager-table td,
.documents-table td {
  padding: 12px;
  text-align: left;
  border: 1px solid #dcdcde;
}

.real-estate-table th,
.manager-table th,
.documents-table th {
  background: #f0f0f1;
  font-weight: 600;
  color: #1d2327;
}

.real-estate-table tr:hover,
.manager-table tr:hover,
.documents-table tr:hover {
  background-color: #f6f7f7;
}

/* Forms and Controls */
.search-filters {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-filters input,
.search-filters select,
.form-group input,
.form-group select,
.form-group textarea {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  min-width: 200px;
  width: 100%;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #1d2327;
}

/* Buttons */
button {
  padding: 8px 16px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.upload-btn {
  background-color: #2271b1;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 5px;
}

.upload-btn:hover {
  background-color: #135e96;
}

/* Status Badges */
.stage-badge,
.status-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  min-width: 80px;
  display: inline-block;
}

.stage-1 {
  background: #fff3cd;
  color: #856404;
}
.stage-2 {
  background: #cce5ff;
  color: #004085;
}
.stage-3 {
  background: #d1ecf1;
  color: #0c5460;
}
.stage-4 {
  background: #d4edda;
  color: #155724;
}
.stage-5 {
  background: #e2e3e5;
  color: #383d41;
}

.status-pendiente {
  background: #fff3cd;
  color: #856404;
}
.status-subido {
  background: #d4edda;
  color: #155724;
}
.status-revision {
  background: #cce5ff;
  color: #004085;
}
.status-rechazado {
  background: #f8d7da;
  color: #721c24;
}

/* Modals */
.real-estate-modal,
.manager-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.modal-content {
  background: #fff;
  width: 90%;
  max-width: 600px;
  margin: 50px auto;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  animation: fadeIn 0.3s ease-out;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 15px;
  margin-bottom: 20px;
  border-bottom: 1px solid #e5e5e5;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px solid #e5e5e5;
}

/* Progress Indicators */
.upload-progress {
  display: none;
  width: 100%;
  height: 4px;
  background: #e9ecef;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}

.upload-progress-bar {
  height: 100%;
  background: #2271b1;
  width: 0;
  transition: width 0.3s ease;
}

/* Stage Progress */
.stage-progress {
  display: flex;
  justify-content: space-between;
  margin: 20px 0;
  position: relative;
}

.stage-step {
  position: relative;
  flex: 1;
  text-align: center;
}

.stage-step::before {
  content: "";
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e9ecef;
  border: 3px solid #fff;
  z-index: 2;
}

.stage-step.completed::before {
  background: #2271b1;
}

/* Utilities */
.hidden {
  display: none;
}
.text-center {
  text-align: center;
}
.text-right {
  text-align: right;
}
.text-left {
  text-align: left;
}

.mt-2 {
  margin-top: 0.5rem;
}
.mb-2 {
  margin-bottom: 0.5rem;
}
.mr-2 {
  margin-right: 0.5rem;
}
.ml-2 {
  margin-left: 0.5rem;
}

.w-100 {
  width: 100%;
}
.w-50 {
  width: 50%;
}

.d-flex {
  display: flex;
}
.align-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .mortgage-documents-container,
  .mortgage-real-estate-container,
  .mortgage-manager-container {
    padding: 10px;
  }

  .search-filters {
    flex-direction: column;
  }

  .search-filters input,
  .search-filters select {
    width: 100%;
  }

  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .real-estate-table,
  .manager-table,
  .documents-table {
    min-width: 1000px; /* En mobile, ancho mínimo menor */
  }

  .stage-progress {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .modal-content {
    width: 95%;
    margin: 20px auto;
  }

  .real-estate-tabs,
  .manager-tabs {
    flex-direction: column;
    gap: 5px;
  }
}

/* Contract Popup Styles */
.contract-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.contract-popup-content {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.contract-popup-header {
  margin-bottom: 1.5rem;
}

.contract-popup-title {
  font-size: 1.5rem;
  color: #2c3338;
  margin-bottom: 1rem;
}

.contract-popup-description {
  color: #50575e;
  margin-bottom: 1.5rem;
}

.contract-popup-buttons {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.contract-popup-button {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  border: none;
}

.contract-popup-download {
  background-color: #2271b1;
  color: white;
}

.contract-popup-close {
  background-color: #6c757d;
  color: white;
}

/* Panel de asignaciones */
.assignment-panel {
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filter-controls {
  margin-bottom: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
}

.search-group {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.search-input {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  min-width: 200px;
  flex: 1;
}

.profile-select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  min-width: 150px;
}

.assign-button {
  padding: 6px 12px;
  background-color: #2271b1;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* Estilos para pestañas activas */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.tab-button.active {
  background-color: #2271b1;
  color: white;
}

/* Estilos para modales */
.manager-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 20px;
  border-radius: 8px;
  width: 80%;
  max-width: 600px;
}

/* Estilos para botones */
.edit-button,
.delete-button {
  padding: 5px 10px;
  margin: 0 5px;
  border-radius: 4px;
  cursor: pointer;
}

.edit-button {
  background-color: #2271b1;
  color: white;
  border: none;
}

.delete-button {
  background-color: #dc3545;
  color: white;
  border: none;
}

/* Estilos para botones de acción */
.actions-column {
  display: flex;
  gap: 5px;
}

.edit-button,
.delete-button,
.assign-button {
  padding: 5px 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.edit-button {
  background-color: #2271b1;
  color: white;
}

.delete-button {
  background-color: #dc3545;
  color: white;
}

.assign-button {
  background-color: #198754;
  color: white;
}

/* Modal de asignación */
.assignment-modal-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  margin: 50px auto;
}

.assignment-modal-content select {
  width: 100%;
  padding: 8px;
  margin: 10px 0;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* Estilos para badges de etapa */
.stage-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.stage-1 {
  background: #fff3cd;
  color: #856404;
}
.stage-2 {
  background: #cce5ff;
  color: #004085;
}
.stage-3 {
  background: #d1ecf1;
  color: #0c5460;
}
.stage-4 {
  background: #d4edda;
  color: #155724;
}
.stage-5 {
  background: #e2e3e5;
  color: #383d41;
}

/* Estilos para la tabla de inmobiliarias */
.view-button {
  background-color: #6c757d;
  color: white;
  padding: 5px 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* Estilos para el modal de usuarios */
.users-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.users-modal-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 800px;
  margin: 50px auto;
  max-height: 80vh;
  overflow-y: auto;
}

/* Estilos para los filtros */
.search-filters {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
  flex-wrap: wrap;
}

.search-filters input,
.search-filters select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  min-width: 200px;
}

/* Estilos para el panel de asignaciones */
.remove-button {
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
}

.assignments-list {
  margin-top: 30px;
}

.assignments-list h4 {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f1;
}

.real-estate-select {
  min-width: 200px;
  margin-right: 10px;
}

#assignments-table {
  margin-top: 20px;
}

#unassigned-users-table {
  margin-bottom: 30px;
}

.assignment-filters {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.assignment-filters input {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  flex: 1;
}

/* Estilos específicos para modales */
.manager-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.modal-content {
  position: relative;
  background-color: #fff;
  margin: 5% auto;
  padding: 20px;
  width: 90%;
  max-width: 600px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.close-modal {
  position: absolute;
  right: 15px;
  top: 15px;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  line-height: 1;
}

.close-modal:hover {
  color: #333;
}

.modal-header {
  padding-right: 30px; /* Espacio para el botón de cerrar */
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e5e5e5;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #e5e5e5;
}

.modal-footer button {
  padding: 8px 16px;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
}

.cancel-button {
  background-color: #6c757d;
  color: white;
  border: none;
}

.save-button {
  background-color: #2271b1;
  color: white;
  border: none;
}

.save-button:hover {
  background-color: #135e96;
}

.cancel-button:hover {
  background-color: #5a6268;
}

.user-modal-tabs {
  display: flex;
  border-bottom: 1px solid #e0e0e0;
}

.user-modal-tabs .tab-button {
  padding: 10px 20px;
  background: #f4f4f4;
  border: none;
  cursor: pointer;
  transition: background 0.3s;
}

.user-modal-tabs .tab-button.active {
  background: #2271b1;
  color: white;
}

.modal-panel {
  display: none;
}

.modal-panel.active {
  display: block;
}

.user-modal-content {
  padding: 20px;
}

.manager-modal .modal-content {
  width: 90% !important;
  max-width: 1200px !important;
  margin: 50px auto !important;
}

.documents-table {
  width: 100%;
}

.documents-table th,
.documents-table td {
  padding: 10px;
  text-align: left;
  border: 1px solid #e0e0e0;
}

.documents-table th {
  background-color: #f4f4f4;
  font-weight: bold;
}

.manager-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.close-modal {
  cursor: pointer;
  font-size: 24px;
}

.modal-footer {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.form-control {
  width: 100%;
  padding: 8px;
  margin: 10px 0;
  border: 1px solid #ddd;
  border-radius: 4px;
}
.real-estate-info-input {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.real-estate-textarea {
  width: 100%;
  padding: 10px;
  min-height: 80px;
  border: 1px solid #ddd;
  border-radius: 4px;
  resize: vertical;
  font-family: inherit;
  font-size: 14px;
}

.document-actions {
  width: 100%;
}

.document-actions .file-input-hidden {
  display: none !important;
}

/* Estilo específico para la celda de información inmobiliaria */
.real-estate-info-cell {
  padding: 10px !important;
  min-width: 300px;
}
.save-button {
  background-color: #2271b1;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
  margin-top: 5px;
}

.save-button:hover {
  background-color: #135e96;
}

.real-estate-info-cell {
  padding: 10px !important;
  min-width: 300px;
}

.real-estate-info-cell textarea {
  width: 100%;
  min-height: 100px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 10px;
  resize: vertical;
}

.real-estate-info-cell .save-button {
  width: 100%;
  padding: 8px;
  background-color: #2271b1;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.real-estate-info-cell .save-button:hover {
  background-color: #135e96;
}
.real-estate-info-cell .stage-locked {
  padding: 10px;
  background-color: #f8f9fa;
  border-radius: 4px;
}

.real-estate-info-cell .info-preview {
  padding: 8px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  min-height: 60px;
  white-space: pre-wrap;
}

.real-estate-info-cell .stage-message {
  color: #666;
  font-style: italic;
}

/* Ocultar elementos de subida de archivo */
.real-estate-info-cell .document-actions,
.real-estate-info-cell .file-input-hidden,
.real-estate-info-cell .upload-btn,
.real-estate-info-cell .upload-progress {
  display: none !important;
}

/* Limpiar estilos de documento para la celda de inmobiliaria */
.real-estate-info-cell .document-name,
.real-estate-info-cell .document-actions {
  display: none !important;
}

/* Modal general */
.modal-content {
  max-height: 90vh; /* altura máxima del 90% de la ventana */
  overflow: hidden; /* oculta el scroll del contenedor principal */
  display: flex;
  flex-direction: column;
}

/* Contenedor del contenido del modal */
.user-modal-content {
  flex: 1; /* toma el espacio restante */
  overflow-y: auto; /* añade scroll vertical */
  padding: 20px;
}

/* Panel de documentos */
.modal-panel {
  max-height: calc(
    80vh - 200px
  ); /* altura máxima menos el espacio de header y footer */
  overflow-y: auto;
}

/* Asegurar que el header y footer se mantienen fijos */
.modal-header {
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.modal-footer {
  position: sticky;
  bottom: 0;
  background: white;
  z-index: 1;
}

/* Ajustes para la tabla de documentos */
.documents-table {
  width: 100%;
}

/* Opcional: hacer que el header de la tabla sea sticky */
.documents-table thead th {
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.real-estate-info-cell label {
  display: block;
  margin-top: 10px;
  font-weight: 500;
  color: #333;
}

.real-estate-info-cell input[type="number"] {
  width: 100%;
  padding: 8px;
  margin: 5px 0;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.info-preview {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 4px;
  margin-top: 10px;
}

.info-preview p {
  margin: 5px 0;
}

.info-preview strong {
  color: #2271b1;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

.user-info-section {
  flex: 1;
}

.mortgage-info-box {
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
  min-width: 300px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mortgage-info-box h3 {
  color: #2271b1;
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
  font-size: 1.1em;
}

.mortgage-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mortgage-info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mortgage-info-item label {
  color: #666;
  font-weight: 500;
}

.mortgage-info-item span {
  color: #1a1a1a;
  font-weight: 600;
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
  }

  .mortgage-info-box {
    width: 100%;
    min-width: 0;
  }
}

.real-estate-info {
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.real-estate-info h3 {
  color: #2271b1;
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.real-estate-details .info-row {
  display: flex;
  margin-bottom: 0.75rem;
}

.real-estate-details .info-row strong {
  min-width: 150px;
  color: #666;
}

.real-estate-details .info-row span {
  color: #1a1a1a;
}

.real-estate-details .additional-info {
  flex-direction: column;
}

.real-estate-details .additional-info strong {
  margin-bottom: 0.5rem;
}

.real-estate-details .info-text {
  background: white;
  padding: 1rem;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
  white-space: pre-line;
  line-height: 1.5;
}

.button-group {
  display: flex;
  gap: 0.5rem;
}

.download-btn,
.update-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s;
}

.download-btn {
  background-color: #28a745;
  color: white;
}

.download-btn:hover {
  background-color: #218838;
}

.update-btn {
  background-color: #2271b1;
  color: white;
}

.update-btn:hover {
  background-color: #135e96;
}

.download-btn .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
}

.document-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.user-modal-content .form-row {
  display: flex;
  gap: 15px;
}

.user-modal-content .form-group {
  flex: 1;
  min-width: 0;
}

/* Estilos para modal de gestión de trabajadores */
.clients-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #ddd;
  padding: 10px;
  margin-top: 10px;
  border-radius: 4px;
}

.client-checkbox {
  padding: 8px;
  border-bottom: 1px solid #f0f0f0;
}

.client-checkbox:last-child {
  border-bottom: none;
}

.workers-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.workers-tabs .tab-button {
  padding: 10px 20px;
  border: none;
  background-color: #f0f0f0;
  border-radius: 4px;
  cursor: pointer;
}

.workers-tabs .tab-button.active {
  background-color: #2271b1;
  color: white;
}

/* Estilos para los paneles modales */
.modal-panel {
  display: none;
}

.modal-panel.active {
  display: block;
}

/* Estilos para el modal de asignación de clientes */
#client-assignment-modal .modal-content {
  max-height: 90vh;
  overflow-y: auto;
}

/* Botón de trabajadores */
.view-button[style*="background-color: #4CAF50"] {
  background-color: #4caf50;
}
.view-button[style*="background-color: #4CAF50"]:hover {
  background-color: #45a049;
}

.mortgage-values-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  background-color: #f9f9f9;
  border-radius: 5px;
  border: 1px solid #e0e0e0;
}

.mortgage-values-form .form-group {
  margin-bottom: 10px;
}

.mortgage-values-form label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #333;
}

.mortgage-values-form input[type="number"] {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #fff;
}

.mortgage-values-form .save-button {
  margin-top: 10px;
  padding: 8px;
  background-color: #2271b1;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
}

.mortgage-values-form .save-button:hover {
  background-color: #135e96;
}

/* Estilos para el botón de email */
.email-button {
  padding: 5px 10px;
  margin: 0 5px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #607d8b;
  color: white;
  border: none;
}

.email-button:hover {
  background-color: #455a64;
}

/* Estilos para el modal de email */
#email-notification-modal .modal-content {
  max-width: 600px;
}

#email-preview {
  margin-top: 20px;
}

.email-preview-content {
  background: #f8f9fa;
  border: 1px solid #ddd;
  padding: 15px;
  border-radius: 4px;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 10px;
}

#custom-message {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
  resize: vertical;
}

/* Ajustes para la notificación de etapa enviada */
.stage-email-notification {
  margin-top: 10px;
  padding: 10px;
  background: #e6f7ff;
  border: 1px solid #91d5ff;
  border-radius: 4px;
  color: #1890ff;
  display: flex;
  align-items: center;
  font-size: 14px;
}

.stage-email-notification .dashicons {
  margin-right: 8px;
}

/* SOLUCIÓN DEFINITIVA PARA TABS */
/* Asegura que todos los paneles estén ocultos por defecto */
#user-modal .modal-panel,
#user-modal #user-documents-panel,
#user-modal #user-data-panel {
  display: none !important;
}

/* El panel actualmente seleccionado se muestra */
#user-modal .modal-panel.current-tab {
  display: block !important;
}

/* Mejoras visuales para los tabs */
#user-modal .user-modal-tabs {
  display: flex;
  border-bottom: 1px solid #ddd;
  margin: 0 0 20px 0;
  padding: 0;
}

#user-modal .user-modal-tabs .tab-button {
  flex: 1;
  padding: 10px 15px;
  background: #f8f9fa;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

#user-modal .user-modal-tabs .tab-button.active {
  background: white;
  border-bottom-color: #2271b1;
  color: #2271b1;
}

/* Contenedor de modal con flexbox */
#user-modal .modal-content {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
}

#user-modal .user-modal-content {
  flex: 1;
  overflow: hidden;
  padding: 15px;
}

.status-pendiente {
  background: #fff3cd;
  color: #856404;
}
.status-firmado {
  background: #d4edda;
  color: #155724;
}
.status-standby {
  background: #cce5ff;
  color: #004085;
}
.status-no_posible {
  background: #f8d7da;
  color: #721c24;
}
/* Estilos para múltiples archivos */
.multiple-files-container,
.loans-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px;
  border-radius: 4px;
  background-color: #f8f9fa;
}

.file-number {
  min-width: 60px;
  font-weight: 500;
}

.add-file-btn,
.add-loan-btn {
  margin-top: 10px;
  padding: 8px 12px;
  background-color: #e9ecef;
  border: 1px solid #ced4da;
  border-radius: 4px;
  color: #495057;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  width: fit-content;
}

.add-file-btn:hover,
.add-loan-btn:hover {
  background-color: #dee2e6;
}

.loan-section {
  border: 1px solid #e9ecef;
  border-radius: 5px;
  padding: 10px;
  margin-bottom: 15px;
  background-color: #f8f9fa;
}

.loan-section h4 {
  margin-top: 0;
  margin-bottom: 10px;
  color: #495057;
  font-size: 16px;
  padding-bottom: 5px;
  border-bottom: 1px solid #dee2e6;
}

/* Ajustar anchos de columnas en tabla de usuarios */
.manager-table th:nth-child(3),
.manager-table td:nth-child(3) {
  width: 80px;
  max-width: 80px;
}

.manager-table th:nth-child(7),
.manager-table td:nth-child(7) {
  width: 300px;
  min-width: 250px;
}

/* ============================================
   SISTEMA DE PESTAÑAS PARA OPCIONES DE HIPOTECA
   ============================================ */

.mortgage-options-container {
  width: 100%;
  background: #fff;
}

.mortgage-options-tabs {
  display: flex;
  gap: 0;
  margin: 15px 0 0 0;
  border-bottom: 2px solid #e0e0e0;
}

.mortgage-tab {
  flex: 1;
  padding: 12px 20px;
  background: #f5f5f5;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: #666;
  transition: all 0.3s ease;
  position: relative;
}

.mortgage-tab:hover {
  background: #e8e8e8;
  color: #333;
}

.mortgage-tab.active {
  background: #fff;
  color: #2271b1;
  border-bottom-color: #2271b1;
}

.mortgage-tab:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 25%;
  height: 50%;
  width: 1px;
  background: #ddd;
}

.mortgage-tab.active::after {
  display: none;
}

/* Contenido de opciones */
.mortgage-option-content {
  display: none;
  padding: 20px 15px;
}

.mortgage-option-content.active {
  display: block;
}

.inner-mortgage-table {
  width: 100%;
  border-collapse: collapse;
}

.inner-mortgage-table td {
  padding: 15px;
  vertical-align: top;
}

/* Indicador de opción vacía */
.empty-option-notice {
  padding: 30px;
  text-align: center;
  background: #f9f9f9;
  border: 2px dashed #ddd;
  border-radius: 8px;
  color: #666;
  font-size: 14px;
}

.empty-option-notice p {
  margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .mortgage-options-tabs {
    flex-direction: column;
  }

  .mortgage-tab {
    border-bottom: 1px solid #e0e0e0;
  }

  .mortgage-tab.active {
    border-left: 3px solid #2271b1;
    border-bottom: 1px solid #e0e0e0;
  }

  .mortgage-tab:not(:last-child)::after {
    display: none;
  }

  .inner-mortgage-table td {
    display: block;
    width: 100% !important;
  }
}
