.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-row label {
  font-weight: 500;
  color: #333;
  font-size: 14px;
}

.form-row input,
.form-row select,
.form-row textarea {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background: #ffffff;
  transition: border-color 0.2s ease;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: #4CAF50;
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

.form-row input:disabled,
.form-row select:disabled,
.form-row textarea:disabled {
  background: #f5f5f5;
  color: #666;
  border-color: #ccc;
  cursor: not-allowed;
  opacity: 0.7;
}

.form-row input:disabled:focus,
.form-row select:disabled:focus,
.form-row textarea:disabled:focus {
  border-color: #ccc;
  box-shadow: none;
}

#unidades-container {
  margin: 2rem 0;
  display: grid;
  gap: 1.5rem;
}

.unidad-card {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 0;
  margin-bottom: 1.5rem;
  transition: box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.unidad-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.unidad-header {
  background: #f8f9fa;
  color: #333;
  padding: 1rem 1.5rem;
  margin: 0;
  border-bottom: 1px solid #e0e0e0;
  font-weight: 600;
  font-size: 16px;
  text-align: left;
}

.unidad-content {
  display: grid;
  gap: 1.5rem;
  padding: 1.5rem;
}

.unidad-content .form-row {
  background: #ffffff;
  padding: 0;
  border-radius: 0;
  border: none;
  transition: none;
}

.unidad-content .form-row label {
  color: #333;
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 0.5rem;
}

.unidad-content input,
.unidad-content textarea {
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 14px;
  transition: border-color 0.2s ease;
  resize: vertical;
}

.unidad-content input:focus,
.unidad-content textarea:focus {
  border-color: #4CAF50;
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

.form-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 2rem 0;
}

.btn {
  padding: 10px 20px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 120px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn::before {
  display: none;
}

.btn:hover::before {
  display: none;
}

.btn-primary {
  background: #4CAF50;
  color: white;
  border-color: #4CAF50;
}

.btn-primary:hover {
  background: #45a049;
  border-color: #45a049;
}

.btn-secondary {
  background: #ffffff;
  color: #333;
  border-color: #ddd;
}

.btn-secondary:hover {
  background: #f8f9fa;
  border-color: #bbb;
}

.btn-warning {
  background: #ff9800;
  color: #ffffff;
  border-color: #ff9800;
}

.btn-warning:hover {
  background: #f57c00;
  border-color: #f57c00;
}

.mensaje {
  margin-top: 1rem;
  padding: 12px 16px;
  border-radius: 4px;
  font-weight: 500;
  text-align: center;
  display: none;
  font-size: 14px;
}

.mensaje.exito {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  display: block;
}

.mensaje.exito::before {
  display: none;
}

.mensaje.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  display: block;
}

.mensaje.error::before {
  display: none;
}

.instrumentos-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.instrumento-item {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  background: #ffffff;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  transition: none;
}

.instrumento-item input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.2s ease;
  background: #ffffff;
}

.instrumento-item input:focus {
  outline: none;
  border-color: #4CAF50;
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

.btn-eliminar-instrumento {
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-eliminar-instrumento:hover {
  background: #c82333;
}

.btn-agregar-instrumento {
  background: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s ease;
  margin-top: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-agregar-instrumento:hover {
  background: #218838;
}

.btn-agregar-instrumento::before {
  display: none;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  padding: 2.5rem;
  max-width: 450px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  transform: scale(0.8) translateY(-30px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: white;
  overflow: hidden;
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), transparent);
  border-radius: 20px;
  pointer-events: none;
}

.modal-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: block;
  animation: bounceIn 0.6s ease-out 0.2s both;
}

.modal-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.modal-message {
  font-size: 1.1rem;
  line-height: 1.5;
  margin-bottom: 2rem;
  opacity: 0.9;
  animation: fadeInUp 0.6s ease-out 0.4s both;
}

.modal-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  animation: fadeInUp 0.6s ease-out 0.5s both;
}

.modal-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
  position: relative;
  overflow: hidden;
}

.modal-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.modal-btn:hover::before {
  width: 300px;
  height: 300px;
}

.modal-btn-confirm {
  background: #ff4757;
  color: white;
  box-shadow: 0 8px 20px rgba(255, 71, 87, 0.4);
}

.modal-btn-confirm:hover {
  background: #ff3742;
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(255, 71, 87, 0.5);
}

.modal-btn-cancel {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.1);
}

.modal-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(255, 255, 255, 0.2);
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
    margin: 1rem 0;
  }
  
  .form-buttons {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  
  .btn {
    width: 100%;
    max-width: 200px;
  }
  
  .unidad-content {
    padding: 1rem;
  }
  
  .unidad-header {
    padding: 1rem;
    font-size: 15px;
  }
  
  .instrumento-item {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  
  .btn-eliminar-instrumento {
    align-self: flex-end;
    width: auto;
    padding: 6px 12px;
  }
}

@media (max-width: 480px) {
  .form-grid {
    padding: 0.75rem;
  }
  
  .unidad-content {
    padding: 0.75rem;
  }
  
  .btn {
    font-size: 13px;
    padding: 8px 16px;
  }
  
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  padding: 2.5rem;
  max-width: 450px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  transform: scale(0.8) translateY(-30px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: white;
  overflow: hidden;
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), transparent);
  border-radius: 20px;
  pointer-events: none;
}

.modal-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: block;
  animation: bounceIn 0.6s ease-out 0.2s both;
}

.modal-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.modal-message {
  font-size: 1.1rem;
  line-height: 1.5;
  margin-bottom: 2rem;
  opacity: 0.9;
  animation: fadeInUp 0.6s ease-out 0.4s both;
}

.modal-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  animation: fadeInUp 0.6s ease-out 0.5s both;
}

.modal-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
  position: relative;
  overflow: hidden;
}

.modal-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.modal-btn:hover::before {
  width: 300px;
  height: 300px;
}

.modal-btn-confirm {
  background: #ff4757;
  color: white;
  box-shadow: 0 8px 20px rgba(255, 71, 87, 0.4);
}

.modal-btn-confirm:hover {
  background: #ff3742;
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(255, 71, 87, 0.5);
}

.modal-btn-cancel {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.1);
}

.modal-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(255, 255, 255, 0.2);
}
}